필터 지우기
필터 지우기

one to many matching in matlab

조회 수: 3 (최근 30일)
annmaria
annmaria 2015년 7월 24일
I have two folders. I want to find the hierarchicalCentroid of the first image in the folder1 and all the images in the folder 2,then calculate the dist_1_2 between the image in folder1 and each image in the folder2,then find the minimum distance and display it . Again calculate the hierarchicalCentroid of the second image in the folder1 and find the distance with each element in the second folder and calculate the minimum distance and so on.. I write one code,But it want some changes. please help me
Dataset='H:\mainproject\codes\letters_numbers';
Testset = 'H:\mainproject\codes\images\test\kk';
plotFlag = 1;
depth = 6;
DataSet = cell([], 1);
for i=1:length(dir(fullfile(Dataset,'*.bmp')))
% Training set process
k = dir(fullfile(Dataset,'*.bmp'));
k = {k(~[k.isdir]).name};
for j=1:length(k)
tempImage = imread(horzcat(Dataset,filesep,k{j}));
imgInfo = imfinfo(horzcat(Dataset,filesep,k{j}));
DataSet{j} = hierarchicalCentroid(tempImage,depth,plotFlag);
%Feature = feature_extractor(image(j));
% DataSet{j} = imresize(hierarchicalCentroid(tempImage),[width height]);
end
end
TestSet = cell([], 1);
for i=1:length(dir(fullfile(Testset,'*.bmp')))
% Training set process
k = dir(fullfile(Testset,'*.bmp'));
k = {k(~[k.isdir]).name};
for j=1:length(k)
tempImage = imread(horzcat(Testset,filesep,k{j}));
imgInfo = imfinfo(horzcat(Testset,filesep,k{j}));
TestSet{j} = hierarchicalCentroid(tempImage,depth,plotFlag);
end
end
dist_1_2 = sum((DataSet{j} - TestSet{j}) .^ 2);

답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by