This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| saveas( handles.axes2 , 'D:/maj proj/samples/output.jpg' ); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| F = getframe(handles.axes2); | |
| Image = frame2im(F); | |
| imwrite(Image,'D:/folder/output.jpg','jpg'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (strcmp('a','radiobutton1') | |
| imshow(c,'Parent',handles.axes2); | |
| elseif (strcmp('b','radiobutton2')) | |
| imshow(b,'Parent',handles.axes2); | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function pushbutton1_Callback(hObject, eventdata, handles) | |
| a=get(handles.edit1, 'string'); | |
| b=imread(a); | |
| c=rgb2gray(b); | |
| imshow(c,'Parent',handles.axes2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| image=get(handles.edit1, 'string'); | |
| imshow(image,'Parent',handles.axes2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| imgurl = strcat(pn,fn); | |
| set(handles.edit1,'string',imgurl); | |
| I = imread(imgurl); | |
| imshow(I,'Parent',handles.axes1); | |
| guidata(hObject, handles); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function pushbutton2_Callback(hObject, eventdata, handles) | |
| % above line of code is default line ofcode for button | |
| % an example to open image files only | |
| % when button is clicked, a dialog box appears to select the file | |
| handles.output = hObject; | |
| [fn pn] = uigetfile( { | |
| '*.png;*.jpg;*.jpeg;*.gif','Image Files (*.png, *.jpg, *.jpeg, *.gif)'; ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % --- Executes on button press in pushbutton2. | |
| function pushbutton2_Callback(hObject, eventdata, handles) | |
| handles.output = hObject; | |
| [fn pn] = uigetfile('*.png','select png file'); | |
| complete = strcat(pn,fn); | |
| set(handles.edit1,'string',complete); | |
| I = imread(complete); | |
| imshow(I,[]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % code by juniorhero to show image in axes in gui | |
| axes(handles.axes2); | |
| imshow('D:\maj proj\samples\Lenna.png') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| a=imread('Koala.jpg'); | |
| b=255-a | |
| subplot(1,2,1) | |
| imshow(a) | |
| title 'Original Image' | |
| subplot(1,2,2) | |
| imshow(b) | |
| title 'Negative Image' |