Filter löschen
Filter löschen

How to save an image with plotted lines and annotations

10 Ansichten (letzte 30 Tage)
Jed
Jed am 19 Mär. 2014
Kommentiert: Jed am 8 Apr. 2014
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 Kommentar
Jed
Jed am 19 Mär. 2014
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!!

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Image Analyst
Image Analyst am 19 Mär. 2014
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 Kommentare
Image Analyst
Image Analyst am 8 Apr. 2014
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 am 8 Apr. 2014
Yea good idea, thanks

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Convert Image Type finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by