Common Problems in Digital Image Processing

Comprehensive overview of common problems encountered in Digital Image Processing (DIP) and their solutions.

Warning

This article is a work in progress and may contain incomplete information or inaccuracies. Please verify details from reliable sources.

Common Problems in Digital Image Processing (DIP)

นี่คือปัญหาที่พบบ่อยใน Image Processing พร้อมชื่อปัญหาและเทคนิคที่ใช้แก้ไข ซึ่งจะช่วยให้คุณฝึกใช้ความรู้ด้าน Digital Image Processing (DIP) ได้ครบทั้ง Preprocessing → Processing → Postprocessing

Image Quality Issues

1. Noise (สัญญาณรบกวน)

  • Description: Unwanted random variations in brightness or color information in images.
  • Techniques: Median Filtering, Gaussian Smoothing, Bilateral Filtering, Non-Local Means
  • ปัญหา: ภาพมีจุดรบกวน ทำให้รายละเอียดไม่คมชัด เช่น ภาพจากกล้องมือถือในที่มืด หรือภาพสแกนเก่า ๆ
ประเภท Noiseลักษณะภาพเทคนิคแก้ไข
Gaussian Noiseจุดรบกวนแบบสุ่มกระจายทั่วภาพGaussian Filter, Wiener Filter
Salt & Pepper Noiseจุดดำ-ขาวกระจายเป็นหย่อม ๆMedian Filter
Speckle Noiseพบในภาพ UltrasoundAdaptive Filtering
Poisson NoiseเกิดจากการนับโฟตอนในภาพVariance Stabilizing Transform

💡 ฝึกปฏิบัติ:

# ตัวอย่าง Code ลดสัญญาณรบกวนด้วย OpenCV
import cv2
import numpy as np
from skimage.metrics import peak_signal_noise_ratio as psnr

# อ่านภาพ
img = cv2.imread('noisy_image.jpg')

# ลด Gaussian Noise
gaussian_blur = cv2.GaussianBlur(img, (5, 5), 0)

# ลด Salt & Pepper Noise
median_blur = cv2.medianBlur(img, 5)

# ลด Noise ขั้นสูงด้วย Non-Local Means
nlm_blur = cv2.fastNlMeansDenoisingColored(img, None, 10, 10, 7, 21)

# เปรียบเทียบคุณภาพ
print("PSNR Gaussian:", psnr(img, gaussian_blur))
print("PSNR Median:", psnr(img, median_blur))
print("PSNR NLM:", psnr(img, nlm_blur))

2. Blurring (ภาพเบลอ / Out of Focus)

  • Description: Loss of sharpness in images, often due to camera shake or out-of-focus capture.
  • Techniques: Deconvolution, Wiener Filter, Blind Deconvolution, Richardson-Lucy Algorithm
  • ปัญหา: ภาพไม่ชัดจากการเคลื่อนไหวของกล้องหรือโฟกัสไม่ตรง เช่น ภาพถ่ายที่กล้องสั่น หรือภาพที่โฟกัสไม่ถูกจุด
สาเหตุเทคนิคแก้ไข
Motion Blur (กล้องสั่น)Wiener Filter, Lucy-Richardson Deconvolution
Out of FocusLaplacian Sharpening, Unsharp Masking
Camera ShakeBlind Deconvolution

💡 ฝึกปฏิบัติ:

# ตัวอย่าง Code การแก้ภาพเบลอ
import cv2
import numpy as np

# อ่านภาพ
img = cv2.imread('blurry_image.jpg')

# 1. Unsharp Masking - เพิ่มความคมชัด
gaussian = cv2.GaussianBlur(img, (5, 5), 0)
unsharp_masked = cv2.addWeighted(img, 1.5, gaussian, -0.5, 0)

# 2. สร้าง Motion Blur เทียม (เพื่อทดสอบ)
kernel_size = 15
kernel_motion_blur = np.zeros((kernel_size, kernel_size))
kernel_motion_blur[int((kernel_size-1)/2), :] = np.ones(kernel_size)
kernel_motion_blur = kernel_motion_blur / kernel_size
motion_blur = cv2.filter2D(img, -1, kernel_motion_blur)

# แสดงภาพ
cv2.imshow("Original", img)
cv2.imshow("Enhanced (Unsharp Masked)", unsharp_masked)
cv2.waitKey(0)

