图像的代数运算,包括对图像的加法,减法,乘法,除法等运算。
展示表现的形式即为一些基本操作。
阈值图像、去背景图,放缩比例等。
如下展示:
clear all;close all;clc;
II=imread('dfgdg.jpg');%读取图像
subplot(241);imshow(II);title('原始图像');
TT=graythresh(II);
AA=im2bw(II,TT);%自适应阀值,并使用该阀值对图像进行二值变换
subplot(242);imshow(AA,[]);title('阈值图像');
subplot(243);
surf(double(II(1:8:end,1:8:end))),zlim([0 255]);title('原始图像surf三维可视化');
background=imopen(II,strel('disk',15));
JJ=imsubtract(II,background);%去除背景的图像
% JJ=imsubtract(II,52);%减去任意常量值,去除任意像素
subplot(244);imshow(JJ);title('去背景后的图像');
KK=imadd(JJ,80);
subplot(245);imshow(background);title('背景图像');
Kkk=imadd(JJ,80);
subplot(246);imshow(Kkk);title('调整对比度');
CCS=immultiply(KK,0.5);%图像放缩像素
subplot(247);imshow(CCS);title('图像放缩像素');
BLL=imdivide(JJ,1.2);%乘除任意比例后像素
subplot(248);imshow(BLL);title('像素比例图');
效果如图: