Macros | |
#define | area_centered_grey_value_quantile(imgIn, val, quantilePercent, xc, yc, cdx, cdy, ch) area_grey_value_quantile(imgIn, val, quantilePercent, (xc)-((cdx)/2), (yc)-((cdy)/2), (cdx), (cdy), ch) |
Get Grey Value Quantile of an image area based around center (Macro). More... | |
#define | image_grey_value_quantile(imgIn, val, quantilePercent, ch) area_grey_value_quantile(imgIn, val, quantilePercent, 0, 0, (imgIn)->dx, (imgIn)->dy, ch) |
Get Grey Value Quantile of an image (Macro). More... | |
Functions | |
U32 | arx (image *a, I32 thr) |
Count of Image Pixels above Threshold. More... | |
U32 | arx2 (image *a, I32 th1, I32 th2) |
Count of Image Pixels between Two Thresholds. More... | |
I32 | mean (image *a) |
Mean of Image's Grey Values. More... | |
U32 | variance (image *a) |
Variance of Image's Grey Values. More... | |
I32 | contrast (image *a) |
Contrast of Image's Grey Values. More... | |
U32 | focus (image *a, I32 sh) |
Focal Value of an Image. More... | |
U32 | SumImage (image *Src) |
Sum of all Image Pixel Values. More... | |
U40 | ProdImage (image *Src1, image *Src2) |
Inner Product of Two Images. More... | |
I32 | histo (image *a, U32 hist[]) |
Histogram over Image's Grey Values. More... | |
I32 | histo_at_rlc (image *img, U32 hist[256], U16 *rlc, U16 rlcCol) |
Histogram over RLC's Image Grey Values. More... | |
I32 | histo_grey_value_quantile (U32 hist[256], U8 *val, I32 quantilePercent) |
Get Grey Value Quantile of a histo()-gram. More... | |
I32 | histo_U32_value_quantile (U32 *hist, I32 entries, U32 *pos, I32 quantilePercent) |
void | projh (image *a, U32 result[]) |
Horizontal Projection of an Image. More... | |
void | projv (image *a, U32 result[]) |
Vertical Projection of an Image. More... | |
I32 | area_grey_value_quantile (image *imgIn, U32 *val, I32 quantilePercent, I32 x0, I32 y0, I32 dx, I32 dy, I32 ch) |
Get Grey Value Quantile of an image area. More... | |
I32 | NormalizedCorrelationI32 (image *SearchX, image *Pattern, float MinContr, I32 *Corr, float *Contr, I32 *PosX, I32 *PosY) |
Normalized Correlation Returning I32 Correlation Value. More... | |
I32 | contrastF (image *src, F32 *avg, F32 *contrast) |
Average Grey Value and Contrast Calculation. More... | |
Functions in this group use a larger number of pixels of the source image in order to calculate a value or a number of values. Examples are projections and average calculations.
#define area_centered_grey_value_quantile | ( | imgIn, | |
val, | |||
quantilePercent, | |||
xc, | |||
yc, | |||
cdx, | |||
cdy, | |||
ch | |||
) | area_grey_value_quantile(imgIn, val, quantilePercent, (xc)-((cdx)/2), (yc)-((cdy)/2), (cdx), (cdy), ch) |
The macro calculates the grey value which is equal to or smaller than the given grey value quantile of the histogram, but always at least 0.
More information can be found at the called function area_grey_value_quantile().
#define image_grey_value_quantile | ( | imgIn, | |
val, | |||
quantilePercent, | |||
ch | |||
) | area_grey_value_quantile(imgIn, val, quantilePercent, 0, 0, (imgIn)->dx, (imgIn)->dy, ch) |
The macro calculates the grey value which is equal to or smaller than the given grey value quantile of the histogram, but always at least 0.
More information can be found at the called function area_grey_value_quantile().
The function calculates the count of pixels above (and not equals to) the threshold thr
.
The function calculates the number of pixels between the thresholds th1
and th2
.
The function calculates the mean value of an image variable. The value is rounded and returned to the calling function. There is no restriction for the format of the image.
The mean is the sum of all pixel values in the image divided by the image area.
The function calculates the statistical variance of an image variable. The value is rounded and returned to the calling function. There is no restriction for the format of the image like for earlier VCLIB.
The variance is the sum of all pixel values squared divided by the image area.
The variance can be used to measure the contrast, e.g the presence or absence of high contrast structures like printing, etc.
The function calculates the average contrast in image variable a
.
Contrast is defined as the standard deviation of the grey values of all pixels in the image variable. The maximum allowed size of the image variable is 65536 pixels (e.g. 256×256)
The function calculates the average grey value and the average contrast in image variable src
.
Contrast is defined as the standard deviation of the grey values of all pixels in the image variable. The maximum allowed size of the image variable is 4096×4096-1 pixels.
The function calculates the relative focus measure of the image variable a
. sh
is a shift value to suppress noise. sh=0
means no shift, sh=-1
is equivalent to dividing by 2, sh=-2
is equivalent to dividing by 4, etc. The focal value is calculated according to the following procedure:
a1 | a2 |
b1 | b2 |
a1 and a2 are adjacent Pixels in the upper line, b1 and b2 are adjacent pixels in the lower line. We have:
The summation is performed for all ((dx-1
)*(dy-1
)) pixels of the image variable.
This function sums up all the pixels in an image. The result is U32, therefore (2^24-1) pixels may be in the image, e.g. almost 4096×4096 pixels.
Src | Image with Pixels to Sum Up. |
Sum | Equals to ![]() |
This function calculates the cross-correlation or inner product between two images. Line summation is done with U32, therefore the maximum line width is (2^16-1) = 65535. The line summation is done with U40, so that the maximum image size is (2^24-1), e.g. almost 4096×4096 pixels.
Src1 | First Image. |
Src2 | Second Image. |
Inner Product | Equals to ![]() |
The function calculates the histogram of the image variable a
. The histogram is the absolute frequency of the 256 different gray scales in an image/image window. In addition to the image variable a
, a pointer to an array with 256 values is passed to the function. After calling the function, the result can be taken from this array.
a | Source Image |
hist | Target Histogram |
The function calculates the histogram of all pixels of the image variable a
where a given run length code rlc
has a specified color rlcCol
. The histogram is the absolute frequency of the 256 different gray scales in an image/image window. In addition to the image variable a
, a pointer to an array with 256 values is passed to the function. After calling the function, the result can be taken from this array.
a | Source Image of type IMAGE_GREY. |
hist | Target Histogram |
rlc,rlcCol | Regions at rlc (unlabelled RLC) with color rlcCol will be selected for histogram building |
The function calculates the grey value which is equal to or smaller than the given grey value quantile of the histogram, but always at least 0.
val | grey value, where at minimum (100% - quantilePercent) pixels of the area have a grey value which is bigger than this one. |
1 | if grey value is 0, but quantile is lower. |
The function calculates the horizontal projection of an image variable. Here, projection means the sum of all pixels in one line. The result is stored in the array result
[dy]. result
[0] is the projection of the first line, result
[1] the projection of the second line, etc.
The function calculates the vertical projection of an image variable. Here, projection means the sum of all pixels in one column. The result is stored in the array result
[dx]. result
[0] is the projection of the first column, result
[1] is the projection of the second column, etc.
I32 area_grey_value_quantile | ( | image * | imgIn, |
U32 * | val, | ||
I32 | quantilePercent, | ||
I32 | x0, | ||
I32 | y0, | ||
I32 | dx, | ||
I32 | dy, | ||
I32 | ch | ||
) |
The function calculates the grey value which is equal to or smaller than the given grey value quantile of the histogram, but always at least 0.
imgIn | image keeping the area to be processed. |
val | grey value, where at minimum (100% - quantilePercent) pixels of the area have a grey value which is bigger than this one. |
-1 | iff region is empty. |
1 | iff region is smaller than the requested region. |
-2 | iff Image Type is not IMAGE_GREY. |
-3 | iff selected channel is not (yet) supported. |
1 | if grey value is 0, but quantile is lower. |
I32 NormalizedCorrelationI32 | ( | image * | SearchX, |
image * | Pattern, | ||
float | MinContr, | ||
I32 * | Corr, | ||
float * | Contr, | ||
I32 * | PosX, | ||
I32 * | PosY | ||
) |
This function calls the function NormalizedCorrelation(). It has been kept for compatibility reasons. In case of doubt we recommend using NormalizedCorrelation() directly.
SearchX | The Image to be Searched In. |
Pattern | The Reference Pattern. |
MinContr | The Minimum Contrast Requirement, can speed up the Search. |
Corr | Correlation Value Output, Set to NULL, if not Required. |
Contr | Contrast Value Output, Set to NULL, if not Required. |
PosX | x-Position Output, Set to NULL, if not Required. |
PosY | y-Position Output, Set to NULL, if not Required. |