clear, close all, clc
% Create a cascade detector object.
faceDetector = vision.CascadeObjectDetector();
% Load an image and convert it to frame
%X=imread('monalisa.jpg');
X=imread('G7_2022.jpg');
%X=imread('G7_2023.jpg');
Xframe=im2frame(X);
% Detect the faces and compute the bounding boxes
bbox = step(faceDetector, Xframe.cdata);
% Draw the returned bounding box around the detected face.
videoOut = insertObjectAnnotation(Xframe.cdata,'rectangle',...
    bbox,'Face');
figure, imshow(videoOut), title('Detected face');