3. Low Contrast (คอนทราสต์ต่ำ)

  • Description: Images with poor contrast, making it difficult to distinguish between different regions.
  • Techniques: Histogram Equalization, Contrast Limited Adaptive Histogram Equalization (CLAHE), Gamma Correction
  • ปัญหา: ภาพมีคอนทราสต์ต่ำ ภาพดูหม่น สีไม่ชัด มักเกิดจากแสงไม่พอ หรือภาพถ่ายย้อนแสง
เทคนิคแก้ไขคำอธิบาย
Histogram Equalizationปรับกระจายความสว่างใหม่ทั้งภาพ
CLAHE (Contrast Limited Adaptive Histogram Equalization)เหมาะสำหรับภาพทางการแพทย์
Gamma Correctionใช้กับภาพที่สว่างเกินไปหรือมืดเกินไป

💡 ฝึกปฏิบัติ:

# ตัวอย่าง Code การปรับคอนทราสต์
import cv2
import numpy as np

# อ่านภาพ
img = cv2.imread('low_contrast.jpg', 0)  # อ่านเป็นภาพขาวดำ

# 1. Histogram Equalization - เหมาะกับภาพทั่วไป
hist_eq = cv2.equalizeHist(img)

# 2. CLAHE - เหมาะกับภาพทางการแพทย์และภาพที่มีรายละเอียดซับซ้อน
clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8,8))
clahe_img = clahe.apply(img)

# 3. Gamma Correction - ปรับความสว่าง
gamma = 1.5
gamma_corrected = np.array(255 * (img / 255) ** gamma, dtype='uint8')

# แสดงภาพ
cv2.imshow("Original", img)
cv2.imshow("Histogram Equalized", hist_eq)
cv2.imshow("CLAHE", clahe_img)
cv2.waitKey(0)

Feature and Edge Analysis

4. Edge Detection (การหาขอบภาพไม่ชัด)

  • Description: Difficulty in accurately detecting edges in images due to noise or low contrast.
  • Techniques: Canny Edge Detector, Sobel Operator, Prewitt Operator, Laplacian of Gaussian (LoG)
  • ปัญหา: ขอบวัตถุในภาพไม่ชัดเจน หรือต้องการหาขอบวัตถุแต่ได้ผลลัพธ์ไม่ดี เช่น ภาพที่มี noise เยอะ หรือขอบวัตถุที่มีความเปรียบต่างต่ำ
เทคนิคแก้ไขเหมาะสำหรับ
Sobel / Prewitt Filterขอบพื้นฐาน
Canny Edge Detectionต้องการขอบที่คมและลด noise
Laplacian of Gaussian (LoG)ภาพที่มีรายละเอียดสูง

💡 ฝึกปฏิบัติ:

# ตัวอย่าง Code การหาขอบภาพ
import cv2
import numpy as np

# อ่านภาพ
img = cv2.imread('edge_example.jpg', 0)  # อ่านเป็นภาพขาวดำ

# ลด noise ก่อนทำ edge detection (สำคัญมาก)
img = cv2.GaussianBlur(img, (5, 5), 0)

# 1. Sobel Edge Detection
sobelx = cv2.Sobel(img, cv2.CV_64F, 1, 0, ksize=3)
sobely = cv2.Sobel(img, cv2.CV_64F, 0, 1, ksize=3)
sobel_combined = cv2.magnitude(sobelx, sobely)
sobel_combined = np.uint8(sobel_combined)

# 2. Canny Edge Detection
canny_edges = cv2.Canny(img, 100, 200)  # ปรับค่า threshold ตามความเหมาะสม

# 3. Laplacian Edge Detection
laplacian = cv2.Laplacian(img, cv2.CV_64F)
laplacian = np.uint8(np.absolute(laplacian))

# เปรียบเทียบ
cv2.imshow("Original", img)
cv2.imshow("Sobel", sobel_combined)
cv2.imshow("Canny", canny_edges)
cv2.imshow("Laplacian", laplacian)
cv2.waitKey(0)

5. Distortion (ภาพบิดเบี้ยว)

  • Description: Geometric distortions in images caused by lens imperfections or perspective issues.
  • Techniques: Geometric Transformations, Camera Calibration, Lens Distortion Correction
  • ปัญหา: ภาพจากเลนส์กล้องมักจะมีความโค้ง เช่น Fish-eye หรือภาพที่ถ่ายมุมกว้างทำให้วัตถุดูบิดเบี้ยว
ประเภท Distortionเทคนิคแก้ไข
Barrel Distortion (ขอบภาพพองออก)Camera Calibration + Remapping
Pincushion Distortion (ขอบภาพหดเข้า)Camera Calibration

