feat: 添加点云去噪及其参数调整
This commit is contained in:
@@ -34,7 +34,7 @@ find_package(Qt6 REQUIRED COMPONENTS
|
||||
)
|
||||
|
||||
# 查找PCL
|
||||
find_package(PCL REQUIRED COMPONENTS common io visualization)
|
||||
find_package(PCL REQUIRED COMPONENTS common io visualization filters)
|
||||
if(PCL_FOUND)
|
||||
include_directories(${PCL_INCLUDE_DIRS})
|
||||
link_directories(${PCL_LIBRARY_DIRS})
|
||||
@@ -101,6 +101,52 @@ add_executable(${PROJECT_NAME} WIN32
|
||||
${RESOURCES}
|
||||
)
|
||||
|
||||
# ==================== 标定文件(cmos0)检查 ====================
|
||||
set(VIEWER_CALIBRATION_DIR "${CMAKE_SOURCE_DIR}/cmos0")
|
||||
set(VIEWER_REQUIRED_CALIB_FILES
|
||||
"coe.txt"
|
||||
"kc.txt"
|
||||
"KK.txt"
|
||||
)
|
||||
|
||||
set(VIEWER_MISSING_CALIB_FILES "")
|
||||
foreach(_calib_file IN LISTS VIEWER_REQUIRED_CALIB_FILES)
|
||||
if(NOT EXISTS "${VIEWER_CALIBRATION_DIR}/${_calib_file}")
|
||||
list(APPEND VIEWER_MISSING_CALIB_FILES "${_calib_file}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
option(VIEWER_REQUIRE_CALIB_FILES "Fail configure when required cmos0 calibration files are missing" ON)
|
||||
|
||||
if(VIEWER_MISSING_CALIB_FILES)
|
||||
if(VIEWER_REQUIRE_CALIB_FILES)
|
||||
message(FATAL_ERROR
|
||||
"Missing calibration file(s) in ${VIEWER_CALIBRATION_DIR}: ${VIEWER_MISSING_CALIB_FILES}\n"
|
||||
"Please ensure cmos0 contains: ${VIEWER_REQUIRED_CALIB_FILES}"
|
||||
)
|
||||
else()
|
||||
message(WARNING
|
||||
"Missing calibration file(s) in ${VIEWER_CALIBRATION_DIR}: ${VIEWER_MISSING_CALIB_FILES}\n"
|
||||
"Build continues, but runtime or MSI may be incomplete."
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "Calibration files found: ${VIEWER_REQUIRED_CALIB_FILES}")
|
||||
endif()
|
||||
|
||||
# 复制标定文件到运行目录(bin/cmos0)
|
||||
if(EXISTS "${VIEWER_CALIBRATION_DIR}" AND NOT VIEWER_MISSING_CALIB_FILES)
|
||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:${PROJECT_NAME}>/cmos0"
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${VIEWER_CALIBRATION_DIR}"
|
||||
"$<TARGET_FILE_DIR:${PROJECT_NAME}>/cmos0"
|
||||
COMMENT "Copy cmos0 calibration files to runtime directory"
|
||||
)
|
||||
else()
|
||||
message(WARNING "Skip copying cmos0 because required calibration files are missing.")
|
||||
endif()
|
||||
|
||||
# 链接库
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
Qt6::Core
|
||||
@@ -141,6 +187,15 @@ install(DIRECTORY ${CMAKE_SOURCE_DIR}/bin/platforms/
|
||||
FILES_MATCHING PATTERN "*.dll"
|
||||
)
|
||||
|
||||
# 安装标定文件目录(用于MSI)
|
||||
if(EXISTS "${VIEWER_CALIBRATION_DIR}" AND NOT VIEWER_MISSING_CALIB_FILES)
|
||||
install(DIRECTORY ${VIEWER_CALIBRATION_DIR}/
|
||||
DESTINATION cmos0
|
||||
FILES_MATCHING
|
||||
PATTERN "*.txt"
|
||||
)
|
||||
endif()
|
||||
|
||||
# ==================== CPack配置 - MSI安装程序 ====================
|
||||
set(CPACK_PACKAGE_NAME "Viewer")
|
||||
set(CPACK_PACKAGE_VENDOR "Lorenzo Zhao")
|
||||
|
||||
Reference in New Issue
Block a user