フィルターのクリア

renaming the image after matching the image with other folder in matlab

1 回表示 (過去 30 日間)
annmaria
annmaria 2015 年 7 月 12 日
コメント済み: annmaria 2015 年 7 月 13 日
I have two folders, In the first folder connected components are present like alphabets and some other components, each are named with 1,2....In the second folder 26 alphabets are present and are named with 1,2,...26. Using pca each elements in the first folder is matched with the second folder. If it does not matched i want to remove it from the folder. If the first element matched with the first element in the second folder then i want to rename the element in the first folder with alphabet A. If it matched with second then rename it as B and so on Is it possible? can anyone give some example for that pls..thanks in advance the code for matching the images is given below
clear all
clc
close all
% You can customize and fix initial directory paths
TrainDatabasePath = uigetdir('D:\Program Files\MATLAB\R2006a\work', 'Select training database path' );
TestDatabasePath = uigetdir('D:\Program Files\MATLAB\R2006a\work', 'Select test database path');
prompt = {'Enter test image name (a number between 1 to 10):'};
dlg_title = 'Input of PCA-Based Face Recognition System';
num_lines= 1;
def = {'1'};
TestImage = inputdlg(prompt,dlg_title,num_lines,def);
TestImage = strcat(TestDatabasePath,'\',char(TestImage),'.bmp');
im = imread(TestImage);
T = CreateDatabase(TrainDatabasePath);
[m, A, Eigenfaces] = EigenfaceCore(T);
OutputName = Recognition(TestImage, m, A, Eigenfaces);
Z=OutputName;
SelectedImage = strcat(TrainDatabasePath,'\',OutputName);
SelectedImage = imread(SelectedImage);
imshow(im)
title('Test Image');
figure,imshow(SelectedImage);
title('Equivalent Image');
str = strcat('Matched image is : ',OutputName);
disp(str)
imshow(im) title('Test Image'); figure,imshow(SelectedImage); title('Equivalent Image');
str = strcat('Matched image is : ',OutputName); disp(str)

採用された回答

Image Analyst
Image Analyst 2015 年 7 月 12 日
Which variable gives the number of the letter/image that it matched? Anyway, you can use movefile() to rename image files . You might also find sprintf() and fullfile() useful.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by