how do I use Alphadata commands for image on GUIDE

1 回表示 (過去 30 日間)
vidya
vidya 2014 年 12 月 15 日
コメント済み: Image Analyst 2014 年 12 月 15 日
Dear Matlab expert group,
I am relatively new to matlab image processing and guide. I am struggling to use alphadata commands for image processing purposes in GUIDE. Please can someone share any information about the same. I have attached the initial figure and matlab file for your information. I was able to select an image and display it on an axes using the following
[fileinfo pathinfo] = uigetfile('*.*','File Selector');
image = strcat(pathinfo, fileinfo);
jpgimage = imread(image);
axes(handles.axes1);
x = imshow(jpgimage);
I am failing to add alphadata commands for a pushbutton that can be used to create a layer of alphadata on the existing image. I have put the commands below.
>> q = zeros(size(jpgimage));
>> q(:,:,:)=0.6;
>> PSF = fspecial('disk', 5);
>> Blurred = imfilter(q, PSF,'circular','conv' );
>> [r,c,~] = size(jpgimage);
>> [X Y] = meshgrid(1:r,1:c);
>> Z = mvnpdf([X(:) Y(:)], [r c]./2, diag(50.*[r c]));
>> Z = (Z-min(Z(:)))./range(Z(:));
>> Z = reshape(Z',[c r])';
>> fh = figure;
>> imshow(jpgimage,'Border','tight'), hold on
>> hImg = imshow(q,'Border','tight'); hold on
>> set(hImg, 'AlphaData',Z);
Thanks a lot for the help.
Kind Regards, Vidya

回答 (2 件)

Image Analyst
Image Analyst 2014 年 12 月 15 日

vidya
vidya 2014 年 12 月 15 日
Dear Image Analyst,
Please can you share basic steps to perform alphadata action on image in a graphic user interphase environment. Thanks a lot for the links.
Kind Regards,
Vidya
  1 件のコメント
Image Analyst
Image Analyst 2014 年 12 月 15 日
I don't know what that environment is. Don't Steve's commands work in that environment?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by