Class DetectionRegion

java.lang.Object
com.digimarc.dms.readers.image.DetectionRegion
Direct Known Subclasses:
PreviewDetectionRegion

public class DetectionRegion extends Object
Defines region of interest within a frame. This can be used with ImageReader.setImageDetectionRegion(DetectionRegion) or VideoCaptureReader.setImageDetectionRegion(DetectionRegion) to constrain the image area that DMSDK will use to search for 1D barcodes or Digimarc digital watermarks.

This implementation is suitable for apps that have region coordinates for the full input image. Apps that want to provide region coordinates based on a visible camera preview should use the PreviewDetectionRegion implementation instead.

  • Constructor Details

    • DetectionRegion

      public DetectionRegion(float left, float top, float right, float bottom, int rotation)
    • DetectionRegion

      public DetectionRegion(@NonNull android.graphics.RectF regionOfInterest, int rotation)
      Parameters:
      regionOfInterest - Region for detection. Each value within the rect should be in normalized coordinates (0..1)
      rotation - Amount region should be rotated in degrees to match the target rotation of input frames
      Throws:
      IllegalArgumentException - if the provided region of interest violates constraints:

      1) any value < 0.0f

      2) any value > 1.0f

      3) left > right

      4) top > bottom

      5) if either the height or width of the region < 0.15f.

  • Method Details

    • getRect

      public android.graphics.RectF getRect()
    • getLeft

      public float getLeft()
    • getTop

      public float getTop()
    • getRight

      public float getRight()
    • getBottom

      public float getBottom()
    • getWidth

      public float getWidth()
    • getHeight

      public float getHeight()