久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

cv2.approxPolyDP() , cv2.arcLength() 這些是如何工作的

cv2.approxPolyDP() , cv2.arcLength() How these works(cv2.approxPolyDP() , cv2.arcLength() 這些是如何工作的)
本文介紹了cv2.approxPolyDP() , cv2.arcLength() 這些是如何工作的的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

這些功能是如何工作的?我正在使用 Python3.7 和 OpenCv 4.2.0.提前致謝.

How do these function works? I am using Python3.7 and OpenCv 4.2.0. Thanks in Advance.

approx = cv2.approxPolyDP(cnt, 0.01*cv2.arcLength(cnt, True), True)

推薦答案

如果您正在尋找示例代碼段,以下是一個:

If you are looking for a example snippet, below is one:

import cv2
import imutils

# edged is the edge detected image
cnts = cv2.findContours(edged, cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE)
cnts = imutils.grab_contours(cnts)
cnts = sorted(cnts, key = cv2.contourArea, reverse = True)[:5]
# loop over the contours
for c in cnts:
    # approximate the contour
    peri = cv2.arcLength(c, True)
    approx = cv2.approxPolyDP(c, 0.02 * peri, True)
    # if our approximated contour has four points, then we
    # can assume that we have found our screen
    if len(approx) == 4:
        screenCnt = approx
        break

在上面的代碼片段中,它首先從邊緣檢測圖像中找到輪廓,然后對輪廓進行排序以找到五個最大的輪廓.最后,它遍歷輪廓并使用 cv2.approxPolyDP 函數來平滑和逼近四邊形.cv2.approxPolyDP 適用于文檔邊界等輪廓中有尖銳邊緣的情況.

In the above snippet, first it finds the contours from a edge detected image, then it sorts the contours to find the five largest contours. Finally it loop over the contours and used cv2.approxPolyDP function to smooth and approximate the quadrilateral. cv2.approxPolyDP works for the cases where there are sharp edges in the contours like a document boundary.

這篇關于cv2.approxPolyDP() , cv2.arcLength() 這些是如何工作的的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

How to draw a rectangle around a region of interest in python(如何在python中的感興趣區域周圍繪制一個矩形)
How can I detect and track people using OpenCV?(如何使用 OpenCV 檢測和跟蹤人員?)
How to apply threshold within multiple rectangular bounding boxes in an image?(如何在圖像的多個矩形邊界框中應用閾值?)
How can I download a specific part of Coco Dataset?(如何下載 Coco Dataset 的特定部分?)
Detect image orientation angle based on text direction(根據文本方向檢測圖像方向角度)
Detect centre and angle of rectangles in an image using Opencv(使用 Opencv 檢測圖像中矩形的中心和角度)
主站蜘蛛池模板: 91精品国产91久久久久久三级 | 国产精品一区二区精品 | www.亚洲| 久久小视频| 日韩精品专区在线影院重磅 | 精品久久久久久亚洲综合网站 | 日韩欧美一区二区三区免费观看 | 亚洲欧美日韩高清 | 国产精品成人久久久久a级 久久蜜桃av一区二区天堂 | 色播视频在线观看 | 日韩黄色免费 | 高清免费av| 99久久日韩精品免费热麻豆美女 | 九色网址 | 日本三级线观看 视频 | 国产精品不卡视频 | 一区二区三区精品 | 日韩欧美久久 | 一级做a爰片久久毛片 | 91大神新作在线观看 | 国产欧美精品一区二区色综合 | 精品一区二区三区在线观看国产 | 欧美二区在线 | 激情av网站 | 国产精品国产a级 | av资源在线看 | 欧美日韩国产在线 | 欧美福利视频 | 特黄视频 | 亚洲欧美国产精品久久 | 久色视频在线观看 | 国产精品成人一区二区三区 | 伊人免费在线观看高清 | 97人人超碰| 黄色网址在线播放 | 欧美在线播放一区 | 精品一区二区三区在线观看 | 性高朝久久久久久久3小时 av一区二区三区四区 | 国产精品成人在线播放 | 久久美女视频 | 欧美aaaaaaaaaa|