001//
002// This file is auto-generated. Please don't modify it!
003//
004package org.opencv.features2d;
005
006import org.opencv.features2d.Feature2D;
007import org.opencv.features2d.SimpleBlobDetector;
008import org.opencv.features2d.SimpleBlobDetector_Params;
009
010// C++: class SimpleBlobDetector
011/**
012 * Class for extracting blobs from an image. :
013 *
014 * The class implements a simple algorithm for extracting blobs from an image:
015 *
016 * 1.  Convert the source image to binary images by applying thresholding with several thresholds from
017 *     minThreshold (inclusive) to maxThreshold (exclusive) with distance thresholdStep between
018 *     neighboring thresholds.
019 * 2.  Extract connected components from every binary image by findContours and calculate their
020 *     centers.
021 * 3.  Group centers from several binary images by their coordinates. Close centers form one group that
022 *     corresponds to one blob, which is controlled by the minDistBetweenBlobs parameter.
023 * 4.  From the groups, estimate final centers of blobs and their radiuses and return as locations and
024 *     sizes of keypoints.
025 *
026 * This class performs several filtrations of returned blobs. You should set filterBy\* to true/false
027 * to turn on/off corresponding filtration. Available filtrations:
028 *
029 * <ul>
030 *   <li>
031 *    <b>By color</b>. This filter compares the intensity of a binary image at the center of a blob to
032 * blobColor. If they differ, the blob is filtered out. Use blobColor = 0 to extract dark blobs
033 * and blobColor = 255 to extract light blobs.
034 *   </li>
035 *   <li>
036 *    <b>By area</b>. Extracted blobs have an area between minArea (inclusive) and maxArea (exclusive).
037 *   </li>
038 *   <li>
039 *    <b>By circularity</b>. Extracted blobs have circularity
040 * (\(\frac{4*\pi*Area}{perimeter * perimeter}\)) between minCircularity (inclusive) and
041 * maxCircularity (exclusive).
042 *   </li>
043 *   <li>
044 *    <b>By ratio of the minimum inertia to maximum inertia</b>. Extracted blobs have this ratio
045 * between minInertiaRatio (inclusive) and maxInertiaRatio (exclusive).
046 *   </li>
047 *   <li>
048 *    <b>By convexity</b>. Extracted blobs have convexity (area / area of blob convex hull) between
049 * minConvexity (inclusive) and maxConvexity (exclusive).
050 *   </li>
051 * </ul>
052 *
053 * Default values of parameters are tuned to extract dark circular blobs.
054 */
055public class SimpleBlobDetector extends Feature2D {
056
057    protected SimpleBlobDetector(long addr) { super(addr); }
058
059    // internal usage only
060    public static SimpleBlobDetector __fromPtr__(long addr) { return new SimpleBlobDetector(addr); }
061
062    //
063    // C++: static Ptr_SimpleBlobDetector cv::SimpleBlobDetector::create(SimpleBlobDetector_Params parameters = SimpleBlobDetector::Params())
064    //
065
066    public static SimpleBlobDetector create(SimpleBlobDetector_Params parameters) {
067        return SimpleBlobDetector.__fromPtr__(create_0(parameters.nativeObj));
068    }
069
070    public static SimpleBlobDetector create() {
071        return SimpleBlobDetector.__fromPtr__(create_1());
072    }
073
074
075    //
076    // C++:  String cv::SimpleBlobDetector::getDefaultName()
077    //
078
079    public String getDefaultName() {
080        return getDefaultName_0(nativeObj);
081    }
082
083
084    @Override
085    protected void finalize() throws Throwable {
086        delete(nativeObj);
087    }
088
089
090
091    // C++: static Ptr_SimpleBlobDetector cv::SimpleBlobDetector::create(SimpleBlobDetector_Params parameters = SimpleBlobDetector::Params())
092    private static native long create_0(long parameters_nativeObj);
093    private static native long create_1();
094
095    // C++:  String cv::SimpleBlobDetector::getDefaultName()
096    private static native String getDefaultName_0(long nativeObj);
097
098    // native support for java finalize()
099    private static native void delete(long nativeObj);
100
101}