Detect Humans in Image MATLAB Code
Version 1.0.0 (175 ko) par
MUHAMMAD BILAL WARIS
This code uses the vision.CascadeObjectDetector function to create a detector object, which is pre-trained to detect faces in images. The st
This code is a simple implementation of the Viola-Jones algorithm for detecting humans in an image. The code performs the following steps:
- 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.
This code provides a basic example of how to use the Viola-Jones algorithm to detect humans in images using MATLAB, but it's worth noting that the this algorithm may not work as well on all images or with different lighting or angles. Deep learning based approaches can be used to improve the accuracy of detection.
Citation pour cette source
MUHAMMAD BILAL WARIS (2024). Detect Humans in Image MATLAB Code (https://www.mathworks.com/matlabcentral/fileexchange/123945-detect-humans-in-image-matlab-code), MATLAB Central File Exchange. Extrait(e) le .
Compatibilité avec les versions de MATLAB
Créé avec
R2015a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS LinuxTags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
Version | Publié le | Notes de version | |
---|---|---|---|
1.0.0 |