17 回归法做图像变化检测——建立图的回归等式(matlab程序)

1.简述

      

       回归是确定两种或两种以上的变量间相互依赖的定量关系的方法。映射到本文就是用我们图像数据去预测该图像上衣服的价格。说直白点,就是通过X与Y确立函数关系式,只不过X换成了图片罢了。

 

2.代码

 

%%  建立图的回归等式
image1=imread('11.TIF');
image2=imread('22.TIF');

figure,imshow(image1);
figure,imshow(image2);

image1=rgb2gray(image1);
image2=rgb2gray(image2);
same_sample1=image1(1:131,158:364);
same_sample2=image2(1:131,158:364);

same_sample1=double(same_sample1);
same_sample2=double(same_sample2);
figure,imshow(uint8(same_sample1));
[r1,c1]=size(same_sample1);
[r2,c2]=size(same_sample2);
sample1=reshape(same_sample1,1,r1*c1);
sample2=reshape(same_sample2,1,r2*c2);
p=polyfit(same_sample1,same_sample2,1);
norm_image=polyval(p,double(image1));

[rx,cx]=size(image22);

varia_domain=norm_image-double(image22(1:rx,1:cx));
figure,imshow(varia_domain)

 

3.运行结果

3d874b7e0ecf46cda0c6994fae71f849.png

 f36eb5c449154f4eabcdb680210e7ebb.png

 57aaa8f5803e44beb763da26032ef094.png

 573599a64b8a4c1388fdfbe0a6c55459.png

 d293ce6ea4694884844f61e2cdc9d212.png

 8336f72728d543e09dfcb97712ae96ca.png

 6c0f6011c8384a6a859369cd46c12c45.png

 1446af1a48664ee68502f9fdfe2140de.png

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

素馨堂

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值