multimedia programming 08: point processing 4 departments of digital contents sang il park
TRANSCRIPT
![Page 1: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/1.jpg)
Multimedia Programming 08:
Point Processing 4Departments of Digital
ContentsSang Il Park
![Page 2: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/2.jpg)
Image Processing 1-2
Neighborhood Processing (Filtering)
Alexei Efros
![Page 3: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/3.jpg)
k
ku
k
kv
vyuxFk
yxG ],[)12(
1],[
2
Cross-correlation filtering ( 상호 - 상관 필터 )
평균은 모든 점들마다 1/(2k+1)2 의 값을 곱하는 것 . 만약 점들마다 서로 다른 값을 곱한다면 ?
위와 같은 식을 상호상관 연산이라고 하며 다음과 같이 줄여 쓴다 .
H ( 각 점의 가중치 ) 를 “ filter,” “kernel,” 또는 “ mask” 라고 부른다 .
![Page 4: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/4.jpg)
Median filtering ( 중간값 필터 )
• 윈도우 내에서 중간값을 선택하는 것을 중간값 필터라고 한다 .
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 90 0 90 90 90 0 0
0 0 0 90 90 90 90 90 0 0
0 0 0 0 0 0 0 0 0 0
0 0 90 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0
0 90 0
0 0 0
1 2 3 4 5 6 7 8 90 0 0 0 0 0 0 0 90
Median( 중간값 )
값을 크기순으로올림차순으로 나열
![Page 5: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/5.jpg)
Blurring Function in OpenCV
• Type: – CV_BLUR : Mean Filtering– CV_GAUSSIAN : Gaussian Filtering– CV_MEDIAN : Median Filter
• Size: 3, 5, 7, …, 2k+1
cvSmooth(IplImage * src, IplImage * dst, int type, int size)
cvSmooth(IplImage * src, IplImage * dst, int type, int size)
![Page 6: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/6.jpg)
Unsharp Masking ( 언샵 필터링 )
• 블러링 (smoothing) 이 지워버리는 정보는 무엇일까 ?
=+
blurred difference original
200 400 600 800
100
200
300
400
500
- =
original blurred difference
• 블러된 이미지에 사라진 정보를 더하면 원본을 얻을 수 있다 .
![Page 7: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/7.jpg)
Unsharp Masking ( 언샵 필터링 )
• 사라진 정보를 강조하여 표현한다면 ?
=+
blurred difference original
• alpha 값을 조절하면 이미지의 날카로움을 조절할 수 있다
이를 Unsharp 필터라고 한다 .
![Page 8: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/8.jpg)
Unsharp Masking ( 언샵 필터링 )
• Example:
Source image Alpha = 0
![Page 9: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/9.jpg)
Unsharp Masking ( 언샵 필터링 )
• Example:
Source image Alpha = 0.5
![Page 10: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/10.jpg)
Unsharp Masking ( 언샵 필터링 )
• Example:
Source image Alpha = 1
![Page 11: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/11.jpg)
Unsharp Masking ( 언샵 필터링 )
• Example:
Source image Alpha = 2
![Page 12: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/12.jpg)
Unsharp Masking ( 언샵 필터링 )
• Example:
Source image Alpha = 2Alpha = 4
![Page 13: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/13.jpg)
Color VS. Gray
• Gray image 가 지워버리는 정보는 무엇일까 ?
• Gray 이미지에 사라진 정보를 더하면 원본을 얻을 수 있다 .
200 400 600 800
100
200
300
400
500
- =
original Gray difference
=+
Gray difference original
![Page 14: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/14.jpg)
Unsharp Masking ( 언샵 필터링 )
• 사라진 정보를 강조하여 표현한다면 ?
=+
Gray difference New image
• alpha 값을 조절하면 이미지의 채도를 조절할 수 있다
![Page 15: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/15.jpg)
Smart Blurring?
![Page 16: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/16.jpg)
Image Processing 1-3
Histogram Equalization
Alexei Efros
![Page 17: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/17.jpg)
Image Histogram
• Histogram:– Counting the number of pixels with the same
brightness
image histogram
http://www.accusoft.com/resourcecenter/tutorials/dip/VQ/lesson1c.htm
![Page 18: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/18.jpg)
Image Histogram
• Histogram:– Counting the number of pixels with the same
brightness
http://www.cambridgeincolour.com/tutorials/histograms1.htm
![Page 19: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/19.jpg)
Image Histogram
• Example
http://www.cambridgeincolour.com/tutorials/histograms1.htm
![Page 20: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/20.jpg)
Image Histogram
• Two images
http://www.cambridgeincolour.com/tutorials/histograms1.htm
![Page 21: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/21.jpg)
• Modify the image to have a well-distributed histogram
Histogram Equalization
![Page 22: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/22.jpg)
Cumulative Histogram
• Number of the pixels below the brightness
image histogram Cumulative histogram
http://www.accusoft.com/resourcecenter/tutorials/dip/VQ/lesson1c.htm
![Page 23: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/23.jpg)
Cumulative histogram
Cumulative Histograms
Why is it so important?
![Page 24: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/24.jpg)
Why is it so important?
Let’s focus on the first image.
255
192
128
64
0
input
output
![Page 25: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/25.jpg)
Why is it so important?
Using Cumulative histogram as a function.
255
192
128
64
0
input
output
input
outp
ut
![Page 26: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/26.jpg)
Histogram Equalization
![Page 27: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/27.jpg)
Coding Practice
• Make your own code for histogram equalization• For each color channel (R, G, B)
– 1. Compute the histogram
– 2. Compute the cumulative histogram
– 3. Set the maximum value as 255
– 4. Using the cumulative histogram as a mapping function
255
192
128
64
0
![Page 28: Multimedia Programming 08: Point Processing 4 Departments of Digital Contents Sang Il Park](https://reader036.vdocuments.mx/reader036/viewer/2022062515/56649cf35503460f949c11ff/html5/thumbnails/28.jpg)
Recoveringthe colorful underwater world!
http://www.dive.snoack.de/