OpenCV Chinese Website: http://wiki.opencv.org.cn/index.php/%E9%A6%96%E9%A1%B5
http://codego.net/365464/
OpenCV as free software for open source, bug and feature problems (can be replaced with Intel IPP)
For example, PNG file with transparency, check data that OPENCV does not support the 4th channel of PNG, that is, the transparency channel.
Some said to modify the OpenCV PNG decoding function and then recompile the implementation of the transparent channel support, but this method is cumbersome, iOS, Android, Windows to recompile.
Try to hold the idea, experiment, seemingly solved the problem:
1, cvloadimage loading the PNG file, the default 2nd parameter is 1, that is Cv_load_image_color, the generated Iplimage object channel number is 3, instead of 4, lost the 4th channel. The Iplimage object that needs to be changed to Cvloadimage (PBUF,-1) is 4 channel;
2, OpenCV cvshowimage function, display the corresponding Iplimage object or wrong, can be ignored regardless of the ya.
3, in the processing of the generated Iplimage object, remember to deal with the 4th channel data, such as the Cvscalar object A to get each pixel point, to the a.val[3] data processing.
4, save, you can directly use the Cvsaveimage function to save as a PNG file, do not need to consider the third parameter settings.