Java 中的对象检测/跟踪

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3909020/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 03:55:57  来源:igfitidea点击:

Object detection/tracking within Java

javaimage-processingobject-detection

提问by AtharvaI

I'm looking to do some image processing in Java and I'll be developing in Ubuntu with Eclipse. So here is my objective:

我希望用 Java 进行一些图像处理,我将在 Ubuntu 中使用 Eclipse 进行开发。所以这是我的目标:

From a greyscale image, I would like to be able to detect certain sized objects and draw a rectangular frame around them. However, the catch is that this image is captured from a thermal imaging camera so to detect body heat the pixels will have a value within a certain range. After detecting all the objects in the image, I will need to count them, but that's later.

从灰度图像中,我希望能够检测某些大小的对象并在它们周围绘制一个矩形框。然而,问题是该图像是从热成像相机捕获的,因此为了检测体热,像素将具有一定范围内的值。在检测到图像中的所有对象后,我需要对它们进行计数,但那是以后的事。

So here's my challenge. Which tools/apis/open classes can I use to do something like this. I looked around and found some basic manipulations such as rotate, crop, resize. But haven't really found anything I can use.

所以这是我的挑战。我可以使用哪些工具/apis/开放类来做这样的事情。我环顾四周,发现了一些基本的操作,例如旋转、裁剪、调整大小。但还没有真正找到我可以使用的任何东西。

Where should I look/start?

我应该从哪里看/从哪里开始?

thanks a lot in advance

非常感谢提前

采纳答案by Eelco

ImageJ is very useful: http://rsbweb.nih.gov/ij/

ImageJ 非常有用:http: //rsbweb.nih.gov/ij/

Although ImageJ is set up as a GUI, you can use it as a library too (I do that too)

尽管 ImageJ 设置为 GUI,但您也可以将其用作库(我也这样做)

You'll have to search for a proper object detection plugin (but there are some floating around...)

你必须寻找一个合适的对象检测插件(但有一些浮动......)

good luck! Eelco

祝你好运!艾尔科

回答by Radone

On this page you can find open-source tool for image processing and image mining: http://spl.utko.feec.vutbr.cz/en/image-processing-extension-for-rapidminer-5

在此页面上,您可以找到用于图像处理和图像挖掘的开源工具:http: //spl.utko.feec.vutbr.cz/en/image-processing-extension-for-rapidminer-5

回答by voxoid

This article fully explainsthe algorithm you're looking for, and the accompanying source code is here. You can see it in action in this video.

这篇文章完整地解释了你正在寻找的算法,随附的源代码在这里。您可以在此视频中看到它的运行情况

(Disclaimer: I'm the author; but I do think this is very useful, and have successfully used the algorithm a lot myself.)

(免责声明:我是作者;但我确实认为这非常有用,并且我自己已经成功地使用了很多算法。)

The algorithm tracks moving objects, finds their bounding rectangle (which the application draws), counts the number of pixels in each objects, correlates them throughout frames as the same object (with an int ID). You may need to do a trival conversion of your grayscale image to RGB (by copying the gray values to all three channels) since the algorithm was designed for color input.

该算法跟踪移动对象,找到它们的边界矩形(应用程序绘制的矩形),计算每个对象中的像素数,将它们在整个帧中关联为同一对象(具有 int ID)。您可能需要将灰度图像简单地转换为 RGB(通过将灰度值复制到所有三个通道),因为该算法是为颜色输入而设计的。

When it comes to commercial computer vision applications, OpenCVand the Point Cloud Library aka PCLare your best friends. And articles like the one linked explains how to use tools like OpenCV to accomplish full stack motion tracking. (The pure Java implementation shows how it works down to the individual pixels.)

当谈到商业计算机视觉应用程序时,OpenCV点云库又名 PCL是您最好的朋友。类似链接的文章解释了如何使用 OpenCV 之类的工具来完成全栈运动跟踪。(纯 Java 实现显示了它是如何工作到单个像素的。)