Eclipse gives error when using GaussianBlur with OpenCV for Android

I posted a small part of my code because I keep getting a weird error that I cannot get rid of. The problem can be found in this line: Imgproc.GaussianBlur (mGray, mGray, new size (5.5), 2,2, 2);

public Mat onCameraFrame(Mat inputFrame) { mGray = new Mat(); Imgproc.cvtColor(mRgba, mGray, Imgproc.COLOR_RGBA2GRAY); // doing a gaussian blur prevents getting a lot of false hits Imgproc.GaussianBlur(mGray, mGray, new Size (5,5), 2.2, 2); // Values 3 and 4are the LowerThreshold and UpperThreshold. Imgproc.Canny(inputFrame, mIntermediateMat, 80, 100); Imgproc.cvtColor(mIntermediateMat,mRgba, Imgproc.COLOR_GRAY2BGRA, 4); return mIntermediateMat; } 

The error I get from Eclipse is:

 The method GaussianBlur(Mat,Mat,Size,double,double) in the type imgproc is not applicable for the arguments (Mat,Mat,CameraSize,int,int) 

I am using an edited version of tutorial3 Camera-control (OpenCV for Android version 2.4.4), where the output is shown as Canny edge detection. I need GaussianBlur to get rid of some small details. Does anyone know what exactly is wrong with this line of code?

+7
source share
2 answers

I got this decision from Alexander Smorkalov, and it worked. Just change Imgproc.GaussianBlur (mGray, mGray, new size (5.5), 2,2, 2); to Imgproc.GaussianBlur (mGray, mGray, new org.opencv.core.Size (5.5), 2.2, 2);

+2
source

This code is working fine. Just reorder the options as needed.

 Imgproc.GaussianBlur(mGray, mGray, new Size(15,15),50); 

Size means that you will use it as the size of the kernel. Also, the kernel size must be odd! 50 shows the standard deviation of the core in the X direction.

Formula: sigma = 0.3 * ((kSize-1)*0.5 - 1) + 0.8

Here sigma is transmitted 50, so sigmaX = sigmaY = 50

+4
source

All Articles