gray_projections — 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.:
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.
The operator gray_projections only considers the given Region and ignores any previously set domain of the input image Image.
If n(x) = 0, i.e., if there are no region points in the corresponding row r+r' or column c+c', the respective value of HorProjection or VertProjection is set to -1.
gray_projections can be executed on an OpenCL device for the 'simple' mode if the OpenCL device supports the cl_khr_global_int32_base_atomics OpenCL extension. For processing images of type real, the OpenCL device must support the cl_khr_fp64 and cl_khr_int64_base_atomics extensions.
Region to be processed.
Grayvalues for projections.
Method to compute the projections.
Default value: 'simple'
List of values: 'rectangle', 'simple'
List of values (for compute devices): 'simple'