How to open image using fopen and preprocess in GUI

조회 수: 6 (최근 30일)
Dnyanesh Kanade
Dnyanesh Kanade 2015년 7월 5일
댓글: Jan 2015년 7월 5일
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.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by