Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

Can't find any faces on pictures

$
0
0
I'm java programmer and I'm using `opencv-2413.jar` library.
ByteArrayOutputStream streamBA = new ByteArrayOutputStream(); //wi - is instance of WritableImage (images with faces are big: 720p and 1080p, and correct. I save it to disk and they opens well) RenderedImage ri = SwingFXUtils.fromFXImage(wi, null); ImageIO.write(ri, "jpg", streamBA); byte[] img = streamBA.toByteArray(); MatOfByte rawImage = new MatOfByte(img); Mat image = Highgui.imdecode(rawImage, Highgui.CV_LOAD_IMAGE_GRAYSCALE); System.out.println(image.toString()); MatOfRect faces = new MatOfRect(); // I'm trying different cascades, the result is the same CascadeClassifier faceDetector = new CascadeClassifier(); faceDetector.detectMultiScale(image, faces); System.out.println(faces.elemSize() + "\n"); for (Rect r : faces.toList()) { System.out.println(r.x + " " + r.y); } Everything is going ok, but `faces.elemSize()` is always `0`. What I'm doing wrong?

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>