BQ_assemblyPosition ver 1.0.0
基础版本预发布,用于应用集成。
This commit is contained in:
parent
8bf516d9b2
commit
0747a9ae2e
172
BQ_assemblyPosition/BQ_assemblyPosition.vcxproj
Normal file
172
BQ_assemblyPosition/BQ_assemblyPosition.vcxproj
Normal file
@ -0,0 +1,172 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\sourceCode\BQ_assemblyPosition.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\sourceCode\BQ_assemblyPosition_Export.h" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{0e62eee4-abb5-4364-a794-ccffe8815426}</ProjectGuid>
|
||||
<RootNamespace>BQassemblyPosition</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)build\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IncludePath>..\..\thirdParty\VzNLSDK\Inc;..\..\thirdParty\opencv320\build\include;..\sourceCode;..\sourceCode\inc;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)build\$(Platform)\$(Configuration)\</OutDir>
|
||||
<IncludePath>..\..\thirdParty\VzNLSDK\Inc;..\..\thirdParty\opencv320\build\include;..\sourceCode;..\sourceCode\inc;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;BQASSEMBLYPOSITION_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;BQASSEMBLYPOSITION_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;BQASSEMBLYPOSITION_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>..\..\thirdParty\opencv320\build\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<AdditionalLibraryDirectories>..\..\thirdParty\opencv320\build\x64\vc14\lib;..\build\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>opencv_world320d.lib;baseAlgorithm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;BQASSEMBLYPOSITION_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||
<AdditionalIncludeDirectories>..\..\thirdParty\opencv320\build\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<EnableUAC>false</EnableUAC>
|
||||
<AdditionalLibraryDirectories>..\..\thirdParty\opencv320\build\x64\vc14\lib;..\build\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>opencv_world320.lib;baseAlgorithm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
20
BQ_assemblyPosition_test/BQ_assemblyPosition_test.cpp
Normal file
20
BQ_assemblyPosition_test/BQ_assemblyPosition_test.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
// BQ_assemblyPosition_test.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "Hello World!\n";
|
||||
}
|
||||
|
||||
// 运行程序: Ctrl + F5 或调试 >“开始执行(不调试)”菜单
|
||||
// 调试程序: F5 或调试 >“开始调试”菜单
|
||||
|
||||
// 入门使用技巧:
|
||||
// 1. 使用解决方案资源管理器窗口添加/管理文件
|
||||
// 2. 使用团队资源管理器窗口连接到源代码管理
|
||||
// 3. 使用输出窗口查看生成输出和其他消息
|
||||
// 4. 使用错误列表窗口查看错误
|
||||
// 5. 转到“项目”>“添加新项”以创建新的代码文件,或转到“项目”>“添加现有项”以将现有代码文件添加到项目
|
||||
// 6. 将来,若要再次打开此项目,请转到“文件”>“打开”>“项目”并选择 .sln 文件
|
||||
147
BQ_assemblyPosition_test/BQ_assemblyPosition_test.vcxproj
Normal file
147
BQ_assemblyPosition_test/BQ_assemblyPosition_test.vcxproj
Normal file
@ -0,0 +1,147 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>16.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{bc38d1e5-10cb-438b-ac72-6012303ce139}</ProjectGuid>
|
||||
<RootNamespace>BQassemblyPositiontest</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="BQ_assemblyPosition_test.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@ -151,6 +151,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gasFillingPortPosition_test
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BQ_assemblyPosition", "BQ_assemblyPosition\BQ_assemblyPosition.vcxproj", "{0E62EEE4-ABB5-4364-A794-CCFFE8815426}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{95DC3F1A-902A-490E-BD3B-B10463CF0EBD} = {95DC3F1A-902A-490E-BD3B-B10463CF0EBD}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BQ_assemblyPosition_test", "BQ_assemblyPosition_test\BQ_assemblyPosition_test.vcxproj", "{BC38D1E5-10CB-438B-AC72-6012303CE139}"
|
||||
EndProject
|
||||
|
||||
@ -78,12 +78,12 @@
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<IncludePath>..\..\thirdParty\VzNLSDK\Inc;..\..\thirdParty\opencv320\build\include;..\sourceCode;..\sourceCode\inc;$(IncludePath)</IncludePath>
|
||||
<IncludePath>..\..\thirdParty\VzNLSDK\Inc;..\..\thirdParty\opencv320\build\include;..\sourceCode;..\sourceCode\inc;F:\ShangGu\ProductDev\AlgoDev\thirdParty\PCL 1.12.0\3rdParty\Eigen\eigen3;$(IncludePath)</IncludePath>
|
||||
<OutDir>$(SolutionDir)build\$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<IncludePath>..\..\thirdParty\VzNLSDK\Inc;..\..\thirdParty\opencv320\build\include;..\sourceCode;..\sourceCode\inc;$(IncludePath)</IncludePath>
|
||||
<IncludePath>..\..\thirdParty\VzNLSDK\Inc;..\..\thirdParty\opencv320\build\include;..\sourceCode;..\sourceCode\inc;F:\ShangGu\ProductDev\AlgoDev\thirdParty\PCL 1.12.0\3rdParty\Eigen\eigen3;$(IncludePath)</IncludePath>
|
||||
<OutDir>$(SolutionDir)build\$(Platform)\$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
|
||||
442
sourceCode/BQ_assemblyPosition.cpp
Normal file
442
sourceCode/BQ_assemblyPosition.cpp
Normal file
@ -0,0 +1,442 @@
|
||||
#include <vector>
|
||||
#include "SG_baseDataType.h"
|
||||
#include "SG_baseAlgo_Export.h"
|
||||
#include "BQ_assemblyPosition_Export.h"
|
||||
#include <opencv2/opencv.hpp>
|
||||
#include <limits>
|
||||
|
||||
//version 1.0.0 : base version release to customer
|
||||
std::string m_strVersion = "1.0.0";
|
||||
const char* wd_BQAssemblyPositionVersion(void)
|
||||
{
|
||||
return m_strVersion.c_str();
|
||||
}
|
||||
|
||||
//计算一个平面调平参数。
|
||||
//数据输入中可以有一个地平面和参考调平平面,以最高的平面进行调平
|
||||
//旋转矩阵为调平参数,即将平面法向调整为垂直向量的参数
|
||||
SSG_planeCalibPara sx_BQ_getBaseCalibPara(
|
||||
std::vector< std::vector<SVzNL3DPosition>>& scanLines)
|
||||
{
|
||||
return sg_getPlaneCalibPara2(scanLines);
|
||||
}
|
||||
|
||||
//相机姿态调平,并去除地面
|
||||
void sx_BQ_lineDataR(
|
||||
std::vector< SVzNL3DPosition>& a_line,
|
||||
const double* camPoseR,
|
||||
double groundH)
|
||||
{
|
||||
lineDataRT_vector(a_line, camPoseR, groundH);
|
||||
}
|
||||
|
||||
int _counterLinePtNum(std::vector<SVzNL3DPosition>& lineData)
|
||||
{
|
||||
int ptNum = 0;
|
||||
for (int i = 0, i_max = (int)lineData.size(); i < i_max; i++)
|
||||
{
|
||||
if ((abs(lineData[i].pt3D.z) > 1e-4) ||
|
||||
(abs(lineData[i].pt3D.x > 1e-4)) ||
|
||||
(abs(lineData[i].pt3D.y > 1e-4)))
|
||||
ptNum++;
|
||||
}
|
||||
return ptNum;
|
||||
}
|
||||
|
||||
bool compareByAngle(const SWD_polarPt& a, const SWD_polarPt& b) {
|
||||
return a.angle < b.angle;
|
||||
}
|
||||
|
||||
SSX_BQAssemblyInfo sx_BQ_computeAssemblyInfoFrom3D(
|
||||
std::vector< std::vector<SVzNL3DPosition>>& scanLines,
|
||||
const SSG_cornerParam cornerPara,
|
||||
const SSG_outlierFilterParam filterParam,
|
||||
SSG_treeGrowParam growParam,
|
||||
SSG_planeCalibPara groundCalibPara,
|
||||
SSX_BQAssemblyPara assemblyParam,
|
||||
int* errCode)
|
||||
{
|
||||
*errCode = 0;
|
||||
SSX_BQAssemblyInfo assemblyPose;
|
||||
memset(&assemblyPose, 0, sizeof(SSX_BQAssemblyInfo));
|
||||
int lineNum = (int)scanLines.size();
|
||||
if (lineNum == 0)
|
||||
{
|
||||
*errCode = SG_ERR_3D_DATA_NULL;
|
||||
return assemblyPose;
|
||||
}
|
||||
|
||||
//将开始和结束的空白扫描线去除,获得扫描边界
|
||||
int validStartLine = -1;
|
||||
for (int i = 0; i < lineNum; i++)
|
||||
{
|
||||
int linePtNum = _counterLinePtNum(scanLines[i]);
|
||||
if (linePtNum > 0)
|
||||
{
|
||||
validStartLine = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
int validEndLine = -1;
|
||||
for (int i = lineNum - 1; i >= 0; i--)
|
||||
{
|
||||
int linePtNum = _counterLinePtNum(scanLines[i]);
|
||||
if (linePtNum > 0)
|
||||
{
|
||||
validEndLine = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ((validStartLine < 0) || (validEndLine < 0))
|
||||
{
|
||||
*errCode = SG_ERR_3D_DATA_NULL;
|
||||
return assemblyPose;
|
||||
}
|
||||
|
||||
int linePtNum = (int)scanLines[0].size();
|
||||
bool isGridData = true;
|
||||
|
||||
//自适应各种旋转角度
|
||||
//垂直跳变特征提取
|
||||
std::vector<std::vector<SSG_basicFeature1D>> jumpFeatures_v_raw;
|
||||
for (int line = 0; line < lineNum; line++)
|
||||
{
|
||||
if (line == 250)
|
||||
int kkk = 1;
|
||||
|
||||
std::vector<SVzNL3DPosition>& lineData = scanLines[line];
|
||||
if (linePtNum != (int)lineData.size())
|
||||
isGridData = false;
|
||||
|
||||
//滤波,滤除异常点
|
||||
sg_lineDataRemoveOutlier_changeOriginData(&lineData[0], linePtNum, filterParam);
|
||||
|
||||
std::vector<SSG_basicFeature1D> line_features;
|
||||
int dataSize = (int)lineData.size();
|
||||
sg_getLineCornerFeature_BQ(
|
||||
&lineData[0],
|
||||
dataSize,
|
||||
line,
|
||||
groundCalibPara.planeHeight,
|
||||
cornerPara, //scale通常取bagH的1/4
|
||||
line_features);
|
||||
jumpFeatures_v_raw.push_back(line_features);
|
||||
}
|
||||
|
||||
if (false == isGridData)//数据不是网格格式
|
||||
{
|
||||
*errCode = SG_ERR_NOT_GRID_FORMAT;
|
||||
return assemblyPose;
|
||||
}
|
||||
|
||||
//生成水平扫描
|
||||
std::vector<std::vector<SVzNL3DPosition>> hLines_raw;
|
||||
hLines_raw.resize(linePtNum);
|
||||
for (int i = 0; i < linePtNum; i++)
|
||||
hLines_raw[i].resize(lineNum);
|
||||
for (int line = 0; line < lineNum; line++)
|
||||
{
|
||||
for (int j = 0; j < linePtNum; j++)
|
||||
{
|
||||
scanLines[line][j].nPointIdx = 0; //将原始数据的序列清0(会转义使用)
|
||||
hLines_raw[j][line] = scanLines[line][j];
|
||||
hLines_raw[j][line].pt3D.x = scanLines[line][j].pt3D.y;
|
||||
hLines_raw[j][line].pt3D.y = scanLines[line][j].pt3D.x;
|
||||
}
|
||||
}
|
||||
//水平arc特征提取
|
||||
std::vector<std::vector<SSG_basicFeature1D>> jumpFeatures_h_raw;
|
||||
int lineNum_h_raw = (int)hLines_raw.size();
|
||||
for (int line = 0; line < lineNum_h_raw; line++)
|
||||
{
|
||||
if (line == 416)
|
||||
int kkk = 1;
|
||||
std::vector<SVzNL3DPosition>& lineData = hLines_raw[line];
|
||||
//滤波,滤除异常点
|
||||
int ptNum = (int)lineData.size();
|
||||
sg_lineDataRemoveOutlier_changeOriginData(&lineData[0], ptNum, filterParam);
|
||||
|
||||
std::vector<SSG_basicFeature1D> line_features;
|
||||
int dataSize = (int)lineData.size();
|
||||
sg_getLineCornerFeature_BQ(
|
||||
&hLines_raw[line][0],
|
||||
dataSize,
|
||||
line,
|
||||
groundCalibPara.planeHeight,
|
||||
cornerPara, //scale通常取bagH的1/4
|
||||
line_features);
|
||||
jumpFeatures_h_raw.push_back(line_features);
|
||||
}
|
||||
|
||||
//特征生长,用于滤除噪点
|
||||
//垂直方向特征生长(激光线方向)
|
||||
std::vector<SSG_featureTree> v_trees;
|
||||
for (int line = 0; line < lineNum; line++)
|
||||
{
|
||||
bool isLastLine = false;
|
||||
if (line == lineNum - 1)
|
||||
isLastLine = true;
|
||||
std::vector<SSG_basicFeature1D>& a_lineJumpFeature = jumpFeatures_v_raw[line];
|
||||
if (a_lineJumpFeature.size() > 0)
|
||||
int kkk = 1;
|
||||
if (line == 202)
|
||||
int kkk = 1;
|
||||
sg_lineFeaturesGrowing(
|
||||
line,
|
||||
isLastLine,
|
||||
a_lineJumpFeature,
|
||||
v_trees,
|
||||
growParam);
|
||||
}
|
||||
|
||||
//水平方向特征生长(扫描运动方向)
|
||||
std::vector<SSG_featureTree> h_trees;
|
||||
for (int line = 0; line < lineNum_h_raw; line++)
|
||||
{
|
||||
if (line == 650)
|
||||
int kkk = 1;
|
||||
bool isLastLine = false;
|
||||
if (line == lineNum_h_raw - 1)
|
||||
isLastLine = true;
|
||||
std::vector<SSG_basicFeature1D>& a_lineJumpFeature = jumpFeatures_h_raw[line];
|
||||
sg_lineFeaturesGrowing(
|
||||
line,
|
||||
isLastLine,
|
||||
a_lineJumpFeature,
|
||||
h_trees,
|
||||
growParam);
|
||||
}
|
||||
|
||||
std::vector<SWD_polarPt> polarPoints;
|
||||
for (int i = 0, i_max = (int)v_trees.size(); i < i_max; i++)
|
||||
{
|
||||
SSG_featureTree* a_vTree = &v_trees[i];
|
||||
//在原始点云上标记,同时有Mask上标记
|
||||
for (int j = 0, j_max = (int)a_vTree->treeNodes.size(); j < j_max; j++)
|
||||
{
|
||||
int lineIdx = a_vTree->treeNodes[j].jumpPos2D.x;
|
||||
int ptIdx = a_vTree->treeNodes[j].jumpPos2D.y;
|
||||
if (scanLines[lineIdx][ptIdx].nPointIdx >= 0)
|
||||
{
|
||||
SWD_polarPt a_polarPt;
|
||||
a_polarPt.lineIdx = lineIdx;
|
||||
a_polarPt.ptIdx = ptIdx;
|
||||
a_polarPt.R = 0;
|
||||
a_polarPt.angle = 0;
|
||||
a_polarPt.x = scanLines[lineIdx][ptIdx].pt3D.x;
|
||||
a_polarPt.y = scanLines[lineIdx][ptIdx].pt3D.y;
|
||||
a_polarPt.z = scanLines[lineIdx][ptIdx].pt3D.z;
|
||||
polarPoints.push_back(a_polarPt);
|
||||
scanLines[lineIdx][ptIdx].nPointIdx = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0, i_max = (int)h_trees.size(); i < i_max; i++)
|
||||
{
|
||||
SSG_featureTree* a_hTree = &h_trees[i];
|
||||
//在原始点云上标记,同时有Mask上标记
|
||||
for (int j = 0, j_max = (int)a_hTree->treeNodes.size(); j < j_max; j++)
|
||||
{
|
||||
int lineIdx = a_hTree->treeNodes[j].jumpPos2D.y;
|
||||
int ptIdx = a_hTree->treeNodes[j].jumpPos2D.x;
|
||||
if (scanLines[lineIdx][ptIdx].nPointIdx >= 0)
|
||||
{
|
||||
SWD_polarPt a_polarPt;
|
||||
a_polarPt.lineIdx = lineIdx;
|
||||
a_polarPt.ptIdx = ptIdx;
|
||||
a_polarPt.cptIndex = -1;
|
||||
a_polarPt.R = 0;
|
||||
a_polarPt.angle = 0;
|
||||
a_polarPt.x = scanLines[lineIdx][ptIdx].pt3D.x;
|
||||
a_polarPt.y = scanLines[lineIdx][ptIdx].pt3D.y;
|
||||
a_polarPt.z = scanLines[lineIdx][ptIdx].pt3D.z;
|
||||
polarPoints.push_back(a_polarPt);
|
||||
scanLines[lineIdx][ptIdx].nPointIdx = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//计算几何中心
|
||||
int contourPtSize = (int)polarPoints.size();
|
||||
if (contourPtSize == 0)
|
||||
{
|
||||
*errCode = SX_ERR_ZERO_CONTOUR_PT;
|
||||
return assemblyPose;
|
||||
}
|
||||
double center_x = 0;
|
||||
double center_y = 0;
|
||||
for (int pi = 0; pi < contourPtSize; pi++)
|
||||
{
|
||||
center_x += polarPoints[pi].x;
|
||||
center_y += polarPoints[pi].y;
|
||||
}
|
||||
center_x = center_x / (double)contourPtSize;
|
||||
center_y = center_y / (double)contourPtSize;
|
||||
//计算极坐标的R和Theta
|
||||
for (int pi = 0; pi < contourPtSize; pi++)
|
||||
{
|
||||
double angle = atan2(polarPoints[pi].y - center_y, polarPoints[pi].x - center_x);
|
||||
angle = (angle / PI) * 180 + 180.0;
|
||||
double R = sqrt(pow(polarPoints[pi].y - center_y, 2) + pow(polarPoints[pi].x - center_x, 2));
|
||||
polarPoints[pi].R = R;
|
||||
polarPoints[pi].angle = angle;
|
||||
}
|
||||
//按角度大小排序
|
||||
std::sort(polarPoints.begin(), polarPoints.end(), compareByAngle);
|
||||
for (int pi = 0; pi < contourPtSize; pi++)
|
||||
polarPoints[pi].cptIndex = pi; // index
|
||||
|
||||
//提取R极值点
|
||||
double minR = -1, maxR = -1; //计算最小和最大的R,用以区分有没有分支。minR和maxR相差小时,为圆形或8角形,没有分支
|
||||
int minRPos = -1;
|
||||
std::vector<SWD_polarPt> polarRPeakPts;
|
||||
int winSize = contourPtSize / 36; //+-10度范围
|
||||
if (winSize < 5)
|
||||
winSize = 5;
|
||||
for (int pi = 0; pi < contourPtSize; pi++)
|
||||
{
|
||||
double currR = polarPoints[pi].R;
|
||||
if (minR < 0)
|
||||
{
|
||||
minR = currR;
|
||||
maxR = currR;
|
||||
minRPos = pi;
|
||||
}
|
||||
else
|
||||
{
|
||||
minRPos = minR > currR ? pi : minRPos;
|
||||
minR = minR > currR ? currR : minR;
|
||||
maxR = maxR < currR ? currR : maxR;
|
||||
}
|
||||
bool isPeak = true;
|
||||
for (int k = -winSize; k <= winSize; k++)
|
||||
{
|
||||
int idx = (pi + k + contourPtSize) % contourPtSize; //筒形结构
|
||||
if (polarPoints[idx].R > currR)
|
||||
{
|
||||
isPeak = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (true == isPeak)
|
||||
polarRPeakPts.push_back(polarPoints[pi]);
|
||||
}
|
||||
|
||||
double ratio_MaxMin = maxR / minR;
|
||||
bool hasBranch = ratio_MaxMin < 1.25 ? false : true;
|
||||
|
||||
std::vector<SWD_polarPt> validPolarRPeakPts;
|
||||
std::vector<SWD_polarPeakInfo> polarPeakInfo;
|
||||
int pkId = 0;
|
||||
//过滤圆弧段的极值:由于重心偏移,圆弧段也会形成极值。根据极值两边L=直线段长度构成的张角判断
|
||||
double arcAngleChkLen = 100; //检测圆弧张角的尺度
|
||||
for (int i = 0, i_max = (int)polarRPeakPts.size(); i < i_max; i++)
|
||||
{
|
||||
int ptidx = polarRPeakPts[i].cptIndex;
|
||||
double px, py, pz;
|
||||
px = polarRPeakPts[i].x;
|
||||
py = polarRPeakPts[i].y;
|
||||
|
||||
int LL1 = -1;
|
||||
int halfLL1 = -1;
|
||||
for (int j = ptidx - 1; j > -contourPtSize; j--)
|
||||
{
|
||||
int idx = (j + contourPtSize) % contourPtSize; //筒形结构
|
||||
double cx = polarPoints[idx].x;
|
||||
double cy = polarPoints[idx].y;
|
||||
double len = sqrt(pow(px - cx, 2) + pow(py - cy, 2));
|
||||
if (len < arcAngleChkLen)
|
||||
halfLL1 = idx;
|
||||
if (len > (assemblyParam.lineLen))
|
||||
{
|
||||
LL1 = idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int LL2 = -1;
|
||||
int halfLL2 = -1;
|
||||
for (int j = ptidx + 1; j < contourPtSize * 2; j++)
|
||||
{
|
||||
int idx = j % contourPtSize; //筒形结构
|
||||
double cx = polarPoints[idx].x;
|
||||
double cy = polarPoints[idx].y;
|
||||
double len = sqrt(pow(px - cx, 2) + pow(py - cy, 2));
|
||||
if (len < arcAngleChkLen)
|
||||
halfLL2 = idx;
|
||||
if (len > (assemblyParam.lineLen))
|
||||
{
|
||||
LL2 = idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ((LL1 >= 0) && (LL2 >= 0))
|
||||
{
|
||||
double len1 = sqrt(pow(px - polarPoints[halfLL1].x, 2) + pow(py - polarPoints[halfLL1].y, 2));
|
||||
double len2 = sqrt(pow(px - polarPoints[halfLL2].x, 2) + pow(py - polarPoints[halfLL2].y, 2));
|
||||
double len3 = sqrt(pow(polarPoints[halfLL1].x - polarPoints[halfLL2].x, 2) +
|
||||
pow(polarPoints[halfLL1].y - polarPoints[halfLL2].y, 2));
|
||||
double cosTheta = (len1 * len1 + len2 * len2 - len3 * len3) / (2 * len1 * len2);
|
||||
double theta = acos(cosTheta) * 180.0 / PI;
|
||||
if (theta < 150)
|
||||
{
|
||||
SWD_polarPeakInfo a_pkInfo;
|
||||
a_pkInfo.cptIndex = ptidx;
|
||||
a_pkInfo.L1_ptIndex = LL1;
|
||||
a_pkInfo.L2_ptIndex = LL2;
|
||||
a_pkInfo.cornerAngle = theta;
|
||||
a_pkInfo.cornerDir = 0;
|
||||
polarRPeakPts[i].cptIndex = ptidx;
|
||||
polarRPeakPts[i].pkId = pkId;
|
||||
pkId++;
|
||||
validPolarRPeakPts.push_back(polarRPeakPts[i]);
|
||||
polarPeakInfo.push_back(a_pkInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
//处理矩形工件
|
||||
if (validPolarRPeakPts.size() != 4)
|
||||
{
|
||||
*errCode = SX_ERR_INVLID_RPEAK_NUM;
|
||||
return assemblyPose;
|
||||
}
|
||||
|
||||
//取长边作X轴,短边作Y轴,法向为Z轴,中心点为O点
|
||||
std::vector<SVzNL3DPoint> sidePts_1;
|
||||
std::vector<SVzNL3DPoint> sidePts_2;
|
||||
std::vector<SVzNL3DPoint> sidePts_3;
|
||||
std::vector<SVzNL3DPoint> sidePts_4;
|
||||
return assemblyPose;
|
||||
}
|
||||
|
||||
//根据Mark计算工件位置和姿态
|
||||
SSX_BQAssemblyInfo sx_BQ_computeAssemblyInfoFromMark(
|
||||
SSX_BQAssemblyInfo originPos,
|
||||
std::vector<cv::Point3d> originMarkPos,
|
||||
std::vector<cv::Point3d> currMarkPos,
|
||||
int* errCode)
|
||||
{
|
||||
*errCode = 0;
|
||||
SSX_BQAssemblyInfo resultPos;
|
||||
memset(&resultPos, 0, sizeof(SSX_BQAssemblyInfo));
|
||||
if ((originMarkPos.size() < 3) || (currMarkPos.size() < 3))
|
||||
{
|
||||
*errCode = SX_ERR_INVLID_MARK_NUM;
|
||||
return resultPos;
|
||||
}
|
||||
|
||||
cv::Mat R, T; //旋转平移
|
||||
cv::Point3d C_origin, C_curr; //质心
|
||||
caculateRT(originMarkPos, currMarkPos, R, T, C_origin, C_curr);
|
||||
|
||||
// 5. 推算Pn的坐标
|
||||
pointRT(R, T, C_origin, C_curr, originPos.O, resultPos.O);
|
||||
pointRT(R, T, C_origin, C_curr, originPos.X, resultPos.X);
|
||||
pointRT(R, T, C_origin, C_curr, originPos.Y, resultPos.Y);
|
||||
pointRT(R, T, C_origin, C_curr, originPos.Z, resultPos.Z);
|
||||
return resultPos;
|
||||
}
|
||||
|
||||
|
||||
|
||||
49
sourceCode/BQ_assemblyPosition_Export.h
Normal file
49
sourceCode/BQ_assemblyPosition_Export.h
Normal file
@ -0,0 +1,49 @@
|
||||
#pragma once
|
||||
|
||||
#include "SG_algo_Export.h"
|
||||
#include <vector>
|
||||
|
||||
#define _OUTPUT_DEBUG_DATA 1
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int type; //组件种类
|
||||
double lineLen; //直线段长度
|
||||
}SSX_BQAssemblyPara;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int type; //组件种类
|
||||
cv::Point3d O; //工件中心点
|
||||
cv::Point3d X; //工件坐标系OX轴向量。
|
||||
cv::Point3d Y; //工件坐标系OY轴向量。
|
||||
cv::Point3d Z; //工件坐标系OZ轴向量。
|
||||
}SSX_BQAssemblyInfo;
|
||||
|
||||
//读版本号
|
||||
SG_APISHARED_EXPORT const char* wd_BQAssemblyPositionVersion(void);
|
||||
|
||||
//计算一个平面调平参数。
|
||||
//数据输入中可以有一个地平面和参考调平平面,以最高的平面进行调平
|
||||
//旋转矩阵为调平参数,即将平面法向调整为垂直向量的参数
|
||||
SG_APISHARED_EXPORT SSG_planeCalibPara sx_BQ_getBaseCalibPara(
|
||||
std::vector< std::vector<SVzNL3DPosition>>& scanLines);
|
||||
|
||||
//相机姿态调平,并去除地面
|
||||
SG_APISHARED_EXPORT void sx_BQ_lineDataR(
|
||||
std::vector< SVzNL3DPosition>& a_line,
|
||||
const double* camPoseR,
|
||||
double groundH);
|
||||
|
||||
//提取工件角点及定位长度信息
|
||||
SG_APISHARED_EXPORT SSX_BQAssemblyInfo sx_BQ_getAssemblyInfo(
|
||||
std::vector< std::vector<SVzNL3DPosition>>& scanLines,
|
||||
const SSG_cornerParam cornerPara,
|
||||
const SSG_outlierFilterParam filterParam,
|
||||
SSG_treeGrowParam growParam,
|
||||
SSG_planeCalibPara groundCalibPara,
|
||||
SSX_BQAssemblyPara assemblyParam,
|
||||
int* errCode);
|
||||
|
||||
|
||||
|
||||
@ -163,29 +163,6 @@ typedef struct
|
||||
SVzNL3DPoint edge_link2_ends[2];
|
||||
}SSX_featureContour;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int pkId;
|
||||
int lineIdx;
|
||||
int ptIdx;
|
||||
int cptIndex; //圆周扫描上的点序
|
||||
//double cornerAngle; //以点为中心的两侧弦的夹角
|
||||
double R;
|
||||
double angle;
|
||||
double x;
|
||||
double y;
|
||||
double z;
|
||||
}SWD_polarPt;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int cptIndex;
|
||||
int L1_ptIndex;
|
||||
int L2_ptIndex;
|
||||
double cornerAngle;
|
||||
int cornerDir;
|
||||
}SWD_polarPeakInfo;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
double angle;
|
||||
|
||||
@ -538,4 +538,17 @@ SG_APISHARED_EXPORT void wd_seedWatershed(
|
||||
SG_APISHARED_EXPORT void wd_noiseFilter(
|
||||
std::vector< std::vector<SVzNL3DPosition>>& scanLines,
|
||||
const SSG_outlierFilterParam filterParam,
|
||||
int* errCode);
|
||||
int* errCode);
|
||||
|
||||
// Eigen库实现:计算从pts1向pts2的旋转平移矩阵
|
||||
//需要
|
||||
SG_APISHARED_EXPORT void caculateRT(
|
||||
const std::vector<cv::Point3d>& pts1,
|
||||
const std::vector<cv::Point3d>& pts2,
|
||||
cv::Mat& R, cv::Mat& T,
|
||||
cv::Point3d& C1, cv::Point3d& C2);
|
||||
|
||||
//计算点旋转平移后的位置
|
||||
SG_APISHARED_EXPORT void pointRT(const cv::Mat& R, const cv::Mat& T,
|
||||
const cv::Point3d& originPt, const cv::Point3d& rtOriginPT, //RT(旋转平移)前后的质心
|
||||
const cv::Point3d& pt, cv::Point3d& rtPt); //RT前后的点
|
||||
|
||||
@ -501,4 +501,27 @@ typedef struct
|
||||
{
|
||||
SVzNL3DPoint pt1;
|
||||
SVzNL3DPoint pt2;
|
||||
}SWD_3DPointPair;
|
||||
}SWD_3DPointPair;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int pkId;
|
||||
int lineIdx;
|
||||
int ptIdx;
|
||||
int cptIndex; //圆周扫描上的点序
|
||||
//double cornerAngle; //以点为中心的两侧弦的夹角
|
||||
double R;
|
||||
double angle;
|
||||
double x;
|
||||
double y;
|
||||
double z;
|
||||
}SWD_polarPt;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int cptIndex;
|
||||
int L1_ptIndex;
|
||||
int L2_ptIndex;
|
||||
double cornerAngle;
|
||||
int cornerDir;
|
||||
}SWD_polarPeakInfo;
|
||||
|
||||
@ -7,6 +7,7 @@
|
||||
|
||||
#include <cmath>
|
||||
#include <unordered_map>
|
||||
#include <Eigen/dense>
|
||||
|
||||
SVzNL3DRangeD sg_getScanDataROI(
|
||||
//¼ÆËãɨÃèROI
|
||||
@ -2426,3 +2427,86 @@ void pointClout2DProjection(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//对空间两组对应点计算旋转平移矩阵
|
||||
// Eigen库实现
|
||||
void caculateRT(
|
||||
const std::vector<cv::Point3d>& pts1,
|
||||
const std::vector<cv::Point3d>& pts2,
|
||||
cv::Mat& R, cv::Mat& T,
|
||||
cv::Point3d& C1, cv::Point3d& C2)
|
||||
{
|
||||
//【1】 求中心点
|
||||
cv::Point3d p1, p2;
|
||||
int N = pts1.size();
|
||||
for (int i = 0; i < N; i++)
|
||||
{
|
||||
p1 += pts1[i];
|
||||
p2 += pts2[i];
|
||||
}
|
||||
p1 = cv::Point3d(cv::Vec3d(p1) / N);
|
||||
p2 = cv::Point3d(cv::Vec3d(p2) / N);
|
||||
C1 = p1;
|
||||
C2 = p2;
|
||||
// 【2】得到去中心坐标
|
||||
std::vector<cv::Point3d> q1(N), q2(N);
|
||||
for (int i = 0; i < N; i++)
|
||||
{
|
||||
q1[i] = pts1[i] - p1;
|
||||
q2[i] = pts2[i] - p2;
|
||||
}
|
||||
|
||||
//【3】计算需要进行奇异值分解的 W = sum(qi * qi’转置) compute q1*q2^T
|
||||
Eigen::Matrix3d W = Eigen::Matrix3d::Zero();
|
||||
for (int i = 0; i < N; i++)
|
||||
W += Eigen::Vector3d(q1[i].x, q1[i].y, q1[i].z) * Eigen::Vector3d(q2[i].x, q2[i].y, q2[i].z).transpose();
|
||||
|
||||
// 【4】对 W 进行SVD 奇异值分解
|
||||
Eigen::JacobiSVD<Eigen::Matrix3d> svd(W, Eigen::ComputeFullU | Eigen::ComputeFullV);
|
||||
Eigen::Matrix3d U = svd.matrixU();
|
||||
Eigen::Matrix3d V = svd.matrixV();
|
||||
|
||||
// 【5】计算旋转 和平移矩阵 R 和 t, R= V *M* UT
|
||||
double det = (U * V.transpose()).determinant();
|
||||
Eigen::Matrix3d M;
|
||||
M << 1, 0, 0, 0, 1, 0, 0, 0, det;
|
||||
|
||||
Eigen::Matrix3d R_ = V * M * (U.transpose());
|
||||
|
||||
// t = p' - R * p
|
||||
Eigen::Vector3d t_ = Eigen::Vector3d(p2.x, p2.y, p2.z) - R_ * Eigen::Vector3d(p1.x, p1.y, p1.z);
|
||||
|
||||
// 【6】格式转换 convert to cv::Mat
|
||||
R = (cv::Mat_<double>(3, 3) <<
|
||||
R_(0, 0), R_(0, 1), R_(0, 2),
|
||||
R_(1, 0), R_(1, 1), R_(1, 2),
|
||||
R_(2, 0), R_(2, 1), R_(2, 2)
|
||||
);
|
||||
|
||||
T = (cv::Mat_<double>(3, 1) << t_(0, 0), t_(1, 0), t_(2, 0));
|
||||
return;
|
||||
}
|
||||
|
||||
//计算点旋转平移后的位置
|
||||
void pointRT(const cv::Mat& R, const cv::Mat& T,
|
||||
const cv::Point3d& originPt, const cv::Point3d& rtOriginPT, //RT(旋转平移)前后的质心
|
||||
const cv::Point3d& pt, cv::Point3d& rtPt) //RT前后的点
|
||||
{
|
||||
Eigen::Matrix3d _R;
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 3; ++j) {
|
||||
_R(i, j) = R.at<double>(i, j);
|
||||
}
|
||||
}
|
||||
Eigen::Vector3d _T = Eigen::Vector3d(T.at<double>(0, 0), T.at<double>(1, 0), T.at<double>(2, 0));
|
||||
|
||||
Eigen::Vector3d vec_origin = Eigen::Vector3d(originPt.x, originPt.y, originPt.z);
|
||||
Eigen::Vector3d vec_rtOrigin = Eigen::Vector3d(rtOriginPT.x, rtOriginPT.y, rtOriginPT.z);
|
||||
Eigen::Vector3d vec_pt = Eigen::Vector3d(pt.x, pt.y, pt.z);
|
||||
Eigen::Vector3d result = _R * (vec_pt - vec_origin) + vec_rtOrigin;
|
||||
|
||||
rtPt.x = result(0);
|
||||
rtPt.x = result(1);
|
||||
rtPt.x = result(2);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@
|
||||
#define SX_ERR_ZERO_CONTOUR_PT -2005
|
||||
#define SX_ERR_INVLID_RPEAK_NUM -2006
|
||||
#define SX_ERR_INVLID_RPEAK_PAIR -2007
|
||||
#define SX_ERR_INVLID_MARK_NUM -2008
|
||||
|
||||
//땍綾婁혤
|
||||
#define SX_ERR_INVLID_CUTTING_Z -2101
|
||||
@ -23,3 +24,4 @@
|
||||
|
||||
//뀔관
|
||||
#define SX_BAG_TRAY_EMPTY -2201
|
||||
|
||||
|
||||
12
sourceCode/WD_bottleCapQualityCheck.cpp
Normal file
12
sourceCode/WD_bottleCapQualityCheck.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
#include <vector>
|
||||
#include "SG_baseDataType.h"
|
||||
#include "SG_baseAlgo_Export.h"
|
||||
#include "WD_bottleCapQualityCheck_Export.h"
|
||||
#include <opencv2/opencv.hpp>
|
||||
#include <limits>
|
||||
|
||||
void wd_getBottleCapQualtiy(
|
||||
std::vector< std::vector<SVzNL3DPosition>>& scanLines)
|
||||
{
|
||||
return;
|
||||
}
|
||||
14
sourceCode/WD_bottleCapQualityCheck_Export.h
Normal file
14
sourceCode/WD_bottleCapQualityCheck_Export.h
Normal file
@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#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 <opencv2/opencv.hpp>
|
||||
|
||||
SG_APISHARED_EXPORT void wd_getBottleCapQualtiy(
|
||||
std::vector< std::vector<SVzNL3DPosition>>& scanLines);
|
||||
Loading…
x
Reference in New Issue
Block a user