我需要帮助来识别边框并将图像与原始图像进行比较。我需要有关如何通过处理或 matlab 或初学者的任何东西来实现这一点的指导。例如看下图。
原图:
多重图像:
最佳答案
您展示的“多张图片”只需简单的图像处理即可轻松处理,无需模板匹配 :)
% read the second image
img2 = imread('http://i.stack.imgur.com/zyHuj.jpg');
img2 = im2double(rgb2gray(img2));
% detect coca-cola logos
bw = im2bw(img2); % Otsu's thresholding
bw = imfill(~bw, 'holes'); % fill holes
stats = regionprops(bw, {'Centroid', 'BoundingBox'}); % connected components
% show centers and bounding boxes of each connected component
centers = vertcat(stats.Centroid);
imshow(img2), hold on
plot(centers(:,1), centers(:,2), 'LineStyle','none', ...
'Marker','x', 'MarkerSize',20, 'Color','r', 'LineWidth',3)
for i=1:numel(stats)
rectangle('Position',stats(i).BoundingBox, ...
'EdgeColor','g', 'LineWidth',3)
end
hold off
关于java - 在单个图像中检测多个图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20802649/