Main Content

Set ROI

Draw over specified region of video frame stored in external memory

Since R2023a

Add-On Required: This feature requires the SoC Blockset Support Package for AMD FPGA and SoC Devices add-on.

  • Set ROI block

Libraries:
Find this block in the YOLO v2 Vehicle Detector with Live Camera Input on Zynq-Based Hardware example

Description

The Set ROI block overwrites one or more rectangular regions of a video frame stored in external memory. For instance, you can use this block to display score labels on identified objects. The block uses the processor-FPGA interface and the memory map of this reference design to read and modify the specified pixels in the frame.

You can use this block only once per model. Your design should provide the ROI coordinates and replacement values and set valid to true once video frames are available in memory. The YOLO v2 Vehicle Detector with Live Camera Input on Zynq-Based Hardware (Vision HDL Toolbox) example shows how to use this block in the postprocessing model that is targeted to the ARM® processor.

Examples

Limitations

  • To use this block, in the hardware setup, set Hardware Board to Xilinx Zynq UltraScale+ MPSoC ZCU102 Evaluation Kit and set Add-on Card to FMC-HDMI-CAM.

  • Use the IP core workflow to generate HDL code. This block does not support using the SoC Builder tool. For more information on workflows, see SoC Generation Workflows.

    In the HDL Workflow Advisor tool, in step 1.1, set Target platform to Xilinx Zynq Ultrascale+ MPSoC ZCU102 Evaluation Kit. In step 1.2, set Reference design to RGB with DL Processor.

Ports

Input

expand all

Specify the coordinates of the ROIs as an N-by-2 matrix of the form [x y], where N is the number of ROIs, and x y are coordinates of the top-left corner of each rectangle.

Data Types: single | double | uint32

Specify the replacement pixel values as a matrix of N-by-width-by-height. All the ROIs must be the same size.

Data Types: single | double | uint32

When this input is true (1), the block modifies all frames found in memory. Your design should provide the StartPos and ROI values and set valid to true once video frames are available in memory.

Data Types: Boolean

Parameters

expand all

This block assumes the frame is stored in memory in row-major order. If your design stores the frame in column-major order, clear this checkbox.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2023a