當前位置: 首頁>>代碼示例>>Python>>正文


Python cv2.SimpleBlobDetector方法代碼示例

本文整理匯總了Python中cv2.SimpleBlobDetector方法的典型用法代碼示例。如果您正苦於以下問題:Python cv2.SimpleBlobDetector方法的具體用法?Python cv2.SimpleBlobDetector怎麽用?Python cv2.SimpleBlobDetector使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在cv2的用法示例。


在下文中一共展示了cv2.SimpleBlobDetector方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: init_blob_detector

# 需要導入模塊: import cv2 [as 別名]
# 或者: from cv2 import SimpleBlobDetector [as 別名]
def init_blob_detector():
    params = cv2.SimpleBlobDetector_Params()
    params.minThreshold = 1
    params.maxThreshold = 255
    params.filterByArea = True
    params.minArea = 1
    params.filterByCircularity = False
    params.filterByConvexity = False
    params.filterByInertia = False
    #detector = cv2.SimpleBlobDetector(params)
    detector = cv2.SimpleBlobDetector_create(params)
    return detector 
開發者ID:Guanghan,項目名稱:lighttrack,代碼行數:14,代碼來源:utils_nms.py

示例2: init_blob_detector

# 需要導入模塊: import cv2 [as 別名]
# 或者: from cv2 import SimpleBlobDetector [as 別名]
def init_blob_detector():
    params = cv2.SimpleBlobDetector_Params()
    params.minThreshold = 1
    params.maxThreshold = 255
    params.filterByArea = True
    params.minArea = 1
    params.filterByCircularity = False
    params.filterByConvexity = False
    params.filterByInertia = False
    # detector = cv2.SimpleBlobDetector(params)
    detector = cv2.SimpleBlobDetector_create(params)
    return detector 
開發者ID:zh-plus,項目名稱:video-to-pose3D,代碼行數:14,代碼來源:utils_nms.py

示例3: __init__

# 需要導入模塊: import cv2 [as 別名]
# 或者: from cv2 import SimpleBlobDetector [as 別名]
def __init__(self, args):
        self.node_name = "cvBridge"
        rospy.init_node(self.node_name)

        # What we do during shutdown
        rospy.on_shutdown(self.cleanup)

        # Create the cv_bridge object
        self.bridge = CvBridge()

        # Subscribe to the camera image topics and set
        # the appropriate callbacks
        self.image_sub = rospy.Subscriber(args[1], Image, self.image_callback)
        self.image_pub = rospy.Publisher(
            "%s/BlobDetector" % (args[1]), Image, queue_size=10)

        # Detector
        # Set up the detector with parameters.

        # Setup SimpleBlobDetector parameters.
        params = cv2.SimpleBlobDetector_Params()

        # Filter by Color.
        params.filterByColor = rospy.get_param('~FilterByColor')
        params.blobColor = rospy.get_param('~BlobColor')

        # Filter by Area.
        params.filterByArea = rospy.get_param('~FilterByArea')
        params.minArea = rospy.get_param('~BlobMinArea')
        params.maxArea = rospy.get_param('~BlobMaxArea')

        # Filter by Circularity
        params.filterByCircularity = rospy.get_param('~FilterByCircularity')
        params.minCircularity = rospy.get_param('~BlobMinCircularity')
        params.maxCircularity = rospy.get_param('~BlobMaxCircularity')

        # Filter by Convexity
        params.filterByConvexity = rospy.get_param('~FilterByConvexity')
        params.minConvexity = rospy.get_param('~BlobMinConvexity')
        params.maxConvexity = rospy.get_param('~BlobMaxConvexity')

        # Filter by Inertia
        params.filterByInertia = rospy.get_param('~FilterByInertia')
        params.minInertiaRatio = rospy.get_param('~BlobMinInertia')
        params.maxInertiaRatio = rospy.get_param('~BlobMaxInertia')

        self.MaxLeavesSocketA = [0]
        self.MaxLeavesSocketB = [0]
        self.MaxLeavesSocketC = [0]
        self.MaxLeavesSocketD = [0]
        self.MaxLeavesSocketE = [0]
        self.MaxLeavesSocketF = [0]

        self.detector = cv2.SimpleBlobDetector(params)
        rospy.loginfo("Waiting for image topics...") 
開發者ID:OpenAgricultureFoundation,項目名稱:openag_cv,代碼行數:57,代碼來源:BlobDetector.py


注:本文中的cv2.SimpleBlobDetector方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。