I need to write a GUI that shows an image and allows to draw on it by selecting different colors

2 visualizzazioni (ultimi 30 giorni)
I was looking at the 45 sample GUIs
I need something similar to that shown in GUI 39.
The only difference is that the drawing must be done not on a white image but on a specific image.
Then I would need another gui that works with to images, with the same size (which are image A and ASeg, which is the result of segmenting image A)
The GUI should show imag ASeg, and allow the user must to zoom on it. By zooming the user sees just a portion ASeg_Sub of image ASeg. Now, if the user clicks on the image, the GUI should switch the view and show the image A, and precisely the same portion A_Sub.
I hope I have been clear. Could you help me please?

Risposte (1)

Image Analyst
Image Analyst il 23 Mag 2019
Attached is a masking demo and a drawing demo that may give you a start.
  4 Commenti
Image Analyst
Image Analyst il 25 Mag 2019
Spostato: DGM il 14 Feb 2023
Were you using the setColor() method of imfreehand()? Let's see your code.
Elena Casiraghi
Elena Casiraghi il 26 Mag 2019
Spostato: DGM il 14 Feb 2023
Here you get the code.
The code starts with CorrectMarkersLater, which calls correctMarkersNow, which calls pointsInPoly.
The aim is to show all RGB images in a directory: (correctMarkersLater). For each image, there is an RGB which shows the result of segmentation with red color/yellow color/green color. CorrectmarkersNow shows the image with segmentation results and asks the user to select areas containing wrong segmentations. Where the user selects the areas, for each areas: the areas is shown and the user is asked to select areas that must be removed or to draw the border of missing areas (pointsInPoly). The drawing is made in pointInPoly.m, and here is the problem.
I would like to code pointsInpoly by substituting the getline(...,'closed') with something that:
1) let's the user zoom on the image,
2) if the user simply clicks (intead of drawing a closed line) on the zoomed images, I would like to swith the view on the same zoomed portion of the original image (without segmentation)
3) eventually draw a line after zooming and clicking to view the original image,
4) eventually zoom out,...
With getline I can recognized if the user does a double click or draws a closed curve, HOWEVER:
  • when calling getline the zoom option on the figure goes off
  • Even if the zoom was on... I don't know how to retrieve the portion of the image showed after zooming ... therefore I don't know which portion of Original image to show
I hope I have been clear
THANKS FOR YOUR HELP!

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by