I am trying to create a transparent image in OpenCV and without excitement massaging it as jpg.
My code is something like this:
string outputImageName="myimage.jpg";
Mat outputImage(outputRows,outputCols,CV_8UC4);
outputImage=cv::Scalar(255,255,255,255);
imwrite(outputImageName,outputImage);
But the image is not transparent, and its color is white.
How can i do this?
If OpenCV cannot do this, is there a free library that I use for this?
source
share