Filter color with median value in mask
MT
FwStatus | fwiFilterMedianColor_8u_C3R | ( | const Fw8u * pSrc, int srcStep, Fw8u * pDst, int dstStep, FwiSize dstRoiSize, FwiMaskSize maskSize ); | |
FwStatus | fwiFilterMedianColor_8u_AC4R | ( | const Fw8u * pSrc, int srcStep, Fw8u * pDst, int dstStep, FwiSize dstRoiSize, FwiMaskSize maskSize ); | |
FwStatus | fwiFilterMedianColor_16s_C3R | ( | const Fw16s * pSrc, int srcStep, Fw16s * pDst, int dstStep, FwiSize dstRoiSize, FwiMaskSize maskSize ); | |
FwStatus | fwiFilterMedianColor_16s_AC4R | ( | const Fw16s * pSrc, int srcStep, Fw16s * pDst, int dstStep, FwiSize dstRoiSize, FwiMaskSize maskSize ); | |
FwStatus | fwiFilterMedianColor_32f_C3R | ( | const Fw32f * pSrc, int srcStep, Fw32f * pDst, int dstStep, FwiSize dstRoiSize, FwiMaskSize maskSize ); | |
FwStatus | fwiFilterMedianColor_32f_AC4R | ( | const Fw32f * pSrc, int srcStep, Fw32f * pDst, int dstStep, FwiSize dstRoiSize, FwiMaskSize maskSize ); |
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). |
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)).