logging in or signing up MATLAB and Digital Image Processing Niteesh Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT lite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: Embed: Flash iPad Copy Does not support media & animations WordPress Embed Customize Embed URL: Copy Thumbnail: Copy The presentation is successfully added In Your Favorites. Views: 1770 Category: Science & Tech.. License: All Rights Reserved Like it (0) Dislike it (0) Added: February 18, 2012 This Presentation is Public Favorites: 1 Presentation Description Basics of Matlab and Image Processing Softwares Comments Posting comment... Premium member Presentation Transcript Welcome To All: Welcome To AllAGENDA: AGENDA MATLAB SOFTWARE DIGITAL AND SIGNAL IMAGE PROCESSING APPLICATIONIntroduction to Matlab: Introduction to MatlabDesktop Tools (Matlab v6): Command Window type commands Workspace view program variables clear to clear double click on a variable to see it in the Array Editor Command History view past commands save a whole session using diary Launch Pad access tools, demos and documentation Desktop Tools (Matlab v6)Math Functions: Math Functions Elementary functions (sin, cos, sqrt, abs, exp, log10, round) type help elfun Advanced functions (bessel, beta, gamma, erf) type help specfun type help elmatGraph Functions (summary): Graph Functions (summary) plot linear plot stem discrete plot grid add grid lines xlabel add X-axis label ylabel add Y-axis label title add graph title subplot divide figure window figure create new figure window pause wait for user responseMatlab Files (.m): Matlab Files (.m) Use predefined functions or write your own functions Reside on the current directory or the search path add with File/Set Path Use the Editor/Debugger to edit, runGetting Help: Getting Help Using the Help Browser (.html, .pdf) View getstart.pdf, graphg.pdf, using_ml.pdf Type help help function , e.g. help plot Running demos type demos type help demosCommand window: Command windowChange the current working directory: Change the current working directoryArithmetic operators : Arithmetic operators plus - Plus + uplus - Unary plus + minus - Minus - uminus - Unary minus - mtimes - Matrix multiply * times - Array multiply .* mpower - Matrix power ^ power - Array power .^ mldivide - Backslash or left matrix divide \ mrdivide - Slash or right matrix divide / ldivide - Left array divide .\ rdivide - Right array divide ./Relational operators: Relational operators eq - Equal == ne - Not equal ~= lt - Less than < gt - Greater than > le - Less than or equal <= ge - Greater than or equal >=Logical operators : Logical operators Short-circuit logical AND && Short-circuit logical OR || and - Element-wise logical AND & or - Element-wise logical OR | not - Logical NOT ~ xor - Logical EXCLUSIVE OR any - True if any element of vector is nonzero all - True if all elements of vector are nonzeroBITWISE OPERATORS: BITWISE OPERATORS bitand - Bit-wise AND. bitcmp - Complement bits. bitor - Bit-wise OR. bitmax - Maximum floating point integer. bitxor - Bit-wise XOR. bitset - Set bit. bitget - Get bit. bitshift - Bit-wise shift.Vectors : Vectors a = [1 2 3 4 5 6 9 8 7] ; t = 0:2:20 t = 0 2 4 6 8 10 12 14 16 18 20 b = a + 2 b = 3 4 5 6 7 8 11 10 9 c = a + b c = 4 6 8 10 12 14 20 18 16Matrices : Matrices B = [3 4 5 6; 1 2 3 4; 9 10 11 12] ; B = 1 2 3 4 5 6 7 8 9 10 11 12 C = B' C = 1 5 9 2 6 10 3 7 11 4 8 12plot: plot t=0:0.25:7; y = sin(t); plot(t,y)PLOT: PLOT t=0:0.25:7; y = sin(t); plot(t,y) ; xlabel('x axis'); ylabel('y axis'); title('Heading'); grid on; gtext('text');IF LOOP: IF LOOP a=5; if a > 6 disp('a is greater'); elseif a==0 disp('a is zero'); else disp('a is smaller'); endFOR LOOP: FOR LOOP a=5; for i=1:5 a=a+1 end disp(a); ANS a =10While Loop: While Loop a=5; while a < 10 a=a+1; end disp(a); Ans a =10Function : Function function c=add(a,b); c=a+b; return Main a=5; b=6; c=add(a,b); disp(c); d=mul(a,b); disp(d); function c=mul(a,b); c=a*b; returnHow to read an image: How to read an image a =imread('cameraman.tif'); imshow(a); pixval on; a =imread('flowers.tif'); imshow(a); pixval on;How to read an audio file: How to read an audio file a =wavread ('test.wav'); wavplay(a,44100); Plot(a);How to read an video file: How to read an video file a=aviread('movie.avi'); movie(a);Add two images : Add two images I = imread(‘rice.tif'); J = imread('cameraman.tif'); K = imadd(I,J,'uint16'); imshow(K,[]) I = imread('rice.tif'); J = imadd(I,50); subplot(1,2,1), imshow(I) subplot(1,2,2), imshow(J)Subtract two images: Subtract two images I = imread('rice.tif'); Iq = imsubtract(I,50); subplot(1,2,1), imshow(I) subplot(1,2,2), imshow(Iq)Convert image to gray and binary : Convert image to gray and binary clc; clear; close all a= imread('flowers.tif'); subplot(2,2,1); imshow(a); subplot(2,2,2); b=imresize(a,[256 256]); imshow(b); subplot(2,2,3); c=rgb2gray(b); imshow(c); subplot(2,2,4); d=im2bw(c); imshow(d);RGB component: RGB component a=imread('flowers.tif'); subplot(2,2,1); imshow(a); R=a; G=a; B=a; R(:,:,2:3)=0; subplot(2,2,2); imshow(R); G(:,:,1)=0; G(:,:,3)=0; subplot(2,2,3); imshow(G); B(:,:,1)=0; B(:,:,2)=0; subplot(2,2,4); imshow(B);Convert Image into One dimensional : Convert Image into One dimensional a = imread('cameraman.tif'); [r c]=size(a); Len=r*c; b=reshape(a,[1 Len]);CONVER MOVIE TO FRAMES: CONVER MOVIE TO FRAMES file=aviinfo('movie1.avi'); % to get inforamtaion abt video file frm_cnt=file.NumFrames % No.of frames in the video file str2='.bmp' h = waitbar(0,'Please wait...'); for i=1:frm_cnt frm(i)=aviread(filename,i); % read the Video file frm_name=frame2im(frm(i)); % Convert Frame to image file frm_name=rgb2gray(frm_name);%convert gray filename1=strcat(strcat(num2str(i)),str2); imwrite(frm_name,filename1); % Write image file waitbar(i/frm_cnt,h) end close(h)CONVERT FRAMES TO MOVIES: CONVERT FRAMES TO MOVIES frm_cnt=5; number_of_frames=frm_cnt; filetype='.bmp'; display_time_of_frame=1; mov = avifile('MOVIE.avi'); count=0; for i=1:number_of_frames name1=strcat(num2str(i),filetype); a=imread(name1); while count<display_time_of_frame count=count+1; imshow(a); F=getframe(gca); mov=addframe(mov,F); end count=0; end mov=close(mov);How to read a text file: How to read a text file fid = fopen('message.txt','r'); ice1= fread(fid); s = char(ice1'); fclose(fid); disp(s); Ans helloHow to write a text file: How to write a text file txt=[65 67 68 69]; fid = fopen('output.txt','wb'); fwrite(fid,char(txt),'char'); fclose(fid); ANS =ACDEStore an Image,Audio: Store an Image,Audio a =imread('cameraman.tif'); imwrite(a,'new.bmp'); a=wavread('test.wav'); wavwrite(d,44100,16,'nTEST.WAV');SAVE AND LOAD THE VARIABLE: SAVE AND LOAD THE VARIABLE A=5; save A A; load A B=1; C=A+B; disp(C);Wavelet transform: Wavelet transform a =imread('cameraman.tif'); [LL LH HL HH]=dwt2(a,'haar'); Dec=[... LL,LH HL,HH ... ]; imshow(Dec,[]);DCT transform : DCT transform a=imread('cameraman.tif'); subplot(1,3,1);imshow(a,[]); b=dct2(a); subplot(1,3,2);imshow(b,[]);title('DCT'); c=idct2(b); subplot(1,3,3);imshow(c,[]);title('IDCT');NOISE AND FILTER: NOISE AND FILTER I = imread('eight.tif'); J = imnoise(I,'salt & pepper',0.02); K = medfilt2(J); subplot(1,2,1);imshow(J) subplot(1,2,2);imshow(K) GUI: GUIDIALOG BOX : DIALOG BOX warndlg('hello'); helpdlg('hello'); errordlg('hello'); msgbox('hello');PowerPoint Presentation: ButtonName=questdlg('What is your wish?', ... 'Genie Question', ... 'Food','Clothing','Money','Money'); switch ButtonName, case 'Food', disp('Food is delivered'); case 'Clothing', disp('The Emperor''s new clothes have arrived.') case 'Money', disp('A ton of money falls out the sky.'); end % switchUSER INTERFACE GET FILE: USER INTERFACE GET FILE [filename, pathname] = uigetfile('*.m', 'Pick an M-file'); if isequal(filename,0) | isequal(pathname,0) disp('User pressed cancel') else disp(['User selected ', fullfile(pathname, filename)]) endUSER INTERFACE PUT FILE: USER INTERFACE PUT FILE [filename, pathname] = uiputfile('*.m', 'Pick an M-file'); if isequal(filename,0) | isequal(pathname,0) disp('User pressed cancel') else disp(['User selected ', fullfile(pathname, filename)]) endGUI : GUIGET IMAGE FILE: GET IMAGE FILE function pushbutton1_Callback(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) [filename, pathname] = uigetfile('*.jpg', 'Pick an Image'); if isequal(filename,0) | isequal(pathname,0) warndlg('User pressed cancel') else M1 = imread( filename); handles.M1 = M1; axes(handles.axes1); imshow(M1); handles.filename1=filename; %Update handles structure guidata(hObject, handles); endGUI…: GUI…MENU BAR: MENU BARPUSH BUTTON: PUSH BUTTONTOGGLE BUTTON: TOGGLE BUTTONRADIO BUTTON: RADIO BUTTONCHECKBOX: CHECKBOXEDIT TEXT: EDIT TEXTSTATIC TEXT: STATIC TEXTSLIDER: SLIDERFRAME: FRAMELISTBOX: LISTBOXPOPUP MENU: POPUP MENUAXES: AXESALIGN OBJECTS: ALIGN OBJECTSMENU EDITOR: MENU EDITORM FILE EDITOR: M FILE EDITORPROPERTY INSPECTOR: PROPERTY INSPECTORRUN: RUNEMPTY GUI: EMPTY GUIGENERATED M FILE: GENERATED M FILEPUSH BUTTON: PUSH BUTTONRIGHT CLICK PUSH BUTTON & GO FOR PROPERTY INSPECTOR: RIGHT CLICK PUSH BUTTON & GO FOR PROPERTY INSPECTORCHANGE THE STRING AND TAG VALUE: CHANGE THE STRING AND TAG VALUECHANGE THE STRING AND TAG VALUE: CHANGE THE STRING AND TAG VALUERIGHT CLICK PUSH BUTTON & GO FOR M FILE EDITOR: RIGHT CLICK PUSH BUTTON & GO FOR M FILE EDITORGO FOR CALLBACK: GO FOR CALLBACKWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACK a =imread('cameraman.tif'); imshow(a);RUN THE PROGRAM OR PRESS F5: RUN THE PROGRAM OR PRESS F5CHOOSE AXES: CHOOSE AXESCHOOSE AXES: CHOOSE AXESRIGHT CLICK AXES & GO FOR PROPERTY INSPECTOR: RIGHT CLICK AXES & GO FOR PROPERTY INSPECTORCHANGE THE STRING AND TAG VALUE: CHANGE THE STRING AND TAG VALUEWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACK a =imread('cameraman.tif'); axes(handles.one); imshow(a);RUN THE PROGRAM: RUN THE PROGRAMCODE: CODE a =imread('cameraman.tif'); axes(handles.one); imshow(a);TOGGLE BUTTON: TOGGLE BUTTONRIGHT CLICK TOGGLE & GO FOR PROPERTY INSPECTOR: RIGHT CLICK TOGGLE & GO FOR PROPERTY INSPECTORCHANGE THE STRING AND TAG VALUE: CHANGE THE STRING AND TAG VALUERIGHT CLICK TOGGLE & GO FOR M FILE EDITOR: RIGHT CLICK TOGGLE & GO FOR M FILE EDITORWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACK a=get(hObject,'Value'); if a ==1 a =imread('cameraman.tif'); axes(handles.one); imshow(a); else a =imread('greens.jpg'); axes(handles.one); imshow(a); endRUN THE PROGRAM: RUN THE PROGRAMRIGHT CLICK RADIO BUTTON & GO FOR PROPERTY INSPECTOR: RIGHT CLICK RADIO BUTTON & GO FOR PROPERTY INSPECTORCHANGE THE STRING AND TAG VALUE: CHANGE THE STRING AND TAG VALUERIGHT CLICK CHECK BOX & GO FOR MFILE EDITOR: RIGHT CLICK CHECK BOX & GO FOR MFILE EDITORWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACKRUN THE PROGRAM: RUN THE PROGRAMRIGHT CLICK CHECK BOX & GO FOR PROPERTY INSPECTOR: RIGHT CLICK CHECK BOX & GO FOR PROPERTY INSPECTORCHANGE THE STRING AND TAG VALUE: CHANGE THE STRING AND TAG VALUERIGHT CLICK CHECK BOX & GO FOR M FILE EDITOR: RIGHT CLICK CHECK BOX & GO FOR M FILE EDITORWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACKRUN THE PROGRAM: RUN THE PROGRAMRIGHT CLICK FRAME & SEND TO BACK: RIGHT CLICK FRAME & SEND TO BACKRUN THE PROGRAM: RUN THE PROGRAMRIGHT CLICK LIST BOX & GO FOR PROPERTY INSPECTOR: RIGHT CLICK LIST BOX & GO FOR PROPERTY INSPECTOREDIT THE STRING OPTIONS: EDIT THE STRING OPTIONSRIGHT CLICK LIST BOX & GO FOR M FILE EDITOR: RIGHT CLICK LIST BOX & GO FOR M FILE EDITORWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACK contents = get(hObject,'Value') switch contents case 1 a =imread('cameraman.tif'); axes(handles.one); imshow(a); case 2 a =imread('flowers.tif'); axes(handles.one); imshow(a); case 3 a =imread('rice.tif'); axes(handles.one); imshow(a); otherwise a =imread('mri.tif'); axes(handles.one); imshow(a); endCHOOSE POPUPMENU: CHOOSE POPUPMENURIGHT CLICK POPUP MENU & GO FOR PROPERTY INSPECTOR: RIGHT CLICK POPUP MENU & GO FOR PROPERTY INSPECTOREDIT THE STRING OPTIONS: EDIT THE STRING OPTIONSWRITE THE CODE: WRITE THE CODE contents = get(hObject,'Value') switch contents case 1 a =imread('cameraman.tif'); axes(handles.one); imshow(a); case 2 a =imread('flowers.tif'); axes(handles.one); imshow(a); case 3 a =imread('rice.tif'); axes(handles.one); imshow(a); otherwise a =imread('mri.tif'); axes(handles.one); imshow(a); endRIGHT CLICK EDIT TEXT & GO FOR PROPERTY INSPECTOR: RIGHT CLICK EDIT TEXT & GO FOR PROPERTY INSPECTOREDIT STRING AND TAG: EDIT STRING AND TAGRIGHT CLICK EDIT TEXT & GO FOR M FILE EDITOR: RIGHT CLICK EDIT TEXT & GO FOR M FILE EDITORRIGHT CLICK AXES & GO FOR PROPERTY INSPECTOR: RIGHT CLICK AXES & GO FOR PROPERTY INSPECTORWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACKWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACK a=get(hObject,'String') ; b=char(a); c=imread(b); axes(handles.one); imshow(c);RIGHT CLICK STATIC TEXT & GO FOR PROPERTY INSPECTOR: RIGHT CLICK STATIC TEXT & GO FOR PROPERTY INSPECTORCHANGE THE STRING AND TAG VALUE: CHANGE THE STRING AND TAG VALUEWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACK a=get(hObject,'String') ; set(handles.t1,'String',a); b=char(a); c=imread(b); axes(handles.one); imshow(c);SLIDER: SLIDERRIGHT CLICK SLIDER & GO FOR PROPERTY INSPECTOR: RIGHT CLICK SLIDER & GO FOR PROPERTY INSPECTORDROP TWO AXES: DROP TWO AXESDROP PUSH BUTTON: DROP PUSH BUTTONCHANGE THE STRING AND TAG VALUE: CHANGE THE STRING AND TAG VALUEGO FOR CALLBACK: GO FOR CALLBACKWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACK [filename, pathname] = uigetfile('*.bmp', 'Pick an Image'); if isequal(filename,0) | isequal(pathname,0) warndlg('User pressed cancel') else a=imread(filename); axes(handles.axes1); imshow(a); handles.filename=filename; guidata(hObject, handles); endRIGHT CLICK SLIDER & GO FOR M FILE EDITOR: RIGHT CLICK SLIDER & GO FOR M FILE EDITORWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACKRUN THE PROGRAM: RUN THE PROGRAM a=get(hObject,'Value'); filename =handles.filename; I = imread(filename); J = imadd(I,50); axes(handles.axes2); imshow(J)MENU EDITOR: MENU EDITOREDIT STRING AND TAG: EDIT STRING AND TAGRUN : RUNReferences: References www.analog.com //Analog Devices www.ti.com //Texas Instruments www.dspguru.com www.dspdesignline.com www.dspguide.com The Scientist and Engineers' guide to DSP www.dspstore.com //A very nice site which is having all DSP updates www.globalspec.comAny Queries: Any Queries You do not have the permission to view this presentation. In order to view it, please contact the author of the presentation.
MATLAB and Digital Image Processing Niteesh Download Post to : URL : Related Presentations : Share Add to Flag Embed Email Send to Blogs and Networks Add to Channel Uploaded from authorPOINT lite Insert YouTube videos in PowerPont slides with aS Desktop Copy embed code: Embed: Flash iPad Copy Does not support media & animations WordPress Embed Customize Embed URL: Copy Thumbnail: Copy The presentation is successfully added In Your Favorites. Views: 1770 Category: Science & Tech.. License: All Rights Reserved Like it (0) Dislike it (0) Added: February 18, 2012 This Presentation is Public Favorites: 1 Presentation Description Basics of Matlab and Image Processing Softwares Comments Posting comment... Premium member Presentation Transcript Welcome To All: Welcome To AllAGENDA: AGENDA MATLAB SOFTWARE DIGITAL AND SIGNAL IMAGE PROCESSING APPLICATIONIntroduction to Matlab: Introduction to MatlabDesktop Tools (Matlab v6): Command Window type commands Workspace view program variables clear to clear double click on a variable to see it in the Array Editor Command History view past commands save a whole session using diary Launch Pad access tools, demos and documentation Desktop Tools (Matlab v6)Math Functions: Math Functions Elementary functions (sin, cos, sqrt, abs, exp, log10, round) type help elfun Advanced functions (bessel, beta, gamma, erf) type help specfun type help elmatGraph Functions (summary): Graph Functions (summary) plot linear plot stem discrete plot grid add grid lines xlabel add X-axis label ylabel add Y-axis label title add graph title subplot divide figure window figure create new figure window pause wait for user responseMatlab Files (.m): Matlab Files (.m) Use predefined functions or write your own functions Reside on the current directory or the search path add with File/Set Path Use the Editor/Debugger to edit, runGetting Help: Getting Help Using the Help Browser (.html, .pdf) View getstart.pdf, graphg.pdf, using_ml.pdf Type help help function , e.g. help plot Running demos type demos type help demosCommand window: Command windowChange the current working directory: Change the current working directoryArithmetic operators : Arithmetic operators plus - Plus + uplus - Unary plus + minus - Minus - uminus - Unary minus - mtimes - Matrix multiply * times - Array multiply .* mpower - Matrix power ^ power - Array power .^ mldivide - Backslash or left matrix divide \ mrdivide - Slash or right matrix divide / ldivide - Left array divide .\ rdivide - Right array divide ./Relational operators: Relational operators eq - Equal == ne - Not equal ~= lt - Less than < gt - Greater than > le - Less than or equal <= ge - Greater than or equal >=Logical operators : Logical operators Short-circuit logical AND && Short-circuit logical OR || and - Element-wise logical AND & or - Element-wise logical OR | not - Logical NOT ~ xor - Logical EXCLUSIVE OR any - True if any element of vector is nonzero all - True if all elements of vector are nonzeroBITWISE OPERATORS: BITWISE OPERATORS bitand - Bit-wise AND. bitcmp - Complement bits. bitor - Bit-wise OR. bitmax - Maximum floating point integer. bitxor - Bit-wise XOR. bitset - Set bit. bitget - Get bit. bitshift - Bit-wise shift.Vectors : Vectors a = [1 2 3 4 5 6 9 8 7] ; t = 0:2:20 t = 0 2 4 6 8 10 12 14 16 18 20 b = a + 2 b = 3 4 5 6 7 8 11 10 9 c = a + b c = 4 6 8 10 12 14 20 18 16Matrices : Matrices B = [3 4 5 6; 1 2 3 4; 9 10 11 12] ; B = 1 2 3 4 5 6 7 8 9 10 11 12 C = B' C = 1 5 9 2 6 10 3 7 11 4 8 12plot: plot t=0:0.25:7; y = sin(t); plot(t,y)PLOT: PLOT t=0:0.25:7; y = sin(t); plot(t,y) ; xlabel('x axis'); ylabel('y axis'); title('Heading'); grid on; gtext('text');IF LOOP: IF LOOP a=5; if a > 6 disp('a is greater'); elseif a==0 disp('a is zero'); else disp('a is smaller'); endFOR LOOP: FOR LOOP a=5; for i=1:5 a=a+1 end disp(a); ANS a =10While Loop: While Loop a=5; while a < 10 a=a+1; end disp(a); Ans a =10Function : Function function c=add(a,b); c=a+b; return Main a=5; b=6; c=add(a,b); disp(c); d=mul(a,b); disp(d); function c=mul(a,b); c=a*b; returnHow to read an image: How to read an image a =imread('cameraman.tif'); imshow(a); pixval on; a =imread('flowers.tif'); imshow(a); pixval on;How to read an audio file: How to read an audio file a =wavread ('test.wav'); wavplay(a,44100); Plot(a);How to read an video file: How to read an video file a=aviread('movie.avi'); movie(a);Add two images : Add two images I = imread(‘rice.tif'); J = imread('cameraman.tif'); K = imadd(I,J,'uint16'); imshow(K,[]) I = imread('rice.tif'); J = imadd(I,50); subplot(1,2,1), imshow(I) subplot(1,2,2), imshow(J)Subtract two images: Subtract two images I = imread('rice.tif'); Iq = imsubtract(I,50); subplot(1,2,1), imshow(I) subplot(1,2,2), imshow(Iq)Convert image to gray and binary : Convert image to gray and binary clc; clear; close all a= imread('flowers.tif'); subplot(2,2,1); imshow(a); subplot(2,2,2); b=imresize(a,[256 256]); imshow(b); subplot(2,2,3); c=rgb2gray(b); imshow(c); subplot(2,2,4); d=im2bw(c); imshow(d);RGB component: RGB component a=imread('flowers.tif'); subplot(2,2,1); imshow(a); R=a; G=a; B=a; R(:,:,2:3)=0; subplot(2,2,2); imshow(R); G(:,:,1)=0; G(:,:,3)=0; subplot(2,2,3); imshow(G); B(:,:,1)=0; B(:,:,2)=0; subplot(2,2,4); imshow(B);Convert Image into One dimensional : Convert Image into One dimensional a = imread('cameraman.tif'); [r c]=size(a); Len=r*c; b=reshape(a,[1 Len]);CONVER MOVIE TO FRAMES: CONVER MOVIE TO FRAMES file=aviinfo('movie1.avi'); % to get inforamtaion abt video file frm_cnt=file.NumFrames % No.of frames in the video file str2='.bmp' h = waitbar(0,'Please wait...'); for i=1:frm_cnt frm(i)=aviread(filename,i); % read the Video file frm_name=frame2im(frm(i)); % Convert Frame to image file frm_name=rgb2gray(frm_name);%convert gray filename1=strcat(strcat(num2str(i)),str2); imwrite(frm_name,filename1); % Write image file waitbar(i/frm_cnt,h) end close(h)CONVERT FRAMES TO MOVIES: CONVERT FRAMES TO MOVIES frm_cnt=5; number_of_frames=frm_cnt; filetype='.bmp'; display_time_of_frame=1; mov = avifile('MOVIE.avi'); count=0; for i=1:number_of_frames name1=strcat(num2str(i),filetype); a=imread(name1); while count<display_time_of_frame count=count+1; imshow(a); F=getframe(gca); mov=addframe(mov,F); end count=0; end mov=close(mov);How to read a text file: How to read a text file fid = fopen('message.txt','r'); ice1= fread(fid); s = char(ice1'); fclose(fid); disp(s); Ans helloHow to write a text file: How to write a text file txt=[65 67 68 69]; fid = fopen('output.txt','wb'); fwrite(fid,char(txt),'char'); fclose(fid); ANS =ACDEStore an Image,Audio: Store an Image,Audio a =imread('cameraman.tif'); imwrite(a,'new.bmp'); a=wavread('test.wav'); wavwrite(d,44100,16,'nTEST.WAV');SAVE AND LOAD THE VARIABLE: SAVE AND LOAD THE VARIABLE A=5; save A A; load A B=1; C=A+B; disp(C);Wavelet transform: Wavelet transform a =imread('cameraman.tif'); [LL LH HL HH]=dwt2(a,'haar'); Dec=[... LL,LH HL,HH ... ]; imshow(Dec,[]);DCT transform : DCT transform a=imread('cameraman.tif'); subplot(1,3,1);imshow(a,[]); b=dct2(a); subplot(1,3,2);imshow(b,[]);title('DCT'); c=idct2(b); subplot(1,3,3);imshow(c,[]);title('IDCT');NOISE AND FILTER: NOISE AND FILTER I = imread('eight.tif'); J = imnoise(I,'salt & pepper',0.02); K = medfilt2(J); subplot(1,2,1);imshow(J) subplot(1,2,2);imshow(K) GUI: GUIDIALOG BOX : DIALOG BOX warndlg('hello'); helpdlg('hello'); errordlg('hello'); msgbox('hello');PowerPoint Presentation: ButtonName=questdlg('What is your wish?', ... 'Genie Question', ... 'Food','Clothing','Money','Money'); switch ButtonName, case 'Food', disp('Food is delivered'); case 'Clothing', disp('The Emperor''s new clothes have arrived.') case 'Money', disp('A ton of money falls out the sky.'); end % switchUSER INTERFACE GET FILE: USER INTERFACE GET FILE [filename, pathname] = uigetfile('*.m', 'Pick an M-file'); if isequal(filename,0) | isequal(pathname,0) disp('User pressed cancel') else disp(['User selected ', fullfile(pathname, filename)]) endUSER INTERFACE PUT FILE: USER INTERFACE PUT FILE [filename, pathname] = uiputfile('*.m', 'Pick an M-file'); if isequal(filename,0) | isequal(pathname,0) disp('User pressed cancel') else disp(['User selected ', fullfile(pathname, filename)]) endGUI : GUIGET IMAGE FILE: GET IMAGE FILE function pushbutton1_Callback(hObject, eventdata, handles) % hObject handle to pushbutton1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) [filename, pathname] = uigetfile('*.jpg', 'Pick an Image'); if isequal(filename,0) | isequal(pathname,0) warndlg('User pressed cancel') else M1 = imread( filename); handles.M1 = M1; axes(handles.axes1); imshow(M1); handles.filename1=filename; %Update handles structure guidata(hObject, handles); endGUI…: GUI…MENU BAR: MENU BARPUSH BUTTON: PUSH BUTTONTOGGLE BUTTON: TOGGLE BUTTONRADIO BUTTON: RADIO BUTTONCHECKBOX: CHECKBOXEDIT TEXT: EDIT TEXTSTATIC TEXT: STATIC TEXTSLIDER: SLIDERFRAME: FRAMELISTBOX: LISTBOXPOPUP MENU: POPUP MENUAXES: AXESALIGN OBJECTS: ALIGN OBJECTSMENU EDITOR: MENU EDITORM FILE EDITOR: M FILE EDITORPROPERTY INSPECTOR: PROPERTY INSPECTORRUN: RUNEMPTY GUI: EMPTY GUIGENERATED M FILE: GENERATED M FILEPUSH BUTTON: PUSH BUTTONRIGHT CLICK PUSH BUTTON & GO FOR PROPERTY INSPECTOR: RIGHT CLICK PUSH BUTTON & GO FOR PROPERTY INSPECTORCHANGE THE STRING AND TAG VALUE: CHANGE THE STRING AND TAG VALUECHANGE THE STRING AND TAG VALUE: CHANGE THE STRING AND TAG VALUERIGHT CLICK PUSH BUTTON & GO FOR M FILE EDITOR: RIGHT CLICK PUSH BUTTON & GO FOR M FILE EDITORGO FOR CALLBACK: GO FOR CALLBACKWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACK a =imread('cameraman.tif'); imshow(a);RUN THE PROGRAM OR PRESS F5: RUN THE PROGRAM OR PRESS F5CHOOSE AXES: CHOOSE AXESCHOOSE AXES: CHOOSE AXESRIGHT CLICK AXES & GO FOR PROPERTY INSPECTOR: RIGHT CLICK AXES & GO FOR PROPERTY INSPECTORCHANGE THE STRING AND TAG VALUE: CHANGE THE STRING AND TAG VALUEWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACK a =imread('cameraman.tif'); axes(handles.one); imshow(a);RUN THE PROGRAM: RUN THE PROGRAMCODE: CODE a =imread('cameraman.tif'); axes(handles.one); imshow(a);TOGGLE BUTTON: TOGGLE BUTTONRIGHT CLICK TOGGLE & GO FOR PROPERTY INSPECTOR: RIGHT CLICK TOGGLE & GO FOR PROPERTY INSPECTORCHANGE THE STRING AND TAG VALUE: CHANGE THE STRING AND TAG VALUERIGHT CLICK TOGGLE & GO FOR M FILE EDITOR: RIGHT CLICK TOGGLE & GO FOR M FILE EDITORWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACK a=get(hObject,'Value'); if a ==1 a =imread('cameraman.tif'); axes(handles.one); imshow(a); else a =imread('greens.jpg'); axes(handles.one); imshow(a); endRUN THE PROGRAM: RUN THE PROGRAMRIGHT CLICK RADIO BUTTON & GO FOR PROPERTY INSPECTOR: RIGHT CLICK RADIO BUTTON & GO FOR PROPERTY INSPECTORCHANGE THE STRING AND TAG VALUE: CHANGE THE STRING AND TAG VALUERIGHT CLICK CHECK BOX & GO FOR MFILE EDITOR: RIGHT CLICK CHECK BOX & GO FOR MFILE EDITORWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACKRUN THE PROGRAM: RUN THE PROGRAMRIGHT CLICK CHECK BOX & GO FOR PROPERTY INSPECTOR: RIGHT CLICK CHECK BOX & GO FOR PROPERTY INSPECTORCHANGE THE STRING AND TAG VALUE: CHANGE THE STRING AND TAG VALUERIGHT CLICK CHECK BOX & GO FOR M FILE EDITOR: RIGHT CLICK CHECK BOX & GO FOR M FILE EDITORWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACKRUN THE PROGRAM: RUN THE PROGRAMRIGHT CLICK FRAME & SEND TO BACK: RIGHT CLICK FRAME & SEND TO BACKRUN THE PROGRAM: RUN THE PROGRAMRIGHT CLICK LIST BOX & GO FOR PROPERTY INSPECTOR: RIGHT CLICK LIST BOX & GO FOR PROPERTY INSPECTOREDIT THE STRING OPTIONS: EDIT THE STRING OPTIONSRIGHT CLICK LIST BOX & GO FOR M FILE EDITOR: RIGHT CLICK LIST BOX & GO FOR M FILE EDITORWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACK contents = get(hObject,'Value') switch contents case 1 a =imread('cameraman.tif'); axes(handles.one); imshow(a); case 2 a =imread('flowers.tif'); axes(handles.one); imshow(a); case 3 a =imread('rice.tif'); axes(handles.one); imshow(a); otherwise a =imread('mri.tif'); axes(handles.one); imshow(a); endCHOOSE POPUPMENU: CHOOSE POPUPMENURIGHT CLICK POPUP MENU & GO FOR PROPERTY INSPECTOR: RIGHT CLICK POPUP MENU & GO FOR PROPERTY INSPECTOREDIT THE STRING OPTIONS: EDIT THE STRING OPTIONSWRITE THE CODE: WRITE THE CODE contents = get(hObject,'Value') switch contents case 1 a =imread('cameraman.tif'); axes(handles.one); imshow(a); case 2 a =imread('flowers.tif'); axes(handles.one); imshow(a); case 3 a =imread('rice.tif'); axes(handles.one); imshow(a); otherwise a =imread('mri.tif'); axes(handles.one); imshow(a); endRIGHT CLICK EDIT TEXT & GO FOR PROPERTY INSPECTOR: RIGHT CLICK EDIT TEXT & GO FOR PROPERTY INSPECTOREDIT STRING AND TAG: EDIT STRING AND TAGRIGHT CLICK EDIT TEXT & GO FOR M FILE EDITOR: RIGHT CLICK EDIT TEXT & GO FOR M FILE EDITORRIGHT CLICK AXES & GO FOR PROPERTY INSPECTOR: RIGHT CLICK AXES & GO FOR PROPERTY INSPECTORWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACKWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACK a=get(hObject,'String') ; b=char(a); c=imread(b); axes(handles.one); imshow(c);RIGHT CLICK STATIC TEXT & GO FOR PROPERTY INSPECTOR: RIGHT CLICK STATIC TEXT & GO FOR PROPERTY INSPECTORCHANGE THE STRING AND TAG VALUE: CHANGE THE STRING AND TAG VALUEWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACK a=get(hObject,'String') ; set(handles.t1,'String',a); b=char(a); c=imread(b); axes(handles.one); imshow(c);SLIDER: SLIDERRIGHT CLICK SLIDER & GO FOR PROPERTY INSPECTOR: RIGHT CLICK SLIDER & GO FOR PROPERTY INSPECTORDROP TWO AXES: DROP TWO AXESDROP PUSH BUTTON: DROP PUSH BUTTONCHANGE THE STRING AND TAG VALUE: CHANGE THE STRING AND TAG VALUEGO FOR CALLBACK: GO FOR CALLBACKWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACK [filename, pathname] = uigetfile('*.bmp', 'Pick an Image'); if isequal(filename,0) | isequal(pathname,0) warndlg('User pressed cancel') else a=imread(filename); axes(handles.axes1); imshow(a); handles.filename=filename; guidata(hObject, handles); endRIGHT CLICK SLIDER & GO FOR M FILE EDITOR: RIGHT CLICK SLIDER & GO FOR M FILE EDITORWRITE THE CODE BELOW THE CALLBACK: WRITE THE CODE BELOW THE CALLBACKRUN THE PROGRAM: RUN THE PROGRAM a=get(hObject,'Value'); filename =handles.filename; I = imread(filename); J = imadd(I,50); axes(handles.axes2); imshow(J)MENU EDITOR: MENU EDITOREDIT STRING AND TAG: EDIT STRING AND TAGRUN : RUNReferences: References www.analog.com //Analog Devices www.ti.com //Texas Instruments www.dspguru.com www.dspdesignline.com www.dspguide.com The Scientist and Engineers' guide to DSP www.dspstore.com //A very nice site which is having all DSP updates www.globalspec.comAny Queries: Any Queries