List of usage examples for org.opencv.imgproc Imgproc pyrMeanShiftFiltering
public static void pyrMeanShiftFiltering(Mat src, Mat dst, double sp, double sr, int maxLevel, TermCriteria termcrit)
From source file:com.mycompany.objectdetection.ObjectDetector.java
public void preProcessImg() { int spatialWindowRadius = ((img.width() + img.height()) / 2); spatialWindowRadius = spatialWindowRadius * 3 / 100; //System.out.println(spatialWindowRadius); TermCriteria termCriteria = new TermCriteria(COUNT + EPS, COUNT_VALUE, EPS_VALUE); Imgproc.pyrMeanShiftFiltering(img, imgMeanShifted, spatialWindowRadius, COLOR_WINDOW_RADIUS, MAX_LEVEL, termCriteria);/*from ww w .j a v a 2s .c om*/ }
From source file:objectdetection.ObjectDetector.java
public void preProcessImg() { TermCriteria termCriteria = new TermCriteria(COUNT + EPS, COUNT_VALUE, EPS_VALUE); Imgproc.pyrMeanShiftFiltering(img, imgMeanShifted, SPATIAL_WINDOW_RADIUS, COLOR_WINDOW_RADIUS, MAX_LEVEL, termCriteria);/*ww w . j a va2 s . c o m*/ Imgproc.cvtColor(imgMeanShifted, imgGrayscale, COLOR_BGR2GRAY); Imgproc.Canny(imgGrayscale, imgCanny, THRESHOLD1, THRESHOLD2, APERTURE_SIZE, true); }