I am using OpenCV for adaptiveThreshold
. My code for image processing using OpenCV is like this:
imageMat=new Mat();
Utils.bitmapToMat(bmp, imageMat);
Imgproc.cvtColor(imageMat, imageMat, Imgproc.COLOR_BGR2GRAY);
Imgproc.GaussianBlur(imageMat, imageMat, new Size(3, 3), 0);
Imgproc.adaptiveThreshold(imageMat, imageMat, 255,Imgproc.ADAPTIVE_THRESH_MEAN_C, Imgproc.THRESH_BINARY_INV, 5, 4);
But I am getting an error while declaring Mat
:
No implementation found for long org.opencv.core.Mat.n_Mat() (tried Java_org_opencv_core_Mat_n_1Mat and Java_org_opencv_core_Mat_n_1Mat__)
at org.opencv.core.Mat.n_Mat(Native Method)
at org.opencv.core.Mat.<init>(Mat.java:24)
at com.example.pial_pc.instantbookreview.ImageCapture$3.onPictureTaken(ImageCapture.java:105)
As I'm new to OpenCV, I am not clearly understanding the error. The entire Java class where this code belongs is here.
What should I do to eliminate the error?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…