Note that there are some explanatory texts on larger screens.

plurals
  1. PODrawing circles/squares on an image where the user specifies
    primarykey
    data
    text
    <p>I have a GUI in MATLAB created using <code>guide</code>. So far the user can import an image and save the image. My next step is to allow the user to click on the image to place a circle/square, doesn't matter which, the easier one to implement. Ideally I would like to make it so the latest one created is undoable but the basic implementation is paramount.</p> <p>I'm assuming for the actual drawing of the circle that using PLOT will fine, as mentioned in several other questions. What I'm not sure of is how I would go about getting the location in the image of the mouse click to then place the PLOT at that location. </p> <hr> <p><strong>EDIT:</strong> Here's the main bit of code that I have for the working parts at the moment.</p> <pre><code>function V1Open_Callback(hObject, eventdata, handles) % hObject handle to V1Open (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) hMainGui = getappdata(0, 'hMainGui'); fileName = uigetfile('*.jpg'); setappdata(hMainGui, 'fileName', fileName); updateAxes1 function updateAxes1 hMainGui = getappdata(0, 'hMainGui'); fileName = getappdata(hMainGui, 'fileName'); imshow(imread(fileName)) % --- Executes on button press in V1Save. function V1Save_Callback(hObject, eventdata, handles) % hObject handle to V1Save (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) imsave; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload