You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Levi-Lesches Thank you for the effort
Can you please add the functionality to composed two images and also develop another method which add option to add gradient and colour to background of given image E.g the following is C++ example code
std::string composeImages(const std::string& base64Image1, const std::string& base64Image2) {
// Decode Base64 strings to Mat objects efficiently
cv::Mat mat1 = base64_decode_to_mat(base64Image1);
cv::Mat mat2 = base64_decode_to_mat(base64Image2);
// Create a new Mat with appropriate dimensions
cv::Mat combinedMat(cv::Size(std::max(mat1.cols, mat2.cols), mat1.rows + mat2.rows), CV_8UC3);
// Copy the image data efficiently
mat1.copyTo(combinedMat(cv::Rect(0, 0, mat1.cols, mat1.rows)));
mat2.copyTo(combinedMat(cv::Rect(0, mat1.rows, mat2.cols, mat2.rows)));
// Encode the combined Mat back to Base64returnmat_to_base64(combinedMat);
}
// Helper functions for Base64 encoding/decoding using a third-party library
cv::Mat base64_decode_to_mat(const std::string& base64Image) {
std::vector<uchar> decodedData = base64_decode(base64Image);
cv::Mat mat = cv::imdecode(decodedData, cv::IMREAD_COLOR);
return mat;
}
std::string mat_to_base64(const cv::Mat& mat) {
std::vector<uchar> encodedData;
cv::imencode(".png", mat, encodedData);
returnbase64_encode(encodedData);
}
The text was updated successfully, but these errors were encountered:
sadaqatdev
changed the title
composed two images and add background colour and gradient to given image functionality
composed two images and add background color and gradient to given image functionality
Jan 3, 2024
@Levi-Lesches Thank you for the effort
Can you please add the functionality to composed two images and also develop another method which add option to add gradient and colour to background of given image E.g the following is C++ example code
Some help full links
https://stackoverflow.com/questions/27296170/merge-two-mat-images-into-one
https://stackoverflow.com/questions/33239669/opencv-how-to-merge-two-images
The text was updated successfully, but these errors were encountered: