SmoothImage_Middle


Replaces each pixel with the average of maximum and minimum calculated within a kernel.

Applications:Useful for calculating per-pixel threshold values for image binarization.

Syntax

C++
Python
 
def SmoothImage_Middle(
	inImage: Image,
	inRadiusX: int,
	outImage: Image,
	/,
	*,
	inRoi: Region | None = None,
	inSourceRoi: Region | None = None,
	inBorderColor: Pixel | None = None,
	inKernel: KernelShape = KernelShape.Box,
	inRadiusY: int | None = None
)
-> None

Parameters

Name Type Range Default Description
Input value inImage Image Input image
Input value inRoi Region | None None Range of outImage pixels to be computed
Input value inSourceRoi Region | None None Range of inImage pixels to be read
Input value inBorderColor Pixel | None None Color of the imaginary pixels outside the image boundaries
Input value inKernel KernelShape KernelShape.Box Kernel shape
Input value inRadiusX int 0 - Nearly half of the kernel's width (2*R+1)
Input value inRadiusY int | None 0 - None Nearly half of the kernel's height (2*R+1), or same as inRadiusX
Output value outImage Image Output image

Hardware Acceleration

This operation is optimized for SSE2 technology for pixels of types: all formats (when inSourceRoi = NIL and inBorderColor = NIL).

This operation is optimized for technology.

This operation is optimized for NEON technology for pixels of types: all formats (when inSourceRoi = NIL and inBorderColor = NIL).

This operation supports automatic parallelization for multicore and multiprocessor systems.