✅ Works in Interactive Notebook

Category: Input.

Filter detections by region.

SetRegion[] must be called before Detect[] or Segment[] to filter detections by region. If SetRegion[] is not called, the entire image is used as the region.


SetRegion[x, y, width, height]



The following example loads an image and sets the region in which detections must appear to be returned by Detect[]. Then, Detect[] is run to detect solar panels. Predictions not in the specified region are not returned. Then, the filtered predictions are displayed on the the image on which detection was run.

The region is the top left quadrant of the image, assuming the image is 500x500 pixels.

SetRegion[0, 0, 250, 250]
Detect["solar panel"]

See Also

Made with ❤️ by capjamesg