Files
QDAC-firmware/app/gl_transform_table.c
Glz ce31d900ee 摄像头测试代码
在main.c文件中img_processing();函数里pts_left和pts_right两个数组储存边线坐标
2023-12-17 16:11:35 +08:00

26 lines
556 B
C

#include "zf_common_headfile.h"
#include "gl_headfile.h"
float H_inv[3][3] = {};
// 逆变换,俯视->原图
void transform(float X, float Y, int* x, int* y) {
// Apply inverse transformation
double p[3] = {X, Y, 1.0};
double q[3] = {0.0, 0.0, 0.0};
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
q[i] += H_inv[i][j] * p[j];
}
}
*x =(int) (q[0] / q[2]);
*y = (int) (q[1] / q[2]);
}
const float UndistInverseMapH[90][140] = {};
const float UndistInverseMapW[90][140] = {};