Backboard angle using vision tracking

I’ve been doing a ton of work on vision tracking and so far it’s been going pretty well, but the main issue is that we don’t want to shoot at the vision target - we want to shoot at the center of the hoop! We have the math working to adjust for that, but we need the angle of the backboard relative to the robot

We were thinking of using the apparent aspect ratio of the target to determine the angle (the target is 4:3, so if it appears to be 1:1, we should know we’re at an angle). The problem with this is that A. we have no idea what direction we’re facing the target at, and B. due to fisheye on the Axis 206 camera we’re using, even when we’re directly facing the target, if the target is toward the sides of the screen, it reports a ~20 angle.

Does anyone have any ideas on this?

Once you have the location of the target within the image, you can do further processing on only that local area. One approach that may work is to look for something else such as the hoop or the net. Another approach would be to use tools like the edge detection or do some processing on an given column of pixels to identify the ratio of the left and right edge. I posted in another thread on a more precise technique using law of cosines to solve for the angles of the triangle between the left edge, camera, and right edge.

Greg McKaskle

Do you recall what thread that is in? Because I have been having problems finding LabVIEW threads according to Vision. In addition, I also have been having trouble determining the midpoint of the 4 targets due to the inability or inaccuracy of our lighting at the moment. Our targets keep flickering and therefore makes my code very inaccurate due to overshoot. One last thing; I am currently using pixel based processing. How accurate can I get our distance to the target when we are shooting at the target from an angle because the aspect ratio changes. Any help would be appreciated and resources or other threads would be great. Thanks :smiley:

The thread
And I expect that this is the post you want, but it looks like there is good information in some of the other posts as well.

http://www.chiefdelphi.com/forums/showpost.php?p=1101535&postcount=18

As for the distance error. It definitely should exist, but doesn’t seem that bad for what I thought were reasonable shooting positions. Your milage may vary. A somewhat bigger issue is that this is a distance and position to the center of the rectangle, and that distance and angle may not be where you want to send the ball. If you want a swish-shot, you ideally want to know the center of the hoop. It is near the target, but not at the same position. If you way to bank shot, do you want to shoot at the center of the rect always, or perhaps a bit to the left or right according to angle. I think the answers depend on your shooter.

Of course if the shooter is not super repeatable, these calculations may be overkill.

Greg McKaskle

Would you mind sharing your code on your doing this? I just need an example to show to the other programming people on my team to show them how it could potentially work.

thanks

Please share, send me a pm if yo uwant :smiley: