inspirit / jsfeat

JavaScript Computer Vision library.
MIT License
2.74k stars 374 forks source link

Face detection on raw video but display canny edges to user #51

Closed Joe-Palmer closed 8 years ago

Joe-Palmer commented 8 years ago

Firstly, thank you for this fantastic library, we have just started using it and it's very impressive!

We would like to run face detection on the feed coming from the user's camera but display a preview to the user generated from the canny edge detector. I see you have a use_canny option in your HAAR object detector demo but if I understand it correctly, it is doing the opposite of what we want and feeding the canny edges to the HAAR classifier and showing the original as the preview.

We tried running both the canny edge demo and the HAAR detector demo at the same time on the same page but the performance was terrible.

Do you have a recommendation for a good approach to displaying a canny preview to the user but doing face detection on the original video? Is there a way to pipeline these processes in an efficient way or should we be looking to run canny edges and face detection in parallel with web workers? From our initial experiments, it looks like the BBF face detection is more stable then HAAR so it would be good to try both in conjunction with canny.

Thanks for any advice you can give.

inspirit commented 8 years ago

Hi! Thank u for your interest. I'm currently not able to provide any examples due limited access to PC. However I don't see any troubles doing face detection and canny at the same time. You should look carefully into the demos to see that both Haar and BBf are working in grayscale image. Canny is used as second input for Haar to reduce some computations during processing. You can run both algorithms on 2x smaller image and than just zoom the results when u render them to screen. This is more JavaScript related questions though, not computer vision

Joe-Palmer commented 8 years ago

Thanks for your response, that's very helpful. We will look more closely at your demos and try to add the additional step.