Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 2088

Python Opencv Structured Forests Edge Detection TypeError

$
0
0
When I call the OpenCV Structured Forests Edge Detection in Python as shown below, I get an error: 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) The error I get is: Traceback (most recent call last): File "gop1.py", line 19, in out = cv2.ximgproc_StructuredEdgeDetection.detectEdges(gray_img) TypeError: descriptor 'detectEdges' requires a 'cv2.ximgproc_StructuredEdgeDetection' object but received a 'numpy.ndarray' In the documentation ([link to documentation][1]), detectEdges() is present under ximgproc_StructuredEdgeDetection. I am not sure what I am doing wrong. [1]: https://docs.opencv.org/4.0.1/d8/d54/classcv_1_1ximgproc_1_1StructuredEdgeDetection.html

Viewing all articles
Browse latest Browse all 2088

Trending Articles