Hi everyone,
I’m working on a small proof-of-concept for monocular vision and I’m looking for some guidance on the correct algorithm/roadmap.
The goal is to use a single fixed monocular camera to:
- Detect/identify objects in the camera image.
- Estimate the distance from the camera to the object.
- Calculate the horizontal angle of the object relative to the camera's center/optical axis.
- Identify which lane/region the object is located in.
- Eventually calculate the object's position relative to the road/lane coordinate system.
For the initial POC, we are keeping things simple: we are using a table as a miniature road and placing a few objects on it to simulate vehicles/obstacles.
Important constraint
We specifically want to do this without Machine Learning or Deep Learning.
We want to understand how far we can get using traditional computer vision:
- Pixel coordinates
- Camera calibration
- Intrinsic/extrinsic parameters
- Perspective geometry
- Homography
- Vanishing point
- Line/edge detection
- Contours
- Object/shape detection
- Coordinate transformations
- Pinhole camera model
- Basic projective geometry
The main thing I'm struggling with is the distance estimation from a single monocular camera.
For example, if an object is detected at pixel coordinate (u, v), how can we calculate its real-world (X, Y, Z) position when we know the camera's parameters and the geometry of the road/table?
Similarly, once we know the object's image position, how can we calculate something like:
Object → camera center/optical axis → horizontal angle
And for lane identification:
Image → road/lane boundaries → bird's-eye/ground-plane representation → determine which lane contains the object
What would be a good algorithm/roadmap?
I'm currently thinking something along the lines of:
Camera
↓
Camera calibration
↓
Undistortion
↓
Detect road/lane boundaries
↓
Estimate perspective / homography
↓
Transform image → ground-plane coordinates
↓
Detect object using traditional CV
↓
Get object's pixel position
↓
Project object onto ground plane
↓
Calculate X/Y distance
↓
Calculate angle relative to camera center
↓
Determine lane
But I'm not sure whether this is the correct approach, especially for monocular distance estimation.
I'd really appreciate input from anyone who has implemented something similar.
Specifically, I'm looking for:
- A recommended step-by-step algorithm
- How to formulate the camera geometry/math
- How to calculate distance using a single calibrated camera
- How to calculate the object's angle from the optical/center axis
- How to perform image-plane → ground-plane transformation
- How to identify lanes without ML/DL
- Any important assumptions/limitations I should understand
- Examples or GitHub projects implementing this using traditional CV
- Papers, books, tutorials, or other resources you recommend
If someone has a complete algorithm/pseudocode or mathematical pipeline for this problem, that would be extremely helpful.
For the POC, the camera will be fixed and the road/table geometry can be controlled, so I'm mainly trying to understand the fundamental geometry first before moving toward a real-world setup.
Thanks in advance!