How to open image using fopen and preprocess in GUI

6 次查看(过去 30 天)
I want to select raw image using "pushbutton" 'Select Image'
Then using another "Pushbutton" 'Preprocess' I want to pre process the same
The whole code is
fi=fopen('JPCLN001.img','r','b');
img=fread(fi,[2048 2048],'*uint16','b');
img1=mat2gray(img, [0,4096]);
img2=imrotate(img1,-90);
img2=flip(img2,2); %Horizantal Flip
%subplot(1,2,1);
figure,imshow(img2),title('Original');
img3=imcomplement(img2);
%subplot(1,2,2);
figure,imshow(img3),title('negative');
medf=medfilt2(img3,[3 3]);
%subplot(1,2,1);
figure,imshow(medf),title('Med_filtered');
img4=imadjust(medf);
%subplot(1,2,2);
figure,imshow(img4),title('Contrast1');
img5=histeq(img4);
%subplot(1,2,1);
figure,imshow(img5),title('Hist_Equa');

回答(2 个)

Walter Roberson
Walter Roberson 2015-7-5
编辑:Image Analyst 2015-7-5
Have the callback function for uicontrol('style','push') call uigetfile() . Store the information about the directory and the file name in a place that can be found by the pushbutton for preprocessing.
  2 个评论
Dnyanesh Kanade
Dnyanesh Kanade 2015-7-5
If it is so, how it would be with above code given? As I am new to GUI
Jan
Jan 2015-7-5
@Dnyanesh Kanade: As soon as you try it by your own, you will not be new in this field anymore. Read the suggested tutorials and you are an experienced GUI programmer. Just try it and post, what you have written so far in case of problems.

请先登录,再进行评论。


Jan
Jan 2015-7-5
To learn the basics about creating GUI programmatically (not using GUIDE) see: http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples
  3 个评论
Image Analyst
Image Analyst 2015-7-5
I've uploaded several tutorials into my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862, along with several hundred others I've uploaded to the Answers forum. What do you need? Steve Eddins blog also posts Image Processing Tutorials: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
Jan
Jan 2015-7-5
@Dnyanesh Kanade: You did not ask a question about image processing, but about using buttons. The usage of buttons is explained very well in these tutorials.

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by