Main Content

vehicleDetectorACF

Load vehicle detector using aggregate channel features

Description

example

detector= vehicleDetectorACFreturns a pretrained vehicle detector using aggregate channel features (ACF). The returnedacfObjectDetectorobject is trained using unoccluded images of the front, rear, left, and right sides of the vehicles.

detector= vehicleDetectorACF(modelName)returns a pretrained vehicle detector based on the model specified inmodelName. A'full-view'model uses training images that are unoccluded views from the front, rear, left, and right sides of vehicles. A'front-rear-view'model uses images only from the front and rear sides of the vehicle.

Examples

collapse all

Load the pre-trained detector for vehicles

detector = vehicleDetectorACF('front-rear-view');

Load an image and run the detector.

I = imread('highway.png'); [bboxes,scores] = detect(detector,I);

Overlay bounding boxes and scores for vehicles detected in the image.

I = insertObjectAnnotation(I,'rectangle',bboxes,scores); figure imshow(I) title('Detected Vehicles and Detection Scores')

Figure contains an axes object. The axes object with title Detected Vehicles and Detection Scores contains an object of type image.

Input Arguments

collapse all

Type of vehicle detector model, specified as either'front-rear-view'or'full-view'. A'full-view'model uses training images that are unoccluded views from the front, rear, left, and right sides of vehicles. A'front-rear-view'model uses images only from the front and rear sides of the vehicle.

Data Types:char|string

Output Arguments

collapse all

Trained ACF-based object detector, returned as anacfObjectDetectorobject.

Version History

Introduced in R2017a