Perspective transform a Point not an Image
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuesta aceptada
Teja Muppirala
el 19 de Abr. de 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 comentarios
Más respuestas (1)
Ver también
Categorías
Más información sobre Geometric Transformation and Image Registration en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!