Skip to content

get_grayval_contour_xldget_grayval_contour_xldGetGrayvalContourXldGetGrayvalContourXldget_grayval_contour_xldget_grayval_contour_xld🔗

Short description🔗

get_grayval_contour_xldget_grayval_contour_xldGetGrayvalContourXldGetGrayvalContourXldget_grayval_contour_xldget_grayval_contour_xld — Return gray values of an image at the positions of an XLD contour.

Signature🔗

get_grayval_contour_xld( image Image, xld_cont Contour, string Interpolation, out grayval Grayval )get_grayval_contour_xld( Image, Contour : : Interpolation : Grayval )void GetGrayvalContourXld( const HObject& Image, const HObject& Contour, const HTuple& Interpolation, HTuple* Grayval )static void HOperatorSet.GetGrayvalContourXld( HObject image, HObject contour, HTuple interpolation, out HTuple grayval )def get_grayval_contour_xld( image: HObject, contour: HObject, interpolation: str ) -> Sequence[Union[int, float]]

def get_grayval_contour_xld_s( image: HObject, contour: HObject, interpolation: str ) -> Union[int, float]Herror get_grayval_contour_xld( const Hobject Image, const Hobject Contour, const char* Interpolation, double* Grayval )

Herror T_get_grayval_contour_xld( const Hobject Image, const Hobject Contour, const Htuple Interpolation, Htuple* Grayval )

HTuple HImage::GetGrayvalContourXld( const HXLDCont& Contour, const HString& Interpolation ) const

HTuple HImage::GetGrayvalContourXld( const HXLDCont& Contour, const char* Interpolation ) const

HTuple HImage::GetGrayvalContourXld( const HXLDCont& Contour, const wchar_t* Interpolation ) const (Windows only)

HTuple HImage.GetGrayvalContourXld( HXLDCont contour, string interpolation )

Description🔗

The operator get_grayval_contour_xldGetGrayvalContourXld returns interpolated gray values at several subpixel positions of the Imageimageimage. The coordinates of the positions are specified via one XLD contour Contourcontourcontour. The gray values are returned in Grayvalgrayvalgrayval.

The interpolation method can be selected via the parameter Interpolationinterpolationinterpolation:

  • 'nearest_neighbor'"nearest_neighbor": The results are the gray values of the nearest pixels to the selected coordinates. For images of type byte, direction, cyclic, uint2, int1, int2, int4, and int8, the parameter Grayvalgrayvalgrayval is a tuple of integer numbers. For images of type real and complex, the parameter Grayvalgrayvalgrayval is a tuple of floating point numbers.

  • 'bilinear'"bilinear": The parameter Grayvalgrayvalgrayval is computed using a bilinear interpolation of the four neighboring gray values of the selected coordinates. The result is a tuple of floating point numbers. The runtime increases significantly compared to 'nearest_neighbor'"nearest_neighbor". Direction and cyclic images are treated like byte images.

  • 'bicubic'"bicubic": The parameter Grayvalgrayvalgrayval is computed using a bicubic interpolation of sixteen neighboring gray values of the selected coordinates. The result is a tuple of floating point numbers. The runtime increases significantly compared to 'bilinear'"bilinear". Direction and cyclic images are treated like byte images. In this mode, the resulting gray values may contain values that lie outside of the range of numbers that can be represented by the input image type.

  • 'bicubic_clipped'"bicubic_clipped": The parameter Grayvalgrayvalgrayval is computed using a bicubic interpolation of sixteen neighboring gray values of the selected coordinates. The result is a tuple of floating point numbers. The runtime increases significantly compared to 'bilinear'"bilinear". Direction and cyclic images are treated like byte images. In this mode, resulting gray values that lie outside of the range of numbers that can be represented by the input image type are clipped to that range.

Note that get_grayval_contour_xldGetGrayvalContourXld 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.

Please note also that each point of the XLD contour must be in the range \(-\)0.5 <= row coordinate \(<\) height(Imageimageimage)\(-\)0.5 and \(-\)0.5 <= column coordinate \(<\) width(Imageimageimage)\(-\)0.5.

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) singlechannelimage → object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)Hobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)

Image whose gray values are to be accessed.

Contourcontourcontour (input_object) xld_cont → objectobjectHObjectHXLDContHObjectHobject

Input XLD contour with the coordinates of the positions.

Interpolationinterpolationinterpolation (input_control) string → (string)(string)HTuple (HString)HTuple (string)strHtuple (char*)

Interpolation method.

Default: 'nearest_neighbor'"nearest_neighbor"
List of values: 'bicubic', 'bicubic_clipped', 'bilinear', 'nearest_neighbor'"bicubic", "bicubic_clipped", "bilinear", "nearest_neighbor"

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

Gray values of the selected image coordinates.

Result🔗

If the parameters are valid, the operator get_grayval_contour_xldGetGrayvalContourXld returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

read_imageReadImage, draw_xldDrawXld, gen_contour_polygon_xldGenContourPolygonXld, edges_sub_pixEdgesSubPix

Alternatives

get_grayval_interpolatedGetGrayvalInterpolated

Module🔗

Foundation