Cannot convert image types using the C++ API

asked 2020-10-07 15:11:30 -0600

BullyWiiPlaza gravatar image

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/6...

edit retag flag offensive close merge delete

Comments

please don't refer to an external SO question, try to explain it here, thank you.

berak gravatar imageberak ( 2020-10-08 01:39:21 -0600 )edit

I need this for using a screen shot and a template image

this is unclear, what are you trying to convert, what to, and why ?

berak gravatar imageberak ( 2020-10-08 01:40:05 -0600 )edit