1 | initial version |
As first step, you need to detect the paper, suppose the background is uniform, in that case simple threshold might work.
Now you got the object detected, next calculate the distance by referring the following,
Check out this link might be helpful if you know the focal length and sensor height of the camera.
For far distance object you can use the equation by THE RULE OF 57
Distance of object= (Size of object * 360)/(2 * 3.14 * Angular size in degree)
For more information refer this link.
2 | No.2 Revision |
As first step, you need to detect the paper, suppose the background is uniform, in that case simple threshold might work.
Now you got the object detected, next calculate the distance by referring the following,
Check out this link might be helpful if you know the focal length and sensor height of the camera.
For far distance object you can use the equation by THE RULE OF 57
Distance of object= (Size of object * 360)/(2 * 3.14 * Angular size in degree)
For more information refer this link.
Use imwrite to save the image to hard-disk.