How to save an image displayed ?

조회 수: 1 (최근 30일)
Pramod Bhat
Pramod Bhat 2011년 10월 20일
Dear friends, i would like to save an image displayed by imshow(I) command in tif format. for example, ifter displaying the image, i select an interactive ROI using "imfreehand(gca", them i wud like to save the image with that RIO borders. when whenever i try this, it is saving its borders also with the image. I dont want that border frame to be saved. may you plz help ? the image shud be saved in .tif format only...

채택된 답변

Image Analyst
Image Analyst 2011년 10월 20일
The saved image must be rectangular, no matter what your freehand ROI looks like, but the outer layer of pixels shouldn't be white unless you're cropping the image and then setting them white. You are using imwrite() to save the cropped portion aren't you?
  댓글 수: 2
Pramod Bhat
Pramod Bhat 2011년 10월 20일
I agree that the saved image should be rectangular irrespective of the ROI. But I want the displayed image to be saved. but when u save it, it ll add and extra frame to the image WHICH IS UNWANTED. I want the core image to be saved.
Im telling u my need another way. I just want the ROI curve to be superimposed on the original image and to be saved. I don want any extra frame or background.
Thanking you…
Image Analyst
Image Analyst 2011년 10월 21일
OK let me ask again as simply and explicitly as I can:
"Are you using the function imwrite() to save your image to disk?"
Please answer.

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

추가 답변 (2개)

Grzegorz Knor
Grzegorz Knor 2011년 10월 20일
I'm not sure if I understood you well:
figure, imshow('pout.tif');
h = imfreehand(gca);
.
.
.
axis off
print('-dtiff','-r200',filename)
  댓글 수: 1
Pramod Bhat
Pramod Bhat 2011년 10월 20일
thanq....but while saving, it is saving that inmage with it's border(white frame around the image) also...i don want that border to be saved. i want only that with the ROI to be saved.
may u plz help..

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


Jonas Reber
Jonas Reber 2011년 10월 20일
have a look at the solution I provided in your second question. it should answer both: http://www.mathworks.com/matlabcentral/answers/18795-how-to-recostruct-roi-on-an-image-and-diaplay-it

카테고리

Help CenterFile Exchange에서 Images에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by