opencv
ninnyyan
自强
展开
-
【opencv】cv2读取图片
import cv2#defile fileimage = cv2.imread(file)原创 2019-12-04 16:20:19 · 1813 阅读 · 0 评论 -
【opencv】error: (-215) ssize.width > 0 && ssize.height > 0 in function cv::resize
使用cv2.resize()函数时,出现一个错误:代码image = cv2.imread(input_folder + photo_file)image = cv2.resize(image, (resize_width, resize_height), interpolation=cv2.INTER_NEAREST)cv2.imwrite(output_folder + photo_f...原创 2019-01-16 14:52:31 · 4751 阅读 · 1 评论 -
【opencv】cv2.findcontours ValueError: not enough values to unpack (expected 3, got 2)
emmmmm今天遇到很奇怪的事情,以前写的代码居然就神奇的不能用了,报这个错还以为是怎么了,之前都好好地,查了一下发现…是opencv的方法改掉了,findCountours方法被修改为只返回coutours和hierarchy因此把之前的代码修改为contours_all, hierachy = cv2.findContours(mask.copy(), cv2.RETR_EXTERNA...原创 2019-05-20 11:50:51 · 10132 阅读 · 3 评论 -
NameError: name 'WINDOW_NORMAL' is not defined
cv2.namedWindow('image:',WINDOW_NORMAL)cv2.resizeWindow('image:',960,540)cv2.imshow('image:',image)报NameError: name 'WINDOW_NORMAL' is not defined错误解决方法,WINDOW_NORMAL应该是cv2.WINDOW_NORMAL修改为cv2....原创 2019-05-16 10:42:35 · 3589 阅读 · 0 评论