我读取了一张图像,它的类型是CV_8UC1,我想将其转换为CV_32FC1。但是当我使用convertTo()函数时,我的图像变成了完全白色,我不知道为什么!
Mat Image(512,512,CV_32FC1);
Image = imread("C:\\MGC.jpg",CV_LOAD_IMAGE_GRAYSCALE);
/// show image
namedWindow("pic");
int x = 0; int y = 0;
imshow("pic", Image);
cout<<Image.type()<<endl;
Image.convertTo(Image,CV_32FC1);
cout<<Image.type()<<endl;
////show converted image
namedWindow("pic1");
imshow("pic1",Image );