سؤال

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