Merge branch 'main' of http://192.168.3.13:3000/jerryzeng/algoLib
This commit is contained in:
commit
3621895832
3
.gitignore
vendored
3
.gitignore
vendored
@ -9,4 +9,5 @@
|
|||||||
*.aps
|
*.aps
|
||||||
*.user
|
*.user
|
||||||
*.filters
|
*.filters
|
||||||
**/build
|
**/build
|
||||||
|
arm*
|
||||||
60
CMakeLists.txt
Normal file
60
CMakeLists.txt
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
#设置CMake支持的最低版本
|
||||||
|
cmake_minimum_required(VERSION 3.5)
|
||||||
|
project(ZAlgo)
|
||||||
|
|
||||||
|
set(DCMAKE_BUILD_SYSNAME Arm)
|
||||||
|
set(CMAKE_BUILD_ARCH aarch64)
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER "aarch64-linux-gnu-gcc")
|
||||||
|
set(CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++")
|
||||||
|
|
||||||
|
ADD_DEFINITIONS("-fPIC -O3")
|
||||||
|
ADD_DEFINITIONS("-fexceptions")
|
||||||
|
ADD_DEFINITIONS("-Wl,-Bsymbolic -lc -lm -Wunused-result")
|
||||||
|
|
||||||
|
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden -fpermissive -std=c++14 -fno-use-cxa-atexit")
|
||||||
|
|
||||||
|
#out path configure_file
|
||||||
|
#设置库路径
|
||||||
|
SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/arm/libs)
|
||||||
|
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_SOURCE_DIR}/arm/bin)
|
||||||
|
|
||||||
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../thirdParty/VzNLSDK/Inc)
|
||||||
|
# INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../thirdParty/OpenCV320/include)
|
||||||
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../thirdParty/opencv/build/include)
|
||||||
|
|
||||||
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/sourceCode/inc)
|
||||||
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/sourceCode)
|
||||||
|
|
||||||
|
ADD_DEFINITIONS(-DSG_API_LIBRARY)
|
||||||
|
|
||||||
|
ADD_LIBRARY(baseAlgorithm SHARED sourceCode/SG_baseFunc.cpp
|
||||||
|
sourceCode/SG_clustering.cpp
|
||||||
|
sourceCode/SG_featureGrow.cpp
|
||||||
|
sourceCode/SG_lineFeature.cpp
|
||||||
|
sourceCode/SG_regionGrow.cpp
|
||||||
|
sourceCode/WD_noiseFilter.cpp
|
||||||
|
sourceCode/WD_watershed.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_LIBRARY(bagPositioning SHARED sourceCode/SG_bagPositioning.cpp)
|
||||||
|
|
||||||
|
ADD_LIBRARY(lapWeldDetection SHARED sourceCode/SX_lapWeldDetection.cpp)
|
||||||
|
|
||||||
|
ADD_LIBRARY(beltTearingDetection SHARED sourceCode/beltTearingDetection.cpp)
|
||||||
|
|
||||||
|
ADD_LIBRARY(workpieceCornerExtraction SHARED sourceCode/BQ_workpieceCornerExtraction.cpp)
|
||||||
|
|
||||||
|
ADD_LIBRARY(particleSizeMeasurement SHARED sourceCode/WD_particleSizeMeasure.cpp)
|
||||||
|
|
||||||
|
ADD_LIBRARY(binocularMarkCam SHARED sourceCode/binocularMarkCam.cpp
|
||||||
|
sourceCode/aruco/aruco.cpp
|
||||||
|
sourceCode/aruco/aruco_calib.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
#add executable file
|
||||||
|
# ADD_EXECUTABLE(bagPositioning_test bagPositioning_test/bagPositioning_test.cpp)
|
||||||
|
|
||||||
|
# TARGET_LINK_LIBRARIES(bagPositioning_test
|
||||||
|
# bagPositioning
|
||||||
|
# )
|
||||||
@ -124,12 +124,11 @@
|
|||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>SG_API_LIBRARY;_DEBUG;BAGPOSITIONING_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>SG_API_LIBRARY;_DEBUG;BAGPOSITIONING_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
<AdditionalIncludeDirectories>..\..\thirdParty\opencv320\build\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\thirdParty\OpenCV320\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<AdditionalOptions>/D_CRT_SECURE_NO_WARNINGS %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
@ -145,12 +144,11 @@
|
|||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<PreprocessorDefinitions>SG_API_LIBRARY;NDEBUG;BAGPOSITIONING_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>SG_API_LIBRARY;NDEBUG;BAGPOSITIONING_EXPORTS;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<ConformanceMode>true</ConformanceMode>
|
<ConformanceMode>true</ConformanceMode>
|
||||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
<AdditionalIncludeDirectories>..\..\thirdParty\opencv320\build\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>..\thirdParty\OpenCV320\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<AdditionalOptions>/D_CRT_SECURE_NO_WARNINGS %(AdditionalOptions)</AdditionalOptions>
|
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
@ -158,7 +156,7 @@
|
|||||||
<OptimizeReferences>true</OptimizeReferences>
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
<EnableUAC>false</EnableUAC>
|
<EnableUAC>false</EnableUAC>
|
||||||
<AdditionalLibraryDirectories>..\..\thirdParty\opencv320\build\x64\vc14\lib;..\build\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>..\..\thirdParty\opencv320\build\x64\vc14\lib;..\..\thirdParty\opencv\build\x64\vc16\lib;..\build\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>opencv_world320.lib;baseAlgorithm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>opencv_world320.lib;baseAlgorithm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
|
|||||||
@ -5,11 +5,14 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <VZNL_Types.h>
|
#include <VZNL_Types.h>
|
||||||
#include "direct.h"
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "SG_bagPositioning_Export.h"
|
#include "SG_bagPositioning_Export.h"
|
||||||
#include <opencv2/opencv.hpp>
|
#include <opencv2/opencv.hpp>
|
||||||
|
#ifdef _WIN32
|
||||||
#include <Windows.h>
|
#include <Windows.h>
|
||||||
|
#include "direct.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
|
|||||||
@ -163,6 +163,7 @@
|
|||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<ClInclude Include="..\sourceCode\SG_algo_Export.h" />
|
||||||
<ClInclude Include="..\sourceCode\SG_baseAlgo_Export.h" />
|
<ClInclude Include="..\sourceCode\SG_baseAlgo_Export.h" />
|
||||||
<ClInclude Include="..\sourceCode\SG_baseDataType.h" />
|
<ClInclude Include="..\sourceCode\SG_baseDataType.h" />
|
||||||
<ClInclude Include="..\sourceCode\SG_errCode.h" />
|
<ClInclude Include="..\sourceCode\SG_errCode.h" />
|
||||||
|
|||||||
@ -1,14 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if defined(SG_API_LIBRARY)
|
#include "SG_algo_Export.h"
|
||||||
# define SG_APISHARED_EXPORT __declspec(dllexport)
|
|
||||||
#else
|
|
||||||
# define SG_APISHARED_EXPORT __declspec(dllimport)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "SG_baseDataType.h"
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <opencv2/opencv.hpp>
|
|
||||||
|
|
||||||
#define _OUTPUT_DEBUG_DATA 1
|
#define _OUTPUT_DEBUG_DATA 1
|
||||||
|
|
||||||
@ -71,4 +64,4 @@ SG_APISHARED_EXPORT SSX_BQworkpieceResult sx_BQ_getWorkpieceCorners(
|
|||||||
#if _OUTPUT_DEBUG_DATA
|
#if _OUTPUT_DEBUG_DATA
|
||||||
SSX_debugInfo* debug_conturs,
|
SSX_debugInfo* debug_conturs,
|
||||||
#endif
|
#endif
|
||||||
int* errCode);
|
int* errCode);
|
||||||
|
|||||||
22
sourceCode/SG_algo_Export.h
Normal file
22
sourceCode/SG_algo_Export.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__) || defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
|
||||||
|
# define Q_DECL_EXPORT __declspec(dllexport)
|
||||||
|
# define Q_DECL_IMPORT __declspec(dllimport)
|
||||||
|
#else
|
||||||
|
# define Q_DECL_EXPORT __attribute__((visibility("default")))
|
||||||
|
# define Q_DECL_IMPORT __attribute__((visibility("default")))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(SG_API_LIBRARY)
|
||||||
|
# define SG_APISHARED_EXPORT Q_DECL_EXPORT
|
||||||
|
#else
|
||||||
|
# define SG_APISHARED_EXPORT Q_DECL_IMPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "SG_baseDataType.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef M_PI
|
||||||
|
#define M_PI 3.14159265358979323846 // pi
|
||||||
|
#endif // !M_PI
|
||||||
@ -1,16 +1,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if defined(SG_API_LIBRARY)
|
#define OUTPUT_DEBUG 0
|
||||||
# define SG_APISHARED_EXPORT __declspec(dllexport)
|
|
||||||
#else
|
|
||||||
# define SG_APISHARED_EXPORT __declspec(dllimport)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define OUTPUT_DEBUG 1
|
|
||||||
#define BAG_ALGO_USE_CORNER_FEATURE 1
|
#define BAG_ALGO_USE_CORNER_FEATURE 1
|
||||||
#define RGN_HIST_SIZE 16 //目标颜色统计的数目
|
#define RGN_HIST_SIZE 16 //目标颜色统计的数目
|
||||||
|
|
||||||
#include "SG_baseDataType.h"
|
#include "SG_algo_Export.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@ -55,6 +49,7 @@ SG_APISHARED_EXPORT void sg_lineDataR(
|
|||||||
SVzNL3DLaserLine* a_line,
|
SVzNL3DLaserLine* a_line,
|
||||||
const double* camPoseR,
|
const double* camPoseR,
|
||||||
double groundH);
|
double groundH);
|
||||||
|
|
||||||
SG_APISHARED_EXPORT void sg_lineDataR_RGBD(
|
SG_APISHARED_EXPORT void sg_lineDataR_RGBD(
|
||||||
SVzNLXYZRGBDLaserLine* a_line,
|
SVzNLXYZRGBDLaserLine* a_line,
|
||||||
const double* camPoseR,
|
const double* camPoseR,
|
||||||
|
|||||||
@ -1,12 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
#include "SG_algo_Export.h"
|
||||||
#if defined(SG_API_LIBRARY)
|
|
||||||
# define SG_APISHARED_EXPORT __declspec(dllexport)
|
|
||||||
#else
|
|
||||||
# define SG_APISHARED_EXPORT __declspec(dllimport)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "SG_baseDataType.h"
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <opencv2/opencv.hpp>
|
#include <opencv2/opencv.hpp>
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,15 @@
|
|||||||
#include "SG_baseDataType.h"
|
#include "SG_baseDataType.h"
|
||||||
#include "SG_baseAlgo_Export.h"
|
#include "SG_baseAlgo_Export.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#ifdef __WIN32
|
||||||
#include <corecrt_math_defines.h>
|
#include <corecrt_math_defines.h>
|
||||||
|
#endif // __WIN32
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
//¼ئثمة¨أèROI
|
|
||||||
SVzNL3DRangeD sg_getScanDataROI(
|
SVzNL3DRangeD sg_getScanDataROI(
|
||||||
|
//¼ÆËãɨÃèROI
|
||||||
SVzNL3DLaserLine* laser3DPoints,
|
SVzNL3DLaserLine* laser3DPoints,
|
||||||
int lineNum)
|
int lineNum)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
#include "SG_baseDataType.h"
|
#include "SG_baseDataType.h"
|
||||||
#include "SG_baseAlgo_Export.h"
|
#include "SG_baseAlgo_Export.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#ifdef _WIN32
|
||||||
#include <corecrt_math_defines.h>
|
#include <corecrt_math_defines.h>
|
||||||
|
#endif
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
void _seedClustering(
|
void _seedClustering(
|
||||||
|
|||||||
@ -1,14 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if defined(SG_API_LIBRARY)
|
#include "SG_algo_Export.h"
|
||||||
# define SG_APISHARED_EXPORT __declspec(dllexport)
|
|
||||||
#else
|
|
||||||
# define SG_APISHARED_EXPORT __declspec(dllimport)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "SG_baseDataType.h"
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <opencv2/opencv.hpp>
|
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,14 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if defined(SG_API_LIBRARY)
|
#include "SG_algo_Export.h"
|
||||||
# define SG_APISHARED_EXPORT __declspec(dllexport)
|
|
||||||
#else
|
|
||||||
# define SG_APISHARED_EXPORT __declspec(dllimport)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "SG_baseDataType.h"
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <opencv2/opencv.hpp>
|
|
||||||
|
|
||||||
#define OUTPUT_DEBUG 0
|
#define OUTPUT_DEBUG 0
|
||||||
|
|
||||||
|
|||||||
@ -1,12 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if defined(SG_API_LIBRARY)
|
#include "SG_algo_Export.h"
|
||||||
# define SG_APISHARED_EXPORT __declspec(dllexport)
|
|
||||||
#else
|
|
||||||
# define SG_APISHARED_EXPORT __declspec(dllimport)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "SG_baseDataType.h"
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#define ENABLE_CROSS_WISE_TEAR 0
|
#define ENABLE_CROSS_WISE_TEAR 0
|
||||||
|
|||||||
@ -1,16 +1,9 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#if defined(SG_API_LIBRARY)
|
#include "SG_algo_Export.h"
|
||||||
# define WD_APISHARED_EXPORT __declspec(dllexport)
|
|
||||||
#else
|
|
||||||
# define WD_APISHARED_EXPORT __declspec(dllimport)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "SG_baseDataType.h"
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <opencv2/opencv.hpp>
|
#include <opencv2/opencv.hpp>
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
cv::Size patternSize; //3x3 mark
|
cv::Size patternSize; //3x3 mark
|
||||||
@ -25,11 +18,12 @@ typedef struct
|
|||||||
int boardIdInterval; //每块Mark的charuco码的间隔。比如第一块从0开始,第二块从8开始,间隔为8
|
int boardIdInterval; //每块Mark的charuco码的间隔。比如第一块从0开始,第二块从8开始,间隔为8
|
||||||
int boardChaucoIDNum; //每块Mark的charuco码的数量。对于3x3的charuco, 二维码的个数为4
|
int boardChaucoIDNum; //每块Mark的charuco码的数量。对于3x3的charuco, 二维码的个数为4
|
||||||
}SWD_BQ_MarkBoardInfo;
|
}SWD_BQ_MarkBoardInfo;
|
||||||
|
|
||||||
//读版本号
|
//读版本号
|
||||||
WD_APISHARED_EXPORT const char* wd_charuco3DMarkVersion(void);
|
SG_APISHARED_EXPORT const char* wd_charuco3DMarkVersion(void);
|
||||||
|
|
||||||
//提取查科Mark3D信息
|
//提取查科Mark3D信息
|
||||||
WD_APISHARED_EXPORT void wd_BQ_getCharuco3DMark(
|
SG_APISHARED_EXPORT void wd_BQ_getCharuco3DMark(
|
||||||
cv::Mat& leftImage,
|
cv::Mat& leftImage,
|
||||||
cv::Mat& rightImage,
|
cv::Mat& rightImage,
|
||||||
cv::Mat& cameraMatrixL,
|
cv::Mat& cameraMatrixL,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user