项目作者: frotms

项目描述 :
some filters (boxfilter, fast bilateral filter, fast guided filter and permutohedral bilateral filter)
高级语言: C++
项目地址: git://github.com/frotms/image-filter.git
创建时间: 2017-03-18T08:51:51Z
项目社区:https://github.com/frotms/image-filter

开源协议:

下载


some mainstream image filter: boxfilter, fast guided filter, fast bilateral filter, permutohedral bilateral filter and propagated filter

  • boxfilter
  • fast guided filter
  • fast bilateral filter
  • permutohedral bilateral filter
  • propagated filter

All original dependencies have been removed. Code could be run independently.

BOXFILTER

  1. @param src image,single channel.
  2. @param dst output image,single channel.
  3. @param w width of image.
  4. @param h height of image.
  5. @param c channel of image, only c = 1.
  6. @param r local window radius.
  7. @return 0:ok; 1:error
  8. int BoxfilterFilter(unsigned char *src, unsigned char *dst, int w, int h, int c, int r);

Fast Guided Filter

  1. @param src image,single channel.
  2. @param guidance guided image,single channel.
  3. @param dst output image,single channel.
  4. @param w width of image.
  5. @param h height of image.
  6. @param c channel of image, only c = 1.
  7. @param r local window radius.
  8. @param rp regularization parameter:eps.
  9. @param sr subsampling ratio, sr>1:downscale; 0<sr<1:upscale.
  10. @return 0:ok; 1:error
  11. int FastGuidedFilter(unsigned char *src, unsigned char *guidance, unsigned char *dst, int w, int h, int c, int r, float rp, float sr);

FastBilateralFilter

  1. @param src input image.
  2. @param guidance guided image,single channel, only single channel is valid; invalid parameter in three channels.
  3. @param dst output image.
  4. @param w width of image.
  5. @param h height of image.
  6. @param c channel of image, only c = 1 or c = 3.
  7. @param sigma_s filter sigma in the coordinate space. A larger value of the parameter means that farther pixels will influence each other as long as their colors are close enough (see sigmaColor ). When d>0, it specifies the neighborhood size regardless of sigmaSpace. Otherwise, d is proportional to sigmaSpace.
  8. @param sigma_r filter sigma in the color space. A larger value of the parameter means that farther colors within the pixel neighborhood (see sigmaSpace) will be mixed together, resulting in larger areas of semi-equal color.
  9. @return 0:ok; 1:error
  10. int FastBilateralFilter(unsigned char *src, unsigned char *guidance, unsigned char *dst, int w, int h, int c, float sigma_s, float sigma_r);

PermutohedralBilateralFilter

  1. @param src input image.
  2. @param guidance guided image.
  3. @param dst output image.
  4. @param w width of image.
  5. @param h height of image.
  6. @param c channel of image, only c = 1 or c = 3.
  7. @param sigma_s filter sigma in the coordinate space. A larger value of the parameter means that farther pixels will influence each other as long as their colors are close enough (see sigmaColor ). When d>0, it specifies the neighborhood size regardless of sigmaSpace. Otherwise, d is proportional to sigmaSpace.
  8. @param sigma_r filter sigma in the color space. A larger value of the parameter means that farther colors within the pixel neighborhood (see sigmaSpace) will be mixed together, resulting in larger areas of semi-equal color.
  9. @return 0:ok; 1:error
  10. int PermutohedralBilateralFilter(unsigned char *src, unsigned char *guidance, unsigned char *dst, int w, int h, int c, float sigma_s, float sigma_r);

PropagatedFilter

  1. @param src input image.
  2. @param guidance guided image.
  3. @param dst output image.
  4. @param w width of image.
  5. @param h height of image.
  6. @param c channel of image, only c = 1 or c = 3.
  7. @param r local window radius.
  8. @param sigma_s filter sigma in the coordinate space. A larger value of the parameter means that farther pixels will influence each other as long as their colors are close enough (see sigmaColor ). When d>0, it specifies the neighborhood size regardless of sigmaSpace. Otherwise, d is proportional to sigmaSpace.
  9. @param sigma_r filter sigma in the color space. A larger value of the parameter means that farther colors within the pixel neighborhood (see sigmaSpace) will be mixed together, resulting in larger areas of semi-equal color.
  10. @return 0:ok; 1:error
  11. int PropagatedFilter(unsigned char *src, unsigned char *guidance, unsigned char *dst, int w, int h, int c, int r, float sigma_s, float sigma_r);

Reference