libdmtx 0.7.8.7
libdmtx is a software library that enables programs to read and write Data Matrix barcodes of the modern ECC200 variety.
Loading...
Searching...
No Matches
dmtxmatrix3.c File Reference

libdmtx - Data Matrix Encoding/Decoding Library Copyright 2008, 2009 Mike Laughton. More...

#include <assert.h>
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "dmtx.h"
#include "dmtxstatic.h"

Go to the source code of this file.

Functions

void dmtxMatrix3Copy (OUT DmtxMatrix3 m0, DmtxMatrix3 m1)
 复制3x3矩阵
 
void dmtxMatrix3Identity (OUT DmtxMatrix3 m)
 生成单位变换矩阵
 
void dmtxMatrix3Translate (OUT DmtxMatrix3 m, double tx, double ty)
 生成平移变换矩阵
 
void dmtxMatrix3Rotate (OUT DmtxMatrix3 m, double angle)
 生成旋转变换矩阵
 
void dmtxMatrix3Scale (OUT DmtxMatrix3 m, double sx, double sy)
 生成缩放变换矩阵
 
void dmtxMatrix3Shear (OUT DmtxMatrix3 m, double shx, double shy)
 生成剪切变换矩阵
 
void dmtxMatrix3LineSkewTop (OUT DmtxMatrix3 m, double b0, double b1, double sz)
 生成顶部线倾斜变换矩阵
 
void dmtxMatrix3LineSkewTopInv (OUT DmtxMatrix3 m, double b0, double b1, double sz)
 Generate top line skew transformation (inverse)
 
void dmtxMatrix3LineSkewSide (OUT DmtxMatrix3 m, double b0, double b1, double sz)
 Generate side line skew transformation.
 
void dmtxMatrix3LineSkewSideInv (OUT DmtxMatrix3 m, double b0, double b1, double sz)
 Generate side line skew transformation (inverse)
 
void dmtxMatrix3Multiply (OUT DmtxMatrix3 mOut, DmtxMatrix3 m0, DmtxMatrix3 m1)
 矩阵相乘
 
void dmtxMatrix3MultiplyBy (INOUT DmtxMatrix3 m0, DmtxMatrix3 m1)
 矩阵相乘
 
DmtxPassFail dmtxMatrix3VMultiply (OUT DmtxVector2 *vOut, DmtxVector2 *vIn, DmtxMatrix3 m)
 将向量与矩阵相乘
 
DmtxPassFail dmtxMatrix3VMultiplyBy (INOUT DmtxVector2 *v, DmtxMatrix3 m)
 将向量与矩阵相乘
 
void dmtxMatrix3Print (DmtxMatrix3 m)
 Print matrix contents to STDOUT.
 

Detailed Description

libdmtx - Data Matrix Encoding/Decoding Library Copyright 2008, 2009 Mike Laughton.

All rights reserved. Copyright 2012-2016 Vadim A. Misbakh-Soloviov. All rights reserved.

See LICENSE file in the main project directory for full terms of use and distribution.

Contact: Vadim A. Misbakh-Soloviov dmtx@.nosp@m.mva..nosp@m.name Mike Laughton mike@.nosp@m.drag.nosp@m.onfly.nosp@m.logi.nosp@m.c.com

二维矩阵(3x3)数学运算

Definition in file dmtxmatrix3.c.

Function Documentation

◆ dmtxMatrix3Copy()

void dmtxMatrix3Copy ( OUT DmtxMatrix3 m0,
DmtxMatrix3 m1 )
extern

复制3x3矩阵

该函数将一个 3x3 矩阵的内容复制到另一个矩阵。

Parameters
[out]m0指向目标矩阵的指针,用于存储复制的结果
[in]m1指向源矩阵的指针,从中读取数据进行复制

Definition at line 34 of file dmtxmatrix3.c.

◆ dmtxMatrix3Identity()

void dmtxMatrix3Identity ( OUT DmtxMatrix3 m)
extern

