数字图像灰度变换matlab

约定不等于承诺〃 2022-12-19 11:39 448阅读 0赞
  1. clear;
  2. i = imread('hj.jpg');
  3. i = im2double(rgb2gray(i));
  4. [m,n] = size(i);
  5. fa = 1.25;fb=0;
  6. o = fa.*i+fb/255;
  7. figure(1),subplot(221),imshow(o);
  8. figure(2),subplot(221),[H,X]=imhist(o,64);
  9. stem(X,H/m/n,'.');
  10. fa = 0.5;fb=0;
  11. o = fa.*i+fb/255;
  12. figure(1),subplot(222),imshow(o);
  13. figure(2),subplot(222),[H,X]=imhist(o,64);
  14. stem(X,H/m/n,'.');
  15. fa = 0.5;fb=50;
  16. o = fa.*i+fb/255;
  17. figure(1),subplot(223),imshow(o);
  18. figure(2),subplot(223),[H,X]=imhist(o,64);
  19. stem(X,H/m/n,'.');
  20. fa = -1;fb=255;
  21. o = fa.*i+fb/255;
  22. figure(1),subplot(224),imshow(o);
  23. figure(2),subplot(224),[H,X]=imhist(o,64);
  24. stem(X,H/m/n,'.');

输出结果:
在这里插入图片描述

发表评论

表情:
评论列表 (有 0 条评论,448人围观)

还没有评论,来说两句吧...

相关阅读