You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
2.0 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*
//定义整个系统基础的 定义 信息
*/
#ifndef Define_Base_H_
#define Define_Base_H_
#include <string>
#include <opencv2/opencv.hpp>
#include "CheckUtil.hpp"
#include "ImgCheckConfig.h"
#include "ImageDetConfig.h"
#include "Define_Error.h"
// 检测分析线程类数目
#define IMGCHECKANALYSISY_NUM 2
// 检测线程绑定的 CPU 核带(核带下沉到库内部,调用方传入的 nCpu_start_Idx / nCpu_num 不再生效)
// 分配规则:第 k 个检测线程绑定 核 = CHECK_CPU_BAND_START + (k % CHECK_CPU_BAND_NUM)
// 当前 4 个检测线程落在 15,16,17,18(逻辑核 c 与 c+16 为超线程兄弟,故物理核为 15,0,1,2)
// 注意:CHECK_CPU_BAND_NUM 必须 >= 相机数 * IMGCHECKANALYSISY_NUM,否则取模回绕会导致两个检测线程绑同一核
#define CHECK_CPU_BAND_START 15
#define CHECK_CPU_BAND_NUM 8
// ============== 暗场相机复用明场相机的定位结果 ==============
// 相机名/通道名含 "dark" 的相机不做定位模型(Align_Outer/Align_Inner/Tag_Loc),
// 把 "dark" 替换为 "bright" 得到提供方(明场)的相机名/通道名,同产品内精确配对复用其定位结果。
// 复用等待有超时上限;明场定位失败/超时/无明场图时,暗场回退为自行定位(与旧流程一致)。
#define ALIGN_REUSE_ENABLE 1 // 0=关闭复用(全部相机自行定位)
#define ALIGN_REUSE_FOLLOWER_KEY "dark" // 复用方(暗场)关键字
#define ALIGN_REUSE_SOURCE_KEY "bright" // 提供方(明场)关键字
#define ALIGN_REUSE_WAIT_TIMEOUT_MS 5000 // 等待明场定位结果的超时(毫秒)
#define ALIGN_REUSE_POLL_MS 20 // 等待轮询间隔(毫秒)
// 相机ID 的相关定义
enum Camera_IDX
{
Camera_IDX_0 = 0,
Camera_IDX_1 = 1,
};
static const std::string strCameraName[] =
{
"left",
"right"};
struct Camera_Info
{
Camera_IDX camera_ID;
std::string camera_name;
Camera_Info()
{
Init();
}
void Init()
{
camera_ID = Camera_IDX_0;
camera_name = strCameraName[camera_ID];
}
};
#endif