문제

How do I display the image below on an axis in MATLAB with its transparency. The code below which worked with me for other transparent images does not seem to work with the image below.

A= imread('54fSK.png');
hhimage= imshow(A);
set(hhimage, 'AlphaData', A);

It gives me this error:

Error using set

Bad property value found.

Object Name: image Property

Name: 'AlphaData'.

This is the image I want to display with transparency:

Image I want to display with transparency

도움이 되었습니까?

해결책

Your A is of dimension 135x97x3, AlphaData should be of dimension 135x97x1.

try: set(hhimage, 'AlphaData', A(:,:,1));

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top