Help on showing a mask in an axes object for a MATLAB GUI
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
Jan
2013년 2월 10일
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
추가 답변 (1개)
Image Analyst
2013년 2월 9일
This is covered in Steve's blog: http://blogs.mathworks.com/steve/2009/02/18/image-overlay-using-transparency/
댓글 수: 4
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!