Convert 3 channel Mat into 4 channel doesn't work?
I'm building a VideoMixer class that can take a 3Channel and 4Channel(has alpha) and overlays the 4Channel onto the 3Channel matrix, then converts these back into a 3Channel matrix for further processing.
The idea is that I don't need the alpha channel in the rest of the program so I'm not going to pass that around.
To convert my 3channel passedFrame (input) into my 4channel temporary frame (for mixing) I'm using Mat tempFrame = Mat::zeros(overlayFrame.size(), 30); passedFrame.convertTo(tempFrame,30,1,1);
Where 30 is the enum value of "CV_64FC4", 1 is Alpha (toggling doesn't change anything) and the other 1 is Beta
I'm printing the sizes and types of each frame and my output however is as follows: - Size of overlay is [704 x 576] and type is 30 - Size of passedframe is [704 x 576] and type is 16 - Size of temporaryframe is [704 x 576] and type is 22
When explicitly setting the conversion type to 30, why is my output type 22? (that 8 should be the alpha channel and seems to be ignored)
opencv is probably the wrong library (it's all about computer-vision, not about video editing)
also, why do you think, you need alpha channels ? nothing here will respect those
also, please do not use magic numbers, but well defined enum values, like CV_8UC3
I was merely using magic numbers to show that my deductions were correct, in the program itself i use the correct enumeration, because I can't print " CV_8UC3" afaik, the name of an ENUM is not resolvable or is it?