upsp.target_localization.blob_detector_methods
¶
- blob_func(detection_method, decide_method=None)[source]¶
Returns a function that acts as a wrapper around openCV’s blob detection function to act as a target center localizer
- Parameters
detection_method (
string
) – String must be a key in the global dict target_detectors. The key selects the blob detection parameters to usedecide_method (
{'biggest', 'smallest', 'first', 'last', 'random', None}
, optional) – decision method if more than 1 blob is detected in the image. Biggest and smallest selects the largest and smallest (respectfully) based on the keypoint size parameter. First and last select the first and last (respectfully) based on the order returned by the blob detector. Random selects a random blob. None uses the default method, which is last
- Returns
Blob detector localization function - Wrapper around a blob detector to act as a localization function. The function has the signature:
func(img, target_type=None, return_keypoint=False) -> keypoint
where
img
is a 2D image array containing one target,target_type
does nothing, andreturn_keypoint
specifies whether the keypoint itself is returned (True
) or just the center position (x, y).- Return type
callable