Calculate horizontal and vertical gray-value projections.
gray_projections calculates the horizontal and vertical gray-value projections, i.e., the mean values in the horizontal and vertical direction of the gray values of the input image Image within the input region Region.
If Mode = 'simple' is selected the projection is performed in the direction of the coordinate axes of the image, i.e.:
----
\
HorProjection(r) = 1/n(r+r') / Image(r+r',c+c')
----
(r+r',c+c') in Region
----
\
VertProjection(c) = 1/n(c+c') / Image(r+r',c+c')
----
(r+r',c+c') in Region
Here, (r',c') denotes the upper left corner of the smallest
enclosing axis-parallel rectangle of the input region (see
smallest_rectangle1), and n(x) denotes the number of region
points in the corresponding row r+r' or column c+c'. Hence,
the horizontal projection
returns a one-dimensional function that reflects the vertical gray
value changes. Likewise, the vertical projection returns a function
that reflects the horizontal gray value changes.
If Mode = 'rectangle'is selected the projection is performed in the direction of the major axes of the smallest enclosing rectangle of arbitrary orientation of the input region (see smallest_rectangle2). Here, the horizontal projection direction corresponds to the larger axis, while the vertical direction corresponds to the smaller axis. In this mode, all gray values within the smallest enclosing rectangle of arbitrary orientation of the input region are used to compute the projections.
|
Region (input_object) |
region -> object |
| Region to be processed. | |
|
Image (input_object) |
image -> object : byte / int2 / uint2 |
| Grayvalues for projections. | |
|
Mode (input_control) |
string -> string |
| Method to compute the projections. | |
| Default value: 'simple' | |
| List of values: 'simple', 'rectangle' | |
|
HorProjection (output_control) |
real-array -> real |
| Horizontal projection. | |
|
VertProjection (output_control) |
real-array -> real |
| Vertical projection. | |
gray_projections is reentrant and processed without parallelization.
1D Metrology