💡 ฝึกปฏิบัติ:

# ตัวอย่าง Code การแก้ไขภาพบิดเบี้ยว
import cv2
import numpy as np

# อ่านภาพที่มี distortion
img = cv2.imread('distorted_image.jpg')

# สร้าง camera matrix และ distortion coefficients (ได้จากการ calibrate กล้อง)
# ตัวอย่าง parameters (ควรใช้ค่าที่ได้จากการ calibrate จริง)
camera_matrix = np.array([[800, 0, img.shape[1]/2], 
                          [0, 800, img.shape[0]/2], 
                          [0, 0, 1]])
dist_coeffs = np.array([-0.2, 0.1, 0, 0])  # k1, k2, p1, p2

# แก้ไข distortion
undistorted_img = cv2.undistort(img, camera_matrix, dist_coeffs)

# แสดงผล
cv2.imshow("Original (Distorted)", img)
cv2.imshow("Corrected", undistorted_img)
cv2.waitKey(0)

# ถ้าต้องการ calibrate กล้อง ควรใช้ชุดภาพ chessboard pattern หลาย ๆ ภาพ

6. Thresholding & Segmentation

  • Description: Difficulty in segmenting objects from the background due to shadows or uneven lighting.
  • Techniques: Adaptive Thresholding, Otsu's Binarization, Watershed Algorithm, Grabcut
  • ปัญหา: ต้องการแบ่งวัตถุออกจาก background แต่มีเงาหรือแสงไม่สม่ำเสมอ ทำให้การแบ่งวัตถุออกจากพื้นหลังทำได้ยาก
เทคนิคแก้ไขกรณีใช้งาน
Global Threshold (Otsu)ภาพที่แสงสม่ำเสมอ
Adaptive Thresholdภาพที่แสงไม่สม่ำเสมอ
Watershed Segmentationแยกวัตถุที่ทับซ้อนกัน
GrabCutแยกวัตถุซับซ้อน

💡 ฝึกปฏิบัติ:

# ตัวอย่าง Code การทำ Segmentation
import cv2
import numpy as np

# อ่านภาพ
img = cv2.imread('object.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

# 1. Global Thresholding (Otsu)
ret, thresh_otsu = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)

# 2. Adaptive Thresholding
adaptive_thresh = cv2.adaptiveThreshold(gray, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C,
                                        cv2.THRESH_BINARY, 11, 2)

# 3. Watershed Segmentation (ตัวอย่างพื้นฐาน)
# สร้าง marker จาก foreground และ background
ret, markers = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY + cv2.THRESH_OTSU)
markers = np.int32(markers)
watershed_result = img.copy()
cv2.watershed(img, markers)
watershed_result[markers == -1] = [0, 0, 255]  # วาดเส้นขอบสีแดง

# แสดงผล
cv2.imshow("Original", img)
cv2.imshow("Otsu Thresholding", thresh_otsu)
cv2.imshow("Adaptive Thresholding", adaptive_thresh)
cv2.imshow("Watershed", watershed_result)
cv2.waitKey(0)

Lighting and Color Challenges

7. Illumination Variations (แสงไม่สม่ำเสมอ)

  • Description: Uneven lighting conditions causing parts of the image to be too bright or too dark.
  • Techniques: Histogram Equalization, Adaptive Histogram Equalization (CLAHE), Gamma Correction, Retinex Algorithms
  • ปัญหา: ภาพมีแสงไม่สม่ำเสมอ เช่น ภาพถ่ายในที่ร่มที่มีแสงสว่างไม่ทั่วถึง หรือภาพถ่ายกลางแจ้งที่มีเงามืด
ประเภทปัญหาเทคนิคแก้ไข
Uneven LightingHistogram Equalization, CLAHE
ShadowsShadow Removal Techniques
HighlightsHighlight Recovery Techniques
Low LightMulti-Scale Retinex

💡 ฝึกปฏิบัติ:

# ตัวอย่าง Code แก้ปัญหาแสงไม่สม่ำเสมอ
import cv2
import numpy as np

# อ่านภาพ
img = cv2.imread('uneven_light.jpg')

# แปลงเป็น LAB color space (L=ความสว่าง, A=สีเขียว-แดง, B=สีน้ำเงิน-เหลือง)
lab = cv2.cvtColor(img, cv2.COLOR_BGR2LAB)
l, a, b = cv2.split(lab)

