001//
002// This file is auto-generated. Please don't modify it!
003//
004package org.opencv.ml;
005
006import org.opencv.core.Mat;
007import org.opencv.ml.NormalBayesClassifier;
008import org.opencv.ml.StatModel;
009
010// C++: class NormalBayesClassifier
011/**
012 * Bayes classifier for normally distributed data.
013 *
014 * SEE: REF: ml_intro_bayes
015 */
016public class NormalBayesClassifier extends StatModel {
017
018    protected NormalBayesClassifier(long addr) { super(addr); }
019
020    // internal usage only
021    public static NormalBayesClassifier __fromPtr__(long addr) { return new NormalBayesClassifier(addr); }
022
023    //
024    // C++:  float cv::ml::NormalBayesClassifier::predictProb(Mat inputs, Mat& outputs, Mat& outputProbs, int flags = 0)
025    //
026
027    /**
028     * Predicts the response for sample(s).
029     *
030     *     The method estimates the most probable classes for input vectors. Input vectors (one or more)
031     *     are stored as rows of the matrix inputs. In case of multiple input vectors, there should be one
032     *     output vector outputs. The predicted class for a single input vector is returned by the method.
033     *     The vector outputProbs contains the output probabilities corresponding to each element of
034     *     result.
035     * @param inputs automatically generated
036     * @param outputs automatically generated
037     * @param outputProbs automatically generated
038     * @param flags automatically generated
039     * @return automatically generated
040     */
041    public float predictProb(Mat inputs, Mat outputs, Mat outputProbs, int flags) {
042        return predictProb_0(nativeObj, inputs.nativeObj, outputs.nativeObj, outputProbs.nativeObj, flags);
043    }
044
045    /**
046     * Predicts the response for sample(s).
047     *
048     *     The method estimates the most probable classes for input vectors. Input vectors (one or more)
049     *     are stored as rows of the matrix inputs. In case of multiple input vectors, there should be one
050     *     output vector outputs. The predicted class for a single input vector is returned by the method.
051     *     The vector outputProbs contains the output probabilities corresponding to each element of
052     *     result.
053     * @param inputs automatically generated
054     * @param outputs automatically generated
055     * @param outputProbs automatically generated
056     * @return automatically generated
057     */
058    public float predictProb(Mat inputs, Mat outputs, Mat outputProbs) {
059        return predictProb_1(nativeObj, inputs.nativeObj, outputs.nativeObj, outputProbs.nativeObj);
060    }
061
062
063    //
064    // C++: static Ptr_NormalBayesClassifier cv::ml::NormalBayesClassifier::create()
065    //
066
067    /**
068     * Creates empty model
069     * Use StatModel::train to train the model after creation.
070     * @return automatically generated
071     */
072    public static NormalBayesClassifier create() {
073        return NormalBayesClassifier.__fromPtr__(create_0());
074    }
075
076
077    //
078    // C++: static Ptr_NormalBayesClassifier cv::ml::NormalBayesClassifier::load(String filepath, String nodeName = String())
079    //
080
081    /**
082     * Loads and creates a serialized NormalBayesClassifier from a file
083     *
084     * Use NormalBayesClassifier::save to serialize and store an NormalBayesClassifier to disk.
085     * Load the NormalBayesClassifier from this file again, by calling this function with the path to the file.
086     * Optionally specify the node for the file containing the classifier
087     *
088     * @param filepath path to serialized NormalBayesClassifier
089     * @param nodeName name of node containing the classifier
090     * @return automatically generated
091     */
092    public static NormalBayesClassifier load(String filepath, String nodeName) {
093        return NormalBayesClassifier.__fromPtr__(load_0(filepath, nodeName));
094    }
095
096    /**
097     * Loads and creates a serialized NormalBayesClassifier from a file
098     *
099     * Use NormalBayesClassifier::save to serialize and store an NormalBayesClassifier to disk.
100     * Load the NormalBayesClassifier from this file again, by calling this function with the path to the file.
101     * Optionally specify the node for the file containing the classifier
102     *
103     * @param filepath path to serialized NormalBayesClassifier
104     * @return automatically generated
105     */
106    public static NormalBayesClassifier load(String filepath) {
107        return NormalBayesClassifier.__fromPtr__(load_1(filepath));
108    }
109
110
111    @Override
112    protected void finalize() throws Throwable {
113        delete(nativeObj);
114    }
115
116
117
118    // C++:  float cv::ml::NormalBayesClassifier::predictProb(Mat inputs, Mat& outputs, Mat& outputProbs, int flags = 0)
119    private static native float predictProb_0(long nativeObj, long inputs_nativeObj, long outputs_nativeObj, long outputProbs_nativeObj, int flags);
120    private static native float predictProb_1(long nativeObj, long inputs_nativeObj, long outputs_nativeObj, long outputProbs_nativeObj);
121
122    // C++: static Ptr_NormalBayesClassifier cv::ml::NormalBayesClassifier::create()
123    private static native long create_0();
124
125    // C++: static Ptr_NormalBayesClassifier cv::ml::NormalBayesClassifier::load(String filepath, String nodeName = String())
126    private static native long load_0(String filepath, String nodeName);
127    private static native long load_1(String filepath);
128
129    // native support for java finalize()
130    private static native void delete(long nativeObj);
131
132}