I am trying to find the ground-plane coordinates of contour of an image. I have been able to detect the contour and get the x, y, w and h of the contour, but I now need it on a 2D ground plane coordinate system. I am trying to perform camera calibration to find out data about the camera so that I can perform homography to get the ground plane data. However I am using pre-made videos so I cannot use the checkerboard solution that I am finding online. Does anyone have any ideas?
0
votes
you will have to guess some distances on the ground plane in the image. Vanishing point can help a lot. Can you share such an image?
- Micka
@Micka thank you for the reply, I have attached the image for reference to the original post
- Harry West
that's hard to guess ground plane positions (the ground pane is the water level, right?) in such an image. Do you know the size of the small visible ship? I However, if you can estimate the lens distortion and the pixel size (intrinsic parameters of the camera) you can use the horizon to estimate camera rotation angles, define the vanishing point for the "camera-direction" on the horizon and define parallel lines on the ground. Then I think from the pixel positions of line's points you can compute ground point locations, up to some accuracy/error.
- Micka
@Micka yeah I'm looking to get the water level as the ground plane coordinates. I won't know the size of the ships as they are going to be random in my program. So I need to find the intrinsic parameters, find the rotation off of the horizon, and then use vanishing point off of that to find ground coordinates? Sorry I am new to this field and trying to teach this to myself
- Harry West
after correcting lens distortion and camera rotation (so that the horizon is straight and horizontal) choose the vanishing point in the middle of the image width. Then choose 2 lines from the horizon to equal positions left/right in the image. Then choose a point on each of those lines with same y coordinate. Those 2 points should have equal real world distance to the camera. From known pixel size you can now draw a 3D ray from the camera through the pixel to the real world. Unclear how to actually select the right depth where ro stop on those rays. You'll need some knowledge in linear algebra
- Micka
1 Answers
1
votes
- For objects far away, the height of the bridge in the foreground is very small compared to their distance from the camera, so a homography computed from points on the bridge will be approximately correct far away, provided the bridge is approximately horizontal (no roll). This is another way of saying that the images all horizontal planes pass through the horizon.
- For objects nearby, but not on the bridge, the above approximation will suffer from parallax error. Unless you have an object of known scale on the plane of interest (the sea), or an estimate of the distance of the bridge from that plane, there is no information available to resolve depth - as far as you can tell the bridge could be 100m or 1mm above the sea.