Back to FabImage Library Lite website
You are here: Start » Image Local Transforms » SmoothImage_Median

SmoothImage_Median
Replaces each pixel with the median of pixels within a kernel.
Syntax
void fil::SmoothImage_Median ( const fil::Image& inImage, ftl::Optional<const fil::Region&> inRoi, ftl::Optional<const fil::Region&> inSourceRoi, fil::SmoothImageMedianKernel::Type inKernel, int inRadius, fil::Image& outImage )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inImage | const Image& | Input image | ||
![]() |
inRoi | Optional<const Region&> | NIL | Range of outImage pixels being written | |
![]() |
inSourceRoi | Optional<const Region&> | NIL | Range of inImage pixels being read | |
![]() |
inKernel | SmoothImageMedianKernel::Type | |||
![]() |
inRadius | int | 0 - ![]() |
1 | Nearly half of the kernel's size (2*R+1) |
![]() |
outImage | Image& | Output image |
Requirements
For input inImage only pixel formats are supported: uint8.
Read more about pixel formats in Image documentation.
Hints
- Define the kernel size by setting the inRadius input.
Examples
![]() |
![]() |
SmoothImage_Median performed on a sample image with inRadius = 4.
Errors
Error type | Description |
---|---|
DomainError | inRoi exceeds image dimensions in SmoothImage_Median. |
DomainError | inSourceRoi exceeds image dimensions in SmoothImage_Median. |
DomainError | Not supported pixel format in SmoothImage_Median. |
DomainError | Not supported kernel in SmoothImage_Median. |