java - 在单个图像中检测多个图像

标签 java image matlab image-processing

我需要帮助来识别边框并将图像与原始图像进行比较。我需要有关如何通过处理或 matlab 或初学者的任何东西来实现这一点的指导。例如看下图。

原图:

enter image description here

多重图像: Larger Image

最佳答案

您展示的“多张图片”只需简单的图像处理即可轻松处理,无需模板匹配 :)

% 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

enter image description here

关于java - 在单个图像中检测多个图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20802649/

相关文章:

matlab - 倍频程/MATLAB : How to compare structs for equality?

css - 在 CSS 中使图像适合浏览器大小

image - 检测图像中的乐高底板

jQuery 在不破坏布局的情况下增加图像大小

图例中同一行的两种不同颜色的Matlab

Java 的 System.getRuntime().exec 表现得不像 shell 用户调用它

Java:有没有更简单的方法来解析字符串中的数组元素?

java - 在 Java 中模拟 Excel 微积分行为以进行测试

java - 无法将语言特定字符保留到 xml 数据类型的数据库列中

MATLAB:线性回归