F_VN_FindRois

F_VN_FindRois 1:

Extracts rectangular regions of interest (ROIs) from an image by partitioning it into tiles using the selected method and parameters.

Syntax

Definition:

FUNCTION F_VN_FindRois : HRESULT
VAR_INPUT
    ipSrcImage      : ITcVnImage;
    ipRois          : Reference To ITcVnContainer;
    eFindRoisMethod : ETcVnFindRoisMethod;
END_VAR
VAR_IN_OUT
    stParams        : TcVnParamsFindRois;
END_VAR
VAR_INPUT
    hrPrev          : HRESULT;
END_VAR

 Inputs

Name

Type

Description

ipSrcImage

ITcVnImage

Source image (1 channel, non-negative values).

ipRois

Reference To ITcVnContainer

Returns the ROIs (ContainerType_Vector_TcVnRectangle_DINT; Non-zero interface pointers are reused.)

eFindRoisMethod

ETcVnFindRoisMethod

Method to create ROIs

hrPrev

HRESULT

HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.)

 In/Outputs

Name

Type

Description

stParams

TcVnParamsFindRois

Parameters for extracting ROIs

 Return value

HRESULT

Further information

The function F_VN_FindRois extracts regions of interest (ROIs) from an input image in which high and concentrated intensity values mark relevant image areas (e.g., a binary image or a saliency map). The purpose of this function is to crop large images down to these key areas. The result is a container made up of rectangles that serve as specific search windows for additional vision functions. As a result, computationally intensive functions no longer need to be applied to the entire image, which saves computing time and, by masking out irrelevant image areas, can also improve the accuracy of subsequent analyses.

A proven combination is F_VN_SalientFeatures followed by F_VN_FindRois to identify relevant rectangular image regions from the computed saliency map. To more clearly distinguish between relevant information and background information, it is often helpful to apply filtering beforehand (e.g., using F_VN_Threshold).

Parameter

Input image

The input image ipSrcImage must be single-channel and may contain only non-negative values. Suitable inputs include, for example, binary or saliency images with relevant structures in bright areas.

Regions found

The ipRois parameter returns the detected ROIs as a container of type ContainerType_Vector_TcVnRectangle_DINT.

Method for ROI extraction

The parameter eFindRoisMethod, of type ETcVnFindRoisMethod, specifies the method used to extract the ROIs. The choice of method depends on the type of input image and the nature of the regions being sought:

ROI extraction parameters

The parameter stParams, of type TcVnParamsFindRois, configures the behavior of the selected extraction method. The fields have the following meaning:

Required License

TC3 Vision Base

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1.4024.59 or later

PC or CX (x64) with min. PL50, e.g. Intel 4-core Atom CPU

Tc3_Vision