gray_projectionsT_gray_projectionsGrayProjectionsGrayProjectionsgray_projections (算子名称)

名称

gray_projectionsT_gray_projectionsGrayProjectionsGrayProjectionsgray_projections — Calculate horizontal and vertical gray-value projections.

参数签名

gray_projections(区域, Image : : Mode : HorProjection, VertProjection)

Herror T_gray_projections(const Hobject 区域, const Hobject Image, const Htuple Mode, Htuple* HorProjection, Htuple* VertProjection)

void GrayProjections(const HObject& 区域, const HObject& Image, const HTuple& Mode, HTuple* HorProjection, HTuple* VertProjection)

HTuple HImage::GrayProjections(const HRegion& 区域, const HString& Mode, HTuple* VertProjection) const

HTuple HImage::GrayProjections(const HRegion& 区域, const char* Mode, HTuple* VertProjection) const

HTuple HImage::GrayProjections(const HRegion& 区域, const wchar_t* Mode, HTuple* VertProjection) const   ( Windows only)

HTuple HRegion::GrayProjections(const HImage& Image, const HString& Mode, HTuple* VertProjection) const

HTuple HRegion::GrayProjections(const HImage& Image, const char* Mode, HTuple* VertProjection) const

HTuple HRegion::GrayProjections(const HImage& Image, const wchar_t* Mode, HTuple* VertProjection) const   ( Windows only)

static void HOperatorSet.GrayProjections(HObject 区域, HObject image, HTuple mode, out HTuple horProjection, out HTuple vertProjection)

HTuple HImage.GrayProjections(HRegion 区域, string mode, out HTuple vertProjection)

HTuple HRegion.GrayProjections(HImage image, string mode, out HTuple vertProjection)

def gray_projections(区域: HObject, image: HObject, mode: str) -> Tuple[Sequence[float], Sequence[float]]

描述

gray_projectionsgray_projectionsGrayProjectionsGrayProjectionsGrayProjectionsgray_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 ImageImageImageImageimageimage within the input region 区域区域区域区域区域区域.

If ModeModeModeModemodemode = 'simple'"simple""simple""simple""simple""simple" is selected the projection is performed in the direction of the coordinate axes of the image, i.e.: Here, (r',c') denotes the upper left corner of the smallest enclosing axis-parallel rectangle of the input region (see smallest_rectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1SmallestRectangle1smallest_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 ModeModeModeModemodemode = 'rectangle'"rectangle""rectangle""rectangle""rectangle""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_rectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2SmallestRectangle2smallest_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_projectionsgray_projectionsGrayProjectionsGrayProjectionsGrayProjectionsgray_projections only considers the given 区域区域区域区域区域区域 and ignores any previously set domain of the input image ImageImageImageImageimageimage.

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 HorProjectionHorProjectionHorProjectionHorProjectionhorProjectionhor_projection or VertProjectionVertProjectionVertProjectionVertProjectionvertProjectionvert_projection is set to -1.

gray_projectionsgray_projectionsGrayProjectionsGrayProjectionsGrayProjectionsgray_projections can be executed on an OpenCL device for the 'simple'"simple""simple""simple""simple""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.

运行信息

参数表

区域区域区域区域区域区域 (input_object)  region objectHRegionHObjectHRegionHobject

Region to be processed.

ImageImageImageImageimageimage (input_object)  singlechannelimage objectHImageHObjectHImageHobject (byte* / int2* / uint2* / real*) *allowed for compute devices

Grayvalues for projections.

ModeModeModeModemodemode (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Method to compute the projections.

Default: 'simple' "simple" "simple" "simple" "simple" "simple"

List of values: 'rectangle'"rectangle""rectangle""rectangle""rectangle""rectangle", 'simple'"simple""simple""simple""simple""simple"

List of values (for compute devices): 'simple'"simple""simple""simple""simple""simple"

HorProjectionHorProjectionHorProjectionHorProjectionhorProjectionhor_projection (output_control)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Horizontal projection.

VertProjectionVertProjectionVertProjectionVertProjectionvertProjectionvert_projection (output_control)  real-array HTupleSequence[float]HTupleHtuple (real) (double) (double) (double)

Vertical projection.

模块

1D Metrology