Example usage for org.opencv.imgproc Imgproc erode

List of usage examples for org.opencv.imgproc Imgproc erode

Introduction

In this page you can find the example usage for org.opencv.imgproc Imgproc erode.

Prototype

public static void erode(Mat src, Mat dst, Mat kernel, Point anchor, int iterations, int borderType,
            Scalar borderValue) 

Source Link

Usage

From source file:team492.GripPipeline.java

License:Open Source License

/**
 * Expands area of lower value in an image.
 * // w  w  w  .  j ava 2 s  . c  o  m
 * @param src
 *            the Image to erode.
 * @param kernel
 *            the kernel for erosion.
 * @param anchor
 *            the center of the kernel.
 * @param iterations
 *            the number of times to perform the erosion.
 * @param borderType
 *            pixel extrapolation method.
 * @param borderValue
 *            value to be used for a constant border.
 * @param dst
 *            Output Image.
 */
private void cvErode(Mat src, Mat kernel, Point anchor, double iterations, int borderType, Scalar borderValue,
        Mat dst) {
    if (kernel == null) {
        kernel = new Mat();
    }
    if (anchor == null) {
        anchor = new Point(-1, -1);
    }
    if (borderValue == null) {
        borderValue = new Scalar(-1);
    }
    Imgproc.erode(src, dst, kernel, anchor, (int) iterations, borderType, borderValue);
}