Ask Your Question

Revision history [back]

Cannot convert image types using the C++ API

Using OpenCV I cannot convert the image type of a cv::Mat using the convertTo() function:

screen_shot.convertTo(screen_shot, CV_8UC3);
template_image.convertTo(template_image, CV_8UC3);

Those method calls have no effect, querying the type() method still yields the same value from before.

I need this for using a screen shot and a template image in combination with the matchTemplate function.

For more information, check out this StackOverflow question:
https://stackoverflow.com/questions/64249235