How to save the image in axes in the GUI?

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

I couln't get the image in the axes which is in right hand side. I tried in many ways to get the image:
%image2=getimage(gcf);
figure;imshow(image2);
and
%image=getframe(h_ax1);
image2=frame2im(image);
figure;imshow(image2);,,
I am facing problems to get the image, by using the above lines i am getting the figure with complete red image but not the thresholded image.
Can you please help me in getting the image from the axes..
Thanks

댓글을 달려면 로그인하십시오.

답변 (2개)

Image Analyst
Image Analyst 2014년 7월 21일

0 개 추천

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

Manoj Kumar
Manoj Kumar 2014년 7월 21일
This is my friends coding and I couldn't find in which axes I can get the image that is in the right hand side. Can you please check that for me?
Thanks...
Image Analyst
Image Analyst 2014년 7월 21일
What happened to your friend?
Manoj Kumar
Manoj Kumar 2014년 7월 21일
he has left and this is a task given by my professor to me.
He was using imagesc() to display them, and the second image was called im. So just do
imwrite(im, fullFileName);
Manoj Kumar
Manoj Kumar 2014년 7월 22일
편집: Manoj Kumar 2014년 7월 22일
If i use imwrite(im,fullfilename), I could save the image that I used to run the program, but not the thresholded image that I made at the right side. I want to save the image after thresholding, i.e the image you can see with the red dots on it after thresholding. You can see the thresholded image which is in the right side of the screen shot.
thanks...
Image Analyst
Image Analyst 2014년 7월 25일
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
Manoj Kumar 2014년 7월 27일
편집: Manoj Kumar 2014년 7월 30일
I tried in this way
image=getimage(h_ax1);
figure;imshow(image);
to get the thresholded image, but I got this output,
I even tried with norm_im, but I am getting the segmented Image before thresholding. I need the segmentedImage after thresholding.
I don't understand how to call the image in the right side of the GUI(i think in ax_1)
Can you please run the code using these lines in the command window and help me in getting the image in the right side of the axes.
>> im=imread('segmented.jpg');
>> imorig=imread('original.jpg');
>> manual_thresh(im,imorig);
I here by attach the code.
Manoj Kumar
Manoj Kumar 2014년 7월 30일
hi, can any body help me ?

댓글을 달려면 로그인하십시오.

guo shaobo
guo shaobo 2014년 8월 14일

0 개 추천

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

태그

질문:

2014년 7월 21일

편집:

2014년 9월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by