Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

from the c++ docs :

This filter does not work inplace.

so, you have to use a new Mat for the result:

private Mat sharpen(Mat passedImage)
{
    Mat bgr = new Mat();
    Imgproc.cvtColor(passedImage, bgr, Imgproc.COLOR_BGRA2BGR);

    int iSize = 9;
    Mat bilateral = new Mat();
    Imgproc.bilateralFilter(bgr, bilateral, iSize, iSize*2, iSize/2);
    bgr.release(); // !!

    return bilateral;
}