Is there a way to convert from CV_8UC3 Mat to CV_32FC3 Mat without directly accessing the raw buffer? I tried Mat::convertTo(newImage, CV_32FC3, 1.0); but the colors end up wrong. Thanks.
Is there a way to convert from CV_8UC3 Mat to CV_32FC3 Mat without directly
Share
The convention is, that for the type CV_8UC3 the pixels values range from 0 to 255, and for type CV_32FC3 from 0.0 to 1.0. Thus you need to use a scaling factor of 1/255.0 instead of 1.0: