Main Content


Detect objects in monocular camera using Fast R-CNN deep learning detector


The fastRCNNObjectDetectorMonoCamera object contains information about a Fast R-CNN (regions with convolutional neural networks) object detector that is configured for use with a monocular camera sensor. To detect objects in an image that was captured by the camera, pass the detector to the detect function. To classify image regions, pass the detector to the classifyRegions function.

When using detect or classifyRegions with fastRCNNObjectDetectorMonoCamera, use of a CUDA®-enabled NVIDIA® GPU is highly recommended. The GPU reduces computation time significantly. Usage of the GPU requires Parallel Computing Toolbox™. For information about the supported compute capabilities, see GPU Computing Requirements (Parallel Computing Toolbox).


  1. Create a fastRCNNObjectDetector object by calling the trainFastRCNNObjectDetector function with training data (requires Deep Learning Toolbox™).

    detector = trainFastRCNNObjectDetector(trainingData,...);
  2. Create a monoCamera object to model the monocular camera sensor.

    sensor = monoCamera(...);
  3. Create a fastRCNNObjectDetectorMonoCamera object by passing the detector and sensor as inputs to the configureDetectorMonoCamera function. The configured detector inherits property values from the original detector.

    configuredDetector = configureDetectorMonoCamera(detector,sensor,...);


expand all

Name of the classification model, specified as a character vector or string scalar. By default, the name is set to the heading of the second column of the trainingData table specified in the trainFastRCNNObjectDetector function. You can modify this name after creating your fastRCNNObjectDetectorMonoCamera object.

Example: 'stopSign'

This property is read-only.

Trained Fast R-CNN detection network used within the Fast R-CNN detector, specified as a DAGNetwork (Deep Learning Toolbox) object. This object stores the layers that define the convolutional neural network used within the Fast R-CNN detector. This network classifies region proposals produced by the RegionProposalFcn property.

Region proposal method, specified as a function handle.

This property is read-only.

Names of the object classes that the Fast R-CNN detector was trained to find, specified as a cell array. This property is set by the trainingData input argument for the trainFastRCNNObjectDetector function. Specify the class names as part of the trainingData table.

This property is read-only.

Minimum object size supported by the Fast R-CNN network, specified as a [height width] vector. The minimum size depends on the network architecture.

This property is read-only.

Camera configuration, specified as a monoCamera object. The object contains the camera intrinsics, the location, the pitch, yaw, and roll placement, and the world units for the parameters. Use the intrinsics to transform the object points in the image to world coordinates, which you can then compare to the values in the WorldObjectSize property.

This property is read-only.

Range of object widths and lengths in world units, specified as a [minWidth maxWidth] vector or [minWidth maxWidth; minLength maxLength] matrix. Specifying the range of object lengths is optional.

Object Functions

detectDetect objects using Fast R-CNN object detector configured for monocular camera
classifyRegionsClassify objects in image regions using Fast R-CNN object detector configured for monocular camera

Version History

Introduced in R2017a