Reputation: 13616
I have image:
Image<Bgr,Byte> someImage = new Image<Bgr,Byte>(someImage.jpg);
How can I make all black pixels(black color) transparent?
Thank you in advance.
Upvotes: 0
Views: 3529
Reputation: 14053
You can see an example about how to use alpha to make background transparent on this thread.
Upvotes: 1
Reputation: 1198
You will need to find a way to define your image in such a way that it uses the alpha channel. If you want details, this is the link for RGBA color space.
Basically, you need to initialize a CV_8UC4
image. Keep in mind to initialize all pixels to zero before you start (basically, the entire matrix will be black before you start putting values in)..
Upvotes: 1