Document 7374906

Download Report

Transcript Document 7374906

Chapter 3
Image Enhancement in the Spatial
Domain
ISAN-DSP GROUP
Spatial Domain
หมายถึง ที่ต้ งั อยูห่ รื อระนาบของ pixel ที่ประกอบขึ้นเป็ น image ซึ่ งสามารถระบุ
ตาแหน่งของ pixel ในความหมายของระยะทางได้
กล่าวคือ ใน spatial domain เราสามารถแทน image ด้วย f(x,y)
เมื่อ x และ y คือระยะทางในแนวแกนตั้งและแกนนอนวัดจากจุด Origin
ตัวอย่างที่เป็ นของคู่กนั คือ Spatial Domain กับ Frequency Domain
รู ปภาพใน Spatial Domain
คือรู ปภาพที่อยูใ่ นระนาบ xy ที่เรา
เห็นกันตามปกติ ใน Domain นี้
เราใช้ระยะทางในการกาหนดตาแหน่ง
เมื่อแปลงภาพโดยใช้ Fourier
Transform ความหมายของ
ระยะทางจะหายไป แต่จะเกิดความ
หมายในเชิงความถี่ข้ ึนมาแทน ซึ่ ง
ข้อมูลนี้จะอยูใ่ น Frequency
domain
ISAN-DSP GROUP
Image Enhancement
Image Enhancement หมายถึงการปรับปรุ งภาพให้เหมาะสมกับงานเฉพาะทาง
ด้านต่างๆ เช่นการทาให้ภาพชัดเจนขึ้น (ในสายตามนุษย์)
ตัวอย่าง
หมายเหตุ: วิธีการปรับปรุ งภาพที่เหมาะสาหรับงานอย่างหนึ่ งไม่จาเป็ นต้องเหมาะสมกับ
งานอีกอย่างหนึ่งเสมอไป
ISAN-DSP GROUP
Image Enhancement in the Spatial Domain
หมายถึงการปรับปรุ งภาพโดยใช้กระบวนการที่กระทาใน Spatial domain และให้
ผลลัพธ์ออกมาใน Spatial domain เช่นกัน กล่าวคือ เราสามารถเขียนสู ตรในรู ป
g ( x, y)  T  f ( x, y)
เมื่อ f(x,y) คือภาพตั้งต้น, g(x,y) คือภาพผลลัพธ์
และ T[ ] คือ Function ที่ถูกกาหนดในพื้นที่รอบๆจุด (x,y)
หมายเหตุ: T[ ] อาจจะรับ input เป็ นค่า pixel ที่ตาแหน่ง (x,y) อย่างเดียว
หรื อ input จะเป็ นค่า pixel ใน Neighbors ของจุด (x,y) ขนาดใดๆก็ได้
ตามแต่ลกั ษณะของ Function นั้นๆเช่น
การปรับความสว่างของภาพ
มี input เป็ นค่าของ pixel (x,y) อย่างเดียว
การทาภาพเบลอโดยใช้ smoothing filter
ต้องใช้ input จาก pixel
หลายๆ pixel รอบๆจุด (x,y)
ISAN-DSP GROUP
Types of Image Enhancement in the Spatial Domain
- Single pixel methods
- Gray level transformations
Example
- Historgram equalization
- Contrast stretching
- Arithmetic/logic operations
Examples
- Image subtraction
- Image averaging
- Multiple pixel methods
Examples
Spatial filtering
- Smoothing filters
- Sharpening filters
ISAN-DSP GROUP
Gray Level Transformation
รู ปแบบ: เป็ นการแปลง intensity ของภาพตั้งต้นไปเป็ น intensity ของภาพผลลัพธ์
โดยใช้ function:
s  T (r )
โดย r คือ input intensity และ s คือ output intensity
ตัวอย่าง :
Contrast
enhancement
ISAN-DSP GROUP
Image Negative
Output intensity
ขาว L-1
Original
digital
mammogram
s  L 1  r
Negative
digital
mammogram
ดา
0
ดา
Input intensity
L-1
ขาว
L = จานวนระดับของสี เทา
ISAN-DSP GROUP
Log Transformations
Application
s  c log(r  1)
Fourier
spectrum
Log Tr. of
Fourier
spectrum
ISAN-DSP GROUP
Power-Law Transformations
s  cr 
ISAN-DSP GROUP
Power-Law Transformations : Gamma Correction Application
ภาพที่อยาก
ให้เป็ น
เมื่อปรับ
Gamma
correction
ภาพที่แสดงที่
Monitor
โดยตรง
ภาพที่แสดงที่
Monitor
ภายหลัง
ISAN-DSP GROUP
Power-Law Transformations : Gamma Correction Application
ภาพ MRI ที่ผา่ น
Gamma
Correction
โดยใช้ค่า Gamma
ค่าต่างๆ
ISAN-DSP GROUP
Power-Law Transformations : Gamma Correction Application
ภาพถ่ายทางอากาศที่
ผ่าน Gamma
Correction
โดยใช้ค่า Gamma
ค่าต่างๆ
ISAN-DSP GROUP
Contrast Stretching
Before contrast
enhancement
After
ISAN-DSP GROUP
Gray Level Slicing
ISAN-DSP GROUP
Bit-plane Slicing
Bit 6
Bit 5
Bit 3
Bit 7
Bit 2
Bit 1
ISAN-DSP GROUP
Histogram
จานวน pixel
ภาพที่มืด จะมี histogram
กองอยูไ่ ปทางซ้าย
จานวน pixel
Histogram เป็ นกราฟแบบไม่ต่อเนื่องที่แสดงจานวน pixel ของ intensity ค่าต่างๆ
รู ปแบบ h(rk )  nk
ภาพที่สว่าง จะมี histogram
กองอยูไ่ ปทางขวา
ISAN-DSP GROUP
Histogram (cont.)
Contrast หมายถึงความแตกต่างระหว่างสี ที่มืดที่สุดในภาพกับสี ที่สว่างที่สุดในภาพ
ภาพที่ low contrast จะมี
histogram กระจุกกันอยุใ่ น
ช่วงแคบๆ
ภาพที่ high contrast จะมี
histogram กระจายกันอยุ่
ในช่วงกว้างๆ
ISAN-DSP GROUP
Histogram Processing
หมายถึงกระบวนการปรับปรุ ง intensity ของรู ปภาพเพื่อให้ได้ histogram
ที่มีลกั ษณะตามต้องการ
- Histogram equalization
เป็ นการทาให้ histogram กระจายกันอย่างสม่าเสมอตลอด
- Histogram matching
เป็ นการทาให้ histogram มีลกั ษณะเหมือนกราฟที่กาหนดไว้
ISAN-DSP GROUP
Monotonically Increasing Function
ISAN-DSP GROUP
Histogram Equalization
ISAN-DSP GROUP
Histogram Equalization (cont.)
ISAN-DSP GROUP
Histogram Equalization (cont.)
ISAN-DSP GROUP
Histogram Equalization (cont)
ISAN-DSP GROUP
Histogram Equalization (cont.)
ภาพตั้งต้น
ภาพหลังทา Histogram Eq.
ปั ญหาในข้อนี้: ภาพหลังการทา Histogram equalization กลายเป็ นภาพ Low
Contrast ไป
ISAN-DSP GROUP
Histogram Matching
เป็ นการแปลงให้
Histogram
เป็ นไปตามกราฟ
ที่กาหนด
ISAN-DSP GROUP
Histogram Matching
ISAN-DSP GROUP
Local Enhancement
ISAN-DSP GROUP
Local Enhancement
ISAN-DSP GROUP
Local Enhancement
ISAN-DSP GROUP
Local Enhancement
ISAN-DSP GROUP
Logic Operations
AND
OR
Original
image
Image mask
(คนละความหมายกับ
Mask ใน filter)
ได้ผลลัพธ์เป็ น ROI:
Region of Interest
ISAN-DSP GROUP
Arithmetic Operation: Subtraction
ISAN-DSP GROUP
Arithmetic Operation: Subtraction (cont)
ISAN-DSP GROUP
Arithmetic Operation: Image Averaging
ISAN-DSP GROUP
Arithmetic Operation: Image Averaging (cont.)
ISAN-DSP GROUP
ISAN-DSP GROUP
ISAN-DSP GROUP
ISAN-DSP GROUP
ISAN-DSP GROUP
ISAN-DSP GROUP
ISAN-DSP GROUP
ISAN-DSP GROUP
Chapter 3
Image Enhancement in the
Spatial Domain
ISAN-DSP GROUP
Chapter 3
Image Enhancement in the
Spatial Domain
ISAN-DSP GROUP
Chapter 3
Image Enhancement in the
Spatial Domain
ISAN-DSP GROUP
Chapter 3
Image Enhancement in the
Spatial Domain
ISAN-DSP GROUP
Chapter 3
Image Enhancement in the
Spatial Domain
ISAN-DSP GROUP
Chapter 3
Image Enhancement in the
Spatial Domain
ISAN-DSP GROUP
Chapter 3
Image Enhancement in the
Spatial Domain
ISAN-DSP GROUP
Chapter 3
Image Enhancement in the
Spatial Domain
ISAN-DSP GROUP
Chapter 3
Image Enhancement in the
Spatial Domain
ISAN-DSP GROUP
Chapter 3
Image Enhancement in the
Spatial Domain
ISAN-DSP GROUP