matlab出现了?Error using ==> times Matrix dimensions must agree.该怎么改?X=imread('d:/junzhilvbo.bmp');vHist=imhist(X);% X为待处理图像,map为图像的调色板[m,n]=size(X);% X为待处理图像,m为图像行数,n为图像列数p=vHist/(

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/20 09:35:41
matlab出现了?Error using ==> times Matrix dimensions must agree.该怎么改?X=imread('d:/junzhilvbo.bmp');vHist=imhist(X);% X为待处理图像,map为图像的调色板[m,n]=size(X);% X为待处理图像,m为图像行数,n为图像列数p=vHist/(
xToPWbhGGYfb $LPCK.˞p0`ʐ)I-`n3;ͧ~F&ĥ[:̚mzTMG2MFnYb4B2tI dUT$] l}+f6Y>KCBHÃMp˷3֊_5t+LWuR܀997ݰpC&646]\/FҠHw"g۸Vp_]<:dۭ(%'fkc>ruy]ZR?Zwp{3)PTC̻JY Kns2fF|(z Yqi3L~%5f $' qL^yGL /w"q7m~o{d_QĖ8]PSS $$ XlF^5i_P{=8>\F`^ ZD#/{Fu5޸mC;.9:v.PT I1S

matlab出现了?Error using ==> times Matrix dimensions must agree.该怎么改?X=imread('d:/junzhilvbo.bmp');vHist=imhist(X);% X为待处理图像,map为图像的调色板[m,n]=size(X);% X为待处理图像,m为图像行数,n为图像列数p=vHist/(
matlab出现了?Error using ==> times Matrix dimensions must agree.该怎么改?
X=imread('d:/junzhilvbo.bmp');
vHist=imhist(X);% X为待处理图像,map为图像的调色板
[m,n]=size(X);% X为待处理图像,m为图像行数,n为图像列数
p=vHist/(m*n);% 求各个灰度出现的概率
Pt=cumsum(p);%计算出选择不同t值时,A区域的概率
% 求不为零的灰度值概率的加权累加和
ut=cumsum((find (vHist>0)).*p);
ul=ut.*(length(ut));%求全图的灰度平均值
ua=ut./Pt;% 计算出区域A的加权灰度平均值
ub=(ul-ut)./(1-Pt);% 计算出区域B的加权灰度平均值
% 计算出选择不同t值时,区域间的方差
d=(ul.*Pt-ua).^2./(Pt.*(1-Pt));
[ans,threshold]=max(d);%threshold即为最佳阈值
threshold
Error using ==> times
Matrix dimensions must agree.

matlab出现了?Error using ==> times Matrix dimensions must agree.该怎么改?X=imread('d:/junzhilvbo.bmp');vHist=imhist(X);% X为待处理图像,map为图像的调色板[m,n]=size(X);% X为待处理图像,m为图像行数,n为图像列数p=vHist/(
就是矩阵的维数出问题了.仔细检查你的维数