FacialRecognition icon indicating copy to clipboard operation
FacialRecognition copied to clipboard

Unsatisfied Link Eception

Open cuzzysoft opened this issue 4 years ago • 3 comments

I've added opencv lib to path put I still get this error

run: Exception in thread "main" java.lang.UnsatisfiedLinkError: no jniopencv_core in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1302) at org.bytedeco.javacpp.Loader.load(Loader.java:1043) at org.bytedeco.javacpp.Loader.load(Loader.java:935) at org.bytedeco.javacpp.opencv_core.<clinit>(opencv_core.java:10) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at org.bytedeco.javacpp.Loader.load(Loader.java:994) at org.bytedeco.javacpp.Loader.load(Loader.java:951) at main.java.me.jakejmattson.facialrecognition.FacialRecognition.main(FacialRecognition.java:30) Caused by: java.lang.UnsatisfiedLinkError: no opencv_imgproc401 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:1302) at org.bytedeco.javacpp.Loader.load(Loader.java:1021) ... 7 more C:\Users\EMPEROR-CUZZY\AppData\Local\NetBeans\Cache\8.2\executor-snippets\run.xml:53: Java returned: 1 BUILD FAILED (total time: 3 seconds)

cuzzysoft avatar Feb 12 '21 14:02 cuzzysoft

I have pushed a change swapping the Maven dependency and updating the OpenCV version. You shouldn't have to mess with the path yourself as the dependency used contains the binaries needed to use the library.

JakeJMattson avatar Feb 13 '21 03:02 JakeJMattson

Thanks much for your reply. I've downloaded the update and opened it using Netbeans10. But I get error during building

`BUILD FAILURE
------------------------------------------------------------------------
Total time: 3.928 s
Finished at: 2021-02-12T16:39:19+01:00
Final Memory: 8M/34M
------------------------------------------------------------------------
Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project FacialRecognition: Fatal error compiling: error: invalid target release: 15 -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
`

cuzzysoft avatar Feb 13 '21 05:02 cuzzysoft

I've been able to rectify the above error, then another situation

[ WARN:0] global C:\build\master_winpack-bindings-win64-vc14-static\opencv\modules\videoio\src\cap_msmf.cpp (906) CvCapture_MSMF::grabFrame videoio(MSMF): can't grab frame. Error: -2147483638
Exception in thread "main" java.lang.IllegalArgumentException: Width (0) and height (0) must be > 0
	at java.desktop/java.awt.image.SampleModel.<init>(SampleModel.java:126)
	at java.desktop/java.awt.image.ComponentSampleModel.<init>(ComponentSampleModel.java:140)
	at java.desktop/java.awt.image.PixelInterleavedSampleModel.<init>(PixelInterleavedSampleModel.java:87)
	at java.desktop/java.awt.image.Raster.createInterleavedRaster(Raster.java:642)
	at java.desktop/java.awt.image.Raster.createInterleavedRaster(Raster.java:278)
	at java.desktop/java.awt.image.Raster.createInterleavedRaster(Raster.java:212)
	at java.desktop/java.awt.image.ComponentColorModel.createCompatibleWritableRaster(ComponentColorModel.java:2827)
	at java.desktop/java.awt.image.BufferedImage.<init>(BufferedImage.java:420)
	at me.jakejmattson.facialrecognition.ImageFrame.convertMatToImage(ImageFrame.java:229)
	at me.jakejmattson.facialrecognition.ImageFrame.showImage(ImageFrame.java:204)
	at me.jakejmattson.facialrecognition.FacialRecognition.capture(FacialRecognition.java:62)
	at me.jakejmattson.facialrecognition.FacialRecognition.main(FacialRecognition.java:30)

cuzzysoft avatar Feb 13 '21 14:02 cuzzysoft