How do I detect vertices of an approximated polygon?

asked 2017-02-04 14:05:56 -0600

Smosher104 gravatar image

Hello everyone. I am an FRC programmer working on detecting and identifying retro reflective tape. Currently, I can detect the tape and draw an approximated polygon around the tape that follows it in real time. However, I would like to make it so that an object that is also the same color of green (e.g. another team's led) does not get tracked if it has more vertices's than the tape I am detecting. My question is how can I obtain the number of vertices (not points) from the whatever object has an approximated polygon drawn around it. Any help would be greatly appreciated and very helpful. Thank you for your time.

edit retag flag offensive close merge delete

Comments

Can you provide some code? If you are using findContours then all your points are there in a vector already and you can just count them.

noel gravatar imagenoel ( 2018-12-27 19:18:39 -0600 )edit