View Single Post
  #2   Spotlight this post!  
Unread 31-01-2012, 19:40
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Angular Rectangle Tracking

I did a bit of quick measuring on the attached images and I get ...

105x79
92x82
77x84

for sizes of the green rectangle. I'm not sure if the green surrounds the red or is one larger, but it gets us a pretty good measure of the rectangles that are being viewed.

What I think you'll notice is that the widths are changing by more than the height. Relating everything to the first rect, we have

100%,100%
87.6%,103.8%
73.3%,106.3%

This all makes sense since the rectangle will eventually turn into a small vertical sliver that is (distance - 12") away and full height. A little taller than original actually.

So ... perhaps you should take the math in the original VI and have it calculate the distance using the height of the bounding box using the height of the tape and the pixel height of the image. It may vary a bit more if the camera is tilted up or down looking at the rect, but it should vary less when distorted as your images are.

You mention that beyond this angle, the rect detector fails, and from the green text scores next to the rect, it seems like the aspect ratio is the score element that will fail. There is nothing that says you need to pass all four, or by how much. Those scores give you some measures of how rectangular and how hollow the element is, and you can use them any way you like. For example, if the edge scores are super high, you could allow the aspect ratio to drop significantly, and even use it as an angle estimator. Similarly, the area score will drop a bit as the rect turns into a quadrilateral. The example is there to demonstrate some relationships, but can certainly be specialized and improved, and I encourage you to make it fit the way that your team's robot will play the game.

Thanks for posting the images, and I'll be happy to answer any other questions.
Greg McKaskle
Reply With Quote