Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Help on showing a mask in an axes object for a MATLAB GUI

Asked by AP on 9 Feb 2013

Dear All,

I have designed a GUI which has an axes object. I want to create and overlay a mask on an image in the axes of the GUI, as shown below in the picture. I tried the tips in this link but MATLAB complains with the following error message:

The name 'AlphaData' is not an accessible property for an instance of class 'axes'.

My question is:

  • Then how can I overlay it on the original image (shown in grayscale in the image)?

In fact, the user selects an image by my MATLAB GUI. The code then identifies the areas in the image, which have certain properties, and highlight those areas with the pattern I showed in the uploaded picture. The final image, which is an overlay of the original image and the mask template, will be shown in an axes object in the GUI.

Thanks,

Ahmad

0 Comments

AP

2 Answers

Answer by Jan Simon on 10 Feb 2013
Accepted answer

Please post the code, which causes the error. The 'AlphaData' property should not be set for the AXES, but in:

set(h, 'AlphaData', alpha_data);

the handle "h" belongs to an image object. The error message appears, if you use the axes' handle instead.

0 Comments

Jan Simon
Answer by Image Analyst on 9 Feb 2013

4 Comments

Image Analyst on 9 Feb 2013

Sorry - I didn't notice because the URLs were different. However his code works fine for me. But he's using it on the handle of the image, not of the axes. What does your code do?

AP on 9 Feb 2013

The user selects an image by the MATLAB GUI. The code then identifies the areas in the image, which have certain properties, and highlight those areas with the pattern I showed in the uploaded picture. The final image, which is an overlay of the original image and the mask template, will be shown in an axes object in the GUI.

Image Analyst on 10 Feb 2013

Again, what does your code do? Can we see it?

Image Analyst

Contact us