2023.04.23 ~ 27 ETRI 소셜로봇연구실 진행사항
이미지의 색 분포를 목표 이미지의 색 분포와 비슷하게 하는 알고리즘이다.
출처: https://swprog.tistory.com/entry/Histogram-Matching-Color-mapping-Color-Transfer
초록 계열의 색이 많은 숲 이미지를 파란 계열의 색이 많은 바다 이미지의 히스토그램을 따르도록 매칭시키는 예시이다.
- source image
- target image
- output
바다 색 분포를 가진 숲으로 변환된다.
face parsing을 통해 mask 영역을 segmentation 하고, 해당 영역을 inpainting 모델로 복원하는 연구를 진행하였다.
하지만 inpainting 모델의 복원 결과 코나 입 부분의 shape은 잘 복원 되지만, 피부톤이 blue가 강조되며 복원되는 것을 볼 수 있었다.
그래서 inpainting 된 영역의 히스토그램을 피부 영역의 히스토그램으로 매칭시켜 파란 부분 보정하기 위해 히스토그램 매칭을 사용하였다.
- source image - inpainting 영역
- target image - skin 영역
- output
각 채널 별로 히스토그램 매칭이 잘 되었는지 확인하기 위해 히스토그램을 출력하였다. 왼쪽은 원본 영상의 히스토그램, 중간은 타겟 영상의 히스토그램, 오른쪽은 결과 영상의 히스토그램이다.
- b channel
- g channel
- r channel
원본 영상과 히스토그램이 비슷해진것을 볼 수 있다.
이 repository를 clone하고 histogram_matching_color_image.py 코드를 실행하면 된다.
mkdir ${YOUR_PROJECT_NAME}
cd ${YOUR_PROJECT_NAME}
git clone https://github.com/google-research/deeplab2.gitmkdir](https://github.com/Seungeun-Han/histogram_matching.git