Go to Post ...and leave your bumpers at home. - Andy Grady [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

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 21-02-2016, 10:52
v5190robo v5190robo is offline
Registered User
FRC #5190
 
Join Date: Feb 2016
Location: North Carolina
Posts: 1
v5190robo is an unknown quantity at this point
How to calculate distance from camera using Opencv APIs

Hi,

Is there any Opencv APIs or image processing algorithms in Opencv that can be used to calculate the distance of the camera from the target.

Thanks,
Vijay
Reply With Quote
  #2   Spotlight this post!  
Unread 21-02-2016, 11:27
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
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 12:10.

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