How can Matlab make a title for all figures, according to the "imread" input image.

6 visualizaciones (últimos 30 días)
I'm doing image processing on images, and a lot of figures are plotted. I am reading in one image at a time in, perform some functions and then have outputs. I want the result figure to show a title that will show what image I was working on, before looping to a next image.
Leernaam has .png images for instance diaretdb1_image002.png
Thus: imageIN = imread(LeerNaam);
image processing .... result=bw.*I;
figure, imshow(result), ... title ' I want it to display diaretdb1_image002 automatically, because imageIN used it and all processing was done on imageIN'

Respuesta aceptada

Image Analyst
Image Analyst el 5 de Sept. de 2013
Use sprintf() to create a string that you can use for a title, for example:
caption = sprintf('Working on %s\nImage #%d out of %d',...
filename, currentImageNumber, totalNumberOfImages);
If you want the title to appear above just the current axes, then you can use title():
title(caption, 'FontSize', 24);
otherwise, you can use set() to send the caption to a static text label control:
set(handles.text1, 'String', caption);

Más respuestas (0)

Categorías

Más información sobre Images en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by