久久r热视频,国产午夜精品一区二区三区视频,亚洲精品自拍偷拍,欧美日韩精品二区

您的位置:首頁技術文章
文章詳情頁

python opencv角點檢測連線功能的實現代碼

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

原始圖

python opencv角點檢測連線功能的實現代碼

角點檢測

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角點檢測連線功能的實現代碼

連線

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角點檢測連線功能的實現代碼

完整代碼

''' @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)

到此這篇關于python opencv角點檢測 連線功能的實現代碼的文章就介紹到這了,更多相關python opencv角點檢測內容請搜索好吧啦網以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持好吧啦網!

標簽: Python 編程
相關文章:
主站蜘蛛池模板: 通州区| 安龙县| 台北市| 洛川县| 宜良县| 穆棱市| 高唐县| 潜江市| 宜春市| 大连市| 唐山市| 祁连县| 伊川县| 琼中| 濮阳市| 宜兰县| 鹤峰县| 略阳县| 阿拉善右旗| 廊坊市| 武汉市| 麟游县| 阿拉尔市| 南京市| 渑池县| 兴宁市| 梓潼县| 历史| 葫芦岛市| 丰台区| 剑河县| 青川县| 商水县| 兴隆县| 维西| 遂溪县| 乐业县| 义马市| 平泉县| 项城市| 大宁县|