Elements of this problem are:
- Detect an object in a stereo image
- Determine distance of a point using the difference of the location along the x-axis between images captured with the left and right camera.
- Return a real distance to a point in the image
Assumptions:
- The object of interest has been identified
- All other points in the images not corresponding to the object of interest have been masked
- Images were calibrated for the camera
- Objects of interest are between 4ft and 15ft
Hardware:
- Raspberry Pi 3
- 2 Raspberry Pi cameras
- Arducam Mult-Camera Adapter
Software:
- Python 2.7
- OpenCV 2.4
- Ubuntu MATE 15.10 for Raspberry Pi 3
Procedure:
- Mask unimportant parts of the image
- Detect test objects based on saturation value
- Set remainder of image as black
- Determine the difference of a measured point in the image of a set of test images to empirically estimate the focal constant of the stereo camera setup using the "fast" corner detection algorithm in OpenCV (see Figures 1 and 2)
- For each test set, find the coordinates of the same point in both images
- Hand-calculate the difference and use the known distance to determine the focal constant
- Use the estimate of the focal constant to find the actual distance of an object
- Use estimated focal constant to determine the error between predicted distance and actual distance
- Filter predictions that lay outside of the area of interest
- Filter predictions that are outside of one standard deviation of the mean prediction