Menu Fuction Photoshop Image
1 次查看(过去 30 天)
显示 更早的评论
I have to make a menu with many photoshop options etc. After the user picks an option, the image will change accordingly. My question is how to make the menu reappear without reevaluating the cell? This is what I have so far. I haven't finished several of the options so any advice/pointers/help would be greatly appreciated
clear, clc
P=menu('Photoshop','Import','Array Properties','Darken','Lighten','Reduce Number of Bits','Increase Contrast','Decrease Contrast','Sharpen Image','Soften Image','Crop','Reduce Array Size','Negative','Color Change','Chromakey','End');
if P==1
Photo=imread('baboon','bmp');
end
if P==2
Photo = imshow('baboon.bmp');
attrs = imattributes(Photo)
title('Original Photo with Properties in Command Window')
end
if P==3
figure(1)
imshow('baboon.bmp');
title({'Original'})
figure(2)
Photo=imread('baboon.bmp')-75;
imshow(Photo)
title({'Darker'})
end
if P==4
imread('baboon.bmp')
figure(1)
imshow('baboon.bmp');
title({'Original'})
figure(2)
Photo=imread('baboon.bmp')+75;
imshow(Photo)
title({'Lighter'})
end
if P==5
x=imread('baboon.bmp');
Photo=double(x);
figure(1)
figure(2)
figure(3)
[bit3,map]= rgb2ind(rgb,8,x);
imshow(bit3,map);
figure(4)
figure(5)
figure(6)
figure(7)
figure(8)
end
if P==6
Photo=imread('baboon.bmp');
figure(1)
imshow('baboon.bmp');
title({'Original'})
figure(2)
Photo2=1.5*Photo;
imshow(Photo2)
title({'More Contrast'})
end
if P==7
Photo=imread('baboon.bmp');
figure(1)
imshow('baboon.bmp');
title({'Original'})
figure(2)
Photo2=.5*Photo;
imshow(Photo2)
title({'Less Contrast'})
end
if P==8
Photo=im2double(imread('baboon.bmp'));
imshow(Photo)
end
if P==9
end
if P==10
Photo=imread('baboon.bmp');
imagesc(Photo); axis image
colormap(gray)
Crop = ginput(2);
a = min((Crop(1)), (Crop(2)));
A=fix(a);
b = min((Crop(3)), (Crop(4)));
B=fix(b);
c = max((Crop(1)), (Crop(2)));
C=fix(c);
d = max((Crop(3)), (Crop(4)));
D=fix(d);
Photo2 = Photo(B:D,A:C);
figure(1)
imagesc(Photo2)
title({'Crop'})
figure(2)
imagesc(Photo);
colormap(gray)
title({'Original'})
end
if P==11
end
if P==12
Photo=imread('baboon.bmp');
figure(1)
imshow('baboon.bmp');
title({'Original'})
figure(2)
Photo=255-imread('baboon.bmp');
imshow(Photo)
title({'Negative'})
end
if P==13
Photo=imread('baboon.bmp');
figure(1)
imshow('baboon.bmp');
title({'Original'})
figure(2)
imshow(Photo)
colormap(jet)
title({'Jet Colormap'})
end
if P==14
end
if P==15
break
end
0 个评论
回答(1 个)
Image Analyst
2012-7-23
I don't know what you mean "without reevaluating the cell." What cell? When the user clicks on the menu item, it will drop down the menu just like any other program. There is a menu editor in GUIDE - maybe you should try it.
2 个评论
Image Analyst
2012-7-23
I don't know what that mass of code up there does but I'd do like I said. Use GUIDE to create an application that has an axes for your image, and a pulldown menu to do the various operations on your image and then display the results. Use MAGIC ( http://www.mathworks.com/matlabcentral/fileexchange/24224) if you want a nice framework to start out with.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!