Azzera filtri
Azzera filtri

Problem with imrect. All the GUI became a little part of the image.

2 visualizzazioni (ultimi 30 giorni)
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 Commento
Image Analyst
Image Analyst il 23 Mag 2013
Modificato: Image Analyst il 23 Mag 2013
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.

Accedi per commentare.

Risposte (1)

David Sanchez
David Sanchez il 23 Mag 2013
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')
  1 Commento
Alejandro López
Alejandro López il 23 Mag 2013
Modificato: Alejandro López il 23 Mag 2013
I'm going to try this, thank you.
I edit mi first post to clarify the question too.
PD: Tried, it doesn't fix the problem.

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by