MATLAB图像处理,图形旋转处理,基本直方图,归一化直方图,直方图均衡,直方图匹配

  1. 图像旋转处理
    maketform:第一个参数‘affine’放射变换,第二个参数旋转结构参数
    imtransform:‘nearest’ 最近邻插值
    figure:创建一个用来显示图形输出的一个窗口对象
I=imread('rice.jpg');
tform=maketform('affine',[cos(pi/3),sin(pi/6),0;-sin(pi/6),cos(pi/3),0;0,0,1]);
B=imtransform(I,tform,'nearest');
figure;
subplot(1,2,1);
imshow(I);
subplot(1,2,2);
imshow(B);

在这里插入图片描述
2. 基本直方图
i=rgb2gray(i) //把三维图形转换为二维,即黑白图像
imhist(i) //基本直方图图像

i=imread('rice.jpg')
i=rgb2gray(i)
figure;
subplot(1,2,1);
imshow(i);
subplot(1,2,2),imhist(i);

在这里插入图片描述
3.直方图均衡
在这里插入图片描述

直方图均衡化方法可以产生一幅灰度级分布概率均匀的图像。
I=rgb2gray(I); //把三维图形转换为二维,即黑白图像
[B,T]=histeq(I); //进行均匀化处理,B表示返回的图像,T表示均匀化

I=imread('rice.jpg');
I=rgb2gray(I);
[B,T]=histeq(I);
subplot(2,2,1);
imshow(I);
subplot(2,2,2),imhist(I);
subplot(2,2,3),imshow(B);
subplot(2,2,4),imhist(B);

在这里插入图片描述

  1. 直方图匹配
    A=rgb2gray(A); //把三维图形转换为二维,即黑白图像
    [hgram2,x]=imhist(B); //把0-255颜色的数值分为2份,每一份的数量,例:第一份是0-127的数量,第二份是128到255的数量,x:表示把灰度级分为2份,即x轴255分为几等份
A=imread('a.png');
A=rgb2gray(A);
B=imread('rice.jpg');
B=rgb2gray(B);
[hgram2,x]=imhist(B);
J1=histeq(A,hgram2);
figure;
subplot(3,2,1),imshow(A),title('orig Image');
subplot(3,2,2),imhist(A),title('orig hist');
subplot(3,2,3),imshow(B),title('standard Image');
subplot(3,2,4),imhist(B),title('Standard hist');
subplot(3,2,5),imshow(J1),title('Changed Image');
subplot(3,2,6),imhist(J1),title('Changed hist');

在这里插入图片描述

  • 1
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值