Rolling Guidance Filter 非常有用处,为中国香港大学Qi Zhang,Xiaoyong Shen等所发明,其作用基本上可以认为是bilateral 的升级版。
Rolling Guidance Filter 在去移除和平滑图像中的复杂的小区域时,还能保证大区域物体边界的准确性。
因此,可以使用Rolling Guidance Filter 去除复杂背景,获取物体轮廓,方便图像分割。同时用其逆运算,可以增强图像细节。
获取图像轮廓
Input
Canny of Input | Rolling Guidance Result | Canny of Rolling Guidance Result | |
图像增强
Input
Detail Enhanced by Bilateral Filter | Detail Enhanced by Rolling Guidance (Ours) | |
OpenCV 3.1.0 已经将此算法集成进去,接口定义方法见下:
void cv::ximgproc::rollingGuidanceFilter
( | InputArray | src, | |
OutputArray | dst, | ||
int | d = -1 , | ||
double | sigmaColor = 25 , | ||
double | sigmaSpace = 3 , | ||
int | numOfIter = 4 , | ||
int | borderType = BORDER_DEFAULT | ||
) |
Applies the rolling guidance filter to an image.
Parameters
src | Source 8-bit or floating-point, 1-channel or 3-channel image. |
dst | Destination image of the same size and type as src. |
d | Diameter of each pixel neighborhood that is used during filtering. If it is non-positive, it is computed from sigmaSpace . |
sigmaColor | 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. |
sigmaSpace | 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 . |
numOfIter | Number of iterations of joint edge-preserving filtering applied on the source image. |
borderType |
Note
rollingGuidanceFilter uses jointBilateralFilter as the edge-preserving filter.
See also