Why i get this error
8 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Syeda Noor
el 25 de Dic. de 2020
Comentada: Walter Roberson
el 27 de Dic. de 2020
Undefined operator '&' for input arguments of type 'matlab.graphics.primitive.Image'. why i am getting this error. i have to multiply 2 binary images pixel by pixel in matlab. groungtruth and output are two binary images. both are same but are segmented with two different techniques.
function r=eval_metrics(output,groundtruth)
TP_image=groundtruth&output;
TP=sum(TP_image(:));% # of hits (True Positive)
FN_image=groundtruth&~output;
2 comentarios
Image Analyst
el 25 de Dic. de 2020
Editada: Image Analyst
el 25 de Dic. de 2020
Before the error, put this:
whos output
whos groundtruth
What do you see in the command window? How did you actually get the image that is not a logical array but is actually of type 'matlab.graphics.primitive.Image'?
Is this the same as https://www.mathworks.com/matlabcentral/answers/702337-why-i-get-this-error?s_tid=srchtitle
where we're not sure if you've accepted an answer or not and never attached your image so people can run your code. If so, then why? If not, what's the difference?
Rik
el 27 de Dic. de 2020
Respuesta aceptada
Steven Lord
el 25 de Dic. de 2020
Editada: Steven Lord
el 25 de Dic. de 2020
Generally you're going to want to perform arithmetic and/or logical operations on the image data not the image graphics object.
im = imread('eight.tif');
h = imagesc(im);
whos im h
Arithmetic and logical operations are defined on variables of class uint8 but not on variables of class matlab.graphics.primitive.Image.
im(1, 1) & im(1, 2) % works
h(1, 1) & true % does not work
13 comentarios
Más respuestas (0)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
