FilterMedianColor

Filter color with median value in mask

Supported Technologies

MT

Synopsis

FwStatus   fwiFilterMedianColor_8u_C3R ( const Fw8u * pSrcint srcStepFw8u * pDstint dstStepFwiSize dstRoiSizeFwiMaskSize maskSize );
FwStatus   fwiFilterMedianColor_8u_AC4R ( const Fw8u * pSrcint srcStepFw8u * pDstint dstStepFwiSize dstRoiSizeFwiMaskSize maskSize );
FwStatus   fwiFilterMedianColor_16s_C3R ( const Fw16s * pSrcint srcStepFw16s * pDstint dstStepFwiSize dstRoiSizeFwiMaskSize maskSize );
FwStatus   fwiFilterMedianColor_16s_AC4R ( const Fw16s * pSrcint srcStepFw16s * pDstint dstStepFwiSize dstRoiSizeFwiMaskSize maskSize );
FwStatus   fwiFilterMedianColor_32f_C3R ( const Fw32f * pSrcint srcStepFw32f * pDstint dstStepFwiSize dstRoiSizeFwiMaskSize maskSize );
FwStatus   fwiFilterMedianColor_32f_AC4R ( const Fw32f * pSrcint srcStepFw32f * pDstint dstStepFwiSize dstRoiSizeFwiMaskSize maskSize );

Parameters

dstRoiSize   Destination image ROI size.
dstStep   Destination buffer step size (width of the buffer in bytes).
maskSize   Specifies the size of a mask used in calculations.
pDst   Pointer to a location in a destination buffer.
pSrc   Pointer to a location in a source buffer.
srcStep   Source buffer step size (width of the buffer in bytes).

Description

These functions step through an ROI in a source buffer, replace each source pixel value with the value of the pixel nearest to the source pixel in the area defined by the mask, and write the filtered data to a destination buffer.

The functions remove noise without decreasing image brightness, as averaging filters do, while preserving the correlation between color components.

The distance between the source and mask pixels is calculated as a sum of absolute values using the following formula:

 abs(R(i)-R(j)) + abs(G(i)-G(j)) + abs(B(i)-B(j)).