F_VN_HaralickFeatures
Computes the Haralick features of a graylevel image, which describe the texture.
Syntax
Definition:
FUNCTION F_VN_HaralickFeatures : HRESULT
VAR_INPUT
ipImage : ITcVnImage;
ipFeatures : Reference To ITcVnContainer;
nDist : UDINT;
hrPrev : HRESULT;
END_VAR
Inputs
Name |
Type |
Description |
---|---|---|
ipImage |
Source image (1 channel, USINT) | |
ipFeatures |
Reference To ITcVnContainer |
Returns the computed Haralick features (CTcVnContainer_Vector_LREAL). The returned feature set contains the mean and standard deviation for each of the first 13 Haralick features, computed for 0, 45, 90, 135 degrees. So there will be 26 features in total (f1 mean, f1 stdDev, f2 mean, f2 stdDev, ..., f13 mean, f13 stdDev). |
nDist |
UDINT |
Distance |
hrPrev |
HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.) |
Further information
The function F_VN_HaralickFeatures
calculates the Haralick properties of an image. These values provide an indication of the structure of the image.
Parameter
Image
The input image ipImage
.
Features
The Haralick features are returned as a container via the reference ipFeatures
.
Distance
The distance between neighboring pixels in the Gray-Level Co-occurrence Matrix (GLCM) is specified as nDist
.
Application
For example, the calculation of Haralick features with a distance of 5 looks like this:
hr := F_VN_HaralickFeatures(
ipImage := ipImage,
ipFeatures := ipFeatures,
nDist := 5,
hrPrev := hr);
Related functions
Required License
TC3 Vision Machine Learning
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 |