# แก้ไขเฉพาะช่อง L (ความสว่าง) ด้วย CLAHE
clahe = cv2.createCLAHE(clipLimit=3.0, tileGridSize=(8, 8))
cl = clahe.apply(l)

# รวมช่องสีกลับ
updated_lab = cv2.merge((cl, a, b))

# แปลงกลับเป็น BGR
corrected_img = cv2.cvtColor(updated_lab, cv2.COLOR_LAB2BGR)

# แสดงผล
cv2.imshow("Original", img)
cv2.imshow("Corrected", corrected_img)
cv2.waitKey(0)

8. Color Issues (ปัญหาสี)

  • Description: Problems related to color accuracy and consistency in images.
  • Techniques: Color Correction, White Balance Adjustment, Color Space Transformation
  • ปัญหา: สีผิดเพี้ยนจากแสงหรือกล้อง ทำให้สีที่เห็นในภาพไม่ตรงกับความเป็นจริง
ปัญหาเทคนิคแก้ไข
White Balance ผิดGray World Algorithm
ภาพสีหม่นHSV Color Enhancement
ต้องการเน้นเฉพาะสีMasking + Color Space Conversion (BGR → HSV)
Color CastColor Transfer, Color Grading

💡 ฝึกปฏิบัติ:

# ตัวอย่าง Code การแก้ไขปัญหาสี
import cv2
import numpy as np

# อ่านภาพ
img = cv2.imread('color_problem.jpg')

# 1. Gray World Algorithm (White Balance)
def gray_world(img):
    # แยกช่องสี
    b, g, r = cv2.split(img)
    
    # หาค่าเฉลี่ยของแต่ละช่องสี
    r_avg = np.mean(r)
    g_avg = np.mean(g)
    b_avg = np.mean(b)
    
    # หาค่าเฉลี่ยรวม
    avg = (r_avg + g_avg + b_avg) / 3
    
    # ปรับสมดุลสี
    r = r * (avg / r_avg)
    g = g * (avg / g_avg)
    b = b * (avg / b_avg)
    
    # ตรวจสอบค่าไม่เกิน 255
    r = np.clip(r, 0, 255).astype(np.uint8)
    g = np.clip(g, 0, 255).astype(np.uint8)
    b = np.clip(b, 0, 255).astype(np.uint8)
    
    # รวมช่องสีกลับ
    return cv2.merge([b, g, r])

# 2. แยกสีเฉพาะ (เช่น สีแดง)
def extract_red(img):
    # แปลงเป็น HSV
    hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
    
    # กำหนดช่วงสีแดง (HSV)
    lower_red1 = np.array([0, 100, 100])
    upper_red1 = np.array([10, 255, 255])
    lower_red2 = np.array([160, 100, 100])
    upper_red2 = np.array([179, 255, 255])
    
    # สร้าง mask
    mask1 = cv2.inRange(hsv, lower_red1, upper_red1)
    mask2 = cv2.inRange(hsv, lower_red2, upper_red2)
    mask = mask1 + mask2
    
    # นำ mask ไปคูณกับภาพต้นฉบับ
    result = cv2.bitwise_and(img, img, mask=mask)
    return result

# ประมวลผล
white_balanced = gray_world(img)
red_only = extract_red(img)

# แสดงผล
cv2.imshow("Original", img)
cv2.imshow("White Balanced", white_balanced)
cv2.imshow("Red Only", red_only)
cv2.waitKey(0)

9. Color Distortion (สีผิดเพี้ยน)

  • Description: Inaccurate color representation due to lighting conditions or camera settings.
  • Techniques: Color Correction, White Balance Adjustment, Color Space Transformation, Color Transfer
  • ปัญหา: สีในภาพไม่ตรงกับความเป็นจริง เช่น ภาพถ่ายที่มีสีเพี้ยนจากแสงไฟฟลูออเรสเซนต์ หรือภาพที่ถ่ายในแสงน้อย
ประเภทปัญหาเทคนิคแก้ไข
Color CastWhite Balance Adjustment
Faded ColorsColor Correction
Low SaturationSaturation Adjustment
Mixed Lighting SourcesColor Temperature Correction

💡 ฝึกปฏิบัติ:

# ตัวอย่าง Code การปรับแต่งสีด้วย LAB Color Space
import cv2
import numpy as np

# อ่านภาพ
img = cv2.imread('color_distorted.jpg')

# แปลงเป็น LAB color space (เหมาะสำหรับการปรับแต่งสี)
lab = cv2.cvtColor(img, cv2.COLOR_BGR2LAB)
l, a, b = cv2.split(lab)

