个人笔记

from __future__ import print_function

future 是指python3, 这句话的意思是在python2 中超前使用python3 的print() 函数。

文件名不能与导入的模块名称相同。

例如在程序中 import cv2, 那么你的文件名就不能叫cv2.py.应该更换文件名,例如cv2_test.py.

if  continue

如果你想要跳出某个循环,那么就可以用if  continue 语句。例如:

1 for c in cnts:
2     # if the contour is not sufficiently large, ignore it
3     if cv2.contourArea(c) < 100:
4         continue
5 
6     # compute the rotated bounding box of the contour
7     orig = image.copy()
8     box = cv2.minAreaRect(c)
9     box = cv2.cv.BoxPoints(box) if imutils.is_cv2() else 

 找不到图片报错

1  error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor'

 

posted @ 2021-02-16 11:03  Gicci  阅读(31)  评论(0)    收藏  举报