F_VN_SalientFeatures

F_VN_SalientFeatures 1:

Compute salient features from the input image using the specified method.

Syntax

Definition:

FUNCTION F_VN_SalientFeatures : HRESULT
VAR_INPUT
    ipSrcImage  : ITcVnImage;
    ipDestImage : Reference To ITcVnImage;
    eMethod     : ETcVnSalientFeaturesMethod;
    hrPrev      : HRESULT;
END_VAR

 Inputs

Name

Type

Description

ipSrcImage

ITcVnImage

Source image (USINT elements, 1 or 3 channels; 3 channel input is expected to be RGB and internally converted to Gray).

ipDestImage

Reference To ITcVnImage

Destination image (1 channel image of type TCVN_ET_UINT, an appropriate destination image will be created if required.)

eMethod

ETcVnSalientFeaturesMethod

Method to compute salient features.

hrPrev

HRESULT

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

 Return value

HRESULT

Further information

The function F_VN_SalientFeatures calculates a saliency map from the input image that highlights areas of the image with particularly high information content. Typically, these are edges, transitions, and periodic structures. The result is an output image in which high pixel values indicate areas of interest.

Using F_VN_FindRois, relevant regions can be extracted from the output image to reduce large input images to several areas of interest. By focusing on interesting image areas in this way, the required computing time is also reduced, since it is no longer necessary to analyze the entire image. For example, this allows image regions containing codes to be identified, which are then passed to the F_VN_DetectCodesNeuralNetwork for more accurate detection of the code region. By reducing the image size to individual regions with a smaller image area, smaller model types can also be used.

The saliency image can be further processed before it is passed to F_VN_FindRois. This allows the features to be further filtered and adjusted on a per-application basis, thereby improving the accuracy and stability of ROI extraction.

Parameter

Input image

The input image ipSrcImage must be of type USINT and have either 1 or 3 channels. For a 3-channel image, it is interpreted internally as RGB and automatically converted to a grayscale image. To avoid this internal conversion step and the associated additional computing time, it is recommended that you submit the image as a 1-channel grayscale image.

Result image

The result image ipDestImage is a 1-channel image of type UINT. High pixel values in the output image highlight salient (prominent) regions of the image.

Saliency values must be interpreted in light of the specific method and image. In practice, therefore, relative criteria should be used rather than rigid absolute thresholds.

The output image can be passed directly to F_VN_FindRois. In applications involving distracting image content, it is recommended to filter the saliency image beforehand to suppress false regions. Suitable methods include, for example, thresholding using F_VN_Threshold or filtering with morphological operators F_VN_MorphologicalOperator. If you want this output image to be displayed, you can use the F_VN_NormalizeImageForDisplay function.

Method for Calculating Characteristics

The parameter eMethod, of type ETcVnSalientFeaturesMethod, determines the internal method used to compute the saliency map. The choice of method depends on the image content and the desired result. The following methods are available:

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