From: jatin mistry on 27 Mar 2010 05:44 hello everyone, I'm new to using Matlab can anyone explain me how to pass my image data (loaded into my GUI) to another m-file which will perform image processing of the image data and show the results.... I've tried with handles but its not working.... I know this can be done using handles but since I am new to MATLAB I'm not getting it... Thanks, Jatin
From: ImageAnalyst on 27 Mar 2010 07:00 Just pass it via the argument list. You simply put the name of the variable that is your image in the arg list: In GUI1 results = gui2(imageArray); Then in your OpenFcn (initialization function if you're using GUIDE) you do something like this: global imageArray; imageArray = varargin{1}; Then you can put that global line in any function where you want to access imageArray, or you can stuff it in to the workspace by setappdata().
From: jatin mistry on 27 Mar 2010 11:36 ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <b9c75983-b389-4dc4-a8cf-fbe2dda6f4e9(a)j21g2000yqh.googlegroups.com>... > Just pass it via the argument list. You simply put the name of the > variable that is your image in the arg list: > > In GUI1 > > results = gui2(imageArray); > > Then in your OpenFcn (initialization function if you're using GUIDE) > you do something like this: > global imageArray; > imageArray = varargin{1}; > > Then you can put that global line in any function where you want to > access imageArray, or you can stuff it in to the workspace by > setappdata(). I'm doing a basic image processing . Actually I'm loading 2 images in my GUI m-file and then when i press a pushbutton I want to perform image processing. %my GUI m-file looks like this: function Loadimage_OpeningFcn(hObject, eventdata, handles, varargin) function btnl1_Callback(hObject, eventdata, handles) axes(handles.axes1); i1=imread('IMAGE_PATH1'); %read image 1 imshow(i1); function btnl2_Callback(hObject, eventdata, handles) axes(handles.axes2); i2=imread('IMAGE_PATH2'); %read image 2 imshow(i2); function btnmosa_Callback(hObject, eventdata, handles) mosaic; %my M-file performing image processing....actually joining 2 images Now how should I pass these images to my m-file mosaic.m so that it performs image processing and returns the resulting image..?? frnds i know this might be a very silly question....but i m new to MATLAB and so finding it hard to link my two files... :( Thanks for reply, Jatin.
|
Pages: 1 Prev: active noise cancellation Next: Please help me to generate a markov chain. |