Python cv2.2和imshow工作不正常
这段简单的代码不起作用Python cv2.2和imshow工作不正常,python,opencv,opencv-contrib,Python,Opencv,Opencv Contrib,这段简单的代码不起作用 output = cv2.namedWindow("Output", cv2.WINDOW_AUTOSIZE) cv2.imshow(output, saliencyMap) cv2.waitKey(0) 它应该在的“输出”窗口中显示SaliecyMap,但它正在生成两个窗口(如下所示) 我正在使用spyder编辑器并收到此消息 You might be loading two sets of Qt binaries into the same pr
output = cv2.namedWindow("Output", cv2.WINDOW_AUTOSIZE)
cv2.imshow(output, saliencyMap)
cv2.waitKey(0)
它应该在的“输出”窗口中显示SaliecyMap
,但它正在生成两个窗口(如下所示)
我正在使用spyder编辑器并收到此消息
You might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded.
QObject::moveToThread: Current thread (0x7fbf1e53c600) is not the object's thread (0x7fbf1e6f0850).
Cannot move to target thread (0x7fbf1e53c600)`
是一个函数,它是一个无效函数,因此它不提供任何输出值。将字符串和Mat作为输入
正确答案应该是:
import cv2
img = cv2.imread('img.png')
cv2.namedWindow("Output", cv2.WINDOW_AUTOSIZE)
cv2.imshow("Output", img)
cv2.waitKey(0)
尝试删除namedWindow行,只需使用cv2.imshow(“output”,saliencyMap);cv2.waitKey(0)
@RahulKedia图像太大,无法在屏幕上显示,我需要使用该功能。谢谢!它完成合并两个实例的工作<代码>cv.WINDOW\u AUTOSIZE
未在屏幕窗口中收缩图像。使用了cv2.WINDOW\u正常,现在可以正常工作了。