Mys*_*cBE 7 java android opencv gaussian
我发布了我的代码的一小部分,因为我不断得到一个我似乎无法摆脱的奇怪错误.问题可以在这一行找到: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;
}
Run Code Online (Sandbox Code Playgroud)
我从Eclipse得到的错误是:
The method GaussianBlur(Mat,Mat,Size,double,double) in
the type imgproc is not applicable for the arguments (Mat,Mat,CameraSize,int,int)
Run Code Online (Sandbox Code Playgroud)
我正在使用tutorial3 Camera-control(OpenCV for Android版本2.4.4)的编辑版本,其输出显示为Canny的边缘检测.我需要GaussianBlur来摆脱一些较小的细节.有谁知道这行代码究竟出了什么问题?
我从 Alexander Smorkalov 那里得到了这个解决方案,它很有效。只需更改 Imgproc.GaussianBlur(mGray, mGray, new Size (5,5), 2.2, 2); 到 Imgproc.GaussianBlur(mGray, mGray, new org.opencv.core.Size (5,5), 2.2, 2);
| 归档时间: |
|
| 查看次数: |
5245 次 |
| 最近记录: |