Point p1 = new Point(), p2 = new Point();
p1.x = (double)i;
p1.y = (double)j;
p2.x = (double)i;
p2.y = (double)k+1;
Imgproc.line(imgMat, p1, p2, new Scalar(255,0,0));
在这段代码中,line函数似乎不工作,它给了我一个错误
java.lang.UnsatisfiedLinkError: Native method not found: org.opencv.imgproc.Imgproc.line_2:(JDDDDDDDD)V
有人能帮我吗??编辑:我不能使用其他绘图功能,如矩形,椭圆和箭头线也。每个函数都给出相同的错误
我遇到了同样的问题,我现在修复它。我导入opencv3.0到我的android工作室,但我加载opencv2.4.11的代码。变化:
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_11, getApplicationContext(), mLoaderCallback);
:
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_0_0, getApplicationContext(), mLoaderCallback);
希望它对你有用,祝你好运!