|
|
GUI open picture load to axis
halloi have the problem ,I dont know how open and load picture, to axis .....................and after this work up for exampl SVD etc. a nd display to ohter axes,:..
thos os open buttom function:..
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)
image=uigetfile(handles.inImg,'Oper image');
im_original=imread(image);
axes(handles.orgIm);
image(im_original);
axis equal;
axis tight;
axis off;
function axes1_CreateFcn(hObject, eventdata, handles)
% hObject handle to axes1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: place code in OpeningFcn to populate axes1
|
|
0
|
|
|
|
Reply
|
luky
|
12/21/2010 8:46:20 PM |
|
It's because you overrode the image function with your string. Then
when it came time to use the image function, it wasn't available
because you redefined it. Try
% Browse for the image file.
[baseFileName, folder] = uigetfile('*.*', 'Specify an image file');
% Create the full file name.
fullImageFileName = fullfile(folder, baseFileName);
im_original=imread(fullImageFileName );
axes(handles.orgIm);
image(im_original);
|
|
1
|
|
|
|
Reply
|
ImageAnalyst
|
12/21/2010 10:43:51 PM
|
|
ImageAnalyst <imageanalyst@mailinator.com> wrote in message <e387bb3d-da9f-4e75-9977-ad452ef9b75f@l8g2000yqh.googlegroups.com>...
> It's because you overrode the image function with your string. Then
> when it came time to use the image function, it wasn't available
> because you redefined it. Try
>
> % Browse for the image file.
> [baseFileName, folder] = uigetfile('*.*', 'Specify an image file');
>
> % Create the full file name.
> fullImageFileName = fullfile(folder, baseFileName);
> im_original=imread(fullImageFileName );
>
> axes(handles.orgIm);
> image(im_original);
thank but this still doesnt work:/ i open this file but nothing to display to axes:/
|
|
0
|
|
|
|
Reply
|
luky
|
12/22/2010 10:34:04 AM
|
|
ImageAnalyst <imageanalyst@mailinator.com> wrote in message <e387bb3d-da9f-4e75-9977-ad452ef9b75f@l8g2000yqh.googlegroups.com>...
> It's because you overrode the image function with your string. Then
> when it came time to use the image function, it wasn't available
> because you redefined it. Try
>
> % Browse for the image file.
> [baseFileName, folder] = uigetfile('*.*', 'Specify an image file');
>
> % Create the full file name.
> fullImageFileName = fullfile(folder, baseFileName);
> im_original=imread(fullImageFileName );
>
> axes(handles.orgIm);
> image(im_original);
Error while evaluating uicontrol Callback
??? Reference to non-existent field 'orgIm'.
Error in ==> test2>uipushtool1_ClickedCallback at 96
axes(handles.orgIm);
Error in ==> gui_mainfcn at 96
feval(varargin{:});
Error in ==> test2 at 42
gui_mainfcn(gui_State, varargin{:});
Error in ==>
@(hObject,eventdata)test2('uipushtool1_ClickedCallback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uipushtool ClickedCallback
|
|
0
|
|
|
|
Reply
|
luky
|
12/22/2010 10:39:04 AM
|
|
Check out Doug Hull's video on this subject:
http://blogs.mathworks.com/videos/2005/10/03/guide-video-part-two/
The code he provides in the finished product folder (main.m) has the necessary examples.
It's probably better that you place the "pointers" to the file and path names with the setappdata() command that way you can change the images without closing the GUI.
In Matt Fig's GUI examples:
http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples
GUI's 39 and 40 control an axes without using GUIDE.
|
|
0
|
|
|
|
Reply
|
Robert
|
12/22/2010 3:22:07 PM
|
|
"Robert" wrote in message <iet52v$su0$1@fred.mathworks.com>...
> Check out Doug Hull's video on this subject:
>
> http://blogs.mathworks.com/videos/2005/10/03/guide-video-part-two/
>
> The code he provides in the finished product folder (main.m) has the necessary examples.
>
> It's probably better that you place the "pointers" to the file and path names with the setappdata() command that way you can change the images without closing the GUI.
>
> In Matt Fig's GUI examples:
> http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples
>
> GUI's 39 and 40 control an axes without using GUIDE.
thank it works
|
|
0
|
|
|
|
Reply
|
luky
|
12/23/2010 1:56:04 PM
|
|
"luky ja" <pica26@seznam.cz> wrote in message <ievkdk$itd$1@fred.mathworks.com>...
> "Robert" wrote in message <iet52v$su0$1@fred.mathworks.com>...
> > Check out Doug Hull's video on this subject:
> >
> > http://blogs.mathworks.com/videos/2005/10/03/guide-video-part-two/
> >
> > The code he provides in the finished product folder (main.m) has the necessary examples.
> >
> > It's probably better that you place the "pointers" to the file and path names with the setappdata() command that way you can change the images without closing the GUI.
> >
> > In Matt Fig's GUI examples:
> > http://www.mathworks.com/matlabcentral/fileexchange/24861-41-complete-gui-examples
> >
> > GUI's 39 and 40 control an axes without using GUIDE.
>
> thank it works
it works, but when i load a picture to one axes.....i want to make svd compression and show the result to other axes...
|
|
0
|
|
|
|
Reply
|
luky
|
12/24/2010 11:27:04 AM
|
|
|
6 Replies
1506 Views
(page loaded in 0.087 seconds)
|
|
|
|
|
|
|
|
|