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)