Search in sources :

Example 1 with KNearest

use of org.bytedeco.opencv.opencv_ml.KNearest in project qupath by qupath.

the class KNearestClassifier method createClassifier.

@Override
protected KNearest createClassifier() {
    KNearest classifier = KNearest.create();
    // System.out.println("Default K: " + classifier.getDefaultK());
    ParameterList params = getParameterList();
    if (params != null) {
        classifier.setIsClassifier(true);
        classifier.setDefaultK(params.getIntParameterValue("k"));
    }
    return classifier;
}
Also used : KNearest(org.bytedeco.opencv.opencv_ml.KNearest) ParameterList(qupath.lib.plugins.parameters.ParameterList)

Aggregations

KNearest (org.bytedeco.opencv.opencv_ml.KNearest)1 ParameterList (qupath.lib.plugins.parameters.ParameterList)1