CvPyrDown vs cvResize to optimize face recognition

I want to optimize the face detection algorithm by reducing the image. What is the best way? should I use cvPyrDown (as I saw in one example and so far yielded bad results), cvResize or another function?

+4
source share
3 answers

If you only want to scale the image, use cvResize , as suggested by Adrian Popovichi.

cvPyrDown apply Gaussian blur to smooth the image, and then by default it will halve the image by rejecting even columns and rows. This anti-aliasing can degrade your performance (I'm not sure how this affects the detection algorithm). Another possibility of poor performance may be gaps created simply by flushing even rows and columns; while smooth interpolations (provided that you are interpolated with something other than the closest neighbor) on cvResize , allow you to recognize the face better. Here 's the cvPyrDown documentation for more information on which kernel is being used.

+6
source

To scale the images, I would use:

void cvResize(const CvArr* src, CvArr* dst, int interpolation=CV_INTER_LINEAR )

To compress an image, it will look best using CV_INTER_AREA interpolation, while to enlarge an image, it will look best with CV_INTER_CUBIC (slow) or CV_INTER_LINEAR (faster, but still looks fine).

But I have not used cvPyrDown yet, so I do not know its characteristics ...

+3
source

If your face detection algorithm uses the features of the hara, then you do not need any rescaling at all, just use the integrated image to access any scalable scale, scaling the detector. Additionally: cvResize looks slower in the new version of OpenCV (2.X) than in OpenCV 1.X

0
source

Source: https://habr.com/ru/post/1385074/


All Articles