Error while evaluating DestroyedObject Callback.
14 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Cesar Ramirez
il 3 Mar 2019
Commentato: Cesar Ramirez
il 4 Mar 2019
Hello everyone, I'm having an error while I activate my Android's Camera, basically I have this code, and it works, but when a press the button X from the window.
This is the code I'm using to activate my camera.
url = 'http://192.168.0.3:8080/shot.jpg';
ss = imread(url);
fh = image(ss,'Parent',handles.axes1);
while(1)
ss = imread(url);
set(fh,'CData',ss);
drawnow;
end
This is the error:
Error using matlab.graphics.primitive.Image/set
Invalid or deleted object.
Error in imagen>actdrd_Callback (line 584)
set(fh,'CData',ss);
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in imagen (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
matlab.graphics.internal.figfile.FigFile/read>@(hObject,eventdata)imagen('actdrd_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating DestroyedObject Callback.
I think the error is the while, but I don't know how to fix it, I tried it, I new on matlab. I hope you can help. Thanks.
0 Commenti
Risposta accettata
Walter Roberson
il 4 Mar 2019
You have an infinite loop. I think you probably attempt to get out of the loop by closing the figure: if you do that then the axes would get deleted and the image would get deleted, making it impossible to update the CData property.
If you want to be able to close the figure then you need to be testing for the image object having been deleted
if ~isvalid(fh); break; end
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Graphics Performance in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!