Matching detected objects from two cameras
I am using OpenCV (c++) and I have two cameras which I am using for object detection purposes. They are working side by side, but they have different configurations. Like, one is only RGB the other is infrared, also the resolutions are different. Anyway, what I want to do is, to detect objects in both (which is done) and match these objects with each other, so that I do not feed the same objects to further functions again and again.
Are there algorithms which can be employed to achieve this? If yes, what are they?
Thanks in advance.
This is so broad. It all depends on which 2 camera's are being matched ...
I am asking for a matching/assignment algorithm like Hungarian algorithm, given two instances of detected obstacle bounding boxes, how to match each with its corresponding one.
And again, if I tell you now to use normalized euclidean distance between samples for example, this would work for setup1, but fail horribly for setup 2. You cannot see this as a general problem. Sensor fusion is very situation specific.
I thought of something like point comparison. I do know the points in both images (from two cameras) where the obstacles appear. If I compare each of its center point with the other obstacles in the second camera, I think that would do it, wouldn't it? Say, there would be a margin like -+ 5 points, if two centers fall under this margin, these centers corresspond to the same obstacle.
Well then that depends on the false positives of your detection techniques I guess. If you have no false positives and a high true positive rate, then yes that could work.
If you know the relative position of one camera to another, then you should be able to transform the coordinates of one object found to the other camera referential and check if it is the same..
If the cameras are really close to each other, I suggest you check for bounding box overlap, if it is higher than a threshold, than it can be marked as being the same object.
^ I've actually managed to achieve this exactly like following that approach. Sorry, it is a bit late now but nevertheless it IS the answer to the question, and should be accepted.
Which approach?