Main Content

Détection d’objets

Classification, détection d’objets, apprentissage par transfert avec des réseaux de neurones à convolution (CNN ou ConvNet) et création de détecteurs personnalisés

La détection d’objets est une technique de Computer Vision qui permet de localiser des objets dans des images ou des vidéos. Les algorithmes de détection d’objets utilisent généralement le Machine Learning ou le Deep Learning pour produire des résultats significatifs. Lorsqu’un être humain regarde une image ou une vidéo, il peut reconnaître et localiser des objets particuliers en quelques instants. La détection d’objets a pour but de reproduire cette intelligence avec un ordinateur. L’approche qui convient le mieux à la détection d’objets dépend de votre application et du problème à résoudre.

Les techniques de Deep Learning nécessitent un grand nombre d’images d’apprentissage labélisées. Il est donc recommandé d’utiliser un GPU pour réduire le temps d’apprentissage du modèle. Les approches de la détection d’objets basées sur le Deep Learning utilisent des réseaux de neurones à convolution (CNN ou ConvNet) tels que R-CNN et YOLO ou bien des détecteurs SSD (Single Shot Detection). Vous pouvez entraîner un détecteur d’objets personnalisé ou utiliser un détecteur préentraîné en tirant parti de l’apprentissage par transfert, une approche qui vous permet de commencer avec un réseau préentraîné, puis de l’affiner en fonction de votre application. Les réseaux de neurones à convolution nécessitent Deep Learning Toolbox™. L’apprentissage et la prédiction sont supportés sur un GPU compatible CUDA®. L’utilisation d’un GPU est recommandée et nécessite Parallel Computing Toolbox™. Pour plus d’informations, veuillez consulter Préférences de Computer Vision Toolbox et Parallel Computing Support in MathWorks Products (Parallel Computing Toolbox).

Les techniques de Machine Learning pour la détection d’objets comprennent l’algorithme ACF (Aggregate Channel Features), la classification SVM (Support Vector Machines) à l’aide des caractéristiques des histogrammes de gradient orienté (HOG) ainsi que l’algorithme de Viola-Jones pour la détection du visage ou du haut du corps humain. Vous pouvez commencer avec un détecteur d’objets préentraîné ou créer un détecteur personnalisé en fonction de votre application.

Labeled boats, neural network, and person detector

Applications

Image LabelerLabel images for computer vision applications
Video LabelerLabel video for computer vision applications

Fonctions

développer tout

Détecteurs basés sur le Deep Learning

rcnnObjectDetectorDetect objects using R-CNN deep learning detector
fastRCNNObjectDetectorDetect objects using Fast R-CNN deep learning detector
fasterRCNNObjectDetectorDetect objects using Faster R-CNN deep learning detector
ssdObjectDetectorDetect objects using SSD deep learning detector (depuis R2020a)
yolov2ObjectDetectorDetect objects using YOLO v2 object detector
yolov3ObjectDetectorDetect objects using YOLO v3 object detector (depuis R2021a)
yolov4ObjectDetectorDetect objects using YOLO v4 object detector (depuis R2022a)

Détecteurs basés sur les caractéristiques

readAprilTagDetect and estimate pose for AprilTag in image (depuis R2020b)
readArucoMarkerDetect and estimate pose for ArUco marker in image (depuis R2024a)
generateArucoMarkerGenerate ArUco marker images (depuis R2024a)
readBarcodeDetect and decode 1-D or 2-D barcode in image (depuis R2020a)
acfObjectDetectorDetect objects using aggregate channel features
peopleDetectorACFDetect people using aggregate channel features
vision.CascadeObjectDetectorDetect objects using the Viola-Jones algorithm
vision.ForegroundDetectorForeground detection using Gaussian mixture models
vision.PeopleDetector(To be removed) Detect upright people using HOG features
vision.BlobAnalysisProperties of connected regions

Détecter des objets à l’aide de caractéristiques ponctuelles

detectBRISKFeaturesDetect BRISK features
detectFASTFeaturesDetect corners using FAST algorithm
detectHarrisFeaturesDetect corners using Harris–Stephens algorithm
detectKAZEFeaturesDetect KAZE features
detectMinEigenFeaturesDetect corners using minimum eigenvalue algorithm
detectMSERFeaturesDetect MSER features
detectORBFeaturesDetect ORB keypoints
detectSIFTFeaturesDetect scale invariant feature transform (SIFT) features (depuis R2021b)
detectSURFFeaturesDetect SURF features
extractFeaturesExtract interest point descriptors
matchFeaturesFind matching features

Sélectionner les objets détectés

selectStrongestBboxSelect strongest bounding boxes from overlapping clusters using nonmaximal suppression (NMS)
selectStrongestBboxMulticlassSelect strongest multiclass bounding boxes from overlapping clusters using nonmaximal suppression (NMS)

Charger les données d’apprentissage

