I know this question has been asked and answered by others. But I still can't not solve my question. I read a frame from a video, which has format unsigned char (CV_8U). I hope to convert it to double precision(CV_64F). I do as following:
VideoCapture capture(fileName); Mat image; capture >> image; cvtColor(image, image, CV_BGR2GRAY); image.convertTo(image, CV_32FC1, 1.0/255); cout << typeid(image.data).name() << endl;
But the result shows the image is still unsigned char. What's wrong with my code? Thank.