- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

transform obtained from an external source, and I am trying to use

this to resample an Image using WarpAffine. The transformation parameters

were calculated with reference to a center different from the origin. Since

WarpAffine has no parameter to specify thre center of the transform, I wanted

to know what sequence of steps I should pass my coeff[2][3] through, to ensure

that the transformation applied to the image is around the same center with

reference to which it was derived.

Thanks,

Sid.

Link Copied

3 Replies

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

I though a bit more about the problem, and I figured out

that I will have to recenter the coordinates, i.e X-C, prior to

applying the resampling on the grid. To restate,

If the usual approach for resampling is X' = AX, where A is the

transform and X is the image grid (giving f(X') actually), how do

I go about implementing X' = A(X-C) using available ip primitives,

where C is the center of the transform.

Thanks again,

Sid.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Let affine transform is

xD = c00*xS + c01*yS + c02

yD = c10*xS + c11*yS + c12

The coordinates of centers are (xScenter, yScenter) and (xDcenter, yDcenter).

So we should use:

xD = c00*(xS-xScenter) + c01*(yS-yScenter) + xDcenter

yD = c10*(xS-xScenter) + c11*(yS-yScenter) + yDcenter

Then the desired coefficients are

02 = xDcenter - c00*xScenter - c01*yScenter

12 = yDcenter - c10*xScenter - c11*yScenter

Thanks,

Beg

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Let me rejuvenate this thread, with reference to my latest thread regarding getAffineTransform for a quadilateral:

if the initial quad of Q = {(xi,yi), i=0,1,2,3}, and the final quad is Q'= {(x'i,y'i), i = 0,1,2,3}, and coeffs[2][3]

are obtained by ippiGetAffineTransform between Q and Q', to what center are this coeffs referred to? Am i right

in thinking : (x2-x1)/2 and (y2-y1)/2 ?

Thanks

Sid.

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page