chenwenyan

图像减法运行涉及到imsubtract函数

实现代码如下:

clear all;          %关闭当前所有图形窗口,清空工作空间变量,清除工作空间所有变量
clc
close all;
A=imread(\'cameraman.tif\');
B=imread(\'testpat1.png\');
C=imsubtract(A,B);  %进行图像减法
set(0,\'defaultFigurePosition\',[100,100,1000,500]);%修改图形图像位置的默认设置
set(0,\'defaultFigureColor\',[1 1 1])%修改图形背景颜色的设置
figure,%显示原图像及差异图像
subplot(141),imshow(A);  %显示原图像
subplot(142),imshow(B);  %显示原图像
subplot(143),imshow(C);
subplot(144),imshow(255-C);% 显示差异图像

  画出来的效果图如下:

分类:

技术点:

相关文章:

  • 2021-11-23
  • 2022-01-06
  • 2022-02-11
  • 2021-12-05
  • 2021-04-09
  • 2021-12-15
  • 2021-12-15
猜你喜欢
  • 2021-11-17
  • 2021-11-19
  • 2021-11-29
  • 2021-11-17
  • 2021-10-21
  • 2021-07-21
相关资源
相似解决方案