Error:
Hello, OpenCV
Running DetectFaceDemo
Detected 0 faces
Writing faceDetection.png
libpng warning: Image width is zero in IHDR
libpng warning: Image height is zero in IHDR
libpng error: Invalid IHDR data
Solution:
Change the path of the files to their absolute paths.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create a face detector from the cascade file in the resources | |
// directory. | |
//CascadeClassifier faceDetector = new CascadeClassifier(getClass().getResource("/lbpcascade_frontalface.xml").getPath()); | |
//Mat image = Highgui.imread(getClass().getResource("/lena.png").getPath()); | |
CascadeClassifier faceDetector = new CascadeClassifier("C:/Users/mizuki/workspace/HelloOpenCV/src/lbpcascade_frontalface.xml"); | |
Mat image = Highgui.imread("C:/Users/mizuki/workspace/HelloOpenCV/src/lena.png"); |
No comments:
Post a Comment