[Digital Image Processing] 그레이스케일 이미지 히스토그램을 그리고 이미지 히스토그램 평준화를 위한 Matlab 프로그램으로 이미지 콘트라스트 향상

프로그램 내용은 다음과 같이 설명됩니다.

1. 이미지의 히스토그램 표시
2. 히스토그램 평활화는 이미지의 대비를 향상시키는 데 사용되며 히스토그램 평활화 전후의 이미지와 이미지의 히스토그램을 표시합니다.

프로그램 코드는 다음과 같습니다.

%Part 1
h=imread('cameraman.tif');
subplot(1,2,1),imshow(h);
subplot(1,2,2),imhist(h),
grid on,
ylabel('pixel count');
%Part 2
h=imread('cameraman.tif');
subplot(1,6,1),imshow(h);
g=histeq(h,40:60);
j=imadjust(h,[0.3,0.7],[]);
subplot(1,6,2),imshow(g);
subplot(1,6,5),imhist(g);
subplot(1,6,3),imshow(j);
subplot(1,6,6),imhist(j);
subplot(1,6,4),imhist(h),
grid on,
ylabel('pixel count');

절차 원칙은 다음과 같습니다.

part1, imread 함수를 사용하여 컴퓨터 디스크에서 이미지 cameraman.tif를 읽고 imshow 함수를 사용하여 이미지 창에 이미지를 표시한 다음 imhist 함수를 사용하여 이미지의 히스토그램을 가져와 이미지에 표시합니다. 창문.

part2는 각각 함수 histeq 및 함수 imadjust를 사용하여 이미지 대비를 향상시키기 위해 이미지 cameraman.tif의 히스토그램을 균등화합니다. imshow 함수를 사용하여 원본 이미지, histeq 함수로 처리된 이미지, imadjust 함수로 처리된 이미지를 이미지 창에 표시한 다음 imhist 함수를 사용하여 세 이미지의 히스토그램을 이미지 창에 표시합니다.

프로그램 실행 결과는 다음과 같습니다.

1 부:

 그림 1: 이미지 cameraman.tif 및 히스토그램

2 부:

 그림 2: 원본 이미지, 대비가 향상된 이미지 및 각 이미지의 히스토그램

 이것을 본 친구들은 떠나기 전에 좋아하는 것을 잊지 마십시오!

블로거를 팔로우하여 디지털 이미지 처리에 대해 자세히 알아보세요!

Supongo que te gusta

Origin blog.csdn.net/qq_59049513/article/details/122585682
Recomendado
Clasificación