Intensity Transform

정예슬·2023년 10월 18일
0

vision

목록 보기
13/21
post-thumbnail

Intensity Transform이란?

디지털 영상 처리에서 이미지의 픽셀 값 또는 강도를 변환하는 과정. 주로 이미지의 대비, 밝기, 명암 등을 조절하거나 이미지의 특정 부분을 강조하기 위해 사용된다.

Intensity Transform Function(강도 변환 함수)

g(x,y)=T(f(x,y))g(x,y)=T(f(x,y))

여기서 g(x,y)g(x,y)는 변환된 이미지의 픽셀 값, f(x,y)f(x, y)는 입력 이미지의 픽셀 값, TT는 intensity transform 함수이다.


Image Negatives

이미지의 모든 픽셀 값을 반전시키는 함수로 다음과 같이 표현한다.

g(x,y)=L1f(x,y)g(x,y)=L−1−f(x,y)

여기서 LL은 픽셀 값의 최댓값(밝기 레벨)이다.

Image Negative를 MATLAB으로 구현하기

inputImg = imread('test.jpg');
outputImg = 255 - inputImg;
subplot(1,2,1)
imshow(inputImg)
title('Original')
subplot(1,2,2)
imshow(outputImg)
title('Negative')


Log Transformation

밝기를 로그 스케일로 조절하기 위해 사용된다.

g(x,y)=clog(1+f(x,y))g(x,y)=c⋅log(1+f(x,y))

여기서 cc는 정규화 상수이다.

Log Transformation를 MATLAB으로 구현하기

inputImg = imread('test.jpg');
outputImg=uint8(log(1+double(inputImg)) * (255/log(256)));

subplot(1,2,1)
imshow(inputImg)
title('Original')
subplot(1,2,2)
imshow(outputImg)
title('Log Transformation')


Power-law Transformation(Gamma Correction)

이미지의 gamma(감마) 값을 조절하여 밝기 및 대비를 조절한다.

g(x,y)=c[f(x,y)]γg(x,y)=c⋅[f(x,y)]^γ

γγ는 감마(gamma) 값으로 밝기 곡선의 조절을 나타낸다.

  • γγ > 1
    어두운 영역을 밝게 하여 세부 정보를 더 잘 드러나게 하고, 픽셀간 밝기 차이가 강조됨(밝은 영역 대비 강화)

  • γγ = 1
    원본 이미지 유지

  • γγ < 1
    이미지 밝기 대비가 낮아짐. 밝은 영역과 어두운 영역의 차이 감소

Power-law Transformationd을 MATLAB으로 구현하기

inputImg=imread('test.jpg')
C=1;
G=1.5;
s=C*(double(inputImg).^G);
outputImg=uint8(255/(C*(255 .^G))*s);
subplot(1,2,1)
imshow(inputImg)
title('Original')
subplot(1,2,2)
imshow(outputImg)
title('Power-law Transformation')
  • Gamma=1.5

  • Gamma=0.5

profile
춘식이랑 함께하는 개발일지

0개의 댓글