# Calculating distance to an unknown object with single camera

Hi all,

The title says it all, I have a camera mounted on a moving boat and I want to know the distance of the detected targets. Here is the scenario:

• I have the GPS information.
• I do know my velocity and direction.
• I have a single camera and an algorithm to detect the targets.
• I am moving, changing my location all the time. However the camera is mounted.
• Targets are moving, they are mostly boats sailing around.
• My camera is calibrated already.
• Edit: Targets have different sizes. They could be kayaks, boats, huge container ships, sailing boats, etc.

Give these, is there a way to find how far is the detected target from me?

Any help is appreciated.

Thanks

edit retag close merge delete

If the boats have all the same size maybe you can use the size of the detected objects, but unfortunately the boats have different sizes and more, the side is not having the same aspect ratio with the front/back of the boat, it is very difficult to say... Or you can measure the water to the object...

( 2015-05-28 06:54:49 -0500 )edit

Thank you for your rapid answer. Yes, unfortunately the targets have different sizes. They could be small jet-skis, kayaks, fishing boats or huge container ships. Therefore going over the size parameter would not work in my case.

( 2015-05-28 06:56:29 -0500 )edit

So does your camera see the water? can you detect it? just compute the distance from your boat to the object on water, if it is very small, then it is very close... lol You should find some equation, maybe the best is to see very little of your boat and the camera very close to the boat border...

( 2015-05-28 07:52:32 -0500 )edit

This is what I see and out of this field, I am trying to get the distance to the dynamic targets. I did not understand what you meant by "just compute the distance from boat to the object on water", that is what I am wondering anyway, I mean that is the question that I pose. Calculating the distance to the object on the water surface.

( 2015-05-28 09:27:35 -0500 )edit

Sort by ยป oldest newest most voted

ok, your camera is seeing enough water for saying if the object is close of not to the boat. Try what I have mentioned:

You can detect the boat, the other object and the distance on water between them. try to interpret the distance on a log scale and set a threshold like if the converted distance (as exp(dist)) is smaller than it, the object is close.

HINT: you can have 2 areas: front and side for different actions...

Try a first version and come back if you get stocked.

more

Can you please say why have you downvoted?

( 2015-06-10 08:33:13 -0500 )edit

Official site

GitHub

Wiki

Documentation