필터 지우기
필터 지우기

Why my GUI (made with guide) opens with a specific image on my computer, and gives error while loading another one?

조회 수: 1 (최근 30일)
This is the error I get, when I try to load new image (the image is loaded my moving cursor on GUI gives this error):
*Error while evaluating Figure WindowButtonMotionFcn
Error using matlab.graphics.primitive.Image/get Invalid or deleted object.
Error in impixelinfoval/displayPixelInfo (line 126) elseif strcmp(get(him,'tag'),'rset overview')
Error in iptaddcallback/callbackProcessor (line 147) fun(varargin{:});
Error while evaluating Figure WindowButtonMotionFcn*
Previously it was working fine. Now when I load the GUI by running .m file, it opens in one folder above and not in the same folder :(. Please help!!! I am using MATLAB 2016a
  댓글 수: 2
Adam
Adam 2016년 3월 22일
You haven't given enough information. We don't know what is in your WindowButtonMotionFcn.
If it is doing something expecting an image to be there, but you have temporarily deleted the image while you load another one then that would lead to something similar to that.
I'm not really sure what you mean about the folder in which it opens and how that related to the error you mention.
Arif ul Maula
Arif ul Maula 2016년 3월 23일
AIM: OK, I am developing a GUI on MATLAB for image analysis. It should be able to work on other computers with no MATLAB. This means it should be able to read data present in the different folders on other computers.
PROBLEMS: I have created one GUI with GUIDE and created a window app using deploytool in MATLAB 2016b. It worked fine with images in the same folder as my .exe file for that app is present after deployment, but not for other directories. I put 3 different images in the same folder as the .exe. It worked fine with images for some days. It always load with the default graph with axis. So, normally I load one of 3 images and do analysis. But some days ago, it always open up with one of the images and when I read a second image through it, the image is loaded and errors as written in previous post keep on appearing.
THINGS TO DO:
I would like to know what could have possibly happened. If you would like to see the code, I can share with you.
Secondly, I would really like to know why I am not able to read the images from other directories. I am using: foldername = uigetdir(); However, I noted one thing that it runs this command and only add directory of app , no matter what I select.
I would really appreciate your help.
best regards.

댓글을 달려면 로그인하십시오.

채택된 답변

Image Analyst
Image Analyst 2016년 3월 23일
편집: Image Analyst 2016년 3월 23일
Most likely you're not specifying the full filename properly.
Also, let's see what you do between calling uigetdir() and imread() or whatever.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by