I'm trying to set up openCV for a spring rest API, running on TOMCAT 8.5 server.
I tried several things before asking the question :
- I added the opencv to the buildpath
- I added the opencv library to src/WEB-INF/lib of my java project (which I had to create by myself)
I tried to use a maven repository : OpenPnp
org.openpnp opencv 3.2.0-0
My test code is the following one : @RestController public class OpencvController {
@GetMapping("/opencv")
public String opencv() {
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
Mat mat = Mat.eye(3, 3, CvType.CV_8UC1);
System.out.println("mat = " + mat.dump());
return null;
}
}
But i keep getting the error : "java.lang.NoClassDefFoundError: org/opencv/core/Core" and i don't have anymore clue on how to solve it, any help would be really appreciated. Thank you in advance