Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FaceDetection #24

Closed
sunjunlishi opened this issue Sep 21, 2017 · 8 comments
Closed

FaceDetection #24

sunjunlishi opened this issue Sep 21, 2017 · 8 comments

Comments

@sunjunlishi
Copy link

sunjunlishi commented Sep 21, 2017

1 hello author,I test your FaceDetection example
640*480 image,i use your xml,speed is 6-8ms;
detection.Init(image.Size(), 1.16, cv::Size(60,60),cv::Size(450,450));
i use my xml ,speed is 1-2ms;
your work is great,perfect.
2 But, I test my plate detect
detection.Init(image.Size(), 1.16, cv::Size(60,60),cv::Size(450,450));
speed is 1-2ms
and detection.Init(image.Size(), 1.16, cv::Size(80,20),cv::Size(520,130));
speed is 16-20ms
so i think that Your algorithm is faster for squares, but rectangles don't support it very well

@ermig1979
Copy link
Owner

Hello. Could you give me size of scan window of cascade that you use to.

@sunjunlishi
Copy link
Author

my train isSize(64,16) ,is it? Scan window cv::Size(80,20) to cv::Size(520,130));

@szad670401
Copy link

It is exactly that the square window is very fast such as 5050 。but i use it for some detection such as for pedestrian or license plate , which windows size is not square (e.g 6416 )is not so fast。

@ermig1979
Copy link
Owner

ermig1979 commented Sep 21, 2017

If you use minimal size = cv::Size(60,60) and cascade window size = cv::Size(20,20) then the algorithm can reduce input image in 3 times (from 640x480 to 213x160) and process this small image. In second case the algorithm can reduce image only 1.25 times (relation between minimal size cv::Size(80,20) and cascade window size cv::Size(64,16)). So the algorithm need to process image of 512x384. The relation of areas (512x384)/(213x160) = 5.7. So it is not surprising that second case is slow.

P.S. OpenCV algorithm has the same behavior.

@sunjunlishi
Copy link
Author

sunjunlishi commented Sep 21, 2017

oh i see,the training size(20,20) and my training Size(64,16) is important. is it?
it added the minimum scan size to determine the processing speed .thank you very much,and to trouble you

@ermig1979
Copy link
Owner

The algorithm builds pyramid of scaled images with step which is setted by paramemter scaleFactor. Algorithm can skip the level, if window size is lesser or greater then minimal or maximal searched size (scaled to corresponding level). The main time is used to process low levels of the pyramid. So the parameter of minimal object size, cacade window size and scaleFactor have predominant influence to performance of the algorithm.

@sunjunlishi
Copy link
Author

oh ,ye scaleFactor 1.2; I understand thoroughly that the road far away is far away . thanks very much.

@sunjunlishi
Copy link
Author

sunjunlishi commented Sep 22, 2017

Both rectangular and square, the speed is 2-3 times higher than the opencv ,your are great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants