例如,我的目录中有100张图像,其中'x'张图像是相同的,我想知道x的值。
% 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.创建的功能
如果我正确理解了您的问题,并且您要做的就是计算与目标图像完全相同的图像数量,那么这应该可以工作...