当前位置:网站首页>Halon common affine transformation operators
Halon common affine transformation operators
2022-06-27 04:26:00 【weixin_ thirty-nine million nine hundred and twenty-six thousan】
Reprint :
Affine transformation
Affine transformation mainly includes translation transformation 、 Rotation transformation 、 Zoom transform ( It's also called scaling )、 Tilt shift ( It's also called stagger transformation 、 Shear transform 、 Offset transformation )、 Flip transformation . There are six degrees of freedom .
To perform an affine transformation , You must get the transform first matrix . To get the transformation matrix , The coordinates of feature points must be obtained first 、 Angle and other information , Geometric matching and bolb It is an efficient method to obtain feature points , There are other ways , As long as the characteristic points can be obtained stably .
Affine transformation process
(1.) Obtain the coordinates of feature points 、 angle
(2.) Calculate the affine transformation matrix
(3.) To image 、 Area 、 Affine transformation of contour
According to feature points 、 Angle calculation affine transformation matrix
hom_mat2d_identity(:::HomMat2DIdentity)
function : Generate affine transformation matrix
hom_mat2d_rotate(::HomMat2D,Phi,Px,Py:HomMat2DRotate)
function : Add the rotation angle to the affine transformation matrix
HomMat2D:( Input parameters ) Affine transformation matrix
Phi( Input parameters ): Rotation Angle ( Unit radian )
Px( Input parameters ): Transformed fixed point row coordinates . A fixed point is an affine transformation supported by this point ( Here it means to rotate around this point )
Py:( Input parameters ) Fixed point column coordinates of transformation
HomMat2DRotate:( Output parameters ) Output transformation matrix
hom_mat2d_scale(::HomMat2D,Sx,Sy,Px,Py:HomMat2DScale)
function : Add scaling to the affine transformation matrix
HomMat2D( Input parameters ): Affine transformation matrix
Sx( Input parameters ):x Scaling factor in the axis direction
Sy( Input parameters ):y Scaling factor in the axis direction
Px( Input parameters ): Transformed fixed point row coordinates
Py( Input parameters ): Fixed point column coordinates of transformation
HomMat2DScale( Output parameters ): Output transformation matrix
hom_mat2d_translate(::HomMat2D,Tx,Ty:HomMat2DTranslate)
function : Add translation to the anti fire transformation matrix
HomMat2D:( Input parameters ) Affine transformation matrix
Tx( Input parameters ): Along the x The distance of translation in the axis direction
Ty: Input parameters ): Along the y The distance of translation in the axis direction
HomMat2DTranslate( Output parameters ): Output transformation matrix
hom_mat2d_slant(::HomMat2D,Theta,Axis,Px,Py:HomMat2DSlant)
function : Add the oblique tangent to the anti fire transformation matrix
HomMat2D( Input parameters ): Affine transformation matrix
Theta( Input parameters ): Bevel angle ( Company : radian )
Axis( Input parameters ): The axis of the oblique cut . Value list :x,y
Px( Input parameters ): Fixed point of transformation x coordinate
Py( Input parameters ): Fixed point of transformation y coordinate
HomMat2DSlant( Output parameters ): Output affine transformation matrix
vector_angle_to_rigid(::Row1,Column1,Angle1,Row2,Column2,Angle2:HomMat2D)
function : The rigid affine transformation matrix is calculated according to the point and angle , Support rotation and translation
Row1( Input parameters ): Original point line coordinates
Column1( Input parameters ): Original point column coordinates
Angle1( Input parameters ): Original point angle
Row2( Input parameters ): The destination line coordinates of the transformation
Column2( Input parameters ): The coordinates of the destination column of the transformation
Angle2( Input parameters ): The destination angle of the transformation
HomMat2D( Output parameters ): Output affine transformation matrix
The affine transformation matrix is calculated according to more than two characteristic points
vector_to_rigid(::Px,Py,Qx,Qy:HomMat2D)
function : The rigid affine transformation matrix is calculated according to more than two point pairs , Support rotation and translation
Px:( Input parameters ) Of the original point group x coordinate
Py:( Input parameters ) Of the original point group y coordinate
Qx:( Input parameters ) The destination group of the transformation x coordinate
Qy:( Input parameters ) The destination group of the transformation y coordinate
HomMat2D:( Output parameters ) Output affine transformation matrix
vector_to_similarity(::Px,Py,Qx,Qy:HomMat2D)
function : Calculate the similar affine transformation matrix according to more than two point pairs , Support rotation 、 Pan and zoom
Px:( Input parameters ) Of the original point group x coordinate
Py:( Input parameters ) Of the original point group y coordinate
Qx:( Input parameters ) The destination group of the transformation x coordinate
Qy:( Input parameters ) The destination group of the transformation y coordinate
HomMat2D:( Output parameters ) Output affine transformation matrix
The affine transformation matrix is obtained according to more than three feature points
vector_to_hom_mat2d(::Px,Py,Qx,Qy:HomMat2D)
function : Calculate the affine transformation matrix according to more than three point pairs , Support rotation 、 translation 、 The zoom 、 Oblique cutting
Px:( Input parameters ) Of the original point group x coordinate
Py:( Input parameters ) Of the original point group y coordinate
Qx:( Input parameters ) The destination group of the transformation x coordinate
Qy:( Input parameters ) The destination group of the transformation y coordinate
HomMat2D:( Output parameters ) Output affine transformation matrix
Calculate affine transformation parameters
hom_mat2d_to_affine_par(::HomMat2D:Sx,Sy,Phi,Theta,Tx,Ty)
function : According to the affine transformation matrix ( Homogeneous two-dimensional transformation matrix ) Calculate affine transformation parameters
HomMat2D( Input parameters ): Affine transformation matrix
Sx( Output parameters ):x The scaling factor of the direction ( If you change from image space to physical space , Namely x The direction of the Single pixel quantity )
Sy( Output parameters ):y The scaling factor of the direction ( If you change from image space to physical space , Namely y The direction of the Single pixel quantity )
Phi( Output parameters ): Rotation Angle
Theta( Output parameters ): Bevel angle
Tx( Output parameters ): Along the x Direction translation distance
Ty( Output parameters ): Along the y Direction translation distance
8. To image 、ROI and XLD Affine transformation
affine_trans_contour_xld(Contours:ContoursAffinTrans:HomMat2D)
function : Yes XLD Two dimensional affine transformation of contour , Support zoom , rotate , translation , Oblique cutting
Contours( Input parameters ): Input XLD outline
ContoursAffinTrans( Output parameters ): Output transformed XLD outline
HomMat2D( Input parameters ): Affine transformation matrix
affine_trans_image(Image:ImageAffinTrans:HomMat2D,Interpolation,AdaptImageSize)
function : Carry out two-dimensional affine transformation on the image contour , Support zoom 、 rotate 、 translation , Oblique cutting
Image( Input parameters ): The input image
ImageAffinTrans( Output parameters ): The transformed image
HomMat2D( Input parameters ): Affine transformation matrix
Interpolation( Input parameters ): Interpolation algorithm . Parameter value list : nearest_neighbor,bilinear,constant,weighted
AdaptImageSize( Input parameters ): Results whether the image size is adaptive . The default value is :false
affine_trans_region(Region:RegionAffineTrans:HomMat2D,Interpolate:)
function : Perform arbitrary two-dimensional affine transformation on the region
Region( Input parameters ): Input area
RegionAffineTrans( Output parameters ): Transformed region
HomMat2D( Input parameters ): Affine transformation matrix
Interpolate( Input parameters ): Interpolation algorithm . The default value is :nearest_neighbor. Parameter value list :constant,nearest_neighbor
affine_trans_polygon_xld(Polygon:PolygonsAffinTrans:HomMat2D:)
function : Yes XLD Arbitrary two-dimensional affine transformation of polygons
Polygon( Input parameters ): Input XLD polygon
PolygonsAffinTrans( Output parameters ): Transformed XLD polygon
HomMat2D( Input parameters ): Affine transformation matrix
affine_trans_point_2d(::HomMat2D,Px,Py:Qx,Qy)
function : Arbitrary two-dimensional affine transformation of points , Support zoom 、 rotate 、 translation 、 Oblique cutting
HomMat2D( Input parameters ): Affine transformation matrix
Px( Input parameters ): Original point x Or row coordinates
Py( Input parameters ): Original point y Or column coordinates
Qx( Output parameters ): Transformation point x Or row coordinates
Qy( Output parameters ): Transformation point y Or column coordinates
affine_trans_pixel(::HomMat2D,Row,Col:RowTrans,ColTrans)
function : Arbitrary two-dimensional affine transformation of pixels
HomMat2D( Input parameters ): Affine transformation matrix
Row( Input parameters ): Enter pixel row coordinates
Col( Input parameters ): Enter the pixel column coordinates
RowTrans( Output parameters ): Transformed pixel row coordinates
ColTrans( Output parameters ): Transformed pixel column coordinates
ps:affine_trans_point_2d And affine_trans_pixel The difference between :affine_trans_pixel The origin of the image coordinate system used is in the upper left corner of the image ,affine_trans_point_2d Use the standard image coordinate system , The origin is at the center of the pixel in the upper left corner
边栏推荐
猜你喜欢

深潜Kotlin协程(十五):测试 Kotlin 协程

Kotlin Compose compositionLocalOf 与 staticCompositionLocalOf

Network structure and model principle of convolutional neural network (CNN)

【B站UP DR_CAN学习笔记】Kalman滤波3

IOS development: understanding of dynamic library shared cache (dyld)
![[array]bm94 rainwater connection problem - difficult](/img/2b/1934803060d65ea9139ec489a2c5f5.png)
[array]bm94 rainwater connection problem - difficult
![[station B up dr_can learning notes] Kalman filter 2](/img/52/777f2ad2db786c38fd9cd3fe55142c.gif)
[station B up dr_can learning notes] Kalman filter 2

Matlab | visualization of mathematical properties related to three interesting circles

Matlab | drawing of three ordinate diagram based on block diagram layout
![[BJDCTF2020]The mystery of ip](/img/f8/c3a7334252724635d42c8db3d1bbb0.png)
[BJDCTF2020]The mystery of ip
随机推荐
真xx相来了?测试/开发程序员为什么不愿意加班,这是个疯狂的状态......
QChart笔记2: 添加鼠标悬停显示
[数组]BM94 接雨水问题-较难
【Unity】UI交互组件之按钮Button&可选基类总结
ERP需求和销售管理 金蝶
013 C语言基础:C指针
Kotlin Compose 隐式传参 CompositionLocalProvider
Log collection system
013 basics of C language: C pointer
Kotlin compose compositionlocalof and staticcompositionlocalof
实践 DevOps 时,可能面临的六大挑战
百度飞桨“万有引力”2022首站落地苏州,全面启动中小企业赋能计划
Microservice system design -- microservice monitoring and system resource monitoring design
面试-01
008 C语言基础:C判断
021 C语言基础:递归,可变参数
ERP demand and sales management Kingdee
1.5 use of CONDA
Microservice system design - service fusing and degradation design
Nestjs environment variable configuration to solve the problem of how to inject services into interceptors