如何使用MATLAB将单个图像与多个图像进行匹配? [关闭]

问题描述 投票:-4回答:2

例如,我的目录中有100张图像,其中'x'张图像是相同的,我想知道x的值。

matlab image-processing video-processing matlab-cvst
2个回答
1
投票
% Reference image
img_ref = imread('img_ref.jpg');

% Create an variable for alloc the path
img_path ='/your/dir/of/images/'

% Create an variable struct, for searching files with .jpg extension 
names = dir(fullfile(img_path, '*.jpg'));

% Counts the number of images on the path
n_imgs = numel(names); 

for n = 1:n_imgs
    full_name = fullfile(img_path, names(n).name);
    your_imgs = imread(full_name);

    r = isMatch(img_ref,your_imgs);
    disp(r)
end

您可以使用上面由Rob F.创建的功能


1
投票

如果我正确理解了您的问题,并且您要做的就是计算与目标图像完全相同的图像数量,那么这应该可以工作...

© www.soinside.com 2019 - 2024. All rights reserved.