- dev_open_window (0, 0, 500, 400, 'black', WindowHandle)
- read_image (Pen01, 'pen/pen-01.png')
- read_image (Pen29,'pen/pen-29.png')
- get_image_size (Pen01, Width1, Height1)
- get_image_size (Pen29, Width2, Height2)
- Message := 'Pen01 size: ' + Width1 + 'x' + Height1 + ', Pen29 size: ' + Width2 + 'x' + Height2
- Col1:=[84,272,88]
- Row1:=[94,211,214]
- Col2:=[96,285,104]
- Row2:=[77,195,198]
- disp_image(Pen01, WindowHandle)
- disp_circle(WindowHandle, Row1, Col1, [5,5,5])
- disp_image(Pen29, WindowHandle)
- disp_circle(WindowHandle, Row2, Col2, [5,5,5])
- hom_mat2d_identity (HomMat2D)
- vector_to_rigid (Col1, Row1, Col2, Row2, HomMat2D)
- **vector_to_rigid (Row1, Col1, Row2, Col2, HomMat2D)
- **hom_mat2d_invert (HomMat2D, HomMat2D)
- hom_mat2d_to_affine_par(HomMat2D, Sx, Sy, Phi, Theta, Tx, Ty)
- Message := 'Scale: (' + Sx + ', ' + Sy + '), Rotation: ' + Phi*180/3.14159 + '°, Translation: (' + Tx + ', ' + Ty + ')'
- affine_trans_image_size (Pen01, ImageTranslated, HomMat2D, 'constant', Width2, Height2)
- dev_clear_window()
- disp_image(ImageTranslated, WindowHandle)
- sub_image (ImageTranslated, Pen29, ImageDiff, 1, 128)
- disp_image(ImageDiff, WindowHandle)
复制代码
进行逆变换可以对齐,但是为什么?另外vector_to_rigid后面的参数col1,row1,col2,row2对吗?
其他地方好多都是row1,col1,row2,col2. 小白求解答,先谢谢各路大神了!
|