摄像头测试代码
在main.c文件中img_processing();函数里pts_left和pts_right两个数组储存边线坐标
This commit is contained in:
26
app/gl_transform_table.c
Normal file
26
app/gl_transform_table.c
Normal 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] = {};
|
||||
Reference in New Issue
Block a user