成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

python opencv角點(diǎn)檢測(cè)連線功能的實(shí)現(xiàn)代碼

瀏覽:109日期:2022-07-04 14:58:00

原始圖

python opencv角點(diǎn)檢測(cè)連線功能的實(shí)現(xiàn)代碼

角點(diǎn)檢測(cè)

points = cv2.goodFeaturesToTrack(gray, 100, 0.01, 10)points = np.int0(points).reshape(-1,2)for point in points: x, y = point.ravel() cv2.circle(img, (x, y), 10, (0, 255, 0), -1)

python opencv角點(diǎn)檢測(cè)連線功能的實(shí)現(xiàn)代碼

連線

cv2.line(img, (0, y1), (1000, y1), (0, 255, 0), thickness=3, lineType=8)cv2.line(img, (0, y2), (1000, y2), (0, 255, 0), thickness=3, lineType=8)

python opencv角點(diǎn)檢測(cè)連線功能的實(shí)現(xiàn)代碼

完整代碼

''' @author: qq群686070107''' import cv2import numpy as npimg=cv2.imread('1.jpg')gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)points = cv2.goodFeaturesToTrack(gray, 100, 0.01, 10)points = np.int0(points).reshape(-1,2)for point in points: x, y = point.ravel() cv2.circle(img, (x, y), 10, (0, 255, 0), -1)y1 = min(points[:,1])y2 = max(points[:,1])## small and big enough cv2.line(img, (0, y1), (1000, y1), (0, 255, 0), thickness=3, lineType=8)cv2.line(img, (0, y2), (1000, y2), (0, 255, 0), thickness=3, lineType=8)cv2.imshow('img', img)cv2.waitKey(0)

到此這篇關(guān)于python opencv角點(diǎn)檢測(cè) 連線功能的實(shí)現(xiàn)代碼的文章就介紹到這了,更多相關(guān)python opencv角點(diǎn)檢測(cè)內(nèi)容請(qǐng)搜索好吧啦網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持好吧啦網(wǎng)!

標(biāo)簽: Python 編程
相關(guān)文章: