Val*_*ath 1 c++ java linux opencv
我正在尝试使用OpenCv库创建一个样本面部检测应用程序.我按照以下教程
http://docs.opencv.org/doc/tutorials/introduction/desktop_java/java_dev_intro.html https://www.openshift.com/blogs/day-12-opencv-face-detection-for-java-developers
但我得到以下警告,它没有检测到面孔.
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
Run Code Online (Sandbox Code Playgroud)
请帮帮我.我正在使用linuxMint + eclipse系统.
问题在于
FaceDetector.class.getResource("haarcascade_frontalface_alt.xml").getPath()
Run Code Online (Sandbox Code Playgroud)
它返回这样的东西
/C:/src/open/haarcascade_frontalface_alt.xml
Run Code Online (Sandbox Code Playgroud)
应该删除开头的斜线
FaceDetector.class.getResource("haarcascade_frontalface_alt.xml").getPath().substring(1)
Run Code Online (Sandbox Code Playgroud)