Tip:
Highlight text to annotate it
X
Hello, my name is Midshipman Bobby Nordlund
and I worked with Midshipman Gregg Hase
on our "ES450" Intro to Robotics final project.
Our project involved designing a
graphical user interface, or GUI,
to enable live thresholding in MATLAB—
a capability that enables the user
to both identify and specify
what the computer sees in real-time.
Our GUI is designed to be useful,
so it has a function within it
that gets called every time
a frame is analyzed, that is meant to be
customized to do whatever task it is
the user wants to perform.
We used MATLAB’s GUI Design Environment, or GUIDE—
which you can think of as a GUI for making GUIs—
to assist in the process.
It can be accessed by
entering "guide" into the command window.
One of the downsides of
developing a GUI in GUIDE versus writing
one programatically is that
the finished product involves two files versus one:
one that controls the GUI’s behavior
and one that controls its appearance.
Nevertheless, these two files here,
thresholding.fig and thresholding.m,
are the only two necessary for this demonstration.
Our GUI is accessed by entering
"thresholding" into the command window.
Immediately, you see a preview
that comes from a modified version of
Professor Esposito’s "InitUsbCamera" function
buried within "thresholding".
I stuck a lint roller and a "cat’s claw"
on the shelf behind my PC as an example,
and as you can see, the preview is live.
When you click the Analyze button,
the GUI begins an image analysis loop
where the preview is replaced by
frame after frame after frame
along with an overlay corresponding to the intersection
of the threshold parameters set on the left hand side
(much like Lab 9).
Details about what the computer sees
are displayed below the image,
calculated from moment and Hu functions
much like those used in Lab 10.
So, first thing I’ll try to do is
zero-in on the lint roller.
Alright, so that’s pretty close.
And as you can see, the principal angle is -90,
so it’s pointing to the left,
and it does respond to variations in pitch.
So, my second demonstration I’ll try to
zero-in on this "cat’s claw."
Alright, so that’s a much better fix
than the green lint roller, and it too is fairly-
fairly responsive to changes in pitch as you can see;
I can get the principal angle to almost vertical
depending on the orientation of the "cat’s claw."
So when I press the start button (down here),
a customizable function is introduced into the loop.
Right now it’s simply the "why" command,
which you can see is
displaying answers in the command window.
Modifying it is pretty intuitive, and the code is well documented.
Pressing the stop toggle,
you can see the GUI ceases looping the customizable function,
and pressing the "stop analysis toggle"
completes the GUI’s graceful degradation.
The customizable function "do" is close to line 200,
as you can see.
It just displays "why."
You can put any function in there;
just remember whatever function is put in there
is being looped, so take that into consideration.