odules:ty:compileJavaWARNING

modules:ty:compileJava WARNING: An illegal reflective access operation has occurred WARNING: Illegal reflective access by worker.org.gradle.internal.reflect.JavaMethod (file:/Users/---/.gradle/caches/3.0/workerMain/gradle-worker.jar) to method java.lang.ClassLoader.getPackages() WARNING: Please consider reporting this to the maintainers of worker.org.gradle.internal.reflect.JavaMethod WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations WARNING: All illegal access operations will be denied in a future release

FaceDetector.java

Running FaceDetector
Exception in thread "main" java.lang.NullPointerException
at cam.FaceDetector.main(FaceDetector.java:20)

solution

the path absolute

solution :

make sure that you do this following steps :
- path absolute
- test if empty

 CascadeClassifier faceDetector = new CascadeClassifier("C:/opencv/sources/data/haarcascades/haarcascade_frontalface_alt.xml");
     
        Mat image = Imgcodecs.imread("D:/network/opencv/lena2.png");
   
    if (faceDetector.empty()){
     System.out.println("faceless");
    }
    if(image.empty()){
     System.out.println("imageless");
    }

Commentaires

Posts les plus consultés de ce blog

Failed to execute goal org.codehaus.mojo:exec-maven-plugin

Cannot find System Java Compiler