使用GaussianBlur时OpenCV的Andr​​oid版的Eclipse提供了错误错误、OpenCV、GaussianBlur、Andr

2023-09-07 12:49:30 作者:浪痞

我贴我的code一小部分,因为我一直得到一个奇怪的错误,我似乎无法摆脱。这个问题可以在此行中: Imgproc.GaussianBlur(mGray,mGray,新尺寸(5,5),2.2,2);

I posted a little part of my code, cause i keep getting a strange error that I can't seem to get rid of. The problem can be found on 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;
}

我从Eclipse中得到的错误是:

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)

我使用tutorial3摄像机控制的编辑版本(OpenCV进行Android版本2.4.4),其中输出显示的Canny的边缘检测。我需要的GaussianBlur摆脱一些小的细节。有谁知道究竟是什么错此行的code?

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

推荐答案

我从亚历山大Smorkalov这个解决方案,和它的工作。只要改变Imgproc.GaussianBlur(mGray,mGray,新尺寸(5,5),2.2,2);到Imgproc.GaussianBlur(mGray,mGray,新org.opencv.core.Size(5,5),2.2,2);

I got this solution from Alexander Smorkalov, and it worked. Just change the 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);