# ปรับ A channel (แกน เขียว-แดง)
a = cv2.add(a, 5)  # ปรับให้สีเข้าแดงมากขึ้น

# ปรับ B channel (แกน น้ำเงิน-เหลือง)
b = cv2.add(b, -5)  # ปรับให้สีออกน้ำเงินมากขึ้น

# รวมช่องสีกลับ
corrected_lab = cv2.merge((l, a, b))
corrected_img = cv2.cvtColor(corrected_lab, cv2.COLOR_LAB2BGR)

# ปรับความอิ่มตัวของสี (Saturation)
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
h, s, v = cv2.split(hsv)
s = cv2.multiply(s, 1.3)  # เพิ่มความอิ่มตัวของสี 30%
s = np.clip(s, 0, 255).astype(np.uint8)
saturated_hsv = cv2.merge([h, s, v])
saturated_img = cv2.cvtColor(saturated_hsv, cv2.COLOR_HSV2BGR)

# แสดงผล
cv2.imshow("Original", img)
cv2.imshow("Color Corrected (LAB)", corrected_img)
cv2.imshow("Saturation Enhanced", saturated_img)
cv2.waitKey(0)

Advanced Challenges

10. Compression Artifacts (สัญญาณรบกวนจากการบีบอัด)

  • Description: Loss of image quality due to lossy compression techniques.
  • Techniques: Artifact Reduction Filters, Super-Resolution Techniques, Deep Learning Methods
  • ปัญหา: ภาพมีสัญญาณรบกวนหรือบิดเบี้ยวจากการบีบอัด เช่น ภาพ JPEG ที่ถูกบีบอัดมากเกินไปทำให้เกิดบล็อกหรือขอบหยัก
ประเภทปัญหาเทคนิคแก้ไข
Blocking ArtifactsBlock Matching, Inpainting
BlurringDeblurring Techniques
Color BandingDithering, Color Space Transformation
JPEG CompressionJPEG Artifact Removal Filters

💡 ฝึกปฏิบัติ:

# ตัวอย่าง Code การลด Compression Artifacts
import cv2
import numpy as np

# อ่านภาพ
img = cv2.imread('compressed_image.jpg')

# 1. ใช้ Non-local Means Denoising (เหมาะกับ Compression Artifacts)
denoised = cv2.fastNlMeansDenoisingColored(img, None, 10, 10, 7, 21)

# 2. ใช้ Bilateral Filter (รักษาขอบแต่ลด noise)
bilateral = cv2.bilateralFilter(img, 9, 75, 75)

# 3. เพิ่มความคมชัดหลังลด artifacts
kernel = np.array([[-1, -1, -1],
                   [-1, 9, -1],
                   [-1, -1, -1]])
sharpened = cv2.filter2D(denoised, -1, kernel)

# แสดงผล
cv2.imshow("Original (Compressed)", img)
cv2.imshow("Denoised (NLM)", denoised)
cv2.imshow("Bilateral Filter", bilateral)
cv2.imshow("Sharpened After Denoising", sharpened)
cv2.waitKey(0)

11. Image Resolution Enhancement

  • Description: Need to improve the resolution of low-quality images.
  • Techniques: Super-Resolution, Deep Learning (SRGAN, ESRGAN), Interpolation
  • ปัญหา: ภาพมีความละเอียดต่ำ ต้องการเพิ่มความละเอียดโดยไม่ทำให้ภาพเบลอหรือมีรายละเอียดผิดเพี้ยน
เทคนิคคำอธิบาย
Bicubic Interpolationวิธีดั้งเดิม ง่ายแต่ได้ผลไม่ดีมาก
SRGANใช้ GAN เพื่อเพิ่มความละเอียดอย่างมีประสิทธิภาพ
ESRGANพัฒนาจาก SRGAN ให้ได้ผลดีกว่า
Real-ESRGANเวอร์ชันล่าสุด ทำงานได้ดีกับภาพจริง

💡 หมายเหตุ:

  • PSNR (Peak Signal-to-Noise Ratio) และ SSIM (Structural Similarity Index) เป็นมาตรฐานที่ใช้วัดคุณภาพของภาพหลังการประมวลผล
  • ลองใช้ OpenCV หรือ scikit-image ในการทดลองเทคนิคต่าง ๆ เหล่านี้ เพื่อเพิ่มทักษะและความเข้าใจใน Digital Image Processing (DIP) อย่างครบถ้วน

