hi i have two porblem please help me 1- why varible B of the previouse function not known for the next function ?? 2 -what code is required for the save image with written informatin (time by text) ?
function Recogtion_Callback(hObject, eventdata, handles)
% % % % % %
cla(handles.axes3)
[B,f]=uigetfile('*.jpg;*.tif;*.png;*.gif');
ff=[f B];
axes(handles.axes3);
imshow(ff);
guidata(hObject, handles);
tm=datestr(now,'yyyy/mm/dd HH:MM:SS');
text(15,20,tm,'color','r','fontsize',16)
function Save_Callback(hObject, eventdata, handles)
tm=datestr(now,'yyyymmddTHHMMSS');
n=strcat('d:\',tm,'.jpg');
imwrite (B,n);
guidata(hObject, handles);
[EDITED, code formatted, Jan]

回答(1 个)

Jan
Jan 2012-5-22
编辑:DGM 2024-9-25

0 个投票

Do you assume that B is known inside the function SaveCallback? If so, this assumption is wrong. The visibility of variables is limited to their functions. This is explained in the Getting Started chapters of the documentation.
What does "save image with written information" exactly mean? Do you want to add a comment? Then reading imwrite() will provide the necessary arguments.

4 个评论

Or maybe export_fig() if he wrote some text into the overlay with the text() function.
mostafa
mostafa 2012-5-26
no
is there a function that image with print information on image to save by text function ???
The mechanism for that is to text() onto the image, and then getsnap() and imwrite() that result.
Image Analyst
Image Analyst 2012-5-26
编辑:DGM 2024-9-25
You can use insertText() in the Computer Vision Toolbox, or try this File Exchange submission: http://www.mathworks.com/matlabcentral/fileexchange/31187-label-image

请先登录,再进行评论。

类别

帮助中心File Exchange 中查找有关 Image Processing Toolbox 的更多信息

提问:

2012-5-22

编辑:

DGM
2024-9-25

Community Treasure Hunt

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

Start Hunting!

Translated by