Effacer les filtres
Effacer les filtres

How to save an image with plotted lines and annotations

10 vues (au cours des 30 derniers jours)
Jed
Jed le 19 Mar 2014
Commenté : Jed le 8 Avr 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 commentaire
Jed
Jed le 19 Mar 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!!

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 19 Mar 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 commentaires
Image Analyst
Image Analyst le 8 Avr 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 le 8 Avr 2014
Yea good idea, thanks

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Convert Image Type dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by