2017-04-18 76 views
1

我想在场景中查找多个对象(对象看起来相同,但可能在比例和旋转方面不同,我不知道要检测的对象是什么)。我已实现了以下想法,基于OpenCV中的featuredetectors,它的工作原理:检测多个对象(使用OpenCV)

detect and compute keypoints from the object 
for i < max_objects_todetect; i++ 
    1. detect and compute keypoints from the whole scene 
    2. match scene and object keypoints with Flannmatcher 
    3. use findHomography/Ransac to compute the boundingbox of the first object (object which hast the most keypoints in the scene with multiple objects) 
    4. set the pixel in the scene, which are within the computed boundingbox to 0, -> in the next loopcycle there are no keypoints for this object to detect anymore. 

这个实现的问题是,我需要计算的关键点为现场多次这就需要计算时间的很多(250毫秒)。有没有人有更好的想法检测多个对象?

感谢Drian

+0

你使用什么检测器和描述符? –

+0

现在使用SURF检测器和描述符 – Drian

+0

也许你应该使用ORB,而不是SURF。但我不知道你的图像有多准确。 –

回答

0

你好togehter我试图ORB这的确是更快,我会尽量Akaze。

虽然测试ORB我已经encouterd以下问题:

虽然chaning我的图片的大小doesn't影响冲浪检测关键点(发现在小和大画面相同的关键点(在链接图片右)),它会影响ORB检测到的关键点。在小野菜中,我无法找到这些关键点。我试图用ORB参数进行试验,但不能使其工作。

图片:http://www.fotos-hochladen.net/view/bildermaf6d3zt.png

SURF:

cv::Ptr<cv::xfeatures2d::SURF> detector = cv::xfeatures2d::SURF::create(100); 

ORB:

cv::Ptr<cv::ORB> detector = cv::ORB::create(1500, 1.05f,16, 31, 0, 2, ORB::HARRIS_SCORE, 2, 10); 

你知道,以及如何it's可以检测独立的大小相同的关键点图片?

问候Drian

+0

如果它检测到与大小无关的相同关键点,它有什么关系?如果您正在检测多个对象并将它们的像素设置为0,如果对象检测是正确的,与大小无关,在我看来,这并不重要。 –

+0

当我想要检测大部分中的小部分时,我无法使用ORB查找对象,导致我在ORB检测到的小图片中没有关键点,但是当我使用SURF时,我拥有关键点并且我是能够检测到对象。 – Drian

+0

这确实是一个问题。您应该尝试使用参数,特别是'scaleFactor'和'patchSize'。如果这不起作用,请尝试使用“BRISK”进行检测,并使用“对手BRISK”进行说明。探测器应该给你很多'关键点',所以你可能想在估计单应性之前过滤来自描述符的匹配。 –