Perspective transform a Point not an Image

3 次查看(过去 30 天)
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

采纳的回答

Teja Muppirala
Teja Muppirala 2011-4-19
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)

更多回答(1 个)

Timo
Timo 2011-4-19
Hall Teja!
Your my hero! Thanks a lot! Thumbs up! I'm happy now!
Wish you a nice day! You deserve it.
Thanks Timo

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by