히스토그램 매칭이란?

입력 영상(source)의 내용은 그대로 유지하면서 픽셀 강도 분포를 참조 영상(reference)의 분포에 맞추는 이미지 처리 기법
이를 통해 조명 조건이 다른 두 장의 사진을 “정규화(normalization)”하여 일관된 처리 파이프라인을 구축할 수 있음.
from skimage import exposure
# 히스토그램 매칭 수행
# 컬러 이미지인지 확인(channel>1 이면 multi=True 넘겨줌)
channel_axis = -1 if src.ndim == 3 and src.shape[-1] > 1 else None
matched = exposure.match_histograms(src, ref, channel_axis=channel_axis)


결과물(Matched)의 그래프가 파랑선, 주황선 모두 레퍼런스의 그래프와 매우 비슷하게 변경된 것을 볼 수 있음.
*추가 실험 진행해봄
#1


#2


#3


#4


출처
Histogram matching with OpenCV, scikit-image, and Python - PyImageSearch
In this tutorial, you will learn how to perform histogram matching using OpenCV and scikit-image.
pyimagesearch.com
'PyImageSearch' 카테고리의 다른 글
| OpenCV - 감마 보정(Gamma Correction) (0) | 2025.06.17 |
|---|---|
| CDF(누적 분포 함수) (0) | 2025.06.16 |
| OpenCV - Histogram Equalization (0) | 2025.06.16 |
| OpenCV - Image Histograms (0) | 2025.06.15 |
| OpenCV - Edge detection (0) | 2025.06.14 |