[pixkit image] filtering: Image filtering - yunfuliu/pixkit GitHub Wiki

medianfilter

Filtering with median filter.

C++: bool medianfilter(const cv::Mat &src,cv::Mat &dst,cv::Size blocksize)

Parameters:

  • src - The source image.
  • dst - The destination image.
  • blocksize - Size of the considered neighborhood. Size should be odd value (unit: number of pixels).

Example:

medianfilter(src,dst,cv::Size(3,3));

PGF1999

Impulse noise denoising process.

[Abbr] Peer group filtering (PGF)

[Reference] Y. Deng, S.Kenney, M.S.Moore and B. S.Manjunath, "Peer group filtering and perceptual color image quantization", Proc. IEEE International Symposium on Circuits and Systems VLSI , (ISCAS'99), Orlando, FL, vol 4, pp.21-4 , June 1999.

[Developer] Chi-Yi Wu ([email protected])

C++: bool filtering::PGF1999(const cv::Mat &src,cv::Mat &dst,int &blocksize,double &sigma=1.,int &alpha=16)

Parameters:

  • src - The source image, could be gray or color image.
  • dst - The destination image.
  • blocksize - The size of Gaussian filter used for blurring. It should be odd value.
  • sigma - Variance of the Gaussian filter.
  • alpha - Threshold of the distance's first derivative (default = 16).

Example:

PGF1999(src,dst,3);

FBF

An integral image-based box filtering method.

[nickname] Fast box filtering (FBF)

[reference] Y. F. Liu, C. Y. Lin, and J. M. Guo, "Impact of the lips for biometrics," IEEE Trans. Image Processing, vol. 21, no. 6, pp. 3092-3101, June 2012.

C++: bool FBF(const cv::Mat &src,cv::Mat &dst,cv::Size blockSize,cv::Mat &sum=cv::Mat())

Parameters:

  • src - The source image.
  • dst - The destination image.
  • blockSize - Size of the considered neighborhood. Size should be odd value (unit: number of pixels).
  • sum - If the integral image of the src's first moment is provided, this function thus does not calculate it again for saving computations.

Example:

FBF(src,dst,cv::Size(3,3));
// or
cv::Mat sum;
cv::integral(src,sum,CV_64FC1);
FBF(src,dst,cv::Size(3,3),sum);