What does ~= means in image segmentation??
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
begginer01
el 13 de Sept. de 2017
Comentada: Image Analyst
el 14 de Sept. de 2017
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.
Respuesta aceptada
Image Analyst
el 13 de Sept. de 2017
~ means "not", so "Nei8~=i" means "Nei8 not equal to i".
3 comentarios
Walter Roberson
el 13 de Sept. de 2017
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
el 14 de Sept. de 2017
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?
Más respuestas (0)
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!