001//
002// This file is auto-generated. Please don't modify it!
003//
004package org.opencv.features2d;
005
006import org.opencv.core.Mat;
007import org.opencv.core.TermCriteria;
008import org.opencv.features2d.BOWTrainer;
009
010// C++: class BOWKMeansTrainer
011/**
012 * kmeans -based class to train visual vocabulary using the *bag of visual words* approach. :
013 */
014public class BOWKMeansTrainer extends BOWTrainer {
015
016    protected BOWKMeansTrainer(long addr) { super(addr); }
017
018    // internal usage only
019    public static BOWKMeansTrainer __fromPtr__(long addr) { return new BOWKMeansTrainer(addr); }
020
021    //
022    // C++:   cv::BOWKMeansTrainer::BOWKMeansTrainer(int clusterCount, TermCriteria termcrit = TermCriteria(), int attempts = 3, int flags = KMEANS_PP_CENTERS)
023    //
024
025    /**
026     * The constructor.
027     *
028     *     SEE: cv::kmeans
029     * @param clusterCount automatically generated
030     * @param termcrit automatically generated
031     * @param attempts automatically generated
032     * @param flags automatically generated
033     */
034    public BOWKMeansTrainer(int clusterCount, TermCriteria termcrit, int attempts, int flags) {
035        super(BOWKMeansTrainer_0(clusterCount, termcrit.type, termcrit.maxCount, termcrit.epsilon, attempts, flags));
036    }
037
038    /**
039     * The constructor.
040     *
041     *     SEE: cv::kmeans
042     * @param clusterCount automatically generated
043     * @param termcrit automatically generated
044     * @param attempts automatically generated
045     */
046    public BOWKMeansTrainer(int clusterCount, TermCriteria termcrit, int attempts) {
047        super(BOWKMeansTrainer_1(clusterCount, termcrit.type, termcrit.maxCount, termcrit.epsilon, attempts));
048    }
049
050    /**
051     * The constructor.
052     *
053     *     SEE: cv::kmeans
054     * @param clusterCount automatically generated
055     * @param termcrit automatically generated
056     */
057    public BOWKMeansTrainer(int clusterCount, TermCriteria termcrit) {
058        super(BOWKMeansTrainer_2(clusterCount, termcrit.type, termcrit.maxCount, termcrit.epsilon));
059    }
060
061    /**
062     * The constructor.
063     *
064     *     SEE: cv::kmeans
065     * @param clusterCount automatically generated
066     */
067    public BOWKMeansTrainer(int clusterCount) {
068        super(BOWKMeansTrainer_3(clusterCount));
069    }
070
071
072    //
073    // C++:  Mat cv::BOWKMeansTrainer::cluster()
074    //
075
076    public Mat cluster() {
077        return new Mat(cluster_0(nativeObj));
078    }
079
080
081    //
082    // C++:  Mat cv::BOWKMeansTrainer::cluster(Mat descriptors)
083    //
084
085    public Mat cluster(Mat descriptors) {
086        return new Mat(cluster_1(nativeObj, descriptors.nativeObj));
087    }
088
089
090    @Override
091    protected void finalize() throws Throwable {
092        delete(nativeObj);
093    }
094
095
096
097    // C++:   cv::BOWKMeansTrainer::BOWKMeansTrainer(int clusterCount, TermCriteria termcrit = TermCriteria(), int attempts = 3, int flags = KMEANS_PP_CENTERS)
098    private static native long BOWKMeansTrainer_0(int clusterCount, int termcrit_type, int termcrit_maxCount, double termcrit_epsilon, int attempts, int flags);
099    private static native long BOWKMeansTrainer_1(int clusterCount, int termcrit_type, int termcrit_maxCount, double termcrit_epsilon, int attempts);
100    private static native long BOWKMeansTrainer_2(int clusterCount, int termcrit_type, int termcrit_maxCount, double termcrit_epsilon);
101    private static native long BOWKMeansTrainer_3(int clusterCount);
102
103    // C++:  Mat cv::BOWKMeansTrainer::cluster()
104    private static native long cluster_0(long nativeObj);
105
106    // C++:  Mat cv::BOWKMeansTrainer::cluster(Mat descriptors)
107    private static native long cluster_1(long nativeObj, long descriptors_nativeObj);
108
109    // native support for java finalize()
110    private static native void delete(long nativeObj);
111
112}