当前位置: 首页>>代码示例>>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;未经允许,请勿转载。