필터 지우기
필터 지우기

How to save an image with plotted lines and annotations

조회 수: 10 (최근 30일)
Jed
Jed 2014년 3월 19일
댓글: Jed 2014년 4월 8일
Hi, i am doing a batch processing task and for each image i will get a thresholded image with lines plotted ontop showing the initial point of spray and final point of spray and a value for the length of spray. However, i am needing to save all of this to one file like the image below. My matlab knowledge is depressingly basic. I was trying to use the imwrite function below as this will allow me to put all the processed images in the same folder, however, i do not know how to add the plotted lines and annotations to the thresholded image.Does anyone know how to do this? Thank you in advance!
% plot thresholded image
imagesc(BWpen);axis image; hold on;
% plot max penetration onto BWpen
plot(result(:,1),result(:,2),'r-.')
[And the line for nozzle exit]
% annotate with length of penetration
text(InjectorX-60,InjectorY-30,...
sprintf('%1.3f',meani)],'color','b','FontSize',14,'FontWeight','bold');
% attempt to write into folder
imwrite([BWpen], ['cropped\' filelist(k).name]);
  댓글 수: 1
Jed
Jed 2014년 3월 19일
And sorry, secondly, how could i write the values of the maximum penetration for each image into a file so that i could later draw graphs from them? [where the value for maximum penetration is given by 'meani'.in the above code] Thank yoooouu!!

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

채택된 답변

Image Analyst
Image Analyst 2014년 3월 19일
export_fig() (the most downloaded MATLAB app of all time) is probably the most common way. See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_do_I_save_my_figure.2C_axes.2C_or_image.3F_I.27m_having_trouble_with_the_built_in_MATLAB_functions.
  댓글 수: 14
Image Analyst
Image Analyst 2014년 4월 8일
I don't know. I've just used it for capturing screenshots of the entire figure, not of just one axes on the figure. I'd try to contact Oliver Woodford, who wrote export_fig. Worst case, read it in, crop it (hopefully it's the same size every time) and re-save it.
Jed
Jed 2014년 4월 8일
Yea good idea, thanks

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by