SimpleBlobDetector (OpenCV 4.13.0 Java documentation)
Примеры с cv2.imshow требуют сборки OpenCV с GUI. В ноутбуке с headless-версией используйте вывод изображений через Matplotlib.
Package org.opencv.features2d
Class SimpleBlobDetector
- java.lang.Object
-
- org.opencv.core.Algorithm
-
- org.opencv.features2d.Feature2D
-
- org.opencv.features2d.SimpleBlobDetector
-
public class SimpleBlobDetector extends Feature2DClass for extracting blobs from an image. : The class implements a simple algorithm for extracting blobs from an image: 1. Convert the source image to binary images by applying thresholding with several thresholds from minThreshold (inclusive) to maxThreshold (exclusive) with distance thresholdStep between neighboring thresholds. 2. Extract connected components from every binary image by findContours and calculate their centers. 3. Group centers from several binary images by their coordinates. Close centers form one group that corresponds to one blob, which is controlled by the minDistBetweenBlobs parameter. 4. From the groups, estimate final centers of blobs and their radiuses and return as locations and sizes of keypoints. This class performs several filtrations of returned blobs. You should set filterBy\* to true/false to turn on/off corresponding filtration. Available filtrations: Default values of parameters are tuned to extract dark circular blobs.