如何将轮廓转换为链码?

时间:2019-06-27 23:17:40

标签: python opencv

我想将图像的边缘变成链式代码。

代码

edges = cv2.Canny(resized,100,200, L2gradient=True) 
contour = str(cv2.findContours(edges, mode = "CV_RETR_LIST", method = "CV_CHAIN_CODE" ))
print(contour)

输出

contour = str(cv2.findContours(edges, mode = "CV_RETR_LIST", method = "CV_CHAIN_CODE" ))
TypeError: an integer is required (got type str)

我尝试用数字替换字符串,但是我不确定哪个数字与方法和模式相对应。

0 个答案:

没有答案