Go to Post It is possible to live without the Big sponsors, it just takes a lot of fund raising and hard work. - Raumiester2010 [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Spotlight this post!  
Unread 02-21-2016, 11:27 AM
Cinnamon Toast's Avatar
Cinnamon Toast Cinnamon Toast is offline
Registered User
FRC #3641 (The Flying Toasters)
Team Role: Programmer
 
Join Date: Jan 2015
Rookie Year: 2013
Location: Michigan
Posts: 32
Cinnamon Toast is an unknown quantity at this point
Re: How to calculate distance from camera using Opencv APIs

Hi!

Depending on your opencv code this is very possible. The way we do vision processing we do blob detection of a particular target (biggest blob always is the one targeted). After we find the blob we draw a circle around it, and place a dot in the center of the circle. For pose correction we use the pixel coordinates of the dot that we draw. Something else we do get from the code is the radius of the circle that we drew. As the camera gets farther away from the target, the target gets smaller, and so does the circle that we drew around the blob. By taking a couple of measurements, you can just create a linear relationship between radius of the circle and real world distance. The calculation actually holds up pretty well, as we plan to use it for targeting this year.

-Cinnamon Toast.
P.S. PM me if you want some sample code with opencv and stuff. I'd be willing to help.
Reply With Quote
 


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 09:17 AM.

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