Alpha Channel & OpenCV (Feature #217)
Description
I am currently using OpenCV with Qt interface (more option than the simple highgui interface), this work well however it doesn't handle correctly the transparency. In Qt if the transparency is 0 the image is not show!
Therefore I wanted to ask if we could add few functionalities to the next OpenCV release (2.1 or 2.2?):
- Add to cvLoadImage and cvDecode the CV_LOAD_IMAGE_COLOR_ALPHA define which could directly create an image in BGRA with the alpha channel
set to the alpha value defined by PNG or GIF image and with the alpha value set to 255 (NOT ZERO) for other format like JPEG. - Write a new type of cvCvtColor like CV_BGR2BGRA255 to convert directly with alpha channel to 255 (NOT ZERO).
I don't know how to name this function because if image is on float alpha max the default value should be 1. - Tell me if there is a function to set all the values of a channel to a specific value like cvSetData().
Associated revisions
Merge pull request #217 from jet47:fix-tvl1-test
Merge pull request #217 from PhilLab:androidDocFix
History
Updated by James Bowman almost 15 years ago
There are functions in OpenCV that allow you to implement these operations.
See the functions cvMixChannels, cvMerge, and cvSet.
Updated by Benoit R over 14 years ago
I known that we can do this with cvMerge and cvSet, ... (It is what I am doing), but in my case I'm calling a lot to this operation and it is why it could be great to have an operator to do it directly from cvCvtColor.
Another thing is that loading PNG or GIF image with alpha channel is still not possible :(
Updated by Alexander Shishkov about 13 years ago
- Description changed from I am currently using [[OpenCV]] with Qt interface (more option than the simpl... to I am currently using OpenCV with Qt interface (more option than the simple hi... More
Updated by Maksim Shabunin over 9 years ago
Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4245