Region of Interest

The Region of Interest (RoI) filter allows removal of detections outside of the region of the source image. For example, when only detections in front of the vehicle are relevant, detections on the far side can be removed.

The StaticRoiFilter class allows declaration of a static region of interest as a percentage of the image. By default, the class uses a region in the center of the frame, approximating the boundaries of the vehicle's current lane.

Note

If you are using LSModelManager class for model detection, you have to set the LSModelManager#setRecognitionProcessor() callback so that you can filter results using StaticRoiFilter before they are passed to recognition callback and tracker.

Filters

Filters are classes that perform a specific transformation on a collection of detections, such as removing irrelevant detections and estimating the distance between an object and the camera.

Input Frame Cropping

For most use cases, only a small portion of the input frame from a camera that contains the features targeted for detections is actually usable and the rest of the frame can be ignored. For example, a portion of the frame at the top might contain clear blue sky where no features will be expected to appear. Live Sense SDK provides the ability to crop such portions from the input frame so as to:

  • reduce the size of the image in turn helping to reduce the processing time for each frame
  • focus more on the interesting portion of the image to get more accurate detections and reduce false detections

Note

This is available for the Road Signs model only.

Method Signature

public void setSideCropPercent(int leftCropPercent, int topCropPercent, int rightCropPercent, int bottomCropPercent);

Usage

RoadSignsModel.Options rsOption = new RoadSignsModel.Options();
rsOption.setSideCropPercent(int leftCropPercent, int topCropPercent, int rightCropPercent, int bottomCropPercent);

Set the percentage of the frame to be cropped from all four sides individually before being passed for running recognitions.

All crop percentage values are 0 by default and must vary between 0 and 100.

  • @param leftCropPercent, rightCropPercent - percent of the input frame's total width to be cropped from the left and right respectively.
  • @param topCropPercent, bottomCropPercent - percent of the input frame's total width to be cropped from the top and bottom respectively.

The input frame is rotated to its natural orientation based on the rotation value passed to {@link Recognizer#recognizeImage(Bitmap, int, float)} before applying any cropping. This means that the directionality of this method's parameters are interpreted based on the user's view rather than the raw input frame.

@throws IllegalArgumentException - Exception thrown if:

  • any crop percent argument is < 0
  • leftCropPercent + rightCropPercent >= 100
  • topCropPercent + bottomCropPercent >= 100

Progressive Zoom

Through extensive experimentation, an approach has been identified that helps to detect features which are farther and would not have been detected unless they were closer. This approach is to progressively zoom in on the center portion of consecutive input frames per every 3 frames. This helps to detect features that to a large extent will lie in the center of the frame earlier and with good accuracy.

The cropping is always focused around the center of the input image, removing portions around the edges of the frame.

Note

This is available for the Road Signs model only.

Method Signature

public void setUseIncrementalCenterCrop(boolean useIncrementalCenterCrop);

Usage

RoadSignsModel.Options rsOption = new RoadSignsModel.Options();
rsOption.setUseIncrementalCenterCrop(boolean useIncrementalCenterCrop);

Defines if the Road Signs model should incrementally zoom the input frame on each call to {@link RoadSignsModel#recognizeImage(Bitmap, int, float)}.

Any frame adjustments are applied after any side cropping specified through {@link #setSideCropPercent(int, int, int, int)} has been applied.

results matching ""

    No results matching ""