Skip to content

max_imageMaxImageMaxImagemax_imagemax_image🔗

Short description🔗

max_imageMaxImageMaxImagemax_imagemax_image — Calculate the maximum of two images pixel by pixel.

Signature🔗

max_image( image Image1, image Image2, out image ImageMax )void MaxImage( const HObject& Image1, const HObject& Image2, HObject* ImageMax )static void HOperatorSet.MaxImage( HObject image1, HObject image2, out HObject imageMax )def max_image( image_1: HObject, image_2: HObject ) -> HObject

Herror max_image( const Hobject Image1, const Hobject Image2, Hobject* ImageMax )

Herror T_max_image( const Hobject Image1, const Hobject Image2, Hobject* ImageMax )

HImage HImage::MaxImage( const HImage& Image2 ) const

HImage HImage.MaxImage( HImage image2 )

Description🔗

max_imageMaxImage calculates the maximum of the images Image1image1image_1 and Image2image2image_2 (pixel by pixel). The result is stored in the image ImageMaximageMaximage_max. The resulting image has the same pixel type as the input image. If several (pairs of) images are processed in one call, every i-th image from Image1image1image_1 is compared to the i-th image from Image2image2image_2. Thus the number of images in both input parameters must be the same. An output image is generated for every input pair.

max_imageMaxImage can be executed on an OpenCL device for byte, int1, int2, uint2, int4, real, direction, and cyclic images.

Attention🔗

The two input images must be of the same type and size.

Execution information🔗

Execution information
  • Supports OpenCL compute devices.

  • 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 domain level.

Parameters🔗

Image1image1image_1 (input_object) (multichannel-)image(-array) → object (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic*)HObject (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic*)HImage (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic*)HObject (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic*)Hobject (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic*) *allowed for compute devices

Image(s) 1.

Image2image2image_2 (input_object) (multichannel-)image(-array) → object (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic*)HObject (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic*)HImage (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic*)HObject (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic*)Hobject (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic*) *allowed for compute devices

Image(s) 2.

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

Result image(s) by the maximization.

Example🔗

(HDevelop)

read_image(Image1,'monkey')
read_image(Image2,'fabrik')
max_image(Image1,Image2,Max)
dev_display (Max)
(C)
read_image(&Image1,"monkey")\;
read_image(&Image2,"fabrik")\;
max_image(Image1,Image2,&Max)\;
disp_image(Max,WindowHandle)\;

Result🔗

If the parameter values are correct the operator max_imageMaxImage 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

See also

min_imageMinImage

Module🔗

Foundation