What does ~= means in image segmentation??
3 次查看(过去 30 天)
显示 更早的评论
Hello...
What does this error means? How to resolve it?? Please help this is related to MRF segmentation
Error message:
Subscripted assignment dimension mismatch.
Error in EnergyOfLabelField
E(:,i)=sum(Nei8~=i,2);
I don't know how to resolve it....Please help me and solve this issue.. I am attaching my code too so that you can check. Please reply asap.
采纳的回答
Image Analyst
2017-9-13
~ means "not", so "Nei8~=i" means "Nei8 not equal to i".
3 个评论
Walter Roberson
2017-9-13
The code
E=zeros(n,class_number);
for i=1:class_number
E(:,i)=sum(Nei8~=i,2);
end
assumes that the result of sum(Nei8~=i,2) is a vector of length n. That would happen if Nei8 is a column vector of length n rows, or if it is a 2D array with n rows. It would not be the case if Nei8 is a 3 or more dimensional array, and it would not be the case if Nei8 is empty.
You should give the command
dbstop if error
and run your code. When it stops, ask it to display n and to display size(Nei8): if Nei8 is not n x something then you have a problem.
Image Analyst
2017-9-14
It will throw an error on this line first:
Nei8=imstack2vectors(NeiX(segmentation));
because NeiX was not passed in or defined within the function. Who wrote this weird code for you anyway? Can't you ask the author?
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!