20230501 ~ 공부 시작
감마보정은 영어로 Gamma Correction, Gamma Encoding, Gamma Compression 등 여러 용어로 불리지만 이들은 모두 유사한 개념을 나타낸다고 한다.
감마보정을 하는 이유는 인간의 눈이 카메라 센서처럼 빛이 2배 들어온다고 해서 정확히 2배라고 인지하는 것이 아니기 때문에 카메라의 raw 파일이 빛의 양을 선형적으로 계산해서 출력할 경우 이것이 인간의 눈으로 관찰한 것과 다르게 보이기 때문에 이를 보정하여 사람의 눈으로 보기에 최적의 화질로 고쳐주는 것이라고 한다.
참고 이미지
참고 코드
import cv2
import numpy as np
g = float(input("Gamma : "))
img = cv2.imread("input image.png")
out = img.copy()
out = img.astype(np.float)
out = ((out / 255) ** (1 / g)) * 255
out = out.astype(np.uint8)
cv2.imshow("original", img)
cv2.imshow("gamma", out)
cv2.waitKey(0)
참고자료
https://en.wikipedia.org/wiki/Gamma_correction
Gamma correction - Wikipedia
From Wikipedia, the free encyclopedia Nonlinear operation The effect of gamma correction on an image: The original image was taken to varying powers, showing that powers larger than 1 make the shadows darker, while powers smaller than 1 make dark regions l
en.wikipedia.org
https://ko.wikipedia.org/wiki/%EA%B0%90%EB%A7%88_%EB%B3%B4%EC%A0%95
감마 보정 - 위키백과, 우리 모두의 백과사전
위키백과, 우리 모두의 백과사전. 감마 보정(감마 교정)은 비디오 카메라, 컴퓨터 그래픽 등에서 비선형 전달 함수(nonlinear transfer function)를 사용하여 빛의 강도(intensity) 신호를 비선형적으로 변
ko.wikipedia.org
파이썬 openCV 2. 감마 보정(Gamma Correction)
파이썬 openCV의 두 번째 강의 감마보정(Gamma Correction)입니다. 원래 사람의 눈은 컴퓨터가 처리하는 밝기와 다르게 반응합니다. 그래서 어두운곳은 0, 밝은곳을 255로 아무 보정 없이 매칭하게 되면
marisara.tistory.com
https://pyimagesearch.com/2015/10/05/opencv-gamma-correction/
OpenCV Gamma Correction - PyImageSearch
In this tutorial I'll show you how to implement a super fast, easy to use Gamma correction function using Python and OpenCV. Click here to learn more.
pyimagesearch.com
'컴퓨터과학' 카테고리의 다른 글
apple silicon 칩 컴퓨터에서 vmware 로 kubuntu 설치하기 (0) | 2023.05.04 |
---|---|
[논문읽기] Fibro-CoSANet: Pulmonary Fibrosis Prognosis Prediction using a Convolutional Self Attention Network (0) | 2023.05.03 |
[논문읽기] Segment Anything (0) | 2023.05.03 |
[논문읽기] Attention Mechanism in CNN (합성곱 네트워크에서의 어텐션 메커니즘) - Non-local Neural Networks (0) | 2023.05.02 |
[논문 읽기] Vanilla GAN (0) | 2023.05.01 |
댓글