All in one Image Processing File

I need to classify LISS 3 imagery in matlab environment to delineate the mangroves.
I have seen your All in one Image Processing files. I have copied all the files and placed in my local drive. when i am running the mainprogram.m i got some error as follows
??? Error using ==> load Unable to read file mainprogram.fig: No such file or directory.
Error in ==> hgload>localLoadFile at 177 AllVars = load(filename, '-mat');
Error in ==> hgload at 59 [FigVersion, FigData, VerNum] = localLoadFile(filename);
Error in ==> openfig at 72 [fig, savedvisible] = hgload(filename, struct('Visible','off'));
Error in ==> gui_mainfcn>local_openfig at 286 gui_hFigure = openfig(name, singleton, visible);
Error in ==> gui_mainfcn at 159 gui_hFigure = local_openfig(gui_State.gui_Name, gui_SingletonOpt, gui_Visible);
Error in ==> mainprogram at 43 gui_mainfcn(gui_State, varargin{:});
Kindly guide me in this regard. i have to complete my project. Please guide me in a right way sir..... it would be grateful if u point out the mistake i made...
Warm Regards Shoba P

7 Commenti

Image Analyst
Image Analyst il 4 Set 2013
Modificato: Image Analyst il 4 Set 2013
Whom are you referring to when you say "your" and "sir"? What is the value of "filename" - and does that file actually exist?
Which directory are you in when you run the program? Which directory are the files in? What do you get if you execute
dir('*.fig')
Are you trying to load the file called "mainprogram.fig" but telling the load() function to treat it as a .mat file? I don't believe that will work since a .fig file is not the same format as a .mat file. Anyway, did you contact the authors of that file?
Shoba
Shoba il 5 Set 2013
Modificato: Walter Roberson il 5 Set 2013
Sir, i have got the mainprogram.fig file and the GUI has strated working. but i couldnt import my LISS 3 imagery. its not dispayed in the panel. Actually i want to run the code for 4 band(B,G,R,IR) LISS 3 data. But in the main program the code has written like
[flnm flpth fltind] = uigetfile({'*.tif';'*.dat'},'Select 7 Band of Landsat Images','MultiSelect','on');
if fltind~=0
if length(flnm)==7 && ischar(flnm)==0
for i=1:7
ext(1,i)=regexp(flnm{1,i},'[.]');
extdat(1,i)=strcmp('.dat',flnm{1,i}(ext(1,i):end));
exttif(1,i)=strcmp('.tif',flnm{1,i}(ext(1,i):end));
end
if length(find(extdat==1))==7
for i=1:7
impt= fopen([flpth flnm{1,i}],'r');
pp= fread(impt,[2048 2048]);
imp{i,1}=double(pp');
fclose(impt);
clear impt
end
elseif length(find(exttif==1))==7
for i=1:7
imp{i,1}= double(imread([flpth flnm{1,i}]));
end
end
set(handles.importim,'checked','on')
set(handles.rgbpush,'enable','on')
set(handles.graypush,'enable','on')
set(handles.prmn,'enable','on')
else
set(handles.importim,'checked','off')
set(handles.rgbpush,'enable','off')
set(handles.graypush,'enable','off')
set(handles.prmn,'enable','off')
end
end
i am loading 4 band imagery. what should i do? should i change the main program?
openfig() is called automatically when you run a GUIDE gui. openfig() calls various levels, eventually getting down to loading the .fig file. .fig files are .mat format.
It starts working after changing the band no from 7 to 4 in mainprogram. But while doing supervised classification by maximum likelihood method i got empty matrix for mean function as follows k=str2double(inputdlg({'Band1(Training):'},'Select',1,{'4'})); if ~isempty(k) img1=imp{k(1),1}'; img2=imp{2,1}'; img3=imp{3,1}'; img4=imp{1,1}'; % img5=imp{5,1}'; % img7=imp{7,1}'; axes(handles.importaxes); imshow(uint8(img1')) siz=size(img1); [x_c1 y_c1]=ginput(2); [x_c2 y_c2]=ginput(2); [x_c3 y_c3]=ginput(2); xc1=fix(y_c1);yc1=fix(x_c1); xc2=fix(y_c2);yc2=fix(x_c2); xc3=fix(y_c3);yc3=fix(x_c3); wbn = waitbar(0,'Please Wait...','Name','Calculating'); waitbar(.75,wbn,sprintf('%3.0f %%',25)); %%%%% Class1 Statistics %%%%%%%%%\
c1_1=img1(xc1(1):xc1(2),yc1(1):yc1(2));
c1_1_mean=meanfnc(c1_1);
Error Empty matrix: 1-by-0
so i couldnt get the classified output. kindly help me to solve this issue. Thanks in advance Shoba

Accedi per commentare.

 Risposta accettata

Più risposte (0)

Community Treasure Hunt

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

Start Hunting!

Translated by