147 lines
3.3 KiB
C
147 lines
3.3 KiB
C
|
|
|
|||
|
|
#ifndef TB_GLOBALS_H
|
|||
|
|
#define TB_GLOBALS_H
|
|||
|
|
|
|||
|
|
#include "../globals/algoGlobals.h"
|
|||
|
|
#include <vector>
|
|||
|
|
#include <cmath>
|
|||
|
|
#include <algorithm>
|
|||
|
|
#include <cstring>
|
|||
|
|
#include <iostream>
|
|||
|
|
#include <fstream>
|
|||
|
|
|
|||
|
|
#define TB_PATH_MAX 1024
|
|||
|
|
|
|||
|
|
typedef struct
|
|||
|
|
{
|
|||
|
|
uint16_t left_L;
|
|||
|
|
uint16_t right_L;
|
|||
|
|
uint16_t left_T;
|
|||
|
|
uint16_t right_T;
|
|||
|
|
uint16_t W;
|
|||
|
|
uint16_t H;
|
|||
|
|
uint32_t FrmNo;
|
|||
|
|
uint32_t TimeStamp;
|
|||
|
|
uint32_t encInfo;
|
|||
|
|
float u0;
|
|||
|
|
float v0;
|
|||
|
|
float F;
|
|||
|
|
float baseLen;
|
|||
|
|
}Luma_frameInfo;
|
|||
|
|
|
|||
|
|
typedef struct
|
|||
|
|
{
|
|||
|
|
uint16_t WinRdx;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
|
|||
|
|
uint16_t y; //y<><79><EFBFBD><EFBFBD>
|
|||
|
|
uint16_t Rid; //region<6F><6E>ID
|
|||
|
|
uint8_t Flag; //bit0<74><30>overlap<61><70>־<EFBFBD><D6BE>bit1<74>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>źű<C5BA>־
|
|||
|
|
uint8_t PeakRltvRdx; //peak<61>ڴ<EFBFBD><DAB4><EFBFBD><EFBFBD>ڵĵ<DAB5><C4B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>꣬<EFBFBD><EAA3AC>4λ<34><CEBB><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD>꣬<EFBFBD><EAA3AC>4λ<34>ǽ<EFBFBD><C7BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
uint8_t data[RGN_DATA_WIN_SIZE];
|
|||
|
|
//double offset;
|
|||
|
|
}Luma_rgnData;
|
|||
|
|
|
|||
|
|
typedef struct
|
|||
|
|
{
|
|||
|
|
uint16_t WinRdx;//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD>
|
|||
|
|
uint16_t y; //y<><79><EFBFBD><EFBFBD>
|
|||
|
|
uint16_t Rid; //region<6F><6E>ID
|
|||
|
|
uint8_t Flag; //bit0<74><30>overlap<61><70>־<EFBFBD><D6BE>bit1<74>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>źű<C5BA>־
|
|||
|
|
uint8_t pkValue;
|
|||
|
|
int32_t nD1;
|
|||
|
|
int32_t nD2;
|
|||
|
|
}Luma_convolveData;
|
|||
|
|
|
|||
|
|
typedef struct
|
|||
|
|
{
|
|||
|
|
float x;
|
|||
|
|
uint16_t y; //y<><79><EFBFBD><EFBFBD>
|
|||
|
|
uint16_t Rid; //region<6F><6E>ID
|
|||
|
|
uint8_t Flag; //bit0<74><30>overlap<61><70>־<EFBFBD><D6BE>bit1<74>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>źű<C5BA>
|
|||
|
|
uint8_t pkValue;
|
|||
|
|
uint8_t Sync;
|
|||
|
|
}Luma_rgnSubpix;
|
|||
|
|
|
|||
|
|
typedef struct
|
|||
|
|
{
|
|||
|
|
float x;
|
|||
|
|
float y; //y<><79><EFBFBD><EFBFBD>
|
|||
|
|
uint16_t Rid; //region<6F><6E>ID
|
|||
|
|
uint8_t Flag; //bit0<74><30>overlap<61><70>־<EFBFBD><D6BE>bit1<74>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD>źű<C5BA>
|
|||
|
|
uint8_t pkValue;
|
|||
|
|
uint8_t sync;
|
|||
|
|
}Luma_rgnSubpixCalib;
|
|||
|
|
|
|||
|
|
#pragma pack(push, 1)
|
|||
|
|
typedef struct {
|
|||
|
|
uint16_t file_type; // <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD>ͣ<EFBFBD>'BM'
|
|||
|
|
uint32_t file_size; // <20>ļ<EFBFBD><C4BC><EFBFBD>С
|
|||
|
|
uint16_t reserved1; // <20><><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD>
|
|||
|
|
uint16_t reserved2;
|
|||
|
|
uint32_t offset_data; // <20><><EFBFBD><EFBFBD>ƫ<EFBFBD><C6AB>
|
|||
|
|
}BMPFileHeader;
|
|||
|
|
|
|||
|
|
typedef struct {
|
|||
|
|
uint32_t size; // <20><>Ϣͷ<CFA2><CDB7>С<EFBFBD><D0A1>40<34>ֽڣ<D6BD>
|
|||
|
|
int32_t width; // ͼ<><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
int32_t height; // ͼ<><CDBC><EFBFBD>߶ȣ<DFB6><C8A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
|
uint16_t planes; // <20><>ɫƽ<C9AB><C6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ1<CEAA><31>
|
|||
|
|
uint16_t bit_count; // ÿ<><C3BF><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>24<32><34>
|
|||
|
|
uint32_t compression; // ѹ<><D1B9><EFBFBD><EFBFBD>ʽ<EFBFBD><CABD>0<EFBFBD><30>ʾ<EFBFBD><CABE>ѹ<EFBFBD><D1B9><EFBFBD><EFBFBD>
|
|||
|
|
uint32_t size_image; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD>С
|
|||
|
|
int32_t x_pixels_per_meter;
|
|||
|
|
int32_t y_pixels_per_meter;
|
|||
|
|
uint32_t colors_used;
|
|||
|
|
uint32_t colors_important;
|
|||
|
|
} BMPInfoHeader;
|
|||
|
|
|
|||
|
|
|
|||
|
|
typedef struct {
|
|||
|
|
const char *name; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͬʱ<CDAC><CAB1>ΪĿ¼<C4BF><C2BC> */
|
|||
|
|
int start_id; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD> */
|
|||
|
|
int end_id; /* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
} TbGroup;
|
|||
|
|
|
|||
|
|
typedef enum {
|
|||
|
|
TB_1_peakCentering = 0,
|
|||
|
|
TB_2_convolve,
|
|||
|
|
TB_3_subPix,
|
|||
|
|
TB_4_Calib,
|
|||
|
|
TB_5_lrMatch,
|
|||
|
|
TB_6_SSProc,
|
|||
|
|
TB_7_compute3D,
|
|||
|
|
TB_MODULE_COUNT
|
|||
|
|
} TbModule;
|
|||
|
|
|
|||
|
|
typedef struct {
|
|||
|
|
char input[TB_PATH_MAX];
|
|||
|
|
char paras[TB_PATH_MAX];
|
|||
|
|
char output[TB_PATH_MAX];
|
|||
|
|
} TbPaths;
|
|||
|
|
|
|||
|
|
typedef struct {
|
|||
|
|
char calib_fittingMap_L[TB_PATH_MAX];
|
|||
|
|
char calib_fittingMap_R[TB_PATH_MAX];
|
|||
|
|
} TbFittingMapPaths;
|
|||
|
|
|
|||
|
|
extern const char tb_sim_root[];
|
|||
|
|
extern const TbGroup tb_groups[];
|
|||
|
|
extern const size_t tb_group_count;
|
|||
|
|
extern const char * const tb_module_names[TB_MODULE_COUNT];
|
|||
|
|
|
|||
|
|
int tb_check_config(void);
|
|||
|
|
int tb_get_paths(TbModule module, size_t group_index,
|
|||
|
|
int file_id, int LRflag, TbPaths *paths);
|
|||
|
|
|
|||
|
|
/* root<6F><74><EFBFBD><EFBFBD>Ĭ<EFBFBD>ϸ<EFBFBD>Ŀ¼<C4BF><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>HLS<4C><53><EFBFBD><EFBFBD><EFBFBD>Ӳ<EFBFBD>ͬ<EFBFBD><CDAC><EFBFBD><EFBFBD>Ŀ¼<C4BF><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
|
|||
|
|
int tb_get_paths_at(const char *root, TbModule module,
|
|||
|
|
size_t group_index, int file_id, int LRflag, TbPaths *paths);
|
|||
|
|
|
|||
|
|
int tb_get_fittingMap_paths(TbModule module, size_t group_index, TbFittingMapPaths *paths);
|
|||
|
|
|
|||
|
|
Luma_frameInfo readParaFile(const char* file, int idx);
|
|||
|
|
|
|||
|
|
#pragma pack(pop)
|
|||
|
|
|
|||
|
|
|
|||
|
|
#endif
|