# get transformation from points

I'm reading this article about shape context algorithm so for example we have pairs of points http://dl.dropbox.com/u/8841028/shape%20context/point_corespondence.png http://dl.dropbox.com/u/8841028/shape%20context/transform_estimation.png what is mean by matrix of homogeneous coordinates?

edit retag close merge delete

Sort by » oldest newest most voted

Linear transformation can be represented as matrix. Assume that you have an object that is set of points, each in the form of p=(x,y). If you want to apply rotation, scaling or shear to it, you just need to find 2x2 matrix A, and for each point p calculate A*p. As a result objected is rotated, scaled and sheared. But some of extreamely frequent transformations are not linear. Shift for example. Or projective transformation. As a result you can't describe them as matrix operation. Homogeneous coordinates is a workaround for this problem. Instead of represnting point as (x,y) you represent it as (x,y,1). Now you can store those transformations as 3x3 matrix B (that part of it is 1 and 0).

more

Nice explanation but do you know how to explain in a bit more detail why isn't it possible to describe non-linear transformations as a matrix and how does adding an extra coordinate with homogeneous coordinates helps solving that problem?

( 2012-08-26 16:27:52 -0500 )edit
( 2012-08-27 01:41:45 -0500 )edit

What methods applied to solve such system of equation? for example affine transformation can be solved with LeastSquares but how about perspective transform?

( 2012-08-27 04:44:51 -0500 )edit

Opencv has affineTransform and perspectiveTransform functions that can be applied to sets of points, buddy :)

( 2012-08-27 05:25:08 -0500 )edit

I never tried to solve least square equations for perspective transformation, so I don't know. Sorry.

( 2012-08-27 05:28:10 -0500 )edit

@Rui Marques the problem is that perspectiveTransform can't handle with small errors in coordinates,with outliners when we use overdetermined system of linear equations. I tried to solve it with pseudoinverse matrix http://opencv.willowgarage.com/documentation/cpp/algebraic_operations.html but it give me all 0.

( 2012-08-30 01:29:13 -0500 )edit

Official site

GitHub

Wiki

Documentation