Ask Your Question
0

Face Detection using CascadeClassifier

asked 2016-04-08 00:52:30 -0500

I have been looking up a tutorial using the cascadeClassifier class for detecting faces through a webcam, but I would like to modify it to detect faces in an image

The Tutorial is here: http://docs.opencv.org/2.4/doc/tutori...

Should I be using this class? Is there something better that OpenCV offers I can use? How can I modify this code to be compatible with 2D images? I would like to use Viola and Jones boosted cascade approach

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-04-08 02:32:16 -0500

  1. This is an older tutorial, using the legacy C-API, which is basically not recommended anymore.
  2. Here is the new version using C++ API.
  3. To read an image, instead of the line capture.open( -1 ); you could use the URL of the image: capture.open( "/path/to/my/image.png" ); This will use VideoCapture to read the image (but according to the following code it will close rapidly...). And it is not really recommended to use VideoCapture for image reading (different results possible from the usual image reading due to the codec used).
  4. You could replace the VideoCapture usage by a simple imread call. But if you wonder how to do that, I suggest you have a look at the beginner tutorial of OpenCV (complete list).
edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-04-08 00:51:44 -0500

Seen: 120 times

Last updated: Apr 08 '16