In order to detect the face a rectangle is plotted on the face by using region properties s = regionprops (L, imbw1,{'Centroid','Area','Boundingbox'}) Bounding box create a box around the face detected area. Following is the result of face detection.