title: Face Detection with using Computer Vision Toolbox(Viola Jones) in Matlab
body: <p>I have a final project about face detection. I decided to do this project using Matlab and the Computer Vision Toolbox because as you know, this toolbox uses Viola Jones Algorithm for object detection. </p>
  
  <p>I wrote the code below but the code matches a face with the a non-face object. <br /><br />
  <strong>Question</strong><br />
  How can I change the code so that it matches faces only?</p>
  
  <pre><code>clear all
  clc
  
  % Read input image
  I = imread('C:\imageprocessingwithMatlab\Image001.jpg');
  figure,imshow(I);
  
  %% Detect Faces in the image
  % Create a detector object
  faceDetector = vision.CascadeObjectDetector('FrontalFaceCART');   
  
  % Detect faces
  bbox = step(faceDetector, I); 
  
  % Draw boxes around detected faces and display results
  IFaces = insertObjectAnnotation(I, 'rectangle', bbox, 'Face');
  figure, imshow(IFaces), title('Detected Faces');
  </code></pre>