matlab 图像融合后 怎么求图像的均值,
来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/07/12 03:50:13
matlab 图像融合后 怎么求图像的均值,
![matlab 图像融合后 怎么求图像的均值,](/uploads/image/z/10952159-23-9.jpg?t=matlab+%E5%9B%BE%E5%83%8F%E8%9E%8D%E5%90%88%E5%90%8E+%E6%80%8E%E4%B9%88%E6%B1%82%E5%9B%BE%E5%83%8F%E7%9A%84%E5%9D%87%E5%80%BC%2C)
说明:该程序的作用是计算输入图像img的平均梯度值AVEGRAD
平均梯度值可以衡量图像细节反差表达的能力,是图形融合结果的一个评价算子之一
function AVEGRAD=avegrad(img)
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% this function is used to calculate
%%%% the average gradient of an image.
%%%% date :2009-4-15
%%%% 平均梯度可敏感地反映图像对微小细节反差表达的能力,可用来评价图像的模糊程度
%%%% 在图像中,某一方向的灰度级变化率大,它的梯度也就大.因此,可以用平均梯度值
%%%% 来衡量图像的清晰度,还同时反映出图像中微小细节反差和纹理变换特征.
img=double(img);
[M,N]=size(img);
gradval=zeros(M,N); %%% save the gradient value of single pixel
diffX=zeros(M,N); %%% save the differential value of X orient
diffY=zeros(M,N); %%% save the differential value of Y orient
tempX=zeros(M,N);
tempY=zeros(M,N);
tempX(1:M,1:(N-1))=img(1:M,2:N);
tempY(1:(M-1),1:N)=img(2:M,1:N);
diffX=img-tempX;
diffY=img-tempY;
diffX(1:M,N)=0; %%% the boundery set to 0
diffY(M,1:N)=0;
diffX=diffX.*diffX;
diffY=diffY.*diffY;
AVEGRAD=sum(sum(diffX+diffY));
AVEGRAD=sqrt(AVEGRAD/2);
AVEGRAD=AVEGRAD/((M-1)*(N-1));
end
我也在找呢,发现一个,共同参考下吧.
平均梯度值可以衡量图像细节反差表达的能力,是图形融合结果的一个评价算子之一
function AVEGRAD=avegrad(img)
%%%%%%%%%%%%%%%%%%%%%%%%%
%%%% this function is used to calculate
%%%% the average gradient of an image.
%%%% date :2009-4-15
%%%% 平均梯度可敏感地反映图像对微小细节反差表达的能力,可用来评价图像的模糊程度
%%%% 在图像中,某一方向的灰度级变化率大,它的梯度也就大.因此,可以用平均梯度值
%%%% 来衡量图像的清晰度,还同时反映出图像中微小细节反差和纹理变换特征.
img=double(img);
[M,N]=size(img);
gradval=zeros(M,N); %%% save the gradient value of single pixel
diffX=zeros(M,N); %%% save the differential value of X orient
diffY=zeros(M,N); %%% save the differential value of Y orient
tempX=zeros(M,N);
tempY=zeros(M,N);
tempX(1:M,1:(N-1))=img(1:M,2:N);
tempY(1:(M-1),1:N)=img(2:M,1:N);
diffX=img-tempX;
diffY=img-tempY;
diffX(1:M,N)=0; %%% the boundery set to 0
diffY(M,1:N)=0;
diffX=diffX.*diffX;
diffY=diffY.*diffY;
AVEGRAD=sum(sum(diffX+diffY));
AVEGRAD=sqrt(AVEGRAD/2);
AVEGRAD=AVEGRAD/((M-1)*(N-1));
end
我也在找呢,发现一个,共同参考下吧.