小编KNO*_*NOX的帖子

How do you pass a numpy array to openCV without saving the file as a png or jpeg first?

I am trying to take a screenshot, then convert it to a numpy array. I then want to run cv2.matchTemplate using the screenshot. So far the only way I have gotten this to work is to save the image: cv2.imwrite('temp.png',imcv) and then use that image in cv2.matchTemplate. This seems horribly wrong. How can I convert the numpy array properly to avoid saving and just pass it straight to the cv2.matchTemplate function?

I am doing this project in Ubuntu btw.

import …
Run Code Online (Sandbox Code Playgroud)

python opencv numpy

7
推荐指数
1
解决办法
2万
查看次数

标签 统计

numpy ×1

opencv ×1

python ×1