当我在Python中调用OpenCV Structured Forests Edge Detection时,出现了一个错误:
import numpy as np
import cv2
img = cv2.imread('2009_005193.jpg')
gray_img = np.asarray(img.mean(axis=2) / 255, np.float32)
out = cv2.ximgproc_StructuredEdgeDetection.detectEdges(gray_img)
我得到的错误是:
^{pr2}$在文档(link to documentation)中,它作为函数detectEdges()出现在ximgproc_structuredgedetection下。在
在文档中,它将需要3通道浮点32图像。也许您需要先创建structuredgedetection对象。 然而,这对我很有效:
相关问题 更多 >
编程相关推荐