Finding an affine transformation matrix

Click For Summary

Discussion Overview

The discussion revolves around finding an affine transformation matrix for a computer vision application, specifically to map the corners of a unit square to the corners of a quadrilateral defined by 2D coordinates on the image plane. The participants explore the conditions under which such a transformation is possible and the implications of the shape of the quadrilateral.

Discussion Character

  • Technical explanation
  • Debate/contested

Main Points Raised

  • Warren introduces the problem of finding an affine transformation matrix for a quadrilateral defined by its corners on the image plane.
  • One participant suggests translating the quadrilateral to the origin and questions whether the quadrilateral is a parallelogram, noting that affine transformations typically map squares to parallelograms.
  • This participant proposes a method to construct a matrix using the translated corners but expresses uncertainty about whether the fourth corner can be correctly mapped.
  • Another participant provides a counterexample, asserting that the transformation described does not result in an affine mapping, as it does not preserve the properties of affine transformations.
  • A later reply agrees with the counterexample, emphasizing that affine transformations must map lines to lines, which the proposed mapping does not do.
  • Another participant reinforces the idea that affine transformations preserve the ratio of lengths and that the diagonals of a square must bisect each other, implying that the image must also be a parallelogram.
  • This participant suggests that the point D in a quadrilateral is uniquely determined by the intersection of the diagonals and the ratios of segments created by those diagonals.

Areas of Agreement / Disagreement

Participants express disagreement regarding the feasibility of mapping a square to a non-parallelogram quadrilateral using an affine transformation. There is no consensus on the existence of such a transformation, with some arguing it is impossible while others explore the conditions under which it might work.

Contextual Notes

The discussion highlights the limitations of affine transformations, particularly in relation to the shapes involved. The assumptions about the quadrilateral's properties and the implications of its shape on the mapping process are not fully resolved.

chroot
Staff Emeritus
Science Advisor
Gold Member
Messages
10,270
Reaction score
45
Hey guys,

I have a problem in a computer vision application that requires me to find an affine transformation matrix, A.

What I've got are four corners of a quadrilateral, in 2D coordinates on the image plane. These are the projections of the 3D corners of the real quadrilateral onto the image plane.

What I need to find is the 3D affine transformation matrix, A, which transforms the corners of a unit square into the given corners. If I can easily determine if such a transform does not exist, that information would also be useful.

Methods using homogeneous coordinates are fine, of course.

Anyone have any ideas?

- Warren
 
Physics news on Phys.org
if the corners of the image are A,B,C,D, let's translate back to the origin, by subtracting A from all of them.

Then A-A is at the origin, and we have three more points,oops. wait a minute, is this quadrilateral a parallelogram?

if not it seems hard to map a square onto it by an affine map. i.e. an affine map is just a translate of a linear map, and it seems a linear map must send a square to a parallelogram, no?

anyway, back to work: if we take two of the three translated corners say B-A, and C-A, we can make a matrix with those as columns.

then that matrix will send the unit square to the parallelogram spanned by 0 = A-A, B-A, and C-A. then translating back by A, will send the unit square to the parallelogram spanned by A,B,C.

but it might not send the 4th corner of the square to D, unless D-A = B-A + C-A, as vectors.

does this seem right?
 
here is a counterexample:
img530.imageshack.us/img530/2964/notaffinert8.png
 
maze said:
here is a counterexample:
img530.imageshack.us/img530/2964/notaffinert8.png
Affine transformations map lines to lines; yours isn't affine.
 
mathwonk said:
does this seem right?
Looks right to me; I got the same result (only works if the image is a parallelogram) in a different manner. Given two line segments lying on the same line, affine transformations preserve the ratio of their lengths. In particular, the diagonals of a square bisect each other -- and so that must also be true of its image, meaning it has to be a parallelogram.

In general, given the following information about a quadrilateral ABCD whose diagonals intersect at E:

. A
. B
. C
. AE / EC
. BE / ED

the point D is uniquely determined.
 
Hurkyl said:
Affine transformations map lines to lines; yours isn't affine.

thats why its a counterexample...
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 17 ·
Replies
17
Views
7K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
27K