Object detection is a computer vision technique for locating instances of objects in images or videos. Object detection algorithms typically leverage machine learning or deep learning to produce meaningful results. When humans look at images or videos, we can recognize and locate objects of interest within a matter of moments. The goal of object detection is to replicate this intelligence using a computer.
Why Object Detection Is Important
Object detection, a key technology used in advanced driver assistance systems (ADAS), enables cars to detect driving lanes and pedestrians to improve road safety. Object detection is also an essential component in applications such as visual inspection, robotics, medical imaging, video surveillance, and content-based image retrieval.
Keep Exploring This Topic
How Object Detection Works
Object Detection Using Deep Learning
You can use a variety of techniques to perform object detection. Popular deep learning–based approaches using convolutional neural networks (CNNs), such as YOLO, SSD, or R-CNN, automatically learn to detect objects within images.
You can choose from two key approaches to get started with object detection using deep learning:
- Use pretrained object detectors. Several deep learning object detectors are trained on large data sets and can detect common objects such as people, vehicles, or image text without requiring further training.
- Create and train a custom object detector. To tailor an object detector to your specific needs, you can use transfer learning. This approach enables you to build on a pretrained network, refining it further for your application. This method can provide faster results than training from scratch because the object detectors have already been trained on thousands, or even millions, of images.
Whether you use a pretrained object detector or create a custom one, you will need to decide what type of object detection network you prefer.
Object Detection Using Machine Learning
Machine learning techniques are also commonly used for object detection, and they offer different approaches than deep learning. Common machine learning techniques include:
- Aggregate channel features (ACFs)
- Support vector machine (SVM) classification using histograms of oriented gradient (HOG) features
- The Viola-Jones algorithm for human face or upper body detection
As with deep learning–based approaches, you can choose to start with a pretrained object detector or create a custom object detector to suit your application. You will need to manually select the identifying features for an object when using machine learning, compared with automatic feature selection in a deep learning–based workflow.
Keep Exploring This Topic
Machine Learning vs. Deep Learning for Object Detection
The best approach for object detection depends on your application and the problem you’re trying to solve. When choosing between machine learning and deep learning, consider whether you have a powerful GPU and lots of labeled training images. If you don’t have both, a machine learning approach might be the better choice. Deep learning techniques tend to work better when you have more images, and GPUs decrease the time needed to train the model.
Other Object Detection Methods
In addition to deep learning– and machine learning–based object detection, several other common techniques may be applicable depending on your application:
- Image segmentation and blob analysis, which uses simple object properties such as size, shape, or color
- Instance segmentation, a technique that predicts pixel-by-pixel segmentation masks of the precise shape and area of each object
- Keypoint detection, a technique that predicts specific points of interest on the object
- Feature-based object detection, which uses feature extraction, matching, and RANSAC to estimate the location of an object
Object Detection with MATLAB
With just a few lines of MATLAB® code, you can build machine learning and deep learning models for object detection without having to be an expert.
Automatically Label Training Images with Apps
MATLAB provides interactive apps to both prepare training data and customize convolutional neural networks. Labeling the test images for object detectors is tedious, and getting enough training data to create a performant object detector can take a significant amount of time. The Image Labeler app lets you interactively label objects within a collection of images and provides built-in algorithms to automatically label your ground-truth data. For automated driving applications, you can use the Ground Truth Labeler app, and for video processing workflows, you can use the Video Labeler app.
Interactively Create Object Detection Algorithms and Interoperate Between Frameworks
Customizing an existing CNN or creating one from scratch can be prone to architectural problems that can waste valuable training time. The Deep Network Designer app enables you to interactively build, edit, and visualize deep learning networks while also providing an analysis tool to check for architectural issues before training the network.
With MATLAB, you can interoperate with networks and network architectures from frameworks like TensorFlow™-Keras, PyTorch®, and Caffe2 using ONNX™ (Open Neural Network Exchange) import and export capabilities.
Automatically Generate Optimized Code for Deployment
After creating your algorithms with MATLAB, you can leverage automated workflows to generate TensorRT or CUDA® code with GPU Coder™ to perform hardware-in-the-loop testing. The generated code can be integrated with existing projects and used to verify object detection algorithms on desktop GPUs or embedded GPUs such as the NVIDIA® Jetson™ or NVIDIA Drive platform.
Resources
Expand your knowledge through documentation, examples, videos, and more.
Related Topics
Explore similar topic areas commonly used with MATLAB and Simulink products.
30-Day Free Trial
Get startedSeleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia-Pacífico
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)