Why does openCV's convertto function not work?
问题 I have an image which has 4 channels and is in 4 * UINT8 format. I am trying to convert it to 3 channel float and I am using this code: images.convertTo(images,CV_32FC3,1/255.0); After the conversion, the image is in a float format but still has 4 channels. How can I get rid of 4th (alpha) channel in OpenCV? 回答1: As @AldurDisciple said, Mat::convertTo() is intended to be used for changing the data type of a Mat , not for changing the number of channels. To work out, you should split it into