Histogram

Calculate the (multi-channel) histogram of an image.
Can use available TwinCAT Job Tasks for executing parallel code regions.

Syntax

Definition:

HRESULT Histogram(
    HRESULT          hrPrev,
    ITcVnImage*      ipSrcImage,
    ITcVnContainer*& ipDestHistogram,
    ULONG&           nBins = 0,
    double&          fLowerBound = 0,
    double&          fUpperBound = 0,
    ITcVnImage*      ipMask = nullptr
)

Parameters

Name

Type

Default

Description

hrPrev

HRESULT

 

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

ipSrcImage

ITcVnImage*

 

Source image

ipDestHistogram

ITcVnContainer*&

 

Returns a container with a multi-channel histogram, where every channel is represented as a vector of UDINT (ContainerType_Vector_Vector_UDINT. Non-zero interface pointers are reused.)

nBins

ULONG&

0

Desired number of bins or 0 to keep the default for the corresponding image format (in) and default number of bins (out)

fLowerBound

double&

0

Lower (inclusive) boundary of the 0-th histogram bin (in), or receive the default if fLowerBound AND fUpperBound are set to 0 (out)

fUpperBound

double&

0

Upper (exclusive) boundary of the last histogram bin nBins-1 (in), or receive the default if fLowerBound AND fUpperBound are set to 0 (out)

ipMask

ITcVnImage*

nullptr

Source image mask (TCVN_ET_USINT, 1 channel. Mask is optional, set to 0 if not required.)

Histogram 1: Return value

HRESULT

Required License

TC3 Vision Base

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1.4024.54 or later

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

Tc3_Vision