【OpenCV】opencv-python 版使用要点

Backto OpenCV Index

image

# to create a new image
blank_image = np.zeros((height,width,3), np.uint8)

# image size
## for gray image
rows,cols = img.shape
h,w = img.shape
## for color image
rows, cols, channels = img.shape
h,w,c = img.shape

APIs

有些 C++ 中的基础数据结构,比如 Point, Point2f 这些在 Python 版中都没有,直接用 (x,y)代替。同时,Python 中也增加了一些好玩儿的 API,比如

# 直接画箭头
cv2.arrowedLine(image, start_point, end_point, color, line_width)

你可能感兴趣的:(OpenCV)