Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Try this:

import cv2
img = cv2.imread('2009_005193.jpg')
edgedetector = cv2.ximgproc.createStructuredEdgeDetection('./model.yml')
src = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
edges = edgedetector.detectEdges(np.float32(src) / 255.0)
cv2.imshow("edges", edges)