现有一个名为 “boy.jpg” 的图片。下面我们对这个图片来进行对比度和均衡度的调整,并用直方图展示像素点。来看一下效果。

用 matlab 对图片进行对比度和均衡度调整

代码如下:

clear,clc,close all;
f=imread('boy.jpg');
g=rgb2gray(f);   
fa=imadjust(g);     %按默认参数处理对比度
fb=histeq(g);       %按默认参数处理均衡度

subplot(321),imshow(g),title('灰度图');
subplot(322),imhist(g),title('灰度图的直方图');
subplot(323),imshow(fa),title('对比度默认拉伸图');
subplot(324),imhist(fa),title('对比度拉伸后的直方图');
subplot(325),imshow(fb),title('直方图均衡后图');
subplot(326),imhist(fb),title('直方图均衡后的直方图');

运行截图:

用 matlab 对图片进行对比度和均衡度调整

相关文章:

  • 2022-01-08
  • 2021-12-28
  • 2022-12-23
  • 2022-12-23
  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
猜你喜欢
  • 2022-12-23
  • 2021-09-11
  • 2021-11-11
  • 2022-01-02
  • 2021-11-11
  • 2021-11-11
  • 2021-10-04
相关资源
相似解决方案