- Reads an image file and loads it into the variable img.
- Creates a cascade detector object using the vision.CascadeObjectDetector function. This function creates a detector object that is pre-trained to detect faces in images using the Viola-Jones algorithm.
- Use the step function to detect faces in the image. The bboxes variable is a matrix that contains the bounding boxes of the detected faces.
- Draw bounding boxes around the detected faces using the insertObjectAnnotation function. This function takes the original image, the matrix of bounding boxes, and a label ('Human' in this case) as inputs and returns an image with the bounding boxes drawn on it.
- Display the image with the bounding boxes using the imshow function.
MUHAMMAD BILAL WARIS (2023). Detect Humans in Image MATLAB Code (https://www.mathworks.com/matlabcentral/fileexchange/123945-detect-humans-in-image-matlab-code), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform CompatibilityWindows macOS Linux
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!