我是openCV
概念的新秀,所以如果我的问题很愚蠢,请原谅我。实际上,我正在尝试使用Photo.fastNlMeansDenoisingColored()
方法,但是我不明白为什么会这样错误。
代码:
Mat tmp = new Mat (bitmap.getWidth(), bitmap.getHeight(), CvType.CV_8UC1);
Utils.bitmapToMat(bitmap, tmp);
Photo.fastNlMeansDenoisingColored(tmp,tmp, 10, 10, 7, 21);
Utils.matToBitmap(tmp,bitmap);
错误:
CvException [org.opencv.core.CvException: cv::Exception: /hdd2/buildbot/slaves/slave_ardbeg1/50-SDK/opencv/modules/photo/src/denoising.cpp:91: error: (-5) Type of input image should be CV_8UC3! in function void cv::fastNlMeansDenoisingColored(cv::InputArray, cv::OutputArray, float, float, int, int)
]
at org.opencv.photo.Photo.fastNlMeansDenoisingColored_0(Native Method)
at org.opencv.photo.Photo.fastNlMeansDenoisingColored(Photo.java:118)
at opengl.community.myopencvexample.MainActivity$3.onClick(MainActivity.java:83)
at android.view.View.performClick(View.java:4478)
at android.view.View$PerformClick.run(View.java:18698)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:149)
at android.app.ActivityThread.main(ActivityThread.java:5257)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
at dalvik.system.NativeStart.main(Native Method)
答案 0 :(得分:1)
下载native libs并将它们放在您的result = year.concat(month).concat(suffix);
目录中。
答案 1 :(得分:0)
我已经通过将openCV库从2.x更新到3.0解决了我的问题