Using a HBITMAP image with template matching

asked 2015-07-29 09:20:34 -0600

corbin gravatar image

updated 2015-07-29 12:14:49 -0600

Is there a way to save a screenshot in a HBITMAP, (either partial or full) and use it in template matching? If so, what would be the best way to approach doing so. I think imdecode() would work but I could not decipher how to go about using it.

The point of this exercise is to avoid saving the file to disk. I was able to do this already and my program ran but there will be a large number of screenshots taken and I would prefer to not have the hard drive working constantly.

If there is a better way than HBITMAP to enter images from screen into a template match function I would love to learn about it.

Note: I am working in c++ with visual studio 2013. The matching is working great currently but I have not found a dependable way to get screen images into opencv without saving first.

Edit to be clear I am trying to avoid saving the image.

edit retag flag offensive close merge delete

Comments

I found this before I posted and unfortunately it is not applicable to my issue. I don't have trouble getting the image. I am having trouble understanding how to use it without saving it to disk first. The solutions on that link are mostly about saving the image.

corbin gravatar imagecorbin ( 2015-07-29 12:13:41 -0600 )edit