To the code that I would use
First upload the image:
IplImage *myImage;
myImage = cvLoadImage("/path/of/your/image.jpg");
, , , . ( , OpenCV BGR, 125,0,0 ( ), 255,127,127 - - .
, , , ...
cvInRangeS(image,
cvScalar(125.0, 0.0, 0.0),
cvScalar(255.0, 127.0, 127.0),
mask
);
, ( , )
cvNot(mask, mask);
,
IplImage *myImageWithTransparency;
cvCopy(myImage,myImageWithTransparency,mask);
, ,
. OpenCVDocumentation.
,