1、更新车厢倒车恢复原位的判断逻辑
2、新增识别结果定期删除 3、arm于X86切换 4、对识别不符合规则的数据,不上传 5、来车检测状态反馈socket
This commit is contained in:
parent
f2bcc2e472
commit
665e6b62a7
162
CMakeLists.txt
162
CMakeLists.txt
|
|
@ -5,7 +5,7 @@ message("NVIDIA NX PLATFORM")
|
||||||
set(PROJECT_NAME train)
|
set(PROJECT_NAME train)
|
||||||
project(${PROJECT_NAME} VERSION 1.0)
|
project(${PROJECT_NAME} VERSION 1.0)
|
||||||
|
|
||||||
|
|
||||||
add_definitions(-std=c++11)
|
add_definitions(-std=c++11)
|
||||||
add_definitions(-DAPI_EXPORTS)
|
add_definitions(-DAPI_EXPORTS)
|
||||||
|
|
||||||
|
|
@ -20,6 +20,8 @@ find_package(OpenCV REQUIRED)
|
||||||
# message(STATUS "${OpenCV_LIBS}")
|
# message(STATUS "${OpenCV_LIBS}")
|
||||||
# message(STATUS "${OpenCV_INCLUDE_DIRS}")
|
# message(STATUS "${OpenCV_INCLUDE_DIRS}")
|
||||||
|
|
||||||
|
find_package(CUDA REQUIRED)
|
||||||
|
|
||||||
# 设置编译工具
|
# 设置编译工具
|
||||||
set(CMAKE_SYSTEM_NAME Linux)
|
set(CMAKE_SYSTEM_NAME Linux)
|
||||||
set(CMAKE_C_COMPILER "gcc")
|
set(CMAKE_C_COMPILER "gcc")
|
||||||
|
|
@ -41,13 +43,15 @@ set(SYS_USR_LOCAL_INCLUDE_DIR "/usr/local/include")
|
||||||
set(SYS_USR_LOCAL_LIB_DIR "/usr/local/lib")
|
set(SYS_USR_LOCAL_LIB_DIR "/usr/local/lib")
|
||||||
set(AARCH64_LINUX_INCLUDE_DIR "/usr/include/x86_64-linux-gnu")
|
set(AARCH64_LINUX_INCLUDE_DIR "/usr/include/x86_64-linux-gnu")
|
||||||
set(AARCH64_LINUX_LIB_DIR "/usr/lib/x86_64-linux-gnu")
|
set(AARCH64_LINUX_LIB_DIR "/usr/lib/x86_64-linux-gnu")
|
||||||
|
#set(AARCH64_LINUX_INCLUDE_DIR "/usr/include/aarch64-linux-gnu")
|
||||||
|
#set(AARCH64_LINUX_LIB_DIR "/usr/lib/aarch64-linux-gnu")
|
||||||
|
|
||||||
|
|
||||||
#opencv3.2.0的库文件在/usr/lib/aarch64-linux-gnu下 头文件路径在/usr/include/opencv2
|
#opencv3.2.0的库文件在/usr/lib/aarch64-linux-gnu下 头文件路径在/usr/include/opencv2
|
||||||
#opencv4.5.5的库文件在/usr/local/lib下 头文件路径在/usr/local/include/opencv4
|
#opencv4.5.5的库文件在/usr/local/lib下 头文件路径在/usr/local/include/opencv4
|
||||||
#目前使用最新版opencv4.5.5
|
#目前使用最新版opencv4.5.5
|
||||||
set(OPENCV_INCLUDE_DIR ${SYS_USR_LOCAL_INCLUDE_DIR}/opencv4)
|
set(OPENCV_INCLUDE_DIR ${SYS_USR_LOCAL_INCLUDE_DIR}/opencv4)
|
||||||
set(OPENCV_LIB_DIR ${SYS_USR_LOCAL_LIB_DIR})
|
set(OPENCV_LIB_DIR ${SYS_USR_LOCAL_LIB_DIR})
|
||||||
|
|
||||||
set(CUDA_DIR "/usr/local/cuda-11.7")
|
set(CUDA_DIR "/usr/local/cuda-11.7")
|
||||||
set(CUDA_INCLUDE_DIR ${CUDA_DIR}/include)
|
set(CUDA_INCLUDE_DIR ${CUDA_DIR}/include)
|
||||||
|
|
@ -60,80 +64,80 @@ set(DRM_INCLUDE_DIR ${SYS_USR_INCLUDE_DIR}/libdrm) #DRM的头文件在/usr/incl
|
||||||
|
|
||||||
set(TEGRA_LIB_DIR ${AARCH64_LINUX_LIB_DIR}/tegra) #tegra库文件路径/usr/lib/aarch64-linux-gnu/tegra
|
set(TEGRA_LIB_DIR ${AARCH64_LINUX_LIB_DIR}/tegra) #tegra库文件路径/usr/lib/aarch64-linux-gnu/tegra
|
||||||
|
|
||||||
set(PCL_INCLUDE ${SYS_USR_LOCAL_INCLUDE_DIR}/pcl-1.7) #pcl头文件路径
|
#set(PCL_INCLUDE ${SYS_USR_LOCAL_INCLUDE_DIR}/pcl-1.7) #pcl头文件路径
|
||||||
|
|
||||||
|
|
||||||
# nvidia ascend common include
|
# nvidia ascend common include
|
||||||
include_directories(
|
include_directories(
|
||||||
#ai_matrix include
|
#ai_matrix include
|
||||||
${PROJECT_SOURCE_DIR}/ai_matrix
|
${PROJECT_SOURCE_DIR}/ai_matrix
|
||||||
${PROJECT_SOURCE_DIR}/ai_matrix/framework
|
${PROJECT_SOURCE_DIR}/ai_matrix/framework
|
||||||
${PROJECT_SOURCE_DIR}/ai_matrix/myftp
|
${PROJECT_SOURCE_DIR}/ai_matrix/myftp
|
||||||
${PROJECT_SOURCE_DIR}/ai_matrix/myhttp
|
${PROJECT_SOURCE_DIR}/ai_matrix/myhttp
|
||||||
${PROJECT_SOURCE_DIR}/ai_matrix/myJson
|
${PROJECT_SOURCE_DIR}/ai_matrix/myJson
|
||||||
${PROJECT_SOURCE_DIR}/ai_matrix/myJson/json
|
${PROJECT_SOURCE_DIR}/ai_matrix/myJson/json
|
||||||
${PROJECT_SOURCE_DIR}/ai_matrix/mylog
|
${PROJECT_SOURCE_DIR}/ai_matrix/mylog
|
||||||
${PROJECT_SOURCE_DIR}/ai_matrix/pcl
|
${PROJECT_SOURCE_DIR}/ai_matrix/pcl
|
||||||
${PROJECT_SOURCE_DIR}/ai_matrix/myqueue
|
${PROJECT_SOURCE_DIR}/ai_matrix/myqueue
|
||||||
${PROJECT_SOURCE_DIR}/ai_matrix/myshell
|
${PROJECT_SOURCE_DIR}/ai_matrix/myshell
|
||||||
${PROJECT_SOURCE_DIR}/ai_matrix/myutils
|
${PROJECT_SOURCE_DIR}/ai_matrix/myutils
|
||||||
|
|
||||||
#nvidia ascend common cann include
|
#nvidia ascend common cann include
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_base/Base/BlockingQueue
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_base/Base/BlockingQueue
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_base/Base/CBase64
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_base/Base/CBase64
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_base/Base/CommandParser
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_base/Base/CommandParser
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_base/Base/CommonDataType
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_base/Base/CommonDataType
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_base/Base/ConfigParser
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_base/Base/ConfigParser
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_base/Base/ErrorCode
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_base/Base/ErrorCode
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_base/Base/FileManager
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_base/Base/FileManager
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_base/Base/Log
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_base/Base/Log
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_base/Base/
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_base/Base/
|
||||||
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common
|
||||||
#common engine include
|
#common engine include
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/ControlEngine
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/ControlEngine
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/DataSourceEngine
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/DataSourceEngine
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/DataUploadEngine
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/DataUploadEngine
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/FilterEngine
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/FilterEngine
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/MergerEngine
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/MergerEngine
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/PixelFormatConvertEngine
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/SaveEngine
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/SaveEngine
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/SelectBestEngine
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/SelectBestEngine
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/TrainAnaEngine
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/TrainAnaEngine
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/TransEngine
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/TransEngine
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/DataDealEngine
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/DataDealEngine
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/SocketEngine
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/SocketEngine
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/DeleteExpiredFolderEngine
|
||||||
|
|
||||||
#common tools rtsp_server include
|
#common tools rtsp_server include
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_tools/common_tools/rtsp_server/3rdpart/md5
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_tools/common_tools/rtsp_server/3rdpart/md5
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_tools/common_tools/rtsp_server/net/
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_tools/common_tools/rtsp_server/net/
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_tools/common_tools/rtsp_server/xop/
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_tools/common_tools/rtsp_server/xop/
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
#nvidia engine include
|
#nvidia engine include
|
||||||
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/ChkDateStepOneEngine
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/ChkDateStepTwoEngine
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/ContainerEngine
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/DecodeEngine
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/MoveEngine
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/MyYaml
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/TrainStepOneEngine
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/TrainStepTwoEngine
|
|
||||||
|
|
||||||
#nvidia_tools yolov5 include
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/ChkDateStepOneEngine
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_tools/nvidia_tools/yolov5/include
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/ChkDateStepTwoEngine
|
||||||
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/ContainerEngine
|
||||||
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/DecodeEngine
|
||||||
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/MoveEngine
|
||||||
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/MyYaml
|
||||||
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/TrainStepOneEngine
|
||||||
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/TrainStepTwoEngine
|
||||||
|
|
||||||
#third party include
|
#nvidia_tools yolov5 include
|
||||||
${CUDA_INCLUDE_DIR}
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_tools/nvidia_tools/yolov5/include
|
||||||
${TENSORRT_INCLUDE_DIR}
|
|
||||||
${DRM_INCLUDE_DIR}
|
#third party include
|
||||||
${OpenCV_DIR}
|
${CUDA_INCLUDE_DIR}
|
||||||
${AARCH64_LINUX_INCLUDE_DIR}
|
${TENSORRT_INCLUDE_DIR}
|
||||||
${SYS_USR_LOCAL_INCLUDE_DIR}
|
${DRM_INCLUDE_DIR}
|
||||||
${PCL_INCLUDE}
|
${OpenCV_DIR}
|
||||||
|
${AARCH64_LINUX_INCLUDE_DIR}
|
||||||
|
${SYS_USR_LOCAL_INCLUDE_DIR}
|
||||||
|
# ${PCL_INCLUDE}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -144,7 +148,7 @@ link_directories(${SYS_USR_LOCAL_LIB_DIR}
|
||||||
${CUDA_LIB_DIR}
|
${CUDA_LIB_DIR}
|
||||||
${TENSORRT_LIB_DIR}
|
${TENSORRT_LIB_DIR}
|
||||||
${TEGRA_LIB_DIR}
|
${TEGRA_LIB_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
#源文件
|
#源文件
|
||||||
#公共源文件
|
#公共源文件
|
||||||
|
|
@ -171,7 +175,6 @@ file(GLOB_RECURSE COMMON_SRCS_LISTS
|
||||||
#common engine src
|
#common engine src
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common/*.cpp
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common/*.cpp
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/DataSourceEngine/*.cpp
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/DataSourceEngine/*.cpp
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/PixelFormatConvertEngine/*.cpp
|
|
||||||
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/ControlEngine/*.cpp
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/ControlEngine/*.cpp
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/DataUploadEngine/*.cpp
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/DataUploadEngine/*.cpp
|
||||||
|
|
@ -182,26 +185,19 @@ file(GLOB_RECURSE COMMON_SRCS_LISTS
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/TransEngine/*.cpp
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/TransEngine/*.cpp
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/DataDealEngine/*.cpp
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/DataDealEngine/*.cpp
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/SocketEngine/*.cpp
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/SocketEngine/*.cpp
|
||||||
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/SocketEngine/*.cpp
|
||||||
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/DataSourceEngine/*.cpp
|
||||||
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/SaveEngine/*.cpp
|
||||||
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/DeleteExpiredFolderEngine/*.cpp
|
||||||
|
|
||||||
#common tools rtsp_server src
|
#common tools rtsp_server src
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_tools/common_tools/rtsp_server/net/*.cpp
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_tools/common_tools/rtsp_server/net/*.cpp
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_tools/common_tools/rtsp_server/xop/*.cpp
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_tools/common_tools/rtsp_server/xop/*.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
file(GLOB_RECURSE SRCS_LISTS
|
file(GLOB_RECURSE SRCS_LISTS
|
||||||
#nvidia engine src
|
#nvidia engine src
|
||||||
#nvidia engine include
|
#nvidia engine include
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/ControlEngine/*.cpp
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/DataSourceEngine/*.cpp
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/DataUploadEngine/*.cpp
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/FilterEngine/*.cpp
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/MergerEngine/*.cpp
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/PixelFormatConvertEngine/*.cpp
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/SaveEngine/*.cpp
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/SelectBestEngine/*.cpp
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/TrainAnaEngine/*.cpp
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/TransEngine/*.cpp
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/common_engine/DataDealEngine/*.cpp
|
|
||||||
|
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/ChkDateStepOneEngine/*.cpp
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/ChkDateStepOneEngine/*.cpp
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/ChkDateStepTwoEngine/*.cpp
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_engine/nvidia_engine/ChkDateStepTwoEngine/*.cpp
|
||||||
|
|
@ -217,7 +213,7 @@ file(GLOB_RECURSE SRCS_LISTS
|
||||||
#nvidia tools yolov5 src
|
#nvidia tools yolov5 src
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_tools/nvidia_tools/yolov5/src/*.cpp
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_tools/nvidia_tools/yolov5/src/*.cpp
|
||||||
${PROJECT_SOURCE_DIR}/nvidia_ascend_tools/nvidia_tools/yolov5/src/*.cu
|
${PROJECT_SOURCE_DIR}/nvidia_ascend_tools/nvidia_tools/yolov5/src/*.cu
|
||||||
)
|
)
|
||||||
|
|
||||||
cuda_add_executable(${PROJECT_NAME} ${COMMON_SRCS_LISTS} ${SRCS_LISTS})
|
cuda_add_executable(${PROJECT_NAME} ${COMMON_SRCS_LISTS} ${SRCS_LISTS})
|
||||||
|
|
||||||
|
|
@ -227,11 +223,11 @@ target_link_libraries(${PROJECT_NAME} cudart cuda) #CUDA
|
||||||
|
|
||||||
target_link_libraries(${PROJECT_NAME}
|
target_link_libraries(${PROJECT_NAME}
|
||||||
${OpenCV_LIBS} #third party librarys
|
${OpenCV_LIBS} #third party librarys
|
||||||
${PCL_LIBRARY_DIRS}
|
# ${PCL_LIBRARY_DIRS}
|
||||||
pcl_common pcl_io_ply pcl_keypoints pcl_registration pcl_segmentation pcl_features pcl_io pcl_octree #pcl
|
# pcl_common pcl_io_ply pcl_keypoints pcl_registration pcl_segmentation pcl_features pcl_io pcl_octree #pcl
|
||||||
pcl_sample_consensus pcl_surface pcl_filters pcl_kdtree pcl_recognition pcl_search pcl_tracking
|
# pcl_sample_consensus pcl_surface pcl_filters pcl_kdtree pcl_recognition pcl_search pcl_tracking
|
||||||
avformat avcodec avutil avfilter swresample swscale postproc #VideoCodecV2
|
avformat avcodec avutil avfilter swresample swscale postproc #VideoCodecV2
|
||||||
yaml-cpp https_sn
|
yaml-cpp https_sn
|
||||||
jsoncpp curl boost_system boost_filesystem ssh2
|
jsoncpp curl boost_system boost_filesystem ssh2
|
||||||
-Wl,-z,relro,-z,now,-z,noexecstack -pie -s
|
-Wl,-z,relro,-z,now,-z,noexecstack -pie -s
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -179,3 +179,6 @@ gc_c_space_frame_width: 500
|
||||||
|
|
||||||
# 是否识别车头
|
# 是否识别车头
|
||||||
gc_train_heard_detect: true
|
gc_train_heard_detect: true
|
||||||
|
|
||||||
|
#过期文件夹天数
|
||||||
|
gc_days_for_result_expire_folder: 3
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ engines:
|
||||||
DeviceStatusUpSerEngine: 0
|
DeviceStatusUpSerEngine: 0
|
||||||
#ResultToMySQLSrvEngine: 0
|
#ResultToMySQLSrvEngine: 0
|
||||||
#DataToMinioSrvEngine: 0
|
#DataToMinioSrvEngine: 0
|
||||||
|
DeleteExpiredFolderEngine: 0
|
||||||
|
|
||||||
#engine连接
|
#engine连接
|
||||||
connects:
|
connects:
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,187 @@
|
||||||
|
#include "DeleteExpiredFolderEngine.h"
|
||||||
|
|
||||||
|
using namespace ai_matrix;
|
||||||
|
|
||||||
|
DeleteExpiredFolderEngine::DeleteExpiredFolderEngine() {}
|
||||||
|
|
||||||
|
DeleteExpiredFolderEngine::~DeleteExpiredFolderEngine() {}
|
||||||
|
|
||||||
|
APP_ERROR DeleteExpiredFolderEngine::Init()
|
||||||
|
{
|
||||||
|
iDaysNumber_ = MyYaml::GetIns()->GetIntValue("gc_days_for_result_expire_folder");
|
||||||
|
strResultPath_ = MyYaml::GetIns()->GetPathValue("gc_result_path");
|
||||||
|
|
||||||
|
LogInfo << "DeleteExpiredFolderEngine Init ok";
|
||||||
|
return APP_ERR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
APP_ERROR DeleteExpiredFolderEngine::DeInit()
|
||||||
|
{
|
||||||
|
LogInfo << "DeleteExpiredFolderEngine DeInit ok";
|
||||||
|
return APP_ERR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
APP_ERROR DeleteExpiredFolderEngine::Process()
|
||||||
|
{
|
||||||
|
int iRet = APP_ERR_OK;
|
||||||
|
while (!isStop_)
|
||||||
|
{
|
||||||
|
std::string strTrainDate_temp = MyUtils::getins()->GetDate();
|
||||||
|
|
||||||
|
DeletePreviousFolder(strResultPath_, strTrainDate_temp, iDaysNumber_);
|
||||||
|
|
||||||
|
usleep(1000*1000*3600*24); //每二十四小时执行一次
|
||||||
|
}
|
||||||
|
|
||||||
|
return APP_ERR_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeleteExpiredFolderEngine::DeletePreviousFolder(std::string path, const std::string &date, int n_days)
|
||||||
|
{
|
||||||
|
// 1 computer date
|
||||||
|
std::string previous_date = getDateBeforeNDays(date, n_days);
|
||||||
|
if (!previous_date.empty())
|
||||||
|
std::cout << "Date before " << n_days << " days from " << date << " is: " << previous_date << std::endl;
|
||||||
|
|
||||||
|
|
||||||
|
// 2
|
||||||
|
std::vector<Date> subfolders;
|
||||||
|
GetSubfolderNames(path, subfolders);
|
||||||
|
// for (const auto &it : subfolders)
|
||||||
|
// std::cout << it.year << "." << it.month << "." << it.day << std::endl;
|
||||||
|
|
||||||
|
// 3 delete
|
||||||
|
if (path.back() != '/')
|
||||||
|
path += "/";
|
||||||
|
Date reference_date = StrToDate(previous_date); // 给定的参考日期
|
||||||
|
DeleteEarlierDatesFolder(path, subfolders, reference_date);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取某月有多少天
|
||||||
|
int DeleteExpiredFolderEngine::DaysInMonth(int year, int month)
|
||||||
|
{
|
||||||
|
int max_days[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
||||||
|
if (month == 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0))
|
||||||
|
{
|
||||||
|
max_days[2] = 29; // 闰年2月有29天
|
||||||
|
}
|
||||||
|
return max_days[month];
|
||||||
|
}
|
||||||
|
|
||||||
|
// 解析字符串为日期结构体
|
||||||
|
Date DeleteExpiredFolderEngine::StrToDate(const std::string &date_str)
|
||||||
|
{
|
||||||
|
std::istringstream iss(date_str);
|
||||||
|
int year, month, day;
|
||||||
|
char dash;
|
||||||
|
|
||||||
|
if (!(iss >> year >> dash && dash == '-' &&
|
||||||
|
iss >> month >> dash && dash == '-' &&
|
||||||
|
iss >> day))
|
||||||
|
{
|
||||||
|
LogError << ("Invalid date format") << ":" << date_str;
|
||||||
|
}
|
||||||
|
return {year, month, day};
|
||||||
|
}
|
||||||
|
|
||||||
|
// 减去指定天数
|
||||||
|
void DeleteExpiredFolderEngine::SubtractDays(Date &date, int n_days)
|
||||||
|
{
|
||||||
|
while (n_days > 0)
|
||||||
|
{
|
||||||
|
date.day--;
|
||||||
|
n_days--;
|
||||||
|
if (date.day == 0)
|
||||||
|
{
|
||||||
|
if (--date.month == 0)
|
||||||
|
{
|
||||||
|
--date.year;
|
||||||
|
date.month = 12;
|
||||||
|
}
|
||||||
|
int max_days = DaysInMonth(date.year, date.month);
|
||||||
|
date.day = max_days;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 格式化日期结构体为字符串
|
||||||
|
std::string DeleteExpiredFolderEngine::DateToStr(const Date &date)
|
||||||
|
{
|
||||||
|
std::ostringstream oss;
|
||||||
|
oss << date.year << "-" << std::setfill('0') << std::setw(2) << date.month << "-" << std::setw(2) << date.day;
|
||||||
|
return oss.str();
|
||||||
|
}
|
||||||
|
|
||||||
|
// 主要功能函数,接收一个日期字符串和一个整数n,返回n天前的日期字符串
|
||||||
|
std::string DeleteExpiredFolderEngine::getDateBeforeNDays(const std::string &input_date, int n_days)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Date date = StrToDate(input_date);
|
||||||
|
SubtractDays(date, n_days);
|
||||||
|
return DateToStr(date);
|
||||||
|
}
|
||||||
|
catch (const std::exception &e)
|
||||||
|
{
|
||||||
|
LogError << "Error: " << e.what();
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeleteExpiredFolderEngine::GetSubfolderNames(std::string &directory, std::vector<Date> &folder_names)
|
||||||
|
{
|
||||||
|
if (directory.back() != '/')
|
||||||
|
directory += "/";
|
||||||
|
DIR *dir;
|
||||||
|
struct dirent *ent;
|
||||||
|
if ((dir = opendir(directory.c_str())) != nullptr)
|
||||||
|
{
|
||||||
|
while ((ent = readdir(dir)) != nullptr)
|
||||||
|
{
|
||||||
|
// 排除"."和".."
|
||||||
|
if (ent->d_type == DT_DIR && ent->d_name[0] != '.' && ent->d_name == "best")
|
||||||
|
{
|
||||||
|
folder_names.push_back(StrToDate(ent->d_name));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closedir(dir);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LogError << "Unable to open directory: " << directory;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeleteExpiredFolderEngine::DeleteFolder(const std::string directory)
|
||||||
|
{
|
||||||
|
std::string command = "rm -rf " + directory;
|
||||||
|
int result = system(command.c_str());
|
||||||
|
|
||||||
|
if (result != 0)
|
||||||
|
std::cout << "Failed to remove directory recursively: " << directory << std::endl;
|
||||||
|
else
|
||||||
|
std::cout << "delete folder successfully : " << directory << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除向量中小于指定日期的所有元素
|
||||||
|
void DeleteExpiredFolderEngine::DeleteEarlierDatesFolder(std::string &path, std::vector<Date> &subfolders, const Date &reference_date)
|
||||||
|
{
|
||||||
|
if (path.back() != '/')
|
||||||
|
path += "/";
|
||||||
|
for (const Date &cur : subfolders)
|
||||||
|
{
|
||||||
|
// bool flag = false;
|
||||||
|
if (cur.year < reference_date.year)
|
||||||
|
{
|
||||||
|
DeleteFolder(path + DateToStr(cur));
|
||||||
|
}
|
||||||
|
else if (cur.year == reference_date.year && cur.month < reference_date.month)
|
||||||
|
{
|
||||||
|
DeleteFolder(path + DateToStr(cur));
|
||||||
|
}
|
||||||
|
else if (cur.year == reference_date.year && cur.month == reference_date.month && cur.day < reference_date.day)
|
||||||
|
{
|
||||||
|
DeleteFolder(path + DateToStr(cur));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
/**
|
||||||
|
* 过期数据删除引擎
|
||||||
|
**/
|
||||||
|
|
||||||
|
#ifndef DELETEEXPIREDFOLDERENGINE_H
|
||||||
|
#define DELETEEXPIREDFOLDERENGINE_H
|
||||||
|
|
||||||
|
#include "AppCommon.h"
|
||||||
|
#include "EngineBase.h"
|
||||||
|
#include "EngineFactory.h"
|
||||||
|
#include "MyYaml.h"
|
||||||
|
#include "myutils.h"
|
||||||
|
|
||||||
|
// 定义日期结构体
|
||||||
|
struct Date
|
||||||
|
{
|
||||||
|
int year;
|
||||||
|
int month;
|
||||||
|
int day;
|
||||||
|
};
|
||||||
|
|
||||||
|
class DeleteExpiredFolderEngine : public ai_matrix::EngineBase
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
DeleteExpiredFolderEngine();
|
||||||
|
~DeleteExpiredFolderEngine();
|
||||||
|
|
||||||
|
APP_ERROR Init() override;
|
||||||
|
APP_ERROR DeInit() override;
|
||||||
|
APP_ERROR Process() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
// 获取某月有多少天
|
||||||
|
int DaysInMonth(int year, int month);
|
||||||
|
// 解析字符串为日期结构体
|
||||||
|
Date StrToDate(const std::string &date_str);
|
||||||
|
// 减去指定天数
|
||||||
|
void SubtractDays(Date &date, int n_days);
|
||||||
|
// 格式化日期结构体为字符串
|
||||||
|
std::string DateToStr(const Date &date);
|
||||||
|
// 接收一个日期字符串和一个整数n,返回n天前的日期字符串
|
||||||
|
std::string getDateBeforeNDays(const std::string &input_date, int n_days);
|
||||||
|
void GetSubfolderNames(std::string &directory, std::vector<Date> &folder_names);
|
||||||
|
void DeleteFolder(const std::string directory);
|
||||||
|
// 删除向量中小于指定日期的所有元素
|
||||||
|
void DeleteEarlierDatesFolder(std::string &path, std::vector<Date> &subfolders, const Date &reference_date);
|
||||||
|
void DeletePreviousFolder(std::string path, const std::string &date, int n_days);
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::string strResultPath_;
|
||||||
|
|
||||||
|
int iDaysNumber_;
|
||||||
|
};
|
||||||
|
|
||||||
|
ENGINE_REGIST(DeleteExpiredFolderEngine)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -1,81 +0,0 @@
|
||||||
#include "DeleteOldDataEngine.h"
|
|
||||||
|
|
||||||
|
|
||||||
using namespace ai_matrix;
|
|
||||||
|
|
||||||
DeleteOldDataEngine::DeleteOldDataEngine() {}
|
|
||||||
|
|
||||||
DeleteOldDataEngine::~DeleteOldDataEngine() {}
|
|
||||||
|
|
||||||
APP_ERROR DeleteOldDataEngine::Init()
|
|
||||||
{
|
|
||||||
bUseEngine_ = true;
|
|
||||||
// bHwDecode_ = MyYaml::GetIns()->GetBoolValue("gc_hardware_decode");//硬解码
|
|
||||||
this->outTimeDay_ = 10;
|
|
||||||
|
|
||||||
LogInfo << "DeleteOldDataEngine Init ok";
|
|
||||||
return APP_ERR_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
APP_ERROR DeleteOldDataEngine::DeInit()
|
|
||||||
{
|
|
||||||
if (!bUseEngine_)
|
|
||||||
{
|
|
||||||
LogWarn << "engineId_:" << engineId_ << " not use engine";
|
|
||||||
return APP_ERR_OK;
|
|
||||||
}
|
|
||||||
LogInfo << "DeleteOldDataEngine DeInit ok";
|
|
||||||
return APP_ERR_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
//void rm_dir( const char *path )
|
|
||||||
//{
|
|
||||||
// DIR *dir;
|
|
||||||
// struct dirent *dirp;
|
|
||||||
// struct stat buf;
|
|
||||||
// char *p = getcwd( NULL, 0 );
|
|
||||||
// if ( (dir = opendir( path ) ) == NULL )
|
|
||||||
// error_quit( "OpenDir" );
|
|
||||||
// change_path( path );
|
|
||||||
// while ( dirp = readdir( dir ) )
|
|
||||||
// {
|
|
||||||
// if ( (strcmp( dirp->d_name, "." ) == 0) || (strcmp( dirp->d_name, ".." ) == 0) )
|
|
||||||
// continue;
|
|
||||||
// if ( stat( dirp->d_name, &buf ) == -1 )
|
|
||||||
// error_quit( "stat" );
|
|
||||||
// if ( S_ISDIR( buf.st_mode ) )
|
|
||||||
// {
|
|
||||||
// rm_dir( dirp->d_name );
|
|
||||||
// /*if(rmdir(dirp->d_name)==-1)
|
|
||||||
// * error_quit("rmdir");
|
|
||||||
// * printf("rm %s Successed . . .\n",dirp->d_name);*/
|
|
||||||
// continue;
|
|
||||||
// }
|
|
||||||
// if ( remove( dirp->d_name ) == -1 )
|
|
||||||
// error_quit( "remove" );
|
|
||||||
// printf( "rm %s Successed . . .\n", dirp->d_name );
|
|
||||||
// }
|
|
||||||
// closedir( dir );
|
|
||||||
// change_path( p );
|
|
||||||
// if ( rmdir( path ) == -1 )
|
|
||||||
// error_quit( "rmdir" );
|
|
||||||
// printf( "rm %s Successed . . .\n", path );
|
|
||||||
//}
|
|
||||||
|
|
||||||
APP_ERROR DeleteOldDataEngine::Process()
|
|
||||||
{
|
|
||||||
if (!bUseEngine_)
|
|
||||||
{
|
|
||||||
LogWarn << "engineId_:" << engineId_ << " not use engine";
|
|
||||||
return APP_ERR_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
int iRet = APP_ERR_OK;
|
|
||||||
while (!isStop_)
|
|
||||||
{
|
|
||||||
|
|
||||||
"find 目录地址 -type f -ctime +10 | xargs rm -f"
|
|
||||||
|
|
||||||
}
|
|
||||||
return APP_ERR_OK;
|
|
||||||
}
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
/**
|
|
||||||
* 控制识别Engine
|
|
||||||
* */
|
|
||||||
|
|
||||||
#ifndef DELETEOLDDATAENGINE_H
|
|
||||||
#define DELETEOLDDATAENGINE_H
|
|
||||||
|
|
||||||
#include "AppCommon.h"
|
|
||||||
#include "MyYaml.h"
|
|
||||||
#include "myutils.h"
|
|
||||||
#include "EngineBase.h"
|
|
||||||
#include "EngineFactory.h"
|
|
||||||
|
|
||||||
class DeleteOldDataEngine : public ai_matrix::EngineBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
DeleteOldDataEngine();
|
|
||||||
~DeleteOldDataEngine();
|
|
||||||
|
|
||||||
APP_ERROR Init() override;
|
|
||||||
APP_ERROR DeInit() override;
|
|
||||||
APP_ERROR Process() override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
bool bUseEngine_;
|
|
||||||
int outTimeDay_;
|
|
||||||
};
|
|
||||||
|
|
||||||
ENGINE_REGIST(DeleteOldDataEngine)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -28,6 +28,8 @@ APP_ERROR FilterTrainStepOneEngine::Init()
|
||||||
strResultPath_ = MyYaml::GetIns()->GetPathValue("gc_result_path");
|
strResultPath_ = MyYaml::GetIns()->GetPathValue("gc_result_path");
|
||||||
iChkStopPX_ = MyYaml::GetIns()->GetIntValue("gc_chkstop_px");
|
iChkStopPX_ = MyYaml::GetIns()->GetIntValue("gc_chkstop_px");
|
||||||
iChkStopCount_ = MyYaml::GetIns()->GetIntValue("gc_chkstop_count");
|
iChkStopCount_ = MyYaml::GetIns()->GetIntValue("gc_chkstop_count");
|
||||||
|
iPartitionFrameNum_ = MyYaml::GetIns()->GetIntValue("partition_frame_span");
|
||||||
|
iPlitFrameSpanPX_ = MyYaml::GetIns()->GetIntValue("gc_split_frame_span_px");
|
||||||
|
|
||||||
//获取主摄像头信息
|
//获取主摄像头信息
|
||||||
mainCfg_ = MyYaml::GetIns()->GetDataSourceConfigById(0);
|
mainCfg_ = MyYaml::GetIns()->GetDataSourceConfigById(0);
|
||||||
|
|
@ -35,6 +37,8 @@ APP_ERROR FilterTrainStepOneEngine::Init()
|
||||||
std::map<int, ai_matrix::DataSourceConfig> mapUseDataSouceCfg = MyYaml::GetIns()->GetUseDataSourceConfig();
|
std::map<int, ai_matrix::DataSourceConfig> mapUseDataSouceCfg = MyYaml::GetIns()->GetUseDataSourceConfig();
|
||||||
for (auto iter = mapUseDataSouceCfg.begin(); iter != mapUseDataSouceCfg.end(); iter++)
|
for (auto iter = mapUseDataSouceCfg.begin(); iter != mapUseDataSouceCfg.end(); iter++)
|
||||||
{
|
{
|
||||||
|
this->rightFirst_ = iter->second.iRightFirst;
|
||||||
|
this->leftFirst_ = iter->second.iLeftFirst;
|
||||||
if (iter->second.strTarget.find("NUM") != std::string::npos)
|
if (iter->second.strTarget.find("NUM") != std::string::npos)
|
||||||
{
|
{
|
||||||
LogDebug << "DataSource:" << iter->first << " deal NUM";
|
LogDebug << "DataSource:" << iter->first << " deal NUM";
|
||||||
|
|
@ -113,7 +117,7 @@ void FilterTrainStepOneEngine::InitParam()
|
||||||
}
|
}
|
||||||
iDirection_ = DIRECTION_UNKNOWN;
|
iDirection_ = DIRECTION_UNKNOWN;
|
||||||
iNotChgCount_ = 0;
|
iNotChgCount_ = 0;
|
||||||
|
|
||||||
while (!stackBackInfo_.empty())
|
while (!stackBackInfo_.empty())
|
||||||
{
|
{
|
||||||
stackBackInfo_.pop();
|
stackBackInfo_.pop();
|
||||||
|
|
@ -185,8 +189,28 @@ void FilterTrainStepOneEngine::AddBackInfo(std::shared_ptr<ProcessData> pProcess
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
TrainBackInfo trainBackInfoTop = stackBackInfo_.top();
|
TrainBackInfo trainBackInfoTop = stackBackInfo_.top();
|
||||||
|
// 2024年3月27日修改前
|
||||||
|
// if (trainBackInfoTop.strAllClassType != trainBackInfo.strAllClassType)
|
||||||
|
// {
|
||||||
|
// stackBackInfo_.push(trainBackInfo);
|
||||||
|
// LogDebug << "frameId:" << pProcessData->iFrameId << " push strAllClassType:" << strAllClassType
|
||||||
|
// << " stacksize:" << stackBackInfo_.size();
|
||||||
|
// }
|
||||||
|
|
||||||
if (trainBackInfoTop.strAllClassType != trainBackInfo.strAllClassType)
|
if (trainBackInfoTop.strAllClassType != trainBackInfo.strAllClassType)
|
||||||
{
|
{
|
||||||
|
if (iDirection_ == DIRECTION_RIGHT
|
||||||
|
&& trainBackInfo.strAllClassType == "SPACE"
|
||||||
|
&& (trainBackInfoTop.strAllClassType == "PROSPACE" || trainBackInfoTop.strAllClassType == "SPACEPRO"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (iDirection_ == DIRECTION_LEFT
|
||||||
|
&& trainBackInfo.strAllClassType == "SPACE"
|
||||||
|
&& (trainBackInfoTop.strAllClassType == "NUMSPACE" || trainBackInfoTop.strAllClassType == "SPACENUM"))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
stackBackInfo_.push(trainBackInfo);
|
stackBackInfo_.push(trainBackInfo);
|
||||||
LogDebug << "frameId:" << pProcessData->iFrameId << " push strAllClassType:" << strAllClassType
|
LogDebug << "frameId:" << pProcessData->iFrameId << " push strAllClassType:" << strAllClassType
|
||||||
<< " stacksize:" << stackBackInfo_.size();
|
<< " stacksize:" << stackBackInfo_.size();
|
||||||
|
|
@ -240,8 +264,8 @@ bool FilterTrainStepOneEngine::IsEndDealBackInfo(std::shared_ptr<ProcessData> pP
|
||||||
{
|
{
|
||||||
bool bFlag = (pPostDataBack->vecPostSubData[i].step1Location.fLTX <= pPostData->vecPostSubData[i].step1Location.fLTX);
|
bool bFlag = (pPostDataBack->vecPostSubData[i].step1Location.fLTX <= pPostData->vecPostSubData[i].step1Location.fLTX);
|
||||||
LogDebug << "帧:" << pProcessData->iFrameId << " 倒车前帧:" << pPostDataBack->iFrameId << " 恢复到原位:" << bFlag
|
LogDebug << "帧:" << pProcessData->iFrameId << " 倒车前帧:" << pPostDataBack->iFrameId << " 恢复到原位:" << bFlag
|
||||||
<< " 当前框位置:" << pPostData->vecPostSubData[i].step1Location.fLTX
|
<< " 当前框位置:" << pPostData->vecPostSubData[i].step1Location.fLTX
|
||||||
<< " 倒车前位置:" << pPostDataBack->vecPostSubData[i].step1Location.fLTX;
|
<< " 倒车前位置:" << pPostDataBack->vecPostSubData[i].step1Location.fLTX;
|
||||||
if ((iDirection_ == DIRECTION_LEFT && !bFlag) ||
|
if ((iDirection_ == DIRECTION_LEFT && !bFlag) ||
|
||||||
(iDirection_ == DIRECTION_RIGHT && bFlag))
|
(iDirection_ == DIRECTION_RIGHT && bFlag))
|
||||||
{
|
{
|
||||||
|
|
@ -265,7 +289,7 @@ bool FilterTrainStepOneEngine::IsEndDealBackInfo(std::shared_ptr<ProcessData> pP
|
||||||
{
|
{
|
||||||
stackBackInfo_.push(trainBackInfoTop_bak);
|
stackBackInfo_.push(trainBackInfoTop_bak);
|
||||||
LogDebug << "帧:" << pProcessData->iFrameId << " 倒车信息:" << stackBackInfo_.size()
|
LogDebug << "帧:" << pProcessData->iFrameId << " 倒车信息:" << stackBackInfo_.size()
|
||||||
<< " 顶部倒车信息:" << trainBackInfoTop.strAllClassType << " 本次识别信息:" << strAllClassType;
|
<< " 顶部倒车信息:" << trainBackInfoTop.strAllClassType << " 本次识别信息:" << strAllClassType;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -290,7 +314,7 @@ bool FilterTrainStepOneEngine::IsEndDealBackInfo(std::shared_ptr<ProcessData> pP
|
||||||
* 校验火车是否停止
|
* 校验火车是否停止
|
||||||
* inParam : std::shared_ptr<ProcessData> pProcessData :待处理数据
|
* inParam : std::shared_ptr<ProcessData> pProcessData :待处理数据
|
||||||
* outParam: N/A
|
* outParam: N/A
|
||||||
* return : true:停止; false:非停止 1(正常行驶) 2(停车) 3(倒车)
|
* return : true:停止; false:非停止 1(正常行驶) 2(停车) 3(倒车)
|
||||||
*/
|
*/
|
||||||
int FilterTrainStepOneEngine::GetTrainStatus(std::shared_ptr<ProcessData> pProcessData)
|
int FilterTrainStepOneEngine::GetTrainStatus(std::shared_ptr<ProcessData> pProcessData)
|
||||||
{
|
{
|
||||||
|
|
@ -366,6 +390,11 @@ int FilterTrainStepOneEngine::GetTrainStatus(std::shared_ptr<ProcessData> pProce
|
||||||
if ((iCenterBack > iCenterFront && iDirection_ == DIRECTION_LEFT) ||
|
if ((iCenterBack > iCenterFront && iDirection_ == DIRECTION_LEFT) ||
|
||||||
(iCenterBack < iCenterFront && iDirection_ == DIRECTION_RIGHT))
|
(iCenterBack < iCenterFront && iDirection_ == DIRECTION_RIGHT))
|
||||||
{
|
{
|
||||||
|
if (this->iPartitionFrameNum_ < (pProcessData->iFrameId - postDataFront.iFrameId)
|
||||||
|
&& this->iPlitFrameSpanPX_ < abs(iCenterBack - iCenterFront))
|
||||||
|
{
|
||||||
|
return TRAINSTATUS_RUN;
|
||||||
|
}
|
||||||
LogDebug << "frameId:" << pProcessData->iFrameId << " 检测到火车倒车";
|
LogDebug << "frameId:" << pProcessData->iFrameId << " 检测到火车倒车";
|
||||||
return TRAINSTATUS_BACK;
|
return TRAINSTATUS_BACK;
|
||||||
}
|
}
|
||||||
|
|
@ -375,16 +404,16 @@ int FilterTrainStepOneEngine::GetTrainStatus(std::shared_ptr<ProcessData> pProce
|
||||||
return TRAINSTATUS_RUN;
|
return TRAINSTATUS_RUN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
小于10个像素表示可能停车,累计未变化次数。
|
小于10个像素表示可能停车,累计未变化次数。
|
||||||
累计变化次数超过10次,返回停车
|
累计变化次数超过10次,返回停车
|
||||||
累计变化次数未超过10次,返回之前行驶状态
|
累计变化次数未超过10次,返回之前行驶状态
|
||||||
*/
|
*/
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
iNotChgCount_++;
|
iNotChgCount_++;
|
||||||
LogDebug << " frameId:" << pProcessData->iFrameId
|
LogDebug << " frameId:" << pProcessData->iFrameId
|
||||||
<< " 大框移动范围小 判断停车计数:" << iNotChgCount_ << "/" << iChkStopCount_;
|
<< " 大框移动范围小 判断停车计数:" << iNotChgCount_ << "/" << iChkStopCount_;
|
||||||
if (iNotChgCount_ > iChkStopCount_)
|
if (iNotChgCount_ > iChkStopCount_)
|
||||||
{
|
{
|
||||||
LogDebug << "frameId:" << pProcessData->iFrameId << " 检测到火车停车";
|
LogDebug << "frameId:" << pProcessData->iFrameId << " 检测到火车停车";
|
||||||
|
|
@ -506,7 +535,7 @@ void FilterTrainStepOneEngine::SetDirection(std::vector<Step1Location> &vecLocat
|
||||||
{
|
{
|
||||||
iDirection_ = DIRECTION_LEFT;
|
iDirection_ = DIRECTION_LEFT;
|
||||||
}
|
}
|
||||||
//行驶方向 右
|
//行驶方向 右
|
||||||
else if ((slBack.fLTX - slFront.fLTX) > 0)
|
else if ((slBack.fLTX - slFront.fLTX) > 0)
|
||||||
{
|
{
|
||||||
iDirection_ = DIRECTION_RIGHT;
|
iDirection_ = DIRECTION_RIGHT;
|
||||||
|
|
@ -916,7 +945,7 @@ void FilterTrainStepOneEngine::DealProcessDataPre(std::shared_ptr<ProcessData> p
|
||||||
{
|
{
|
||||||
//倒车
|
//倒车
|
||||||
AddBackInfo(iterProcessData->second);
|
AddBackInfo(iterProcessData->second);
|
||||||
iTrainStatusTemp = TRAINSTATUS_STOP;
|
iTrainStatusTemp = TRAINSTATUS_STOP;
|
||||||
}
|
}
|
||||||
else if(iTrainStatus_ == TRAINSTATUS_RUN)
|
else if(iTrainStatus_ == TRAINSTATUS_RUN)
|
||||||
{
|
{
|
||||||
|
|
@ -933,7 +962,7 @@ void FilterTrainStepOneEngine::DealProcessDataPre(std::shared_ptr<ProcessData> p
|
||||||
<< " 火车实时运行状态:" << iTrainStatus_ << "(0无车,1运行,2停车,3倒车) iTrainStatusTemp:" << iTrainStatusTemp;
|
<< " 火车实时运行状态:" << iTrainStatus_ << "(0无车,1运行,2停车,3倒车) iTrainStatusTemp:" << iTrainStatusTemp;
|
||||||
iterProcessData->second->iStatus = iTrainStatusTemp;
|
iterProcessData->second->iStatus = iTrainStatusTemp;
|
||||||
|
|
||||||
this->sendComeTrain(pProcessData->strTrainDate, pProcessData->strTrainName, iDirection_);
|
// this->sendComeTrain(pProcessData->strTrainDate, pProcessData->strTrainName, iDirection_);
|
||||||
|
|
||||||
//上一帧,push端口0
|
//上一帧,push端口0
|
||||||
PushData(strPort0_, iterProcessData->second);
|
PushData(strPort0_, iterProcessData->second);
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,10 @@ private:
|
||||||
int iChkStopPX_;
|
int iChkStopPX_;
|
||||||
int iChkStopCount_;
|
int iChkStopCount_;
|
||||||
int iDirection_; //方向
|
int iDirection_; //方向
|
||||||
|
int rightFirst_; // 向右行驶的在前大框类型
|
||||||
|
int leftFirst_; // 向左行驶的在前大框类型
|
||||||
|
int iPartitionFrameNum_; //满足跨车厢的帧间隔
|
||||||
|
int iPlitFrameSpanPX_; //相连帧 同种大框的跨度最大值
|
||||||
std::map<int, PostData> mapPostDataFrist_; //[key-数据源id, value-第一步识别信息]
|
std::map<int, PostData> mapPostDataFrist_; //[key-数据源id, value-第一步识别信息]
|
||||||
std::map<int, std::map<int, std::vector<Step1Location>>> mapMapStep1Info_; //[key-数据源id, value-[key-识别目标, value-识别框集合]]
|
std::map<int, std::map<int, std::vector<Step1Location>>> mapMapStep1Info_; //[key-数据源id, value-[key-识别目标, value-识别框集合]]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -301,8 +301,8 @@ void SaveStepOneResultEngine::DealTrainSpaceInfo(std::shared_ptr<ProcessData> pP
|
||||||
if (!(bDealCenterFlag_ && !bIntervalFlag && (iCenterCur < (pProcessData->iWidth / 3 + 30))))
|
if (!(bDealCenterFlag_ && !bIntervalFlag && (iCenterCur < (pProcessData->iWidth / 3 + 30))))
|
||||||
{
|
{
|
||||||
vecParationInfo_.push_back(parationInfo);
|
vecParationInfo_.push_back(parationInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (iDirection_ == DIRECTION_RIGHT)
|
else if (iDirection_ == DIRECTION_RIGHT)
|
||||||
{
|
{
|
||||||
|
|
@ -550,7 +550,7 @@ APP_ERROR SaveStepOneResultEngine::Process()
|
||||||
{
|
{
|
||||||
//车头没有属性,因此车头号也加入到属性中。保证向右行驶属性在前时最后2节的切分。
|
//车头没有属性,因此车头号也加入到属性中。保证向右行驶属性在前时最后2节的切分。
|
||||||
//车头只加入一次,防止一个车头2个车头号的场景。但有两个车头且没识别车头间隔则无法处理。
|
//车头只加入一次,防止一个车头2个车头号的场景。但有两个车头且没识别车头间隔则无法处理。
|
||||||
if (!bHaveHeadFlag_)
|
if (!bHaveHeadFlag_)
|
||||||
{
|
{
|
||||||
bool bIntervalFlag = ((int)(pProcessData->iFrameId - headInfo_.iFrameId) > iSplitSpan_ && headInfo_.iFrameId != 0);
|
bool bIntervalFlag = ((int)(pProcessData->iFrameId - headInfo_.iFrameId) > iSplitSpan_ && headInfo_.iFrameId != 0);
|
||||||
|
|
||||||
|
|
@ -585,7 +585,7 @@ APP_ERROR SaveStepOneResultEngine::Process()
|
||||||
}
|
}
|
||||||
else if (postSubData.iTargetType == CONTAINER)
|
else if (postSubData.iTargetType == CONTAINER)
|
||||||
{
|
{
|
||||||
jvStep1Container.append(jvInfo);
|
jvStep1Container.append(jvInfo);
|
||||||
}
|
}
|
||||||
else if (postSubData.iTargetType == SPACE)
|
else if (postSubData.iTargetType == SPACE)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -212,6 +212,11 @@ std::string SelectBestEngine::GetBest(std::vector<TransInfo> &vecAllTransInfo, T
|
||||||
{
|
{
|
||||||
vecAllTransInfo = vecTransInfoTemp;
|
vecAllTransInfo = vecTransInfoTemp;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 此处因车厢太脏。识别效果很差,难以与RFID识别结果融合,所以增加eles
|
||||||
|
return strValue;
|
||||||
|
}
|
||||||
|
|
||||||
//获取最优长度
|
//获取最优长度
|
||||||
int iBestLen = GetBestLength(vecAllTransInfo, iMaxLen);
|
int iBestLen = GetBestLength(vecAllTransInfo, iMaxLen);
|
||||||
|
|
|
||||||
|
|
@ -245,7 +245,7 @@ int HardH264FFmpegDecode::HardH264FFmpegDecoder(AVCodecContext *pDecCtx, AVFrame
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int HardH264FFmpegDecode::HardH264FFmpegDecoderV2(AVCodecContext *pDecCtx, SwsContext *pSwsCtx, AVFrame *pSrcFrame, AVFrame *pDstFrame, AVPacket *pPkt, void* pOutputData,unsigned int* puiOutputDataSize)
|
int HardH264FFmpegDecode::HardH264FFmpegDecoderV2(AVCodecContext *pDecCtx, AVFrame *pSrcFrame, AVFrame *pDstFrame, AVPacket *pPkt, void* pOutputData,unsigned int* puiOutputDataSize)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
@ -269,24 +269,29 @@ int HardH264FFmpegDecode::HardH264FFmpegDecoderV2(AVCodecContext *pDecCtx, SwsCo
|
||||||
// pDecCtx->width = ALIGN_DOWN(pDecCtx->width, 32);
|
// pDecCtx->width = ALIGN_DOWN(pDecCtx->width, 32);
|
||||||
// pDecCtx->height = ALIGN_DOWN(pDecCtx->height, 32);
|
// pDecCtx->height = ALIGN_DOWN(pDecCtx->height, 32);
|
||||||
|
|
||||||
sws_scale(pSwsCtx,
|
// sws_scale(pSwsCtx,
|
||||||
(const uint8_t *const *)pSrcFrame->data,
|
// (const uint8_t *const *)pSrcFrame->data,
|
||||||
pSrcFrame->linesize,
|
// pSrcFrame->linesize,
|
||||||
0,
|
// 0,
|
||||||
pDecCtx->height,
|
// pDecCtx->height,
|
||||||
pDstFrame->data,
|
// pDstFrame->data,
|
||||||
pDstFrame->linesize);
|
// pDstFrame->linesize);
|
||||||
|
|
||||||
//printf("saving frame %3d\n", pDecCtx->frame_number);
|
//printf("saving frame %3d\n", pDecCtx->frame_number);
|
||||||
fflush(stdout);
|
// fflush(stdout);
|
||||||
|
|
||||||
int iSize = pDecCtx->width * pDecCtx->height;
|
// int iSize = pDecCtx->width * pDecCtx->height;
|
||||||
|
//
|
||||||
memcpy(pOutputData, pDstFrame->data[0], iSize); //Y
|
// memcpy(pOutputData, pDstFrame->data[0], iSize); //Y
|
||||||
memcpy(pOutputData+iSize, pDstFrame->data[1], iSize/4); //U
|
// memcpy(pOutputData+iSize, pDstFrame->data[1], iSize/4); //U
|
||||||
memcpy(pOutputData+iSize+iSize/4, pDstFrame->data[2], iSize/4); //V
|
// memcpy(pOutputData+iSize+iSize/4, pDstFrame->data[2], iSize/4); //V
|
||||||
*puiOutputDataSize = iSize*3/2;
|
// *puiOutputDataSize = iSize*3/2;
|
||||||
return iSize*3/2;
|
// return iSize*3/2;
|
||||||
|
memcpy(pOutputData, pSrcFrame->data[0], pSrcFrame->width * pSrcFrame->height); // Y
|
||||||
|
memcpy(pOutputData + pSrcFrame->width * pSrcFrame->height, pSrcFrame->data[1], pSrcFrame->width * pSrcFrame->height / 4); // U
|
||||||
|
memcpy(pOutputData + pSrcFrame->width * pSrcFrame->height + pSrcFrame->width * pSrcFrame->height / 4, pSrcFrame->data[2], pSrcFrame->width * pSrcFrame->height / 4); // V
|
||||||
|
*puiOutputDataSize = pSrcFrame->width * pSrcFrame->height * 3 / 2;
|
||||||
|
return pSrcFrame->width * pSrcFrame->height * 3 / 2;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -68,7 +68,7 @@ public:
|
||||||
int HardH264FFmpegDecoderInit(unsigned int uiWidth, unsigned int uiHeight, unsigned int uiFrameRate = 30);
|
int HardH264FFmpegDecoderInit(unsigned int uiWidth, unsigned int uiHeight, unsigned int uiFrameRate = 30);
|
||||||
int HardH264FFmpegDecoderDeInit();
|
int HardH264FFmpegDecoderDeInit();
|
||||||
int HardH264FFmpegDecoder(AVCodecContext *pDecCtx, AVFrame *pFrame, AVPacket *pPkt, void* pOutputData, unsigned int* puiOutputDataSize);
|
int HardH264FFmpegDecoder(AVCodecContext *pDecCtx, AVFrame *pFrame, AVPacket *pPkt, void* pOutputData, unsigned int* puiOutputDataSize);
|
||||||
int HardH264FFmpegDecoderV2(AVCodecContext *pDecCtx, SwsContext *pSwsCtx, AVFrame *pSrcFrame, AVFrame *pDstFrame, AVPacket *pPkt, void* pOutputData, unsigned int* puiOutputDataSize);
|
int HardH264FFmpegDecoderV2(AVCodecContext *pDecCtx, AVFrame *pSrcFrame, AVFrame *pDstFrame, AVPacket *pPkt, void* pOutputData, unsigned int* puiOutputDataSize);
|
||||||
|
|
||||||
const AVCodec *pCodec_ = nullptr; //解码器
|
const AVCodec *pCodec_ = nullptr; //解码器
|
||||||
AVCodecContext *pCodecCtx_ = nullptr; //上下文
|
AVCodecContext *pCodecCtx_ = nullptr; //上下文
|
||||||
|
|
|
||||||
|
|
@ -67,19 +67,19 @@ APP_ERROR VideoDecodeEngine::Process()
|
||||||
{
|
{
|
||||||
usleep(10*1000); //10ms
|
usleep(10*1000); //10ms
|
||||||
|
|
||||||
iNoCameraDataCnt++;
|
// iNoCameraDataCnt++;
|
||||||
if (iNoCameraDataCnt >= 1000) //10秒内收不到,认为相机断开
|
// if (iNoCameraDataCnt >= 1000) //10秒内收不到,认为相机断开
|
||||||
{
|
// {
|
||||||
LogError << "engineId:" << engineId_ << " 超过10秒获取到摄像头数据,疑似摄像头断开。计数:" << iNoCameraDataCnt;
|
// LogError << "engineId:" << engineId_ << " 超过10秒获取到摄像头数据,疑似摄像头断开。计数:" << iNoCameraDataCnt;
|
||||||
iNoCameraDataCnt = 0;
|
// iNoCameraDataCnt = 0;
|
||||||
//camera异常时,构造空的解码数据push,确保一直有数据流转到后面Engine
|
// //camera异常时,构造空的解码数据push,确保一直有数据流转到后面Engine
|
||||||
std::shared_ptr<ProcessData> pProcessData = std::make_shared<ProcessData>();
|
// std::shared_ptr<ProcessData> pProcessData = std::make_shared<ProcessData>();
|
||||||
pProcessData->iDataSource = engineId_;
|
// pProcessData->iDataSource = engineId_;
|
||||||
pProcessData->i64TimeStamp = MyUtils::getins()->GetCurrentTimeMillis();
|
// pProcessData->i64TimeStamp = MyUtils::getins()->GetCurrentTimeMillis();
|
||||||
pProcessData->iSize = 0;
|
// pProcessData->iSize = 0;
|
||||||
pProcessData->pData = nullptr;
|
// pProcessData->pData = nullptr;
|
||||||
iRet = outputQueMap_[strPort0_]->push(std::static_pointer_cast<void>(pProcessData));
|
// iRet = outputQueMap_[strPort0_]->push(std::static_pointer_cast<void>(pProcessData));
|
||||||
}
|
// }
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
@ -119,7 +119,6 @@ APP_ERROR VideoDecodeEngine::Process()
|
||||||
// hard_h264_ffmpeg_decoder_->pPacket_, pYUV420MBuffer, &pYUV420MBuffer_Size);
|
// hard_h264_ffmpeg_decoder_->pPacket_, pYUV420MBuffer, &pYUV420MBuffer_Size);
|
||||||
|
|
||||||
int iDecodeRet = hard_h264_ffmpeg_decoder_->HardH264FFmpegDecoderV2(hard_h264_ffmpeg_decoder_->pCodecCtx_,
|
int iDecodeRet = hard_h264_ffmpeg_decoder_->HardH264FFmpegDecoderV2(hard_h264_ffmpeg_decoder_->pCodecCtx_,
|
||||||
hard_h264_ffmpeg_decoder_->pSwsContext_,
|
|
||||||
hard_h264_ffmpeg_decoder_->pSrcFrame_,
|
hard_h264_ffmpeg_decoder_->pSrcFrame_,
|
||||||
hard_h264_ffmpeg_decoder_->pDstFrame_,
|
hard_h264_ffmpeg_decoder_->pDstFrame_,
|
||||||
hard_h264_ffmpeg_decoder_->pPacket_,
|
hard_h264_ffmpeg_decoder_->pPacket_,
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ APP_ERROR MoveEngine::Init()
|
||||||
}
|
}
|
||||||
|
|
||||||
InitParam();
|
InitParam();
|
||||||
|
|
||||||
LogInfo << "MoveEngine Init ok";
|
LogInfo << "MoveEngine Init ok";
|
||||||
return APP_ERR_OK;
|
return APP_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
@ -141,8 +141,8 @@ void MoveEngine::InitParam()
|
||||||
}
|
}
|
||||||
|
|
||||||
void MoveEngine::sendComeTrain() {
|
void MoveEngine::sendComeTrain() {
|
||||||
// std::string message = "{\"cometime\":" + this->strTrainDate_ + " " + this->strTrainName_ + "\",\"type\":\"1\"}";
|
std::string message = "{\"cometime\":\"" + this->strTrainDate_ + " " + this->strTrainName_ + "\",\"type\":\"1\"}";
|
||||||
// outputQueMap_[engineName_ + "_" + std::to_string(engineId_) + "_1"]->push(std::static_pointer_cast<void>(std::make_shared<std::string>(message)));
|
outputQueMap_[engineName_ + "_" + std::to_string(engineId_) + "_1"]->push(std::static_pointer_cast<void>(std::make_shared<std::string>(message)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void MoveEngine::sendEndTrain() {
|
void MoveEngine::sendEndTrain() {
|
||||||
|
|
@ -192,7 +192,7 @@ void MoveEngine::SingleDeviceProcess(std::shared_ptr<ProcessData> pProcessData,
|
||||||
{
|
{
|
||||||
outputQueMap_[engineName_ + "_" + std::to_string(engineId_) + "_" + std::to_string(*iter)]->push(std::static_pointer_cast<void>(pMoveData));
|
outputQueMap_[engineName_ + "_" + std::to_string(engineId_) + "_" + std::to_string(*iter)]->push(std::static_pointer_cast<void>(pMoveData));
|
||||||
}
|
}
|
||||||
//通知第一步开始识别
|
//通知第一步开始识别
|
||||||
outputQueMap_[engineName_ + "_" + std::to_string(engineId_) + "_5"]->push(std::static_pointer_cast<void>(pMoveData));
|
outputQueMap_[engineName_ + "_" + std::to_string(engineId_) + "_5"]->push(std::static_pointer_cast<void>(pMoveData));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -269,6 +269,7 @@ APP_ERROR MoveEngine::Process()
|
||||||
memset(fReturnVal, 0x00, sizeof(fReturnVal));
|
memset(fReturnVal, 0x00, sizeof(fReturnVal));
|
||||||
|
|
||||||
yolov8model.YoloV8InferenceModelGetType(img, fReturnVal, STEP0_OUTPUT_ARRAY * sizeof(float));
|
yolov8model.YoloV8InferenceModelGetType(img, fReturnVal, STEP0_OUTPUT_ARRAY * sizeof(float));
|
||||||
|
// exit(0);
|
||||||
|
|
||||||
float fScore = 0.0f;
|
float fScore = 0.0f;
|
||||||
for(int n = 0; n < 4; n++){
|
for(int n = 0; n < 4; n++){
|
||||||
|
|
@ -329,33 +330,33 @@ APP_ERROR MoveEngine::Process()
|
||||||
{
|
{
|
||||||
|
|
||||||
queProcessData_.push(pProcessData);
|
queProcessData_.push(pProcessData);
|
||||||
LogDebug << "iStepInter_: " << iStepInter_ << " queSize:" << queProcessData_.size() << " continue";
|
LogDebug << "iStepInter_: " << iStepInter_ << " queSize:" << queProcessData_.size() << " continue";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// if (iStepInter_ != 1) this->sendComeTrain();
|
if (iStepInter_ != 1) this->sendComeTrain();
|
||||||
iStepInter_ = 1;
|
iStepInter_ = 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
//无车停止识别
|
//无车停止识别
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (iStepInter_ == 1)
|
if (iStepInter_ == 1)
|
||||||
{
|
{
|
||||||
iStepInter_ = 2;
|
iStepInter_ = 2;
|
||||||
|
this->sendEndTrain();
|
||||||
}
|
}
|
||||||
while (!queProcessData_.empty())
|
while (!queProcessData_.empty())
|
||||||
{
|
{
|
||||||
LogDebug << "while iStepInter_: " << iStepInter_ << " queSize:" << queProcessData_.size();
|
LogDebug << "while iStepInter_: " << iStepInter_ << " queSize:" << queProcessData_.size();
|
||||||
queProcessData_.pop();
|
queProcessData_.pop();
|
||||||
}
|
}
|
||||||
this->sendEndTrain();
|
|
||||||
}
|
}
|
||||||
//有车识别处理
|
//有车识别处理
|
||||||
if (iStepInter_ != 0)
|
if (iStepInter_ != 0)
|
||||||
{
|
{
|
||||||
while (!queProcessData_.empty())
|
while (!queProcessData_.empty())
|
||||||
{
|
{
|
||||||
LogDebug << "while2 iStepInter_: " << iStepInter_ << " queSize:" << queProcessData_.size();
|
LogDebug << "while2 iStepInter_: " << iStepInter_ << " queSize:" << queProcessData_.size();
|
||||||
std::shared_ptr<ProcessData> pProcessDataTemp = queProcessData_.front();
|
std::shared_ptr<ProcessData> pProcessDataTemp = queProcessData_.front();
|
||||||
queProcessData_.pop();
|
queProcessData_.pop();
|
||||||
pProcessDataTemp->iStatus = TRAINSTATUS_RUN;
|
pProcessDataTemp->iStatus = TRAINSTATUS_RUN;
|
||||||
|
|
@ -367,7 +368,7 @@ APP_ERROR MoveEngine::Process()
|
||||||
pProcessData->bIsEnd = ((iStepInter_ == 2) ? true : false); //动态检测无车,设置列车结束标识
|
pProcessData->bIsEnd = ((iStepInter_ == 2) ? true : false); //动态检测无车,设置列车结束标识
|
||||||
|
|
||||||
SingleDeviceProcess(pProcessData, nType);
|
SingleDeviceProcess(pProcessData, nType);
|
||||||
|
|
||||||
if (iStepInter_ == 2)
|
if (iStepInter_ == 2)
|
||||||
{
|
{
|
||||||
// this->sendEndTrain();
|
// this->sendEndTrain();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue