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

4 visualizzazioni (ultimi 30 giorni)
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'

Risposta accettata

Image Analyst
Image Analyst il 5 Set 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);

Più risposte (0)

Categorie

Scopri di più su Read, Write, and Modify Image in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by