I have 2 images and i choose one from popup menu then i choose the type of noise from another popup menu to make it on the choosen image how??

Answers (1)

You could make the image global in the first callback, or you could call getimage() in the noise callback. In the callback for the popup about noise, get the value and apply the noise you want:
theImage = getimage(handles.axesImage);
noiseSelection = get(handles.popNoise, 'Value');
switch noiseSelection
case 1
noisyImage = imnoise(theImage, ......);
case 2
noisyImage = imnoise(.....); % noise type 2
end
imshow(noisyImage);

5 Comments

popNoise would be whatever you called the popup menu control in GUIDE. For example you might call it popup1 or popupmenu1 or popNoise, or whatever.
Value is the property that tells you what item the user has selected and is showing in the popup menu. For example if they chose the third item in the list, the value would be 3.
Shimaa what you did As it still doesn't work with me !

Sign in to comment.

Categories

Find more on Modeling in Help Center and File Exchange

Asked:

on 22 Nov 2015

Commented:

on 25 Nov 2015

Community Treasure Hunt

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

Start Hunting!