I want to change figure name to name of the image I = imread
is reading in the following code:
I = imread("6hearts.jpg");
I = rgb2gray(I);
[Ir, Ic]=size(I);
if (Ic > Ir)
I = imrotate(I,270);
end
srcFile = dir('C:\Users\umut8\Desktop\Deneme2*.jpg');
for i = 1:length(srcFile)
filename = strcat("C:\Users\umut8\Desktop\Deneme2",srcFile(i).name);
T = rgb2gray(imread(filename));
[Tr, Tc]=size(T);
temp = 0;
if (Tc > Tr)
T = imrotate(T,270);
Temp = Tc;
Tc = Tr;
Tr = Temp;
end
R = normxcorr2(T,I);
if (find(R > 0.75))
R = imcrop(R,[Tc Tr Ic Ir]);
[r, c, v] = find(R==(max(max(R))));
RGB = insertShape(I, 'rectangle',[c, r, Tc, Tr],'LineWidth', 3, "Color", "Red" ,'Opacity',0.7 );
figure(3);
imshow(RGB)
end
end
I want the title of the figure3
to be the "6hearts" in this spesific example.