Skip to content

get_grayvalGetGrayvalGetGrayvalget_grayvalT_get_grayval🔗

Short description🔗

get_grayvalGetGrayvalGetGrayvalget_grayvalT_get_grayval — Access the gray values of an image object.

Signature🔗

get_grayval( image Image, point.y Row, point.x Column, out grayval Grayval )void GetGrayval( const HObject& Image, const HTuple& Row, const HTuple& Column, HTuple* Grayval )static void HOperatorSet.GetGrayval( HObject image, HTuple row, HTuple column, out HTuple grayval )def get_grayval( image: HObject, row: MaybeSequence[int], column: MaybeSequence[int] ) -> Sequence[Union[int, float]]

Herror T_get_grayval( const Hobject Image, const Htuple Row, const Htuple Column, Htuple* Grayval )

HTuple HImage::GetGrayval( const HTuple& Row, const HTuple& Column ) const

HTuple HImage::GetGrayval( Hlong Row, Hlong Column ) const

HTuple HImage.GetGrayval( HTuple row, HTuple column )

HTuple HImage.GetGrayval( int row, int column )

Description🔗

The parameter Grayvalgrayvalgrayval is a tuple of floating point numbers or integer numbers which returns the gray values of several pixels of Imageimageimage. For a multi-channel image, a group of elements, in particular one value for each channel (or two values for each channel for complex or vector field images), is returned for each pixel. The row coordinates of the pixels are specified in the tuple Rowrowrow, the column coordinates are specified in the tuple Columncolumncolumn.

Note that get_grayvalGetGrayval does not take the domain of the image into account, i.e., if the domain has been reduced, e.g., with reduce_domainReduceDomain, gray values are returned even for points that lie outside the domain.

Attention🔗

The type of the values of Grayvalgrayvalgrayval depends on the type of the gray values of the channels of the image Imageimageimage. The operator get_grayvalGetGrayval produces quite some overhead. Typically, it is used to get single gray values of an image (e.g., get_mpositionGetMposition followed by get_grayvalGetGrayval). It is not suitable for programming image processing operations such as filters. In this case it is more useful to use the operator get_image_pointer1GetImagePointer1 and to directly use the C or C++ interface for integrating own procedures.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

Imageimageimage (input_object) (multichannel-)image → object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)Hobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)

Image whose gray value is to be accessed.

Rowrowrow (input_control) point.y(-array) → (integer)HTuple (Hlong)HTuple (int / long)MaybeSequence[int]Htuple (Hlong)

Row coordinates of pixels to be viewed.

Default: 00
Suggested values: 0, 64, 128, 256, 512, 10240, 64, 128, 256, 512, 1024
Value range: 0 ≤ Row ≤ 32767 (lin)
Minimum increment: 1
Recommended increment: 1
Restriction: 0 <= Row && Row < height(Image)

Columncolumncolumn (input_control) point.x(-array) → (integer)HTuple (Hlong)HTuple (int / long)MaybeSequence[int]Htuple (Hlong)

Column coordinates of pixels to be viewed.

Number of elements: Column == Row
Default: 00
Suggested values: 0, 64, 128, 256, 512, 10240, 64, 128, 256, 512, 1024
Value range: 0 ≤ Column ≤ 32767 (lin)
Minimum increment: 1
Recommended increment: 1
Restriction: 0 <= Column && Column < width(Image)

Grayvalgrayvalgrayval (output_control) grayval-array → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Sequence[Union[int, float]]Htuple (double / Hlong)

Gray values of indicated pixels.

Result🔗

If the state of the parameters is correct, the operator get_grayvalGetGrayval returns the value 2 (H_MSG_TRUE). The behavior in case of empty input (no input images available) is set via the operator set_system('no_object_result',<Result>). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

read_imageReadImage

Alternatives

get_image_pointer1GetImagePointer1, get_grayval_interpolatedGetGrayvalInterpolated, get_grayval_contour_xldGetGrayvalContourXld

See also

set_grayvalSetGrayval

Module🔗

Foundation