How can I select 2 objects among a lot of the same object?

asked 2015-06-19 15:09:27 -0500

mmt gravatar image

Hello everyone!

Do you all have any idea about how can I select only 2 objects among a lot of the same object?

To make clear my question, I will provide some details.

Imagine an video with 10 balls jumping, but you only need to know about 2 of them, and then take their coordinates.

How can I do that? I thought about use mouse event, but I do not know how I can apply it. Or identify all balls and show the number of them, so I can use my keyboard to select which one I need. But I do not know too.

What I have?

I have a video, which I applied knn filter to get only black and white. After this I used findContours and drawContours, so all I have is all balls "identified" and contoured.

Thanks in advance!

I use python to program, and it is required! :(

edit retag flag offensive close merge delete

Comments

Why don't you just take two random balls? Or at some point in time the left most and the right most?

FooBar gravatar imageFooBar ( 2015-06-22 01:41:21 -0500 )edit

The manual usually helps SetMouseCallback

pklab gravatar imagepklab ( 2015-06-26 12:48:11 -0500 )edit