Rotating/Correcting angle by known sizes in an image


#1

Here comes a brain cracker.

We have a setup with a camera in the ceiling taking pictures on a table. The pictures need to be taken 99.9% accurately straight down and since the camera moves slightly from day to day and it’s impossible to get a 100% straight down picture so my current ideas is to:

This is how the images look like:
http://i.imgur.com/hWzE5Iy.jpg

  1. Create a camera in Cinema4d with the same properties as the camera used and put the image on a 2d-plane and rotate the 2d-plane until the sizes match up. (300mm on one side is the same as 300mm on the other side etc. This is veeery time consuming but works

2. Use a corner positioner to trial and error until the sizes match up (300mm on one side is the same as 300mm on the other side etc. This is also very time consuming but slightly faster than the above.

EDIT: Nr 2 doesn’t produce accurate results as it can skew the image without getting wrong measurements.

I just have a strong feeling that there is software/techniques that would tackle this problem more efficiently. Like telling the software that this drawn line is 300mm and this drawn line SHOULD be 300mm and make a decision around that.