C++ read codes:
cv::Mat cv_img = cv::imread("./1.png",-1);
std::cout<< cv_img.channels()<< std::endl;// prints 4
Matlab Write codes:
imwrite(A, './1.png', TIFF); // here, A should be 4 channels data
Ref:
http://blog.csdn.net/yhl_leo/article/details/49737357
http://blog.inet198.cn/?liulina603/article/details/43053957
http://blog.skyoung.org/2014/03/26/OpenCV(III)-How-to-use-Mat/