Search code examples
image-processingmachine-learningcomputer-visionface-detection

Finding object of unknown size on image


I'm writing Face Recognition program. So my goal is to find a face on an image of some size. At the moment I made HOG Algorithm and SVM classificator. For provided image I can tell if its a face or not, but only for images of fixed size where face is in the middle. So how do i find faces that are bigger or smaller than what SVM is trained for or on an unknown location on image?


Solution

  • What do you need is a "multi scale detection".

    The basic ides is to run your detector on several different scales of the image. So you need to crate a pyramid of the image and for each level of the image run you detector using a image scan.

    If the object in the image is bigger than the classifier that you train than after you downsample the image as part of the pyramid the size of the object will be smaller and when you ran your detector on the lower scale you will find the object.

    For objects that are smaller than your original classifier you will need: upsample the image and run the detector or train your classfier on the smallest size that you expect to detect.

    look at https://www.mpi-inf.mpg.de/fileadmin/inf/d2/HLCV/cv-ss13-0605-sliding-window.pdf for some basic explnantion.

    Also you can try to use opencv built in multiscale detection. opencv HOG multicale detector