Ask Your Question

Revision history [back]

Is it safe for a Mat convert to itself with different type?

The following code can be compiled without error. However, is it safe doing this?

Mat im = imread('test.jpg', CV_LOAD_IMAGE_GRAYSCALE);
im.convertTo(im, CV_32F1);

Is it safe for converting to a Mat convert to itself with different type?

The following code can be compiled without error. However, is it safe doing this?

Mat im = imread('test.jpg', CV_LOAD_IMAGE_GRAYSCALE);
im.convertTo(im, CV_32F1);