Gaussian Filter와 Bilateral Filter의 차이점
https://docs.opencv.org/2.4/modules/imgproc/doc/filtering.html
cv2.bilateralFilter(src, d, sigmaColor, sigmaSapce[, dst[, borderType]]) -> dst
src : 원본 이미지 ( 8-bit or floating-point, 1-channel or 3-channel image)
d : 커널크기 ( Destination image of the same size and type as src)
sigmaColor : 색공간 표준편차, 값이 크면 색이 많이 달라도 픽셀들이 서로 영향을 미침
(Filter sigma in the color space. A larger value of the parameter means that farther colors within the pixel neighborhood will be mixed together, resulting in larger areas of semi-equal color)
sigmaSpace : 거리공간 표준편차, 값이 크면 멀리 떨어져 있는 픽셀들이 서로 영향을 미친다
(Filter simga 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. When d>0, it specifies the neighborhood size regardless of sigmaSpace. Otherwise, d is proportional to sigmaSpace)
BilaterFilter can reduce unwanted noise very well while keeping edges fairly sharp. However, it is very slow compared to most filters.
- Sigma Values : For simplicity, you can set the 2 sigma values to be the same. If they are small(<10), the filter will not have much effect, whereas if they are large(>150), they will have a very strong affect, making the image look 'cartoonish'
- Filter size : Large filters(d>5) are very slow, so it is recommended to use d=5 for real-time applications, and perhaps d=9 for offline applications that need heavy noise filtering.
cv2.adaptiveBilateralFilter(src, ksize, sigmaSpace[, dst[, maxSigmaColor[, anchor[, borderType]]]]) -> dst
ksize : the kernel size. This is the neighborhood where the local variance will be calculated, and where pixels will contribute (in a weighted manner)
maxSigmaColor : Maximum allowed sigma color (will clamp the value calculated in the ksize neighborhood.) Larger value of the parameter means that more dissimilar pixels will influence each other (as long as their colors are close enough; see sigmaColor). Then d>0, it specifies the neighborhood size regardless of sigmaSpace, otherwise d is proportional to sigmaSpace
borderType : Pixel extrapolation method
A main pat of our strategy will be to load each raw pixel once, and reuse it to calculate all pixels in the output (filtered) image that need this pixel value. The math of the filter is that of the usual bilateral filter, except that the sigam color is calculated in the neighborhood, and clamped by the potional input value.
'공부하는삶 > Python' 카테고리의 다른 글
Python Composite pattern(composition), Descriptor, Meta class (0) | 2023.08.29 |
---|---|
Sequence (0) | 2020.05.09 |
Magic Method (0) | 2020.05.09 |
Python Multiprocessing module(파이썬 멀티프로세싱 모듈) (0) | 2019.11.28 |
Tensorflow 시작하기 - 1 (0) | 2019.11.28 |
리스트 , 딕셔너리, 집합, 튜플 (0) | 2019.09.19 |