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

7 ビュー (過去 30 日間)
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'

採用された回答

Image Analyst
Image Analyst 2013 年 9 月 5 日
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);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by