【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)
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章