이미지 색상 강화 방법

‍이세현·2024년 2월 5일
1

Color Enhancement를 참고하여 이미지를 RGB color space로 표현했을 때 색상을 강조하는 수식을 작성하였다.

def enhance_color(img, factor=1.2):
    max_rgb = np.max(img, axis=-1, keepdims=True)
    max_rgb_nonzero = np.where(max_rgb == 0, 1, max_rgb)
    dst = (img / max_rgb_nonzero) ** factor * max_rgb

    return dst.astype(np.uint8)

profile
Hi, there 👋

0개의 댓글

관련 채용 정보