Perspective transform a Point not an Image
2 views (last 30 days)
Show older comments
Hello,
I have four points I measured in an Image. In reality they are the corners of a rectangle.
ImagePoints = [x1 y1;x2 y2;x3 y3;x4 y4]
RealPoints = [0 0;100 0;0 60;100 60]
I measure another point lying in this rectangle. I need the real koordinates of this Point (in the rectangle).
ImageMeasurePoint = [x y]; <= I have this.
RealMeasurePoint = [x y]; <= I want this.
I don't want to transform the whole image. I just want to calculate the RealMeasurePoint. Is there a function I can use?
Can you help me.
Thanks Timo
0 Comments
Accepted Answer
Teja Muppirala
on 19 Apr 2011
If you have the Image Processing Toolbox, using cp2tform and tformfwd makes this very easy, and will work even when ImagePoints is not a perfectly straight rectangle:
ImagePoints = [10 10; 110 10; 10 310; 110 310];
RealPoints = [0 0;100 0;0 60;100 60];
T = cp2tform(ImagePoints,RealPoints,'projective')
ImageMeasurePoint = [60 160];
RealMeasurePoint = tformfwd(T,ImageMeasurePoint)
0 Comments
More Answers (1)
See Also
Categories
Find more on Geometric Transformation and Image Registration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!