例如,我在我的目录中有100张图像,其中'x'图像相同,我想知道x的值。如何使用MATLAB将单个图像与多个图像进行匹配?
回答
如果我正确理解你的问题,所有你想要做的是算多少图像是完全一样的,有些目标图像,那么这应该工作...
%directory where images are stored
directory = 'Directory_To_Images';
files = dir(directory);
%total number of matches
numMatches = 0;
%The Real image, the image you wish to test against
RealImage = imread('Target_Image.jpg');
%go through all files in the directory
for i = 1 : length(files)
[pathstr,name,ext] = fileparts(files(i).name);
%test to make sure its a JPG image (you may need to modify this if you have
%multiple file types
if (strcmp(ext,'.jpg'))
%check if the images match
if(isMatch(RealImage, [directory '\' name ext]))
numMatches = numMatches+1;
end
end
end
sprintf('Number of matches: %s', num2str(numMatches))
这里是失踪功能:
function[result] = isMatch(RealImage, TestImage)
testImage = imread(TestImage);
if (sum(sum(sum(RealImage == testImage))) == size(RealImage,1) * size(RealImage,2) * size(RealImage,3))
result = true;
else
result = false;
end
让我们假设一个场景我有一个10分钟的视频剪辑。因为我想知道视频中某个特定人物的存在(总时间)。为此,我提取了视频中的所有帧,现在我想与输入图像匹配,然后根据时间计算帧,例如。说24fps ...如果500张照片匹配500/24秒。有没有其他方法可以找到?在此先感谢 – Raju
@KanakaRaju,让我们假设你学会使用计算器。你问一两件事,得到了你问什么有用的答案(500个图像目录),现在它就像他们浪费了他们的(带薪)时间写,所以您可以修改规则.. –
% 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.
让我们假设一个场景我有一个视频剪辑10分钟。因为我想知道视频中某个特定人物的存在(总时间)。 为此,我提取了视频中的所有帧,现在我想与输入图像匹配,然后根据时间计算帧,例如。说24fps ...如果500张照片匹配500/24秒。有没有其他方法可以找到? 在此先感谢 – Raju
@KanakaRaju,让我们假设你学会使用计算器。你问了一件事,并为你提出的问题(目录中的500张图片)得到了有用的答案,现在就像他们浪费了他们的(无偿)时间写作一样,以便你可以改变规则。 –
- 1. 如何使用SURF特征(在MATLAB中)将图像中的对象与其他图像进行匹配?
- 2. SURF如何将模板与原始图像进行匹配?
- 3. 如何将按钮与图像匹配?
- 4. Jquery与多个图像进行交互
- 5. 如何将实时相机图像与图像匹配
- 6. 通过BiometricSDK将服务器的位图图像与另一个位图图像进行匹配?
- 7. 单个图像中的多个图像
- 8. 导入多个图像matlab
- 9. 匹配两个图像
- 10. 使用c#将图形图像与其他图形图像匹配?
- 11. 如何使用LibSVM为多个描述符进行图像分类 - Matlab
- 12. Matlab - 如何使用二进制图像掩盖三维图像
- 13. 使用Matlab进行图像比较
- 14. 使用Matlab进行马赛克图像
- 15. 访问单个图像像素,matlab
- 16. jquery - 将链接颜色与显示的图像进行匹配
- 17. matlab中两个彩色图像的直方图匹配
- 18. 如何合并单个图像中的多个图像
- 19. 如何使用多个背景图像指定单个全局背景图像?
- 20. 将多个图像压缩成单个图像
- 21. 将多个图像合并为单个图像
- 22. 如何做图像匹配?
- 23. 如何通过单击进行多个图像下载
- 24. 匹配图像
- 25. 将图像解析为多个图像
- 26. 如何将多个图像添加到图像视图
- 27. 将TButtonedEdit图像与TComboBox匹配默认图像
- 28. 如何在Android中将多个图像组合成单个图像?
- 29. 如何将单个PHP上传图像转换为多个上传图像
- 30. MATLAB图像裁剪器用于多个图像?
同为一精确复制? –
@AnderBiguri 我的意思是我想知道的X.即价值,我希望看到所有图片! – Raju
什么?所有图片= 100,然后x = 100?你提出的评论与这个问题是不一致的。你能解释一下你的问题是什么? –