Problem with imrect. All the GUI became a little part of the image.
조회 수: 1 (최근 30일)
이전 댓글 표시
I'm working on a GUI to process real time video. I could use without problem impixel, imrect, impoly... but I don't have any idea why now if I use imrect, instead of remaining in its axis, the image dissapear and all the background of the GUI window became a little part of it, for example all red.
Drawing a rectangle: https://www.dropbox.com/s/ue2pprb93g209ad/Rect.jpg Wrong situation: https://www.dropbox.com/s/24puvriha81dchy/wrong.jpg
I work with timer functions, but I tested that the problem remains even using imrect once. I also tried with another area ROI, imellipse, and the problem was the same.
The structure of the code is practically the same for points, rectangles, polylineas...
M file: https://www.dropbox.com/s/2mbfd95vc7vfw3d/GUI_Gobi.m Fif file: https://www.dropbox.com/s/zeozcymesfcfdbg/GUI_Gobi.fig
The explanations are in Spanish :( But I can translate it if you want.
IniciaButton_Callback runs image adquisition and plot frames to the axis (tag:visor)
It runs also TimerVideo, its timer function.
RawButtonDownFcn runs when the user click on the image, so the user can use different ROIs to measure (intensity in this case).
Lines 188 to 204 runs when you try to use a rentangle in the first pop-up menu (tag: TipoRoi1). The timer of this rectangle is TimerImRect1
PD: I'm sorry for not explain well the problem the first time, and apologize for my English (I meant GUI and axis)
Thank you very much!
EDIT: IMPORTANT: If I close Matlab and reopen it, it works properly. But only the first time I run the GUI.
EDIT: I think I solved the problem. I wrote in TimerVideo some codes that adjust the position of the axes (x, y , w, h). It works now, but I don't understand well why. Maybe imrect modified width and heigh of the axes?
I will update this topic if I find a better solution or I can clarify it.
댓글 수: 1
Image Analyst
2013년 5월 23일
편집: Image Analyst
2013년 5월 23일
I have trouble following your description. Who is "the guy"? What is a "visor" (other than a hat)? Is the visor on the guy?
Do you have any screenshots to help illustrate your situation? You ask us to fix code but you don't provide it. Recall we're still all waiting for the Mind Reading Toolbox - it's not been released yet.
답변 (1개)
David Sanchez
2013년 5월 23일
Did you try to make the background axis invisible to any plotting function?
ha = axes('units','normalized', 'position',[0 0 1 1]);% This creates the 'background' axes
uistack(ha,'bottom');% Move the background axes to the bottom
% Turn the handlevisibility off so that we don't inadvertently plot into the axes again
% Also, make the axes invisible
set(ha,'handlevisibility','off', 'visible','off')
참고 항목
카테고리
Help Center 및 File Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!