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;
}