Go to Post When we design these systems ask " would I want my Mom (or daughter) standing next to this thing when it goes off? - Mike Betts [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 29-01-2012, 23:40
Lightfoot26's Avatar
Lightfoot26 Lightfoot26 is offline
Just Out For A Rip, Bud...
AKA: Seth Lightfoot
FRC #1625 (Winnovation)
Team Role: Mentor
 
Join Date: Dec 2009
Rookie Year: 2010
Location: Winnebago, IL
Posts: 120
Lightfoot26 is just really niceLightfoot26 is just really niceLightfoot26 is just really niceLightfoot26 is just really niceLightfoot26 is just really nice
Angular Rectangle Tracking

Ok, I have studied the NI white paper and have been running the rectangle track example quite a bit. After getting solid target samples using IR emitters and lenses I have found that when exactly straight in front of the targets I get a beautifully accurate distance from the camera to the center of the rectangle, but as I angle myself to the targets I notice my distances all go horribly awry. Now I KNOW that FRIST and NI, with their never ending knowledge wouldn't make an example that can only be accurate straight on, furthermore I feel like as I read on CD I feel like some of you guys are also successfully reading accurate distances when at an angle comparative to the hoop. Any insight on how I can be successful with angular distance reads of the rectangle?

-Much Appreciated
Lightfoot26
__________________
Winnovation Team 1625 (2010-??)
  • Electrical/Programming Captain (2011-2013)
  • Auxiliary Driver (2012-2013)
  • Team Captain (2013)
  • Alumni (Graduated May 2013)
  • Electrical and Programming Mentor (2014-??)
Reply With Quote
  #2   Spotlight this post!  
Unread 30-01-2012, 07: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

Can you give more detail on how far from center, and what horribly awry is? Can you tell what term is not working?

Also be sure that you have the correct camera selected.

Greg McKaskle
Reply With Quote
  #3   Spotlight this post!  
Unread 30-01-2012, 11:26
Lightfoot26's Avatar
Lightfoot26 Lightfoot26 is offline
Just Out For A Rip, Bud...
AKA: Seth Lightfoot
FRC #1625 (Winnovation)
Team Role: Mentor
 
Join Date: Dec 2009
Rookie Year: 2010
Location: Winnebago, IL
Posts: 120
Lightfoot26 is just really niceLightfoot26 is just really niceLightfoot26 is just really niceLightfoot26 is just really niceLightfoot26 is just really nice
Re: Angular Rectangle Tracking

The 206 is selected and is what we are using, and I mean when my camera is at an angle to the hoop I get distance readings 3 to 4 feet off, though when straight on I get readings that are dead accurate.
__________________
Winnovation Team 1625 (2010-??)
  • Electrical/Programming Captain (2011-2013)
  • Auxiliary Driver (2012-2013)
  • Team Captain (2013)
  • Alumni (Graduated May 2013)
  • Electrical and Programming Mentor (2014-??)
Reply With Quote
  #4   Spotlight this post!  
Unread 30-01-2012, 14:34
wireties's Avatar
wireties wireties is offline
Principal Engineer
AKA: Keith Buchanan
FRC #1296 (Full Metal Jackets)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Rockwall, TX
Posts: 1,170
wireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond reputewireties has a reputation beyond repute
Send a message via AIM to wireties
Re: Angular Rectangle Tracking

When you are not directly in front of the goal you are tracking a trapezoid, not a rectangle. I have not looked at the code, does it account for this? Perhaps you can feed a rectangle into your code and use the height of the left or right side of your trapezoid. BTW, the relative heights of the left and right side will tell you want angle you have.

HTH
Reply With Quote
  #5   Spotlight this post!  
Unread 30-01-2012, 21:43
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

Quote:
and I mean when my camera is at an angle to the hoop I get distance readings
What distance? How far off center? What angle? Even better, what about an image so that we can work on the problem together.

Greg McKaskle
Reply With Quote
  #6   Spotlight this post!  
Unread 31-01-2012, 17:58
Lightfoot26's Avatar
Lightfoot26 Lightfoot26 is offline
Just Out For A Rip, Bud...
AKA: Seth Lightfoot
FRC #1625 (Winnovation)
Team Role: Mentor
 
Join Date: Dec 2009
Rookie Year: 2010
Location: Winnebago, IL
Posts: 120
Lightfoot26 is just really niceLightfoot26 is just really niceLightfoot26 is just really niceLightfoot26 is just really niceLightfoot26 is just really nice
Re: Angular Rectangle Tracking

Ok, so I have attached 3 pictures showing what I am talking about, all of these taken when the center is 7 feet 2in from the camera. The first on is the straight on picture, and is giving a near accurate workable measurement. The second is a slight angle showing a drastic gain in distance, though its STILL 7 feet 2in from the center, then I moved the rectangle to the most extreme angle I can get it while the program still detects a rectangle and distance measurement is farther still. That any help?
Attached Thumbnails
Click image for larger version