Practical Workflow

Roadmap สำหรับฝึก

  1. เริ่มจาก Preprocessing
    • Noise Removal → Histogram Equalization → Sharpening
  2. Processing
    • Edge Detection → Segmentation → Morphological Operations
  3. Postprocessing
    • Object Tracking → Feature Extraction → Classification

ตัวอย่างโจทย์

  • มีภาพเอกสารเก่า ๆ ที่ถ่ายมาด้วยมือถือ → ภาพเบลอ + มี noise + คอนทราสต์ต่ำ

ขั้นตอนแก้ไข:

  1. Noise Removal → Median Filter
  2. Sharpening → Unsharp Mask
  3. Contrast Enhancement → CLAHE
  4. Thresholding → Adaptive Threshold
# ตัวอย่าง Complete Pipeline สำหรับการแก้ไขภาพเอกสาร
import cv2
import numpy as np

# อ่านภาพเอกสาร
document = cv2.imread('document_image.jpg')

# 1. แปลงเป็นภาพขาวดำ
gray = cv2.cvtColor(document, cv2.COLOR_BGR2GRAY)

# 2. ลด noise ด้วย Median Filter
denoised = cv2.medianBlur(gray, 5)

# 3. เพิ่มความคมชัดด้วย Unsharp Masking
gaussian = cv2.GaussianBlur(denoised, (0, 0), 3)
unsharp_masked = cv2.addWeighted(denoised, 1.5, gaussian, -0.5, 0)

# 4. ปรับคอนทราสต์ด้วย CLAHE
clahe = cv2.createCLAHE(clipLimit=2.0, tileGridSize=(8, 8))
enhanced = clahe.apply(unsharp_masked)

# 5. ทำ Thresholding เพื่อแยกตัวอักษรออกจากพื้นหลัง
adaptive_thresh = cv2.adaptiveThreshold(enhanced, 255, cv2.ADAPTIVE_THRESH_GAUSSIAN_C,
                                        cv2.THRESH_BINARY, 11, 2)

# แสดงผลแต่ละขั้นตอน
cv2.imshow("Original", document)
cv2.imshow("Denoised", denoised)
cv2.imshow("Contrast Enhanced", enhanced)
cv2.imshow("Final Document", adaptive_thresh)
cv2.waitKey(0)

เครื่องมือและแหล่งเรียนรู้

แนะนำเครื่องมือ

  • OpenCV → สำหรับฝึก coding (cv2) ฟังก์ชันครบถ้วน ใช้ง่าย มีประสิทธิภาพ
  • Scikit-image → สำหรับ image processing ระดับวิชาการ Python Native API
  • ImageJ → สำหรับวิเคราะห์ภาพทางวิทยาศาสตร์ GUI สะดวก
  • Pillow → Python Imaging Library ที่ใช้งานง่ายสำหรับงานทั่วไป
  • MATLAB Image Processing Toolbox → เหมาะสำหรับงานวิจัยและการพัฒนาขั้นสูง
  • TensorFlow/PyTorch → สำหรับวิธีแก้ปัญหาด้วย Deep Learning

แหล่งเรียนรู้

  • OpenCV Documentation: https://docs.opencv.org/
  • Digital Image Processing by Gonzalez and Woods (ตำราคลาสสิก)
  • pyimagesearch.com (บทความ DIP ที่เข้าใจง่าย)
  • Kaggle Notebooks เกี่ยวกับ Image Processing

สรุปเทคนิคแก้ไขปัญหาภาพ

ปัญหาในภาพชื่อเทคนิคแก้ไขฟังก์ชันใน OpenCV
จุดรบกวนNoise Reduction (Gaussian, Median)cv2.GaussianBlur(), cv2.medianBlur()
ภาพเบลอDeblurring, Wiener Filtercv2.filter2D(), cv2.Wiener()
คอนทราสต์ต่ำHistogram Equalization, CLAHEcv2.equalizeHist(), cv2.createCLAHE()
ขอบไม่ชัดCanny Edge Detectioncv2.Canny()
ภาพบิดเบี้ยวCamera Calibrationcv2.undistort(), cv2.calibrateCamera()
วัตถุซ้อนกันWatershed Segmentationcv2.watershed()
สีผิดเพี้ยนWhite Balance, HSV Maskingcv2.cvtColor(), cv2.inRange()
การบีบอัดArtifact Reductioncv2.fastNlMeansDenoisingColored()
ความละเอียดต่ำSuper-ResolutionDeep learning frameworks