Last updated: 3 March 2025

Comment définir une Zone d'Intérêt (Z.I.) à l'intérieur d'une caméra industrielle en 3 étapes

This guide provides a clear, step-by-step process to configure and use the Region of Interest (R.O.I.) function of an industrial camera. You will learn how to resize an image and capture only a defined area within the camera’s field of view.

Comment définir une Zone d'Intérêt (Z.I.) à l'intérieur d'une caméra industrielle en 3 étapes

Why Use a Region of Interest (R.O.I.)?

The R.O.I. function is a powerful feature that allows you to:

  • Reduce the amount of collected data.
  • Decrease bandwidth requirements.
  • Increase the camera’s framerate.
  • Focus on and isolate a specific area of interest.

In this article, we will configure an R.O.I., offset it from the top-left corner, and center it on the image. Follow these three simple steps to define the size and position of your industrial camera’s R.O.I.

How to Set a Region of Interest (R.O.I.) in 4 Steps

Step 1: Check the Image Size and Define the Region of Interest

Begin by identifying the maximum resolution of your industrial camera. For example, consider we are using an MER2 – 231-41GM-P with a resolution of 1920 x 1200 pixels.

  • Define the desired Region of Interest (R.O.I.).
  • For this guide, we’ll set the R.O.I. to 1000x1000 pixels within the camera’s field of view.

Step 2: Set R.O.I. Parameters in the ‘ImageFormatControl’ Menu

⚠️ Note: The menu can
only be accessed when no acquisition is running.

To configure the R.O.I. parameters:

  • Open the Daheng GalaxyView SDK.
  • Navigate to the ‘ImageFormatControl’ menu.
  • Adjust the size of the R.O.I. by setting the following parameters: Width: 1000; Height: 1000. These settings define the size of the R.O.I.
  • Define the R.O.I.’s position using the OffsetX and OffsetY parameters. These values specify the starting point of the R.O.I. within the full image frame.

Define the R.O.I.’s position using the OffsetX and OffsetY parameters. These values specify the starting point of the R.O.I. within the full image frame.

Step 3: Define the R.O.I. Offset Values

When setting OffsetX and OffsetY:

  • Remember that the origin is the top-left corner of the full image.
  • Offset values count toward the bottom-right corner.
  • For example, place the R.O.I. at the desired position by adjusting these offsets.

Example 1: Starting the Region of
Interest (R.O.I.) at the Center of the Whole Image

Toposition the R.O.I. at the center of the full image:

  1. Calculate the center of the full image based on its resolution:
  • Full Image Resolution: 1920 x 1200 pixels.
  • The center of the image is located at:
  • - Width (X): Half of 1920 = 960 pixels.
  • - Height (Y): Half of 1200 = 600 pixels.

2. Set the OffsetX and OffsetY parameters:

  • OffsetX: 960
  • OffsetY: 600

When these offsets are applied, the R.O.I. of 1000x1000 pixels will begin at the center of the full image.

 

 

* While the starting point of the R.O.I. will be at the center of the image, the center of the R.O.I. itself will not align with the center of the whole image.*

Example 2: Aligning the Center of the R.O.I. with the Center of the Whole Image

 

 

To place the Region of Interest (R.O.I.) so its center aligns perfectly with the center of the full image, use the following formula:

Formula for Offsets:

  • OffsetX = (MaxImageWidth/2)-(RoiWidth/2) = (1920 / 2) – (1000 / 2) = 460
  • OffsetY = (MaxImageHeight/2) (RoiHeight/2) = (1200 / 2) – (1000 / 2) = 100

By applying these offsets, the R.O.I. of 1000x1000 pixels will be perfectly centered within the full image of 1920 x 1200 pixels.

Step 4: Draw ROI Feature

Another option to set ROI is by using the “Draw ROI” Feature - click Draw button and click Full Screen to the maximum resolution.

Note: If a hand-drawn ROI operation is performed while the camera is in AcquisitionStop status, then the next time you draw will still on the previous image, because the image is not updated during AcquisitionStop, so, the drawing area may exceed the ROI setting range, which will result in ROI setting

failure. If you want to accurately execute the hand-drawn ROI, it is recommended to operate in the AcquisitionStart status. Alternatively, update the image after setting the ROI, and then draw the ROI.

 

 

Following these steps, you can accurately define the size and position of the R.O.I. for your industrial camera, optimizing its performance for your specific application.

The Effect of Setting a Region of Interest (R.O.I.) onFramerate

Decreasing the size of the Region of Interest (R.O.I.) in an industrial camera leads to an increase in framerate. This occurs for two reasons:

  1. Fewer pixels mean the camera needs less time to acquire and process the image.
  2. Reduced data results in a higher frames-per-second (FPS) rate, optimizing bandwidth usage.

Consider the MER2 – 231-41GM-P camera, which has a maximum framerate of 41 FPS at the maximum resolution of 1920 x 1200 pixels. Let’s calculate the resulting framerate when setting a custom R.O.I. of 1000x1000 pixels.

We use the following formula to calculate the new framerate:

FrameRate = 1 / (Traw ⋅ Height)

Where:

  • Height is the number of pixels in the vertical dimension of the R.O.I. (1000 pixels in this example).
  • Traw is a fixed time constant, which can be calculated by the formula (1/maxFPS) / maxHeight
  • For MER2 – 231-41GM-P,
    Traw = (1/41)/1200 = 0.000020325
  • Now, we can calculate the new framerate with the custom R.O.I. of 1000 pixels height: Framerate= 1 / (0.000020325*1000) = 49.2 FPS.

Thus, the resulting framerate with 1000x1000 R.O.I. would be approximately 49.2 FPS.

Important Note:

While this calculation gives a theoretical framerate, the actual framerate may vary based on various factors such as system configuration, camera settings, and other external influences.

Need support? Contact us!


Left image description

Gaspar van Elmbt

How to use the frame rate calculator for industrial cameras

To calculate the framerate of an industrial camera, a framerate calculator is available. This doc used to be available after installing the SDK. The frame rate calculator (an excel file) was located in the folder C:\Program Files\Daheng Imaging\GalaxySDK\Doc. Currently you can download the frame rate calculator from our download area.

Read more