Skip to content

Seungeun-Han/histogram_matching

Repository files navigation

histogram_matching

2023.04.23 ~ 27 ETRI 소셜로봇연구실 진행사항

히스토그램 매칭이란?

이미지의 색 분포를 목표 이미지의 색 분포와 비슷하게 하는 알고리즘이다.

1

2

출처: https://swprog.tistory.com/entry/Histogram-Matching-Color-mapping-Color-Transfer

Example

초록 계열의 색이 많은 숲 이미지를 파란 계열의 색이 많은 바다 이미지의 히스토그램을 따르도록 매칭시키는 예시이다.

  • source image

forest

  • target image

sea

  • output

바다 색 분포를 가진 숲으로 변환된다.

out


우리가 하려는 것

face parsing → mask inpainting 과정에서 논리적 문제

face parsing을 통해 mask 영역을 segmentation 하고, 해당 영역을 inpainting 모델로 복원하는 연구를 진행하였다.

하지만 inpainting 모델의 복원 결과 코나 입 부분의 shape은 잘 복원 되지만, 피부톤이 blue가 강조되며 복원되는 것을 볼 수 있었다.

image

그래서 inpainting 된 영역의 히스토그램을 피부 영역의 히스토그램으로 매칭시켜 파란 부분 보정하기 위해 히스토그램 매칭을 사용하였다.

Example

  • source image - inpainting 영역

image

  • target image - skin 영역

image

  • output

각 채널 별로 히스토그램 매칭이 잘 되었는지 확인하기 위해 히스토그램을 출력하였다. 왼쪽은 원본 영상의 히스토그램, 중간은 타겟 영상의 히스토그램, 오른쪽은 결과 영상의 히스토그램이다.

  • b channel

KakaoTalk_20230525_200944778_01

  • g channel

KakaoTalk_20230525_200944778_02

  • r channel

KakaoTalk_20230525_200944778_03

원본 영상과 히스토그램이 비슷해진것을 볼 수 있다.

How to use?

이 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

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages