Hello Vipul,
Find the new code attached.
To build the application in your side, just run the environment_setup script (if you ware using yocto toolchain) and then "make" the application. There are some improvements that I still need to do (remove 2 memcpy operations).
In the code attached you it performs the facedetection using OpenCV (detect.multiScale, haarcascades), but now using a improved capture system, g2d for resizing, opencl for colorspace conversion. When a face is not detected, the average performance is:
FPS=16.9492
FPS=15.1515
FPS=16.3934
FPS=15.1515
when a face is detected, the average performance is:
FPS=20.8333
FPS=21.2766
FPS=20.4082
FPS=21.7391
and if you change the capture size (800x600 - lines 73 and 98) to 640x480, face detection is still being performed at 720x640, you will get around ~30FPS.
Attention that the code still needs improvement, please, see it only as a base for understanding the approach I mentioned before.
Regards