boxLabelDatastoreDatastore for bounding box label data (depuis R2019b)
groundTruthGround truth label data
imageDatastoreDatastore for image data
objectDetectorTrainingDataCreate training data for an object detector
combineCombine data from multiple datastores

Entraîner des détecteurs d’objets basés sur les caractéristiques

trainACFObjectDetectorTrain ACF object detector
trainCascadeObjectDetectorTrain cascade object detector model
trainImageCategoryClassifierTrain an image category classifier

Entraîner des détecteurs d’objets basés sur le Deep Learning

trainRCNNObjectDetectorTrain R-CNN deep learning object detector
trainFastRCNNObjectDetectorTrain Fast R-CNN deep learning object detector
trainFasterRCNNObjectDetectorTrain Faster R-CNN deep learning object detector
trainSSDObjectDetectorTrain an SSD deep learning object detector (depuis R2020a)
trainYOLOv2ObjectDetectorTrain YOLO v2 object detector
trainYOLOv3ObjectDetectorTrain YOLO v3 object detector (depuis R2024a)
trainYOLOv4ObjectDetectorTrain YOLO v4 object detector (depuis R2022a)

Augmenter et prétraiter les données d’apprentissage pour le Deep Learning

balanceBoxLabelsBalance bounding box labels for object detection (depuis R2020a)
bboxcropCrop bounding boxes (depuis R2019b)
bboxeraseRemove bounding boxes (depuis R2021a)
bboxresizeResize bounding boxes (depuis R2019b)
bboxwarpApply geometric transformation to bounding boxes (depuis R2019b)
bbox2pointsConvert rectangle to corner points list
imwarpApply geometric transformation to image
imcropCrop image
imresizeResize image
randomAffine2dCreate randomized 2-D affine transformation (depuis R2019b)
centerCropWindow2dCreate rectangular center cropping window (depuis R2019b)
randomWindow2dRandomly select rectangular region in image (depuis R2021a)
integralImageCalculate 2-D integral image

R-CNN (Regions With Convolutional Neural Networks)

rcnnBoxRegressionLayerBox regression layer for Fast and Faster R-CNN
fasterRCNNLayersCreate a faster R-CNN object detection network (depuis R2019b)
rpnSoftmaxLayerSoftmax layer for region proposal network (RPN)
rpnClassificationLayerClassification layer for region proposal networks (RPNs)
regionProposalLayerRegion proposal layer for Faster R-CNN
roiAlignLayerNon-quantized ROI pooling layer for Mask-CNN (depuis R2020b)
roiInputLayerROI input layer for Fast R-CNN
roiMaxPooling2dLayerNeural network layer used to output fixed-size feature maps for rectangular ROIs
roialignNon-quantized ROI pooling of dlarray data (depuis R2021b)

YOLO v2 (You Only Look Once version 2)

yolov2LayersCreate YOLO v2 object detection network
yolov2TransformLayerCreate transform layer for YOLO v2 object detection network
yolov2OutputLayerCreate output layer for YOLO v2 object detection network
spaceToDepthLayerSpace to depth layer (depuis R2020b)

Perte focale

focalCrossEntropyCompute focal cross-entropy loss (depuis R2020b)

SSD (Single Shot Detector)

ssdMergeLayerCreate SSD merge layer for object detection (depuis R2020a)

Boîtes d’ancrage

estimateAnchorBoxesEstimate anchor boxes for deep learning object detectors (depuis R2019b)
cuboid2imgProject cuboids from 3-D world coordinates to 2-D image coordinates (depuis R2022b)
insertObjectAnnotationAnnotate truecolor or grayscale image or video
insertObjectMask Insert masks in image or video stream (depuis R2020b)
insertShapeInsert shapes in image or video
showShapeDisplay shapes on image, video, or point cloud (depuis R2020b)
evaluateObjectDetectionEvaluate object detection data set against ground truth (depuis R2023b)
objectDetectionMetricsObject detection quality metrics (depuis R2023b)
mAPObjectDetectionMetricMean average precision (mAP) metric for object detection (depuis R2024a)
bboxOverlapRatioCompute bounding box overlap ratio
bboxPrecisionRecallCompute bounding box precision and recall against ground truth

Blocs

Deep Learning Object DetectorDetect objects using trained deep learning object detector (depuis R2021b)

Rubriques

En savoir plus

Données d’apprentissage pour la détection d’objets et la segmentation d’instances

Démarrer avec le Deep Learning

  • Deep Learning in MATLAB (Deep Learning Toolbox)
    Discover deep learning capabilities in MATLAB® using convolutional neural networks for classification and regression, including pretrained networks and transfer learning, and training on GPUs, CPUs, clusters, and clouds.
  • Pretrained Deep Neural Networks (Deep Learning Toolbox)
    Learn how to download and use pretrained convolutional neural networks for classification, transfer learning and feature extraction.