1. Convolution
수학에서 말하는 convolution과 비슷하다. 보통 한 신호가 어떤 시스템을 거쳐서 나오는 출력을 표현한다. Image processing에서는 원본 이미지가 kernel을 통해 masking했을 때 convolution연산을 통해 나온다.
일차원행렬의 convolution
convolution은 교환법칙, 결합법칙, 분배법칙, 편미분, shift invariant가 성립한다.
2. linear filtering
2.1 Masking
이미지는 2차원 행렬이다. 이미지에 convolution개념을 적용하려면,
kernel라는 2차원 행렬을 만들어서 적용시킨다.
input image에 kernel을 씌워서 output image를 만드는 것을 masking이라고 한다.
과정은 아래와 같다.
좌변에는 3X3 kernel행렬과 3X3 pixel행렬 곱이 있고
우변의 연산순서로 곱하고 더해주면 결과 값을 얻을 수 있다.
2.2
application
- smoothing
smoothing은 이미지의 노이즈와 디테일을 줄이는 것이다. 수업에서는 gaussian kernel을 이용해 smoothing을 했다. gaussian kernel은 이미지의 고주파수 요소를 제거하는 효과가 있고, 따라서 저역필터를 쓰는 것과 같다. 또한 gaussian끼리의 조합은 또 다른 gaussian이 된다.
-edge detector : derivative filtering
이미지의 미분 값을 계산할 때, 좌우 픽셀 사이의 변화로 계산한다. 수식으로 표현하면 다음과 같다.
출처 : 나의 보고서
image derivative의 특정 경우가 edge detection이다.
edge라는 것은 어떤 방향에서 색의 강도가 불연속적인 부분이다.
따라서 edge pixel에 gradient를 취하면 그 주변에서 최댓값을 갖는다.
gradient 는 gaussian derivative와 convolution을 통해서 구할 수 있고, 그 방향은 edge방향에 항상 수직이다.
--------------------------------------------------------------------------------------이하는 교재의 내용.
2.2
2.2.1 Average filter(평균 필터)
동등하게 intensity값을 줄이는 필터.
2.2.2 Derivative filter(미분 필터)
한쪽 방향의 값만 출력?
2.2.3 Gaussian filter
smoothing 혹은 blur 효과를 내주는 것이 gaussian filter다.
2.3 edge detecting
derivative kernel을 x방향, y방향 2방향으로 적용시킨다.
[gaussian은 smoothing 해주는 것이라 안해줘도 무방하다.]
각 방향으로 적용시킨 후, 출력이미지를 제곱 평균하여 합쳐주면
경계선이미지(edge)를 얻을 수 있다.
이 작업을 edge detecting이라 한다.
derivative 적용(x방향)
derivative 적용(y방향)
edge detecting
출처 :
- 나의 옛 보고서
- Learning OpenCV. Gary Bradski, Adrian Kaehler O'Reilly Media. 2008.10
참고문헌
http://www.swarthmore.edu/NatSci/mzucker1/e27_s2016/filter-slides.pdf
https://en.wikipedia.org/wiki/Kernel_(image_processing)#Convolution
http://www.swarthmore.edu/NatSci/mzucker1/opencv-2.4.10-docs/doc/tutorials/imgproc/imgtrans/sobel_derivatives/sobel_derivatives.html
https://en.wikipedia.org/wiki/Image_derivatives
https://en.wikipedia.org/wiki/Sobel_operator
https://en.wikipedia.org/wiki/Gaussian_blur
'전공지식정리 > 영상처리(Image Signal Processing)' 카테고리의 다른 글
7. Hough Transform (0) | 2020.12.08 |
---|---|
6. Canny edge detector (0) | 2020.12.08 |
5 Color Model (0) | 2020.12.08 |
4. Labeling (0) | 2020.12.08 |
1. opencv pixel access (0) | 2020.12.08 |