摄像头测试代码

在main.c文件中img_processing();函数里pts_left和pts_right两个数组储存边线坐标
This commit is contained in:
Glz
2023-12-17 16:11:35 +08:00
parent eaa7cc0eea
commit ce31d900ee
23 changed files with 1261 additions and 45 deletions

26
app/gl_transform_table.c Normal file
View File

@@ -0,0 +1,26 @@
#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] = {};