Need to generate tform matrix from triangle parameters.

If a user draws a triangle with parameters b, h and theta and wants to change an entire image via a transformation from a new triangle with user inputed parameters b', h', theta'. How can the transformation matrix be found?

 채택된 답변

Matt J
Matt J 2016년 1월 20일
편집: Matt J 2016년 1월 20일
The corners of each triangle are separated by vectors dy and dx. There is some 2x2 matrix A which transforms them from triangle 1 to triangle 2,
dy2=A*dy1
dx2=A*dx1
These are linear equations in the unknown A, which you can solve.

댓글 수: 5

Does this transformation also include a change in angle?
yes, the angle between dy2,dx2 can be different from dy1,dx1, as long as both are significantly non-zero.
And can this matrix then be applied to the rest of the image?
Matt J
Matt J 2016년 1월 21일
편집: Matt J 2016년 1월 22일
would it be possible to use your absor function for this vary problem?
Only if theta doesn't transform. Otherwise, the transformation is not a pure rotation.
Matt J I have since managed to solve for the matrix A how can then use this matrix to generate a matrix for an image?

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Matt J
Matt J 2016년 1월 20일

0 개 추천

Why not use fitgeotrans, like you were advised here?

댓글 수: 1

I don't have the version of matlabwith fitgeotrans. I need to find someway without using two images.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Geometric Transformation and Image Registration에 대해 자세히 알아보기

질문:

2016년 1월 19일

댓글:

2016년 1월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by