【发布时间】:2013-02-18 22:22:26
【问题描述】:
我发布了我的一小部分代码,因为我不断收到一个我似乎无法摆脱的奇怪错误。问题出在这一行: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 method GaussianBlur(Mat,Mat,Size,double,double) in
the type imgproc is not applicable for the arguments (Mat,Mat,CameraSize,int,int)
我正在使用经过编辑的 tutorial3 Camera-control(OpenCV for Android 版本 2.4.4),其中输出显示为 Canny 的边缘检测。我需要 GaussianBlur 来去除一些较小的细节。有谁知道这行代码到底出了什么问题?
【问题讨论】:
标签: java android opencv gaussian