I'm having a code that crops a portion of the image and finds the length of the line drawn on the image in terms of pixels. I'm new to MATLAb and a student so can someone help me out ?

Réponses (2)

Adam
Adam le 14 Mar 2015

0 votes

You can use Guide to create a GUI and then call your .m file function from a callback of a pushbutton or whatever control you want to use to trigger your code.

4 commentaires

NeoSeeker
NeoSeeker le 14 Mar 2015
Can you show me how with an example, from the scratch will be great. And how do I call my .m file function ?
Jan
Jan le 14 Mar 2015
@NeoSeeker: You find many GUI examples in the net and in the documentation of Matlab. It would not be efficient, if someone creates a new example here in the forum. The M-file is called as usual simply be using its name.
NeoSeeker
NeoSeeker le 16 Mar 2015
I tried using the GUIDE method for creating the GUI but I have no idea how to apply the function . Can you tell me with an example of how to apply the function?
If you create a pushbutton then (assuming you have default GUIDE settings so that it created a .m file with the .fig) you will have a callback function for that
pushbutton1_Callback
if you didn't change the button's tag.
In that function you can call your other function although if you have inputs and outputs then that is more complicated as you need to get the inputs from somewhere.
Outputs can be saved on the handles structure as e.g.
handles.result = someFunction( );
guidata( hObject, handles )

Connectez-vous pour commenter.

Image Analyst
Image Analyst le 14 Mar 2015
Description
This GUI will help the novice user get up to speed very quickly on using GUI-based applications. Everything is laid out in a very simple Step 1, Step 2, Step 3, etc. layout. It is a very good starting point for a typical image analysis application. This application uses GUIDE to do the user interface design, and has most of the basic controls such as buttons, listboxes, checkboxes, radio buttons, scrollbars, etc. It allows the user to select a folder of images, select one or more images and display them, to select a series of options, and to individually or batch process one or more images. The user can....................

2 commentaires

Image Analyst
Image Analyst le 16 Mar 2015
See my attached spatial calibration demo that lets you draw a line and get the length. Put that code into a callback function of your GUI.
NeoSeeker
NeoSeeker le 20 Mar 2015
Thank you Image Analyst, I didn't the part where I need to enter the real life distance. Can you explain that part of the code?

Connectez-vous pour commenter.

Catégories

En savoir plus sur Convert Image Type dans Centre d'aide et File Exchange

Question posée :

le 14 Mar 2015

Commenté :

le 20 Mar 2015

Community Treasure Hunt

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

Start Hunting!

Translated by