Open CV Viola-Jones Face Detection in Matlab
No License
This zip file contains source code and windows executables for carrying out face detection on a gray scale image. The code implements Viola-Jones adaboosted algorithm for face detection by providing a mex implementation of OpenCV's face detector. Instructions for use and for compiling can be found in the Readme file.
Usage:
FaceDetect (<Haar Cascase XML file>, <Gray scale Image>)
The function returns Nx4 matrix. In case no faces were detected, N=1 and all four entries are -1. Otherwise, N=number of faces in the image and the vector contains the x, y, width and height information of the face.
Example,
A = imread ('lena.jpg', 'JPG');
Img = double (rgb2gray(A));
Face = FaceDetect('haarcascade_frontalface_alt2.xml',Img);
Cite As
Sreekar Krishna (2026). Open CV Viola-Jones Face Detection in Matlab (https://uk.mathworks.com/matlabcentral/fileexchange/19912-open-cv-viola-jones-face-detection-in-matlab), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Image Processing and Computer Vision > Computer Vision Toolbox > Recognition, Object Detection, and Semantic Segmentation > Object Detection Using Features > Face Detection >
Tags
Acknowledgements
Inspired: Face Detection & Recognition System, Fast Eyetracking
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 | The original code was causing segmentation fault in matlab. Removed the last but one line in the source file 'FaceDetect.cpp' - delete(cascade).
|