Name:	striaght on really 7 feet 2in.png
Views:	185
Size:	327.7 KB
ID:	11659  Click image for larger version

Name:	angle still 7 feet 2in.png
Views:	126
Size:	324.3 KB
ID:	11660  Click image for larger version

Name:	farther angle still 7 feet 2in.png
Views:	145
Size:	325.5 KB
ID:	11661  
__________________
Winnovation Team 1625 (2010-??)
  • Electrical/Programming Captain (2011-2013)
  • Auxiliary Driver (2012-2013)
  • Team Captain (2013)
  • Alumni (Graduated May 2013)
  • Electrical and Programming Mentor (2014-??)
Reply With Quote
  #7   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
  #8   Spotlight this post!  
Unread 02-02-2012, 14:35
Lightfoot26's Avatar
Lightfoot26 Lightfoot26 is offline
Just Out For A Rip, Bud...
AKA: Seth Lightfoot
FRC #1625 (Winnovation)
Team Role: Mentor
 
Join Date: Dec 2009
Rookie Year: 2010
Location: Winnebago, IL
Posts: 120
Lightfoot26 is just really niceLightfoot26 is just really niceLightfoot26 is just really niceLightfoot26 is just really niceLightfoot26 is just really nice
Re: Angular Rectangle Tracking

I thank you for all your help on the situation. After your help and my further understanding of the code, I have tailored the code to do exactly what I want, and now we are extremely accurate. Thanks a bunch!

-Lightfoot26
__________________
Winnovation Team 1625 (2010-??)
  • Electrical/Programming Captain (2011-2013)
  • Auxiliary Driver (2012-2013)
  • Team Captain (2013)
  • Alumni (Graduated May 2013)
  • Electrical and Programming Mentor (2014-??)
Reply With Quote
  #9   Spotlight this post!  
Unread 03-02-2012, 20:49
Bryguy9312 Bryguy9312 is offline
Registered User
FRC #3219
 
Join Date: Jan 2012
Location: Washington
Posts: 2
Bryguy9312 is an unknown quantity at this point
Re: Angular Rectangle Tracking

Quote:
Originally Posted by Lightfoot26 View Post
Ok, so I have attached 3 pictures showing what I am talking about, all of these taken when the center is 7 feet 2in from the camera. The first on is the straight on picture, and is giving a near accurate workable measurement. The second is a slight angle showing a drastic gain in distance, though its STILL 7 feet 2in from the center, then I moved the rectangle to the most extreme angle I can get it while the program still detects a rectangle and distance measurement is farther still. That any help?
Do you think you could post your block diagram? We're having issues running the image processing through our laptop.
Reply With Quote
  #10   Spotlight this post!  
Unread 03-02-2012, 20:57
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'm glad it helped. Good luck with it.

Greg McKaskle
Reply With Quote
  #11   Spotlight this post!  
Unread 20-01-2013, 16:13
joemost joemost is offline
Registered User
no team
Team Role: Engineer
 
Join Date: Jan 2013
Rookie Year: 2012
Location: New Hampshire
Posts: 39
joemost will become famous soon enough
Re: Angular Rectangle Tracking

Quote:
Originally Posted by wireties View Post
When you are not directly in front of the goal you are tracking a trapezoid, not a rectangle. I have not looked at the code, does it account for this? Perhaps you can feed a rectangle into your code and use the height of the left or right side of your trapezoid. BTW, the relative heights of the left and right side will tell you want angle you have.

HTH

My team is still looking how to figure this out too. Has anyone had any luck with tracking trapezoids or shapes other than a perfect rectangle. If so how?
Reply With Quote
  #12   Spotlight this post!  
Unread 20-01-2013, 16:41
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

The code this year is a bit smarter. It is also covered in the white paper. It uses something called the Equivalent Rectangle for a particle.

Basically, a particle has an area A and a perimeter P, so you can solve for the rectangle of height H and width W where A=H*W and P=2*H + 2*W. It can do this for circular, trapezoidal, and other shapes, and doesn't really claim that the particle is a rectangle, but if it happens to be, the W and H should be pretty close, typically a tighter fit than the bounding rect and less sensitive to skewed rectangles.

This year's example uses both the bounding box and equivalent rect as measures to compute the distance.

Greg McKaskle
Reply With Quote
  #13   Spotlight this post!  
Unread 21-01-2013, 20:30
Priyesh69 Priyesh69 is offline
Registered User
FRC #3988
 
Join Date: Nov 2012
Location: montreal
Posts: 46
Priyesh69 is an unknown quantity at this point
Re: Angular Rectangle Tracking

We manage to get the rectangular tracking done. Now how to we put that data in the vi so it will ajust to the right angle of our window motor to get the right angle for our shooter.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 22:29.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi