Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You should do it in two steps. Perspective transform uses the carthesian (x,y) coordinates, lens distrotion correction uses polar coordinates (rho, phi) relative to the center of the image. Theoretically it might be possible to create a complicated formula for this (you write all the transformations as matrices, then multiply them), but I don't see any reason to do this.

However if your camera is static, you could precompute a displacement image, containg for each (x,y) pixel the coordinates of the transformed (x',y') pixel - this would speed up considerably the processing, and would give you directly the coordinates of the objects on the street.

If the camera is not static and you need to get the homography matrix for each image, you have to undisort the image anyway before further operations.

You should do it in two steps. Perspective transform uses the carthesian (x,y) coordinates, lens distrotion correction uses polar coordinates (rho, phi) relative to the center of the image. Theoretically it might be possible to create a complicated formula for this in one step (you write all the transformations as matrices, matrices [carthesian->polar->undisort->carthesian->perspective], then multiply them), but I don't see any reason to do this.

However if your camera is static, you could precompute a displacement image, containg for each (x,y) pixel the coordinates of the transformed (x',y') pixel - this would speed up considerably the processing, and would give you directly the coordinates of the objects on the street.

If the camera is not static and you need to get the homography matrix for each image, you have to undisort the image anyway before further operations.