资源简介

这是我自己写的对图像进行预处理的matlab源程序,主要是对图像进行光照补偿、旋转与尺度归一化。上传上来和大家一起学习、分享。

资源截图

代码片段和文件信息

clear all
rgb_image1=imread(‘2.bmp‘);
figureimshow(rgb_image1);

%提取分量图像。
fR1=double(rgb_image1(::1));
fG1=double(rgb_image1(::2));
fB1=double(rgb_image1(::3));

rgb_image2=imread(‘5.bmp‘);
figureimshow(rgb_image2);

fR2=double(rgb_image2(::1));
fG2=double(rgb_image2(::2));
fB2=double(rgb_image2(::3));

%还原图像
%rgb_image4=cat(3fR1fG1fB1);
%figureimshow(uint8(rgb_image4));

%取图像大小
[xy]=size(fR1);

%计算两幅图像各自的R、G、B分量的均值和方差
R1=mean(mean(fR1));%均值
G1=mean(mean(fR1));
B1=mean(mean(fR1));
r1=mean(var(fR1));%方差
g1=mean(var(fG1));
b1=mean(var(fB1));
R2=mean(mean(fR2));
G2=mean(mean(fR2));
B2=mean(mean(fR2));
r2=mean(var(fR2));
g2=mean(var(fG2));
b2=mean(var(fB2));

%装换图像
gray1=rgb2gray(rgb_image1);
gray2=rgb2gray(rgb_image2);

%计算图像的亮度均值
M1=mean(mean(mean(gray1)));
M2=mean(mean(me

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1219  2008-10-24 08:50  succeed\light.m

     文件        237  2008-10-21 21:00  succeed\myresize.m

     文件       1181  2008-10-24 08:43  succeed\myrotate.m

     文件        351  2008-10-21 09:06  succeed\newimage.m

     文件        763  2008-10-18 19:27  succeed\newmap.m

     目录          0  2008-11-13 00:11  succeed

----------- ---------  ---------- -----  ----

                 3751                    6


评论

共有 条评论