Skip to content

crop_domain_relcrop_domain_relCropDomainRelCropDomainRelcrop_domain_relcrop_domain_rel🔗

Short description🔗

crop_domain_relcrop_domain_relCropDomainRelCropDomainRelcrop_domain_relcrop_domain_rel — Cut out an image area relative to the domain.

Signature🔗

crop_domain_rel( image Image, out image ImagePart, integer Top, integer Left, integer Bottom, integer Right )crop_domain_rel( Image : ImagePart : Top, Left, Bottom, Right : )void CropDomainRel( const HObject& Image, HObject* ImagePart, const HTuple& Top, const HTuple& Left, const HTuple& Bottom, const HTuple& Right )static void HOperatorSet.CropDomainRel( HObject image, out HObject imagePart, HTuple top, HTuple left, HTuple bottom, HTuple right )def crop_domain_rel( image: HObject, top: int, left: int, bottom: int, right: int ) -> HObject

Herror crop_domain_rel( const Hobject Image, Hobject* ImagePart, const Hlong Top, const Hlong Left, const Hlong Bottom, const Hlong Right )

Herror T_crop_domain_rel( const Hobject Image, Hobject* ImagePart, const Htuple Top, const Htuple Left, const Htuple Bottom, const Htuple Right )

HImage HImage::CropDomainRel( Hlong Top, Hlong Left, Hlong Bottom, Hlong Right ) const

HImage HImage.CropDomainRel( int top, int left, int bottom, int right )

Description🔗

crop_domain_relCropDomainRel cuts a rectangular area from the input images. The area is determined by the surrounding rectangle of the domain of the input image. The rectangle can be influenced by the control parameters to modify at the top (Toptoptop), at the left (Leftleftleft), at the bottom (Bottombottombottom), and at the right (Rightrightright). Positive values results in a smaller, negative values in a larger size. If all parameters are set to zero, the region remains unchanged.

Execution information🔗

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

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

  • Automatically parallelized on tuple level.

  • Automatically parallelized on channel level.

Parameters🔗

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

Input image.

ImagePartimagePartimage_part (output_object) (multichannel-)image(-array) → object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)Hobject * (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)

Image area.

Toptoptop (input_control) integer → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of rows clipped at the top.

Default: -1-1
Suggested values: -20, -10, -5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 10, 20-20, -10, -5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 10, 20

Leftleftleft (input_control) integer → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of columns clipped at the left.

Default: -1-1
Suggested values: -20, -10, -5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 10, 20-20, -10, -5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 10, 20

Bottombottombottom (input_control) integer → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of rows clipped at the bottom.

Default: -1-1
Suggested values: -20, -10, -5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 10, 20-20, -10, -5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 10, 20

Rightrightright (input_control) integer → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of columns clipped at the right.

Default: -1-1
Suggested values: -20, -10, -5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 10, 20-20, -10, -5, -3, -2, -1, 0, 1, 2, 3, 4, 5, 10, 20

Result🔗

crop_domain_relCropDomainRel returns 2 (H_MSG_TRUE) if all parameters are correct. The behavior in case of empty input (no regions given) can be set via set_system('no_object_result',<Result>) and the behavior in case of an empty input region via set_system('empty_region_result',<Result>). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

reduce_domainReduceDomain, thresholdThreshold, connectionConnection, regiongrowingRegiongrowing, pouringPouring

Alternatives

crop_domainCropDomain, crop_rectangle1CropRectangle1

See also

smallest_rectangle1SmallestRectangle1, intersectionIntersection, gen_rectangle1GenRectangle1, clip_regionClipRegion

Module🔗

Foundation