生成单位变换矩阵

| 1  0  0 |

m = | 0 1 0 | | 0 0 1 |

        Transform "m"
  (doesn't change anything)
             |\

(0,1) x-—o +–+ \ (0,1) x-—o | | | \ | | | | | / | | +-—* +–+ / +-—* (0,0) (1,0) |/ (0,0) (1,0)

Definition at line 56 of file dmtxmatrix3.c.

◆ dmtxMatrix3LineSkewSide()

void dmtxMatrix3LineSkewSide ( OUT DmtxMatrix3 m,
double b0,
double b1,
double sz )
extern

Generate side line skew transformation.

Parameters
[out]m
[in]b0
[in]b1
[in]sz

Definition at line 234 of file dmtxmatrix3.c.

◆ dmtxMatrix3LineSkewSideInv()

void dmtxMatrix3LineSkewSideInv ( OUT DmtxMatrix3 m,
double b0,
double b1,
double sz )
extern

Generate side line skew transformation (inverse)

Parameters
[out]m
[in]b0
[in]b1
[in]sz

Definition at line 251 of file dmtxmatrix3.c.

◆ dmtxMatrix3LineSkewTop()

void dmtxMatrix3LineSkewTop ( OUT DmtxMatrix3 m,
double b0,
double b1,
double sz )
extern

生成顶部线倾斜变换矩阵

该函数用于创建一个变换矩阵,该矩阵用于对图像进行顶部线的倾斜变换。 这种变换通常用于校正图像中的透视失真。

Parameters
[out]m生成的矩阵
[in]b0基线起点的 y 坐标
[in]b1基线终点的 y 坐标
[in]sz变换后的高度
| b1/b0    0    (b1-b0)/(sz*b0) |
m = | 0 sz/b0 0 | | 0 0 1 |

(sz,b1) o /| Transform "m" / | / | +–+ / | | | (0,b0) x | | | | | +-+ +-+ (0,sz) +-—+ \ / (0,sz) x-—o | | \ / | | | | \/ | | +-—+ +-—+ (0,0) (sz,0) (0,0) (sz,0)

Definition at line 200 of file dmtxmatrix3.c.

◆ dmtxMatrix3LineSkewTopInv()

void dmtxMatrix3LineSkewTopInv ( OUT DmtxMatrix3 m,
double b0,
double b1,
double sz )
extern

Generate top line skew transformation (inverse)

Parameters
[out]m
[in]b0
[in]b1
[in]sz

Definition at line 217 of file dmtxmatrix3.c.

◆ dmtxMatrix3Multiply()

void dmtxMatrix3Multiply ( OUT DmtxMatrix3 mOut,
DmtxMatrix3 m0,
DmtxMatrix3 m1 )
extern

矩阵相乘

该函数用于将两个 3x3 矩阵相乘,并将结果存储在输出矩阵中。

Parameters
[out]mOut指向输出矩阵的指针,用于存储乘法结果
[in]m0指向第一个输入矩阵的指针
[in]m1指向第二个输入矩阵的指针

Definition at line 270 of file dmtxmatrix3.c.

◆ dmtxMatrix3MultiplyBy()

void dmtxMatrix3MultiplyBy ( INOUT DmtxMatrix3 m0,
DmtxMatrix3 m1 )
extern

矩阵相乘

该函数用于将两个 3x3 矩阵相乘,并将结果存储在第一个矩阵中。

Parameters
[in,out]m0指向第一个输入矩阵的指针,其内容将被修改为乘法的结果
[in]m1指向第二个输入矩阵的指针

Definition at line 294 of file dmtxmatrix3.c.

◆ dmtxMatrix3Print()

void dmtxMatrix3Print ( DmtxMatrix3 m)
extern

Print matrix contents to STDOUT.

Parameters
[in]m

Definition at line 353 of file dmtxmatrix3.c.

◆ dmtxMatrix3Rotate()

void dmtxMatrix3Rotate ( OUT DmtxMatrix3 m,
double angle )
extern

生成旋转变换矩阵

Parameters
[out]m生成的矩阵
[in]angle旋转的角度
|  cos(a)  sin(a)  0 |
m = | -sin(a) cos(a) 0 | | 0 0 1 | o Transform "m" / ___ / (0,1) x-—o |/ \ x * (cos(a),sin(a)) | | '– | / | | ___/ / a +-—* `+ - - - - - - (0,0) (1,0) (0,0)

Definition at line 107 of file dmtxmatrix3.c.

◆ dmtxMatrix3Scale()

void dmtxMatrix3Scale ( OUT DmtxMatrix3 m,
double sx,
double sy )
extern

生成缩放变换矩阵

Parameters
[out]m生成的矩阵
[in]sxx轴的缩放因子
[in]syy轴的缩放因子
| sx 0  0 |
m = | 0 sy 0 | | 0 0 1 |
         Transform "m"
             _____     (0,sy)  x-------o (sx,sy)
             \   |             |       |
(0,1) x-—o / | (0,1) +-—+ | | | / /| | | | | | \ / | | | +-—* ` +-—+–* (0,0) (1,0) (0,0) (sx,0)

Definition at line 141 of file dmtxmatrix3.c.

◆ dmtxMatrix3Shear()

void dmtxMatrix3Shear ( OUT DmtxMatrix3 m,
double shx,
double shy )
extern

生成剪切变换矩阵

剪切变换(shear transformation)是空间线性变换之一,是仿射变换的一种原始变换。 它指的是类似于四边形不稳定性那种性质,方形变平行四边形,任意一边都可以被拉长的过程。

XXX: 这里的X和Y方向是不是弄反了

Parameters
[out]m生成的矩阵
[in]shxx轴方向的剪切因子
[in]shyy轴方向的剪切因子
| 0    shy  0 |
m = | shx 0 0 | | 0 0 1 |

Definition at line 164 of file dmtxmatrix3.c.

◆ dmtxMatrix3Translate()

void dmtxMatrix3Translate ( OUT DmtxMatrix3 m,
double tx,
double ty )

生成平移变换矩阵

Parameters
[out]m生成的矩阵
[in]tx沿 x 轴的平移量
[in]ty沿 y 轴的平移量
| 1  0  0 |
m = | 0 1 0 | | tx ty 1 |
        Transform "m"
            _____    (tx,1+ty)  x----o  (1+tx,1+ty)
            \   |               |    |
(0,1) x-—o / | (0,1) +-|–+ | | | / /| | +-—* (1+tx,ty) | | \ / | | +-—* ` +-—+ (0,0) (1,0) (0,0) (1,0)

Definition at line 82 of file dmtxmatrix3.c.

◆ dmtxMatrix3VMultiply()

DmtxPassFail dmtxMatrix3VMultiply ( OUT DmtxVector2 * vOut,
DmtxVector2 * vIn,
DmtxMatrix3 m )
extern

将向量与矩阵相乘

该函数用于将一个 3x3 矩阵与一个 2D 向量相乘,并将结果存储在输出向量中。

Parameters
[out]vOut指向输出向量的指针,用于存储乘法结果
[in]vIn指向输入向量的指针
[in]m要与向量相乘的 3x3 矩阵(仿射变换矩阵)
Returns
DmtxPass | DmtxFail

Definition at line 312 of file dmtxmatrix3.c.

◆ dmtxMatrix3VMultiplyBy()

DmtxPassFail dmtxMatrix3VMultiplyBy ( INOUT DmtxVector2 * v,
DmtxMatrix3 m )
extern

将向量与矩阵相乘

此函数将输入向量v与给定矩阵m相乘,并直接更新输入向量v为乘法的结果。

Parameters
[in,out]v输入向量同时也是输出向量,乘法操作后存储结果。
[in]m用于乘法运算的3x3矩阵。
Returns
DmtxPass | DmtxFail

Definition at line 338 of file dmtxmatrix3.c.