adityaarora1 / LiveEdgeDetection

LiveEdgeDetection is an Android document detection library built on top of OpenCV. It scans documents from camera live mode and allows you to adjust crop using the detected 4 edges and performs perspective transformation of the cropped image. It works best with a dark background.
354 stars 126 forks source link

App Crashes on Camera Open #39

Closed jatankshirsagar closed 1 year ago

jatankshirsagar commented 4 years ago

java.lang.UnsatisfiedLinkError: No implementation found for void org.opencv.imgproc.Imgproc.Canny_3(long, long, double, double) (tried Java_org_opencv_imgproc_Imgproc_Canny_13 and Java_org_opencv_imgproc_Imgproc_Canny_13__JJDD)

java.lang.UnsatisfiedLinkError: No implementation found for void org.opencv.imgproc.Imgproc.Canny_3(long, long, double, double) (tried Java_org_opencv_imgproc_Imgproc_Canny_13 and Java_org_opencv_imgproc_Imgproc_Canny_13JJDD) at org.opencv.imgproc.Imgproc.Canny_3(Native Method) at org.opencv.imgproc.Imgproc.Canny(Imgproc.java:1104) at com.adityaarora.liveedgedetection.util.ScanUtils.detectLargestQuadrilateral(ScanUtils.java:359) at com.adityaarora.liveedgedetection.view.ScanSurfaceView$1.onPreviewFrame(ScanSurfaceView.java:182) at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1438) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6863) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858) 2020-02-01 18:12:45.429 1883-1883/com.jipl.storedge E/UncaughtException: java.lang.UnsatisfiedLinkError: No implementation found for void org.opencv.imgproc.Imgproc.Canny_3(long, long, double, double) (tried Java_org_opencv_imgproc_Imgproc_Canny_13 and Java_org_opencv_imgproc_Imgproc_Canny_13JJDD) at org.opencv.imgproc.Imgproc.Canny_3(Native Method) at org.opencv.imgproc.Imgproc.Canny(Imgproc.java:1104) at com.adityaarora.liveedgedetection.util.ScanUtils.detectLargestQuadrilateral(ScanUtils.java:359) at com.adityaarora.liveedgedetection.view.ScanSurfaceView$1.onPreviewFrame(ScanSurfaceView.java:182) at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1438) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6863) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

zakblacki commented 4 years ago

You have to use older branch tree before the last update this one there is a bug as workaround you have to enable the camera permission in your phone app or you add the permission in your code

jatankshirsagar commented 4 years ago

I am using it in Android and hence I am directly using implementation 'com.github.adityaarora1:LiveEdgeDetection:master-SNAPSHOT' and due to which how can I shift to the previous commit.

zakblacki commented 4 years ago

I am using it in Android and hence I am directly using implementation 'com.github.adityaarora1:LiveEdgeDetection:master-SNAPSHOT' and due to which how can I shift to the previous commit.

here You can just restore theses 3 files he changed

Edit : this crash only happen on android 5 and above. But works fine on android 4 Few things to keep in mind :

In ScanUtils Activity he is not not calling theses I suspect they may fix the orientation angle issue determinePictureSize(); getDisplayOrientation(); getOptimalPreviewSize(); resize();

jatankshirsagar commented 4 years ago
java.lang.UnsatisfiedLinkError: No implementation found for void org.opencv.imgproc.Imgproc.Canny_3(long, long, double, double) (tried Java_org_opencv_imgproc_Imgproc_Canny_13 and Java_org_opencv_imgproc_Imgproc_Canny_13__JJDD)
    at org.opencv.imgproc.Imgproc.Canny_3(Native Method)
    at org.opencv.imgproc.Imgproc.Canny(Imgproc.java:1104)
    at com.adityaarora.liveedgedetection.util.ScanUtils.detectLargestQuadrilateral(ScanUtils.java:359)
    at com.adityaarora.liveedgedetection.view.ScanSurfaceView$1.onPreviewFrame(ScanSurfaceView.java:182)
    at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1438)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:193)
    at android.app.ActivityThread.main(ActivityThread.java:6863)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

2020-03-09 16:36:53.379 23155-23176/com.jipl.storedge I/m.jipl.storedg: Background concurrent copying GC freed 10827(587KB) AllocSpace objects, 3(60KB) LOS objects, 50% free, 15MB/31MB, paused 179us total 178.310ms 2020-03-09 16:36:53.698 23155-23155/com.jipl.storedge E/UncaughtException: java.lang.UnsatisfiedLinkError: No implementation found for void org.opencv.imgproc.Imgproc.Canny_3(long, long, double, double) (tried Java_org_opencv_imgproc_Imgproc_Canny_13 and Java_org_opencv_imgproc_Imgproc_Canny_13__JJDD) at org.opencv.imgproc.Imgproc.Canny_3(Native Method) at org.opencv.imgproc.Imgproc.Canny(Imgproc.java:1104) at com.adityaarora.liveedgedetection.util.ScanUtils.detectLargestQuadrilateral(ScanUtils.java:359) at com.adityaarora.liveedgedetection.view.ScanSurfaceView$1.onPreviewFrame(ScanSurfaceView.java:182) at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1438) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:193) at android.app.ActivityThread.main(ActivityThread.java:6863) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:537) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Android Device : One Plus 3 Os Version : 9

after making changes in the file getting the above error

DerrickRocha commented 4 years ago

I keep seeing this error as well. Is there a work around yet?

ka05 commented 4 years ago

@jatankshirsagar, @DerrickRocha, @zakblacki I have been able to fix this by updating the OpenCV version from 340 to 343. I have created PR #42

adityaarora1 commented 1 year ago

Should work now.