How to save the image in axes in the GUI?
Show older comments
Hi, I have a GUI in which i need to save the image that is in the right hand side of the axes. I here by attach you the snapshot of the GUI. This is the coding for the GUI.
I couldn't find the callback function for the image in the axes. Can you please help me to figure out saving the image that is in right hand side only. Thanks...
1 Comment
Manoj Kumar
on 25 Jul 2014
Answers (2)
Image Analyst
on 21 Jul 2014
0 votes
You put it in the axes so you should have it and can use imwrite on it. If you really want just what's in the axes rather than the original image, then use getframe().
8 Comments
Manoj Kumar
on 21 Jul 2014
Image Analyst
on 21 Jul 2014
What happened to your friend?
Manoj Kumar
on 21 Jul 2014
Image Analyst
on 22 Jul 2014
He was using imagesc() to display them, and the second image was called im. So just do
imwrite(im, fullFileName);
Manoj Kumar
on 22 Jul 2014
Edited: Manoj Kumar
on 22 Jul 2014
Image Analyst
on 25 Jul 2014
When you say
threshimage=image(back);
threshimage is not an image. It's the handle to an image, in other words, a floating point number, not an actual image. Just look up the help for image() function and you'll see I'm right. But then you use it as an image afterwards which is not correct.
What is the image that is in red? I can't tell because the code is hard to follow. Is it back? Is it norm_im? Whatever it is, you have it as a variable in your program and you don't need to pull it out of the axes with getframe().
Manoj Kumar
on 27 Jul 2014
Edited: Manoj Kumar
on 30 Jul 2014
Manoj Kumar
on 30 Jul 2014
guo shaobo
on 14 Aug 2014
0 votes
maybe you could solve this problem by using the following codes:
>>frame = get(get(handles.cameraAxes,'children'),'cdata');% The current displayed frame
>>save('testframe.jpg', 'frame');
cameraAxes is your axes tag in the GUI which display the image
Categories
Find more on Lighting, Transparency, and Shading in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!