YouJiang_sheetPositioning v1.0.0

初始版本
This commit is contained in:
jerryzeng 2026-03-01 21:16:05 +08:00
parent 3ef8cfd43c
commit 73cee324c7
13 changed files with 2177 additions and 220 deletions

View File

@ -216,6 +216,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "workpieceHolePositioning",
{95DC3F1A-902A-490E-BD3B-B10463CF0EBD} = {95DC3F1A-902A-490E-BD3B-B10463CF0EBD}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "YouJiang_sheetPositioning", "YouJiang_sheetPositioning\YouJiang_sheetPositioning.vcxproj", "{BDE8197F-8FD3-4DEF-B1EA-F6A2C7C5DA9B}"
ProjectSection(ProjectDependencies) = postProject
{95DC3F1A-902A-490E-BD3B-B10463CF0EBD} = {95DC3F1A-902A-490E-BD3B-B10463CF0EBD}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "YouJiang_sheetPositioning_test", "YouJiang_sheetPositioning_test\YouJiang_sheetPositioning_test.vcxproj", "{80CBF888-79F3-424F-A094-17EDFD452E1E}"
ProjectSection(ProjectDependencies) = postProject
{95DC3F1A-902A-490E-BD3B-B10463CF0EBD} = {95DC3F1A-902A-490E-BD3B-B10463CF0EBD}
{BDE8197F-8FD3-4DEF-B1EA-F6A2C7C5DA9B} = {BDE8197F-8FD3-4DEF-B1EA-F6A2C7C5DA9B}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@ -552,6 +563,22 @@ Global
{C65F7F4B-B77A-4D65-9490-5304B760B607}.Release|x64.Build.0 = Release|x64
{C65F7F4B-B77A-4D65-9490-5304B760B607}.Release|x86.ActiveCfg = Release|Win32
{C65F7F4B-B77A-4D65-9490-5304B760B607}.Release|x86.Build.0 = Release|Win32
{BDE8197F-8FD3-4DEF-B1EA-F6A2C7C5DA9B}.Debug|x64.ActiveCfg = Debug|x64
{BDE8197F-8FD3-4DEF-B1EA-F6A2C7C5DA9B}.Debug|x64.Build.0 = Debug|x64
{BDE8197F-8FD3-4DEF-B1EA-F6A2C7C5DA9B}.Debug|x86.ActiveCfg = Debug|Win32
{BDE8197F-8FD3-4DEF-B1EA-F6A2C7C5DA9B}.Debug|x86.Build.0 = Debug|Win32
{BDE8197F-8FD3-4DEF-B1EA-F6A2C7C5DA9B}.Release|x64.ActiveCfg = Release|x64
{BDE8197F-8FD3-4DEF-B1EA-F6A2C7C5DA9B}.Release|x64.Build.0 = Release|x64
{BDE8197F-8FD3-4DEF-B1EA-F6A2C7C5DA9B}.Release|x86.ActiveCfg = Release|Win32
{BDE8197F-8FD3-4DEF-B1EA-F6A2C7C5DA9B}.Release|x86.Build.0 = Release|Win32
{80CBF888-79F3-424F-A094-17EDFD452E1E}.Debug|x64.ActiveCfg = Debug|x64
{80CBF888-79F3-424F-A094-17EDFD452E1E}.Debug|x64.Build.0 = Debug|x64
{80CBF888-79F3-424F-A094-17EDFD452E1E}.Debug|x86.ActiveCfg = Debug|Win32
{80CBF888-79F3-424F-A094-17EDFD452E1E}.Debug|x86.Build.0 = Debug|Win32
{80CBF888-79F3-424F-A094-17EDFD452E1E}.Release|x64.ActiveCfg = Release|x64
{80CBF888-79F3-424F-A094-17EDFD452E1E}.Release|x64.Build.0 = Release|x64
{80CBF888-79F3-424F-A094-17EDFD452E1E}.Release|x86.ActiveCfg = Release|Win32
{80CBF888-79F3-424F-A094-17EDFD452E1E}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View 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>
<ClInclude Include="..\sourceCode\YouJiang_sheetPositioning_Export.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\sourceCode\YouJiang_sheetPositioning.cpp" />
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{bde8197f-8fd3-4def-b1ea-f6a2c7c5da9b}</ProjectGuid>
<RootNamespace>YouJiangsheetPositioning</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;..\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;..\sourceCode;..\sourceCode\inc;$(IncludePath)</IncludePath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;YOUJIANGSHEETPOSITIONING_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;YOUJIANGSHEETPOSITIONING_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>_DEBUG;YOUJIANGSHEETPOSITIONING_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalIncludeDirectories>..\..\thirdParty\opencv\build\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalLibraryDirectories>..\..\thirdParty\opencv\build\x64\vc16\lib;..\build\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>opencv_world480d.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>NDEBUG;YOUJIANGSHEETPOSITIONING_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<AdditionalIncludeDirectories>..\..\thirdParty\opencv\build\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalLibraryDirectories>..\..\thirdParty\opencv\build\x64\vc16\lib;..\build\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>opencv_world480.lib;baseAlgorithm.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,157 @@
<?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>{80cbf888-79f3-424f-a094-17edfd452e1e}</ProjectGuid>
<RootNamespace>YouJiangsheetPositioningtest</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>
<OutDir>$(SolutionDir)build\$(Platform)\$(Configuration)\</OutDir>
<IncludePath>..\..\thirdParty\VzNLSDK\Inc;..\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;..\sourceCode;..\sourceCode\inc;$(IncludePath)</IncludePath>
</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>
<AdditionalIncludeDirectories>..\..\thirdParty\opencv\build\include;</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\thirdParty\opencv\build\x64\vc16\lib;..\build\x64\Debug;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>opencv_world480d.lib; YouJiang_sheetPositioning.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.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>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>..\..\thirdParty\opencv\build\include;</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>..\..\thirdParty\opencv\build\x64\vc16\lib;..\build\x64\Release;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>opencv_world480.lib; YouJiang_sheetPositioning.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="YouJiang_sheetPositioning_test.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -2530,7 +2530,7 @@ void _outputScanDataFile_removeZeros(char* fileName, SVzNL3DLaserLine* scanData,
#define TEST_COMPUTE_GRASP_POINT 1
#define TEST_COMPUTE_CALIB_PARA 0
#define TEST_GROUP 29
#define TEST_GROUP 30
#define TEST_TOP_VIEW_GROUP (TEST_GROUP - 8)
#define TEST_TOP_ORIEN_GROUP (TEST_GROUP - 6)
int main()
@ -2619,7 +2619,7 @@ int main()
#if TEST_COMPUTE_CALIB_PARA
char _calib_datafile[256];
sprintf_s(_calib_datafile, "F:\\ShangGu\\编织袋数据\\山东现场\\调平数据.txt");
sprintf_s(_calib_datafile, "F:/ShangGu/编织袋数据/理想拆包数据2/12_LazerData_Je08A052.txt");
int lineNum = 0;
float lineV = 0.0f;
int dataCalib = 0;
@ -2642,10 +2642,10 @@ int main()
}
//
char calibFile[250];
sprintf_s(calibFile, "F:\\ShangGu\\编织袋数据\\山东现场\\ground_calib_para.txt");
sprintf_s(calibFile, "F:/ShangGu/编织袋数据/理想拆包数据2/ground_calib_para.txt");
_outputCalibPara(calibFile, calibPara);
char _out_file[256];
sprintf_s(_out_file, "F:\\ShangGu\\编织袋数据\\山东现场\\ground_grid_calib.txt");
sprintf_s(_out_file, "F:/ShangGu/编织袋数据/理想拆包数据2/ground_grid_calib.txt");
_outputScanDataFile_self(_out_file, laser3DPoints, lineNum,
lineV, maxTimeStamp, clockPerSecond);
printf("%s: calib done!\n", _calib_datafile);
@ -2676,15 +2676,16 @@ int main()
"F:\\ShangGu\\纸箱拆垛数据\\480×580mm纸箱rgb点云及2d图像\\", //18
"F:\\ShangGu\\编织袋数据\\科一现场\\", //19
"F:/ShangGu/编织袋数据/理想拆包数据/", //20
"F:/ShangGu/编织袋数据/理想拆包数据2/", //21
"F:\\ShangGu\\编织袋数据\\编织袋RGBD识别方向\\", //21
"F:\\ShangGu\\编织袋数据\\编织袋RGBD识别方向_2\\", //22
"F:\\ShangGu\\编织袋数据\\侧抓数据\\", //23
"F:\\ShangGu\\编织袋数据\\侧抓数据_现场\\20250419\\", //24
"F:\\ShangGu\\编织袋数据\\侧抓数据_现场\\20250420-1\\", //25
"F:\\ShangGu\\编织袋数据\\侧抓数据_现场\\20250420-2\\", //26
"F:\\ShangGu\\编织袋数据\\侧抓数据_现场\\20250420-3\\", //27
"F:\\ShangGu\\编织袋数据\\侧抓数据_现场\\20250420-4\\", //28
"F:\\ShangGu\\编织袋数据\\编织袋RGBD识别方向\\", //22
"F:\\ShangGu\\编织袋数据\\编织袋RGBD识别方向_2\\", //23
"F:\\ShangGu\\编织袋数据\\侧抓数据\\", //24
"F:\\ShangGu\\编织袋数据\\侧抓数据_现场\\20250419\\", //25
"F:\\ShangGu\\编织袋数据\\侧抓数据_现场\\20250420-1\\", //26
"F:\\ShangGu\\编织袋数据\\侧抓数据_现场\\20250420-2\\", //27
"F:\\ShangGu\\编织袋数据\\侧抓数据_现场\\20250420-3\\", //28
"F:\\ShangGu\\编织袋数据\\侧抓数据_现场\\20250420-4\\", //29
};
SVzNLRange fileIdx[TEST_GROUP] = {
@ -2692,7 +2693,7 @@ int main()
{1,29},{108,135},{0,200}, {1,200}, {1,12},
{2,4}, {1,5}, {1,1}, {1,3}, {1,11},
{5,22},{1, 15},{1,15}, {1, 15},{1,7},
{1,16},
{1,16}, {10,12},
{1,21},{1,28},
{3,3}, {1,51}, {4,83}, {1,74}, {1,61}, {1,84}
@ -2721,7 +2722,7 @@ int main()
SG_bagPositionParam algoParam;
algoParam.outputMode = 0; //0-按序输出左上1-按大小输出(最大)
int endGroup = TEST_GROUP - 1;
for (int grp = 20; grp <= 20; grp++)
for (int grp = 21; grp <= 21; grp++)
{
if (grp < 10)
{
@ -2897,7 +2898,7 @@ int main()
else if (grp == 20)
{
char calibFile[250];
sprintf_s(calibFile, "F:\\ShangGu\\编织袋数据\\理想拆包数据\\ground_calib_para.txt");
sprintf_s(calibFile, "%sground_calib_para.txt", dataPath[grp]);
poseCalibPara = _readCalibPara(calibFile);
algoParam.bagParam.bagL = 650;
@ -2918,7 +2919,31 @@ int main()
algoParam.cornerParam.jumpCornerTh_1 = 60;
algoParam.cornerParam.jumpCornerTh_2 = 15;
}
else if ( (grp >= 21) && (grp <= 22))
else if (grp == 21)
{
char calibFile[250];
sprintf_s(calibFile, "%sground_calib_para.txt", dataPath[grp]);
poseCalibPara = _readCalibPara(calibFile);
algoParam.bagParam.bagL = 650; // 480;
algoParam.bagParam.bagW = 420; // 320; //袋子宽40cm
algoParam.bagParam.bagH = 160; //袋子高16cm
algoParam.growParam.maxLineSkipNum = 5;
algoParam.growParam.yDeviation_max = 20.0;
algoParam.growParam.maxSkipDistance = 20.0;
algoParam.growParam.zDeviation_max = 80;// algoParam.bagParam.bagH / 2; //袋子高度1/2
algoParam.growParam.minLTypeTreeLen = 50.0; //mm
algoParam.growParam.minVTypeTreeLen = 50.0; //mm
algoParam.cornerParam.cornerTh = 45; //45度角
algoParam.cornerParam.scale = 50; // algoParam.bagParam.bagH / 8; // 15; // algoParam.bagParam.bagH / 8;
algoParam.cornerParam.minEndingGap = 20;// algoParam.bagParam.bagW / 4;
algoParam.cornerParam.minEndingGap_z = 40;
algoParam.cornerParam.jumpCornerTh_1 = 60;
algoParam.cornerParam.jumpCornerTh_2 = 15;
}
else if ( (grp >= 22) && (grp <= 23))
{
algoParam.bagParam.bagL = 750; //袋子长65cm
algoParam.bagParam.bagW = 450; //袋子宽40cm
@ -3053,13 +3078,13 @@ int main()
algoParam.cornerParam.jumpCornerTh_1 = 60;
algoParam.cornerParam.jumpCornerTh_2 = 15;
}
else if ( grp == 21)
else if ( grp == 22)
{
char calibFile[250];
sprintf_s(calibFile, "F:\\ShangGu\\编织袋数据\\编织袋RGBD识别方向\\ground_calib_para.txt");
poseCalibPara = _readCalibPara(calibFile);
}
else if (grp == 22)
else if (grp == 23)
{
char calibFile[250];
sprintf_s(calibFile, "F:\\ShangGu\\编织袋数据\\编织袋RGBD识别方向_2\\ground_calib_para.txt");
@ -3089,6 +3114,11 @@ int main()
sprintf_s(_scan_file, "%s%d_LaserData_Je08A354.txt", dataPath[grp], fidx);
laser3DPoints = vzReadLaserScanPointFromFile_XYZ(_scan_file, &lineNum, &lineV, &dataCalib, &maxTimeStamp, &clockPerSecond);
}
else if (grp == 21)
{
sprintf_s(_scan_file, "%s%d_LazerData_Je08A052.txt", dataPath[grp], fidx);
laser3DPoints = vzReadLaserScanPointFromFile_XYZ(_scan_file, &lineNum, &lineV, &dataCalib, &maxTimeStamp, &clockPerSecond);
}
else
{
sprintf_s(_scan_file, "%sLaserLine%d_grid.txt", dataPath[grp], fidx);
@ -3126,7 +3156,7 @@ int main()
int kkk = 1;
//行处理
//调平,去除地面
sg_lineDataR(&laser3DPoints[i], poseCalibPara.planeCalib, poseCalibPara.planeHeight);
sg_lineDataR(&laser3DPoints[i], poseCalibPara.planeCalib, poseCalibPara.planeHeight-10);
}
#if 0 //数据转存
sprintf_s(_scan_file, "%sLaserLine%d_grid_RTadjust.txt", dataPath[grp], fidx);
@ -3169,7 +3199,7 @@ int main()
cv::String img2DName_HOT(_dbg_file);
cv::imwrite(img2DName_HOT, project2D_color_HOT);
#endif
printf("%s: %d(ms)!\n", _scan_file, (int)(t2 - t1));
printf("%s: %d(ms), result=%d, errCode=%d!\n", _scan_file, (int)(t2 - t1), (int)objOps.size(), errCode);
}
else if (grp < TEST_TOP_ORIEN_GROUP)
{

View File

@ -548,9 +548,9 @@ SSG_planeCalibPara _readCalibPara(char* fileName)
}
#define CONVERT_TO_GRID 0
#define CONVERT_TO_GRID 1
#define COMPUTE_CALIB_PARA 0
#define BAG_THREAD_POSITIONING 1
#define BAG_THREAD_POSITIONING 0
#define TEST_GROUP 3
int main()
{
@ -570,14 +570,14 @@ int main()
printf("ver:%s\n", ver);
#if CONVERT_TO_GRID
int convertGrp = 2;
for (int fidx = 17; fidx <= 17; fidx++)
//int convertGrp = 2;
for (int fidx = 1; fidx <= 6; fidx++)
{
char _scan_file[256];
sprintf_s(_scan_file, "%s%dheightline_mm.txt", dataPath[convertGrp], fidx);
sprintf_s(_scan_file, "F:/ShangGu/项目/吕宁项目/测高/样品%d.txt", fidx);
std::vector<std::vector< SVzNL3DPosition>> scanData;
double lineStep = 0.033;
double lineStep = 0.096; //0.033;
double baseZ = 300.0;
vzReadLaserScanPointFromFile_encodePlyTxt(_scan_file, lineStep, baseZ, scanData);
bool isGridData = checkGridFormat(scanData);
@ -587,7 +587,7 @@ int main()
std::vector<std::vector< SVzNL3DPosition>> sampleData;
downSampleGridData(scanData, 2, sampleData);
//将数据恢复为按扫描线存储格式
sprintf_s(_scan_file, "%s袋子_grid_%d.txt", dataPath[convertGrp], fidx);
sprintf_s(_scan_file, "F:/ShangGu/项目/吕宁项目/测高/样品_grid_%d.txt", fidx);
_outputScanDataFile(_scan_file, sampleData,0, 0, 0);
printf("%s: done.\n", _scan_file);
}

View File

@ -220,19 +220,25 @@ void wd_getSurfaceEdgeFeatures(
#endif
/// <summary>
/// 提取激光线上的Jumping特征
/// nPointIdx被重新定义成Feature类型
/// 算法流程:
/// 1逐点计算前向角和后向角
/// 2逐点计算拐角顺时针为负逆时针为正
/// 3搜索正拐角的极大值。
/// 4判断拐角是否为跳变
/// 提取激光线上的Z形Jumping特征
/// </summary>
SG_APISHARED_EXPORT void sg_getLineJumpFeature_cornerMethod(
SG_APISHARED_EXPORT void sg_getLineZJumpFeature_cornerMethod(
SVzNL3DPosition* lineData,
int dataSize,
int lineIdx,
const SSG_cornerParam cornerPara, //scale通常取bagH的1/4
const SSG_cornerParam cornerPara,
const bool getTopEdge,
std::vector< SSG_basicFeature1D>& jumpFeatures);
/// <summary>
/// 提取激光线上的L形Jumping特征
/// </summary>
SG_APISHARED_EXPORT void sg_getLineLJumpFeature_cornerMethod(
SVzNL3DPosition* lineData,
int dataSize,
int lineIdx,
const SSG_cornerParam cornerPara,
const bool getTopEdge,
std::vector< SSG_basicFeature1D>& jumpFeatures);
SG_APISHARED_EXPORT void wd_getLineGloveArcs(

View File

@ -4851,7 +4851,7 @@ bool compareByIdx(const SSG_pntDirAngle& a, const SSG_pntDirAngle& b) {
}
/// <summary>
/// 提取激光线上的Jumping特征, 用于搭接焊缝
/// 提取激光线上的Z形Jumping特征, 用于搭接焊缝
/// seg端点z距离大于门限
/// nPointIdx被重新定义成Feature类型
/// 算法流程:
@ -4860,11 +4860,12 @@ bool compareByIdx(const SSG_pntDirAngle& a, const SSG_pntDirAngle& b) {
/// 3搜索正拐角的极大值。
/// 4判断拐角是否为跳变
/// </summary>
void sg_getLineJumpFeature_cornerMethod(
void sg_getLineZJumpFeature_cornerMethod(
SVzNL3DPosition* lineData,
int dataSize,
int lineIdx,
const SSG_cornerParam cornerPara, //scale通常取bagH的1/4
const SSG_cornerParam cornerPara,
const bool getTopEdge,
std::vector< SSG_basicFeature1D>& jumpFeatures)
{
//去除零点
@ -4986,188 +4987,43 @@ void sg_getLineJumpFeature_cornerMethod(
}
//搜索拐角极值
int _state = 0;
int pre_i = -1;
int sEdgePtIdx = -1;
int eEdgePtIdx = -1;
SSG_pntDirAngle* pre_data = NULL;
std::vector< SSG_pntDirAngle> cornerPeakP;
std::vector< SSG_pntDirAngle> cornerPeakM;
for (int i = 0, i_max = (int)vldPts.size(); i < i_max; i++)
{
if (i == 275)
int kkk = 1;
SSG_pntDirAngle* curr_data = &corners[i];
if (curr_data->pntIdx < 0)
{
if (i == i_max - 1) //最后一个
{
if (1 == _state) //上升
{
cornerPeakP.push_back(corners[eEdgePtIdx]);
}
else if (2 == _state) //下降
{
cornerPeakM.push_back(corners[eEdgePtIdx]);
}
}
continue;
}
double cornerMergeScale = cornerPara.scale * 2;
_searchCornerPeaks(
corners,
vldPts,
cornerPara,
cornerMergeScale,
cornerPeakP,
cornerPeakM
);
if (NULL == pre_data)
{
sEdgePtIdx = i;
eEdgePtIdx = i;
pre_data = curr_data;
pre_i = i;
continue;
}
eEdgePtIdx = i;
double cornerDiff = curr_data->corner - pre_data->corner;
switch (_state)
{
case 0: //初态
if (cornerDiff < 0) //下降
{
_state = 2;
}
else if (cornerDiff > 0) //上升
{
_state = 1;
}
break;
case 1: //上升
if (cornerDiff < 0) //下降
{
cornerPeakP.push_back(*pre_data);
_state = 2;
}
break;
case 2: //下降
if (cornerDiff > 0) // 上升
{
cornerPeakM.push_back(*pre_data);
_state = 1;
}
break;
default:
_state = 0;
break;
}
pre_data = curr_data;
pre_i = i;
}
//注意:最后一个不处理,为基座位置
//极小值点(峰顶)
//极值比较,在尺度窗口下寻找局部极值点
std::vector< SSG_pntDirAngle> cornerFeatures;
double square_distTh = 4 * cornerPara.scale * cornerPara.scale; //2倍的cornerScale。
for (int i = 0, i_max = (int)cornerPeakP.size(); i < i_max; i++)
for (int i = 0; i < (int)cornerPeakP.size(); i++)
{
if (cornerPeakP[i].corner < cornerPara.cornerTh)
continue;
bool isPeak = true;
//向前搜索
int cornerPtIdx = cornerPeakP[i].pntIdx;
for (int j = i - 1; j >= 0; j--)
if ((abs(cornerPeakP[i].backwardAngle) < cornerPara.jumpCornerTh_1) && (abs(cornerPeakP[i].forwardAngle) > cornerPara.jumpCornerTh_2))
{
int prePtIdx = cornerPeakP[j].pntIdx;
double dist = pow(vldPts[cornerPtIdx].pt3D.y - vldPts[prePtIdx].pt3D.y, 2); // + pow(pkTop[i].pt3D.x - pkTop[j].pt3D.x, 2) ;
if (dist > square_distTh) //超出尺度窗口
break;
if (cornerPeakP[i].corner < cornerPeakP[j].corner)
{
isPeak = false;
break;
}
cornerPeakP[i].type = LINE_FEATURE_RIGHT_ANGLE_HR;
cornerFeatures.push_back(cornerPeakP[i]);
}
//向后搜索
if (true == isPeak)
else if ((abs(cornerPeakP[i].forwardAngle) < cornerPara.jumpCornerTh_1) && (abs(cornerPeakP[i].backwardAngle) > cornerPara.jumpCornerTh_2))
{
cornerPtIdx = cornerPeakP[i].pntIdx;
for (int j = i + 1; j < i_max; j++)
{
int postPtIdx = cornerPeakP[j].pntIdx;
double dist = pow(vldPts[cornerPtIdx].pt3D.y - vldPts[postPtIdx].pt3D.y, 2); // +pow(pkTop[i].pt3D.x - pkTop[j].pt3D.x, 2);
if (dist > square_distTh) //超出尺度窗口
break;
if (cornerPeakP[i].corner < cornerPeakP[j].corner)
{
isPeak = false;
break;
}
}
}
if (true == isPeak)
{
if ((abs(cornerPeakP[i].backwardAngle) < cornerPara.jumpCornerTh_1) && (abs(cornerPeakP[i].forwardAngle) > cornerPara.jumpCornerTh_2))
{
cornerPeakP[i].type = LINE_FEATURE_RIGHT_ANGLE_HR;
cornerFeatures.push_back(cornerPeakP[i]);
}
else if ((abs(cornerPeakP[i].forwardAngle) < cornerPara.jumpCornerTh_1) && (abs(cornerPeakP[i].backwardAngle) > cornerPara.jumpCornerTh_2))
{
cornerPeakP[i].type = LINE_FEATURE_RIGHT_ANGLE_FH;
cornerFeatures.push_back(cornerPeakP[i]);
}
cornerPeakP[i].type = LINE_FEATURE_RIGHT_ANGLE_FH;
cornerFeatures.push_back(cornerPeakP[i]);
}
}
for (int i = 0, i_max = (int)cornerPeakM.size(); i < i_max; i++)
for (int i = 0; i < (int)cornerPeakM.size(); i++)
{
if (abs(cornerPeakM[i].corner) < cornerPara.cornerTh)
continue;
bool isPeak = true;
//向前搜索
int cornerPtIdx = cornerPeakM[i].pntIdx;
for (int j = i - 1; j >= 0; j--)
if ((abs(cornerPeakM[i].backwardAngle) < cornerPara.jumpCornerTh_1) && (abs(cornerPeakM[i].forwardAngle) > cornerPara.jumpCornerTh_2))
{
int prePtIdx = cornerPeakM[j].pntIdx;
double dist = pow(vldPts[cornerPtIdx].pt3D.y - vldPts[prePtIdx].pt3D.y, 2); // + pow(pkTop[i].pt3D.x - pkTop[j].pt3D.x, 2) ;
if (dist > square_distTh) //超出尺度窗口
break;
if (abs(cornerPeakM[i].corner) < abs(cornerPeakM[j].corner))
{
isPeak = false;
break;
}
cornerPeakM[i].type = LINE_FEATURE_RIGHT_ANGLE_HF;
cornerFeatures.push_back(cornerPeakM[i]);
}
//向后搜索
if (true == isPeak)
else if ((abs(cornerPeakM[i].forwardAngle) < cornerPara.jumpCornerTh_1) && (abs(cornerPeakM[i].backwardAngle) > cornerPara.jumpCornerTh_2))
{
cornerPtIdx = cornerPeakM[i].pntIdx;
for (int j = i + 1; j < i_max; j++)
{
int postPtIdx = cornerPeakM[j].pntIdx;
double dist = pow(vldPts[cornerPtIdx].pt3D.y - vldPts[postPtIdx].pt3D.y, 2); // +pow(pkTop[i].pt3D.x - pkTop[j].pt3D.x, 2);
if (dist > square_distTh) //超出尺度窗口
break;
if (abs(cornerPeakM[i].corner) < abs(cornerPeakM[j].corner))
{
isPeak = false;
break;
}
}
}
if (true == isPeak)
{
if ((abs(cornerPeakM[i].backwardAngle) < cornerPara.jumpCornerTh_1) && (abs(cornerPeakM[i].forwardAngle) > cornerPara.jumpCornerTh_2))
{
cornerPeakM[i].type = LINE_FEATURE_RIGHT_ANGLE_HF;
cornerFeatures.push_back(cornerPeakM[i]);
}
else if ((abs(cornerPeakM[i].forwardAngle) < cornerPara.jumpCornerTh_1) && (abs(cornerPeakM[i].backwardAngle) > cornerPara.jumpCornerTh_2))
{
cornerPeakM[i].type = LINE_FEATURE_RIGHT_ANGLE_RH;
cornerFeatures.push_back(cornerPeakM[i]);
}
cornerPeakM[i].type = LINE_FEATURE_RIGHT_ANGLE_RH;
cornerFeatures.push_back(cornerPeakM[i]);
}
}
@ -5190,9 +5046,18 @@ void sg_getLineJumpFeature_cornerMethod(
{
SSG_basicFeature1D a_feature;
a_feature.featureType = LINE_FEATURE_L_JUMP_L2H;
a_feature.jumpPos = vldPts[pntIdx_1].pt3D;
a_feature.jumpPos2D = { lineIdx, vldPts[pntIdx_1].nPointIdx };
a_feature.featureValue = cornerFeatures[i].backward_z;
if (true == getTopEdge)
{
a_feature.jumpPos = vldPts[pntIdx_2].pt3D;
a_feature.jumpPos2D = { lineIdx, vldPts[pntIdx_2].nPointIdx }; //取
a_feature.featureValue = cornerFeatures[i+1].forward_z;
}
else
{
a_feature.jumpPos = vldPts[pntIdx_1].pt3D;
a_feature.jumpPos2D = { lineIdx, vldPts[pntIdx_1].nPointIdx }; //取
a_feature.featureValue = cornerFeatures[i].backward_z;
}
jumpFeatures.push_back(a_feature);
}
}
@ -5210,9 +5075,246 @@ void sg_getLineJumpFeature_cornerMethod(
{
SSG_basicFeature1D a_feature;
a_feature.featureType = LINE_FEATURE_L_JUMP_H2L;
a_feature.jumpPos = vldPts[pntIdx_2].pt3D;
a_feature.jumpPos2D = { lineIdx, vldPts[pntIdx_2].nPointIdx };
a_feature.featureValue = cornerFeatures[i + 1].forward_z;
if (true == getTopEdge)
{
a_feature.jumpPos = vldPts[pntIdx_1].pt3D;
a_feature.jumpPos2D = { lineIdx, vldPts[pntIdx_1].nPointIdx };
a_feature.featureValue = cornerFeatures[i].backward_z;
}
else
{
a_feature.jumpPos = vldPts[pntIdx_2].pt3D;
a_feature.jumpPos2D = { lineIdx, vldPts[pntIdx_2].nPointIdx };
a_feature.featureValue = cornerFeatures[i + 1].forward_z;
}
jumpFeatures.push_back(a_feature);
}
}
}
}
return;
}
/// <summary>
/// 提取激光线上的L形Jumping特征
/// 特征定义由绝对定义修改为相对定义
/// </summary>
void sg_getLineLJumpFeature_cornerMethod(
SVzNL3DPosition* lineData,
int dataSize,
int lineIdx,
const SSG_cornerParam cornerPara,
const bool getTopEdge,
std::vector< SSG_basicFeature1D>& jumpFeatures)
{
//去除零点
std::vector< SVzNL3DPosition> vldPts;
std::vector<SSG_RUN> segs;
//修改seg的定义。seg端点是两点间距离大于门限的点
int segStart = -1, segEnd = -1;
for (int i = 0; i < dataSize; i++)
{
SVzNL3DPosition a_pt = lineData[i];
a_pt.nPointIdx = i;
if (lineData[i].pt3D.z > 1e-4)
vldPts.push_back(a_pt);
//seg判断
if (lineData[i].pt3D.z > 1e-4)
{
if (segStart < 0)
segStart = i;
else //检查两点距离
{
SVzNL3DPosition pre_pt = lineData[i - 1];
double diff_z = abs(a_pt.pt3D.z - pre_pt.pt3D.z);
if (diff_z > cornerPara.minEndingGap_z)
{
SSG_RUN a_run;
a_run.start = segStart;
a_run.len = segEnd - segStart + 1;
a_run.value = 1;
segs.push_back(a_run);
segStart = i;
}
}
segEnd = i;
}
else
{
if (segStart >= 0)
{
SSG_RUN a_run;
a_run.start = segStart;
a_run.len = segEnd - segStart + 1;
a_run.value = 1;
segs.push_back(a_run);
segStart = -1;
segEnd = -1;
}
}
}
//last
if (segStart >= 0)
{
SSG_RUN a_run;
a_run.start = segStart;
a_run.len = segEnd - segStart + 1;
a_run.value = 1;
segs.push_back(a_run);
}
//计算前向角和后向角
std::vector< SSG_pntDirAngle> corners;
corners.resize(vldPts.size());
for (int i = 0, i_max = (int)vldPts.size(); i < i_max; i++)
{
if (i == 875)
int kkk = 1;
//前向寻找
int pre_i = -1;
for (int j = i - 1; j >= 0; j--)
{
double dist = sqrt(pow(vldPts[i].pt3D.y - vldPts[j].pt3D.y, 2) +
pow(vldPts[i].pt3D.z - vldPts[j].pt3D.z, 2));
if (dist >= cornerPara.scale)
{
pre_i = j;
break;
}
}
//后向寻找
int post_i = -1;
for (int j = i + 1; j < i_max; j++)
{
double dist = sqrt(pow(vldPts[i].pt3D.y - vldPts[j].pt3D.y, 2) +
pow(vldPts[i].pt3D.z - vldPts[j].pt3D.z, 2));
if (dist >= cornerPara.scale)
{
post_i = j;
break;
}
}
//计算拐角
if ((pre_i < 0) || (post_i < 0))
{
corners[i].pntIdx = -1;
corners[i].forwardAngle = 0;
corners[i].backwardAngle = 0;
corners[i].corner = 0;
corners[i].forwardDiffZ = 0;
corners[i].backwardDiffZ = 0;
corners[i].forward_z = 0;
corners[i].backward_z = 0;
}
else
{
double tanValue_pre = (vldPts[i].pt3D.z - vldPts[pre_i].pt3D.z) / abs(vldPts[i].pt3D.y - vldPts[pre_i].pt3D.y);
double tanValue_post = (vldPts[post_i].pt3D.z - vldPts[i].pt3D.z) / abs(vldPts[post_i].pt3D.y - vldPts[i].pt3D.y);
double forwardAngle = atan(tanValue_post) * 180.0 / PI; //沿序号增长方向
double backwardAngle = atan(tanValue_pre) * 180.0 / PI; //沿序号减小方向
corners[i].pntIdx = i;
corners[i].forwardAngle = forwardAngle;
corners[i].backwardAngle = backwardAngle;
corners[i].corner = -(forwardAngle - backwardAngle); //图像坐标系与正常坐标系y方向相反所以有“-”号
corners[i].forwardDiffZ = vldPts[post_i].pt3D.z - vldPts[i].pt3D.z;
corners[i].backwardDiffZ = vldPts[i].pt3D.z - vldPts[pre_i].pt3D.z;
corners[i].forward_z = vldPts[post_i].pt3D.z; //沿序号增长方向
corners[i].backward_z = vldPts[pre_i].pt3D.z; //沿序号减小方向
}
}
//搜索拐角极值
std::vector< SSG_pntDirAngle> cornerPeakP;
std::vector< SSG_pntDirAngle> cornerPeakM;
double cornerMergeScale = cornerPara.scale;
_searchCornerPeaks(
corners,
vldPts,
cornerPara,
cornerMergeScale,
cornerPeakP,
cornerPeakM
);
std::vector< SSG_pntDirAngle> cornerFeatures;
for (int i = 0; i < (int)cornerPeakP.size(); i++)
{
double angle_diff1 = abs(cornerPeakP[i].forwardAngle) - abs(cornerPeakP[i].backwardAngle);
double angle_diff2 = abs(cornerPeakP[i].backwardAngle) - abs(cornerPeakP[i].forwardAngle);
//if ((abs(cornerPeakP[i].backwardAngle) < cornerPara.jumpCornerTh_1) && (abs(cornerPeakP[i].forwardAngle) > cornerPara.jumpCornerTh_2))
if( angle_diff1 > cornerPara.jumpCornerTh_1)
{
cornerPeakP[i].type = LINE_FEATURE_RIGHT_ANGLE_HR;
cornerFeatures.push_back(cornerPeakP[i]);
}
//else if ((abs(cornerPeakP[i].forwardAngle) < cornerPara.jumpCornerTh_1) && (abs(cornerPeakP[i].backwardAngle) > cornerPara.jumpCornerTh_2))
else if(angle_diff2 > cornerPara.jumpCornerTh_1)
{
cornerPeakP[i].type = LINE_FEATURE_RIGHT_ANGLE_FH;
cornerFeatures.push_back(cornerPeakP[i]);
}
}
for (int i = 0; i < (int)cornerPeakM.size(); i++)
{
double angle_diff1 = abs(cornerPeakM[i].forwardAngle) - abs(cornerPeakM[i].backwardAngle);
double angle_diff2 = abs(cornerPeakM[i].backwardAngle) - abs(cornerPeakM[i].forwardAngle);
//if ((abs(cornerPeakM[i].backwardAngle) < cornerPara.jumpCornerTh_1) && (abs(cornerPeakM[i].forwardAngle) > cornerPara.jumpCornerTh_2))
if (angle_diff1 > cornerPara.jumpCornerTh_1)
{
cornerPeakM[i].type = LINE_FEATURE_RIGHT_ANGLE_HF;
cornerFeatures.push_back(cornerPeakM[i]);
}
//else if ((abs(cornerPeakM[i].forwardAngle) < cornerPara.jumpCornerTh_1) && (abs(cornerPeakM[i].backwardAngle) > cornerPara.jumpCornerTh_2))
else if (angle_diff2 > cornerPara.jumpCornerTh_1)
{
cornerPeakM[i].type = LINE_FEATURE_RIGHT_ANGLE_RH;
cornerFeatures.push_back(cornerPeakM[i]);
}
}
//排序
std::sort(cornerFeatures.begin(), cornerFeatures.end(), compareByIdx);
//获得Jump
for (int i = 0, i_max = (int)cornerFeatures.size(); i < i_max - 1; i++)
{
int pntIdx = cornerFeatures[i].pntIdx;
if (false == getTopEdge) //取下沿
{
if ((cornerFeatures[i].type == LINE_FEATURE_RIGHT_ANGLE_FH) || (cornerFeatures[i].type == LINE_FEATURE_RIGHT_ANGLE_HR))
{
double thickness = abs(cornerFeatures[i].forward_z - cornerFeatures[i].backward_z);
if (thickness > cornerPara.minEndingGap_z)
{
SSG_basicFeature1D a_feature;
a_feature.featureType = LINE_FEATURE_L_JUMP_L2H;
a_feature.jumpPos = vldPts[pntIdx].pt3D;
a_feature.jumpPos2D = { lineIdx, vldPts[pntIdx].nPointIdx }; //取
if (cornerFeatures[i + 1].type == LINE_FEATURE_RIGHT_ANGLE_FH)
a_feature.featureValue = cornerFeatures[i].forward_z;
else
a_feature.featureValue = cornerFeatures[i].backward_z;
jumpFeatures.push_back(a_feature);
}
}
}
else //取上沿
{
if ((cornerFeatures[i].type == LINE_FEATURE_RIGHT_ANGLE_HF) || (cornerFeatures[i].type == LINE_FEATURE_RIGHT_ANGLE_RH))
{
double thickness = abs(cornerFeatures[i].forward_z - cornerFeatures[i].backward_z);
if (thickness > cornerPara.minEndingGap_z)
{
SSG_basicFeature1D a_feature;
a_feature.featureType = LINE_FEATURE_L_JUMP_L2H;
a_feature.jumpPos = vldPts[pntIdx].pt3D;
a_feature.jumpPos2D = { lineIdx, vldPts[pntIdx].nPointIdx }; //取
if (cornerFeatures[i].type == LINE_FEATURE_RIGHT_ANGLE_HF)
a_feature.featureValue = cornerFeatures[i].backward_z;
else
a_feature.featureValue = cornerFeatures[i].forward_z;
jumpFeatures.push_back(a_feature);
}
}

View File

@ -123,11 +123,12 @@ void sx_getLapWeldPostion(
std::vector<SSG_basicFeature1D> a_line_features;
int dataSize = (int)lineData.size();
sg_getLineJumpFeature_cornerMethod(
sg_getLineZJumpFeature_cornerMethod(
&scanLines[line][0],
dataSize,
line,
cornerPara, //scale通常取bagH的1/4
cornerPara,
false, //取下沿
a_line_features);
//薦壺華醱
std::vector<SSG_basicFeature1D> vld_features;
@ -175,11 +176,12 @@ void sx_getLapWeldPostion(
std::vector<SSG_basicFeature1D> a_line_features;
int dataSize = (int)lineData.size();
sg_getLineJumpFeature_cornerMethod(
sg_getLineZJumpFeature_cornerMethod(
&hLines[line][0],
dataSize,
line,
cornerPara, //scale通常取bagH的1/4
cornerPara,
false,//取下沿
a_line_features);
//薦壺華醱

View File

@ -0,0 +1,291 @@
#include <vector>
#include "SG_baseDataType.h"
#include "SG_baseAlgo_Export.h"
#include "YouJiang_sheetPositioning_Export.h"
#include <opencv2/opencv.hpp>
#define DEBUG_OUT_IMAGE 1
std::string m_strVersion = "1.0.0";
const char* wd_sheetPositionVersion(void)
{
return m_strVersion.c_str();
}
//计算一个平面调平参数。
//数据输入中可以有一个地平面和参考调平平面,以最高的平面进行调平
//旋转矩阵为调平参数,即将平面法向调整为垂直向量的参数
SSG_planeCalibPara wd_sheetPosition_getBaseCalibPara(
std::vector< std::vector<SVzNL3DPosition>>& scanLines)
{
return sg_getPlaneCalibPara2(scanLines);
}
//相机姿态调平,并去除地面
void wd_sheetPosition_lineDataR(
std::vector< SVzNL3DPosition>& a_line,
const double* camPoseR,
double groundH)
{
lineDataRT_vector(a_line, camPoseR, groundH);
}
//薄片定位
//使用语义模块匹配1提取特征2基于特征匹配薄片
void wd_YouJiang_getSheetPosition(
std::vector< std::vector<SVzNL3DPosition>>& scanLines,
const SWD_sheetTemplateParam templateParam,
const SSG_planeCalibPara groundCalibPara,
const SWD_sheetAlgoParam algoParam,
SWD_gripState* opState, //操作状态机。指示当前状态
int* errCode,
std::vector<SWD_sheetGrasper>& resultObjPositions)
{
int lineNum = (int)scanLines.size();
if (lineNum == 0)
{
*errCode = SG_ERR_3D_DATA_NULL;
return;
}
bool isGridData = true;
int linePtNum = (int)scanLines[0].size();
for (int i = 0; i < lineNum; i++)
{
if (linePtNum != (int)scanLines[i].size())
isGridData = false;//行处理
//调平,去除地面
wd_sheetPosition_lineDataR(scanLines[i], groundCalibPara.planeCalib, -1);
}
if (false == isGridData)//数据不是网格格式
{
*errCode = SG_ERR_NOT_GRID_FORMAT;
return;
}
//提取薄片上的圆孔
//垂直跳变特征提取
std::vector<std::vector<SSG_basicFeature1D>> lineJumpFeatures_v;
for (int line = 0; line < lineNum; line++)
{
if (line == 76)
int kkk = 1;
std::vector<SVzNL3DPosition>& lineData = scanLines[line];
if (linePtNum != (int)lineData.size())
isGridData = false;
//滤波,滤除异常点
sg_lineDataRemoveOutlier_changeOriginData(&lineData[0], linePtNum, algoParam.filterParam);
std::vector<SSG_basicFeature1D> line_jumpFeatures;
int dataSize = (int)lineData.size();
/// 提取激光线上的Jumping特征
sg_getLineLJumpFeature_cornerMethod(
&lineData[0],
dataSize,
line,
algoParam.cornerParam,
true, //取上沿
line_jumpFeatures);
lineJumpFeatures_v.push_back(line_jumpFeatures);
}
if (false == isGridData)//数据不是网格格式
{
*errCode = SG_ERR_NOT_GRID_FORMAT;
return;
}
//生成水平扫描
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;
}
}
//水平jump特征提取
std::vector<std::vector<SSG_basicFeature1D>> lineJumpFeatures_h;
int lineNum_h_raw = (int)hLines_raw.size();
for (int line = 0; line < lineNum_h_raw; line++)
{
if (line == 522)
int kkk = 1;
std::vector<SVzNL3DPosition>& lineData = hLines_raw[line];
//滤波,滤除异常点
int ptNum = (int)lineData.size();
sg_lineDataRemoveOutlier_changeOriginData(&lineData[0], ptNum, algoParam.filterParam);
std::vector<SSG_basicFeature1D> line_jumpFeatures;
int dataSize = (int)lineData.size();
/// 提取激光线上的Jumping特征
sg_getLineLJumpFeature_cornerMethod(
&lineData[0],
dataSize,
line,
algoParam.cornerParam,
true, //取上沿
line_jumpFeatures);
lineJumpFeatures_h.push_back(line_jumpFeatures);
}
//标注
std::vector<std::vector<SSG_featureClusteringInfo>> featureInfoMask;
std::vector<std::vector<SVzNL3DPoint>> feature3DInfo;
featureInfoMask.resize(lineNum);
feature3DInfo.resize(lineNum);
for (int i = 0; i < lineNum; i++)
{
featureInfoMask[i].resize(lineNum_h_raw);
feature3DInfo[i].resize(lineNum_h_raw);
}
//垂直标注
for (int line = 0; line < lineNum; line++)
{
if (line == 390)
int kkk = 1;
std::vector<SSG_basicFeature1D>& a_lineJumpFeature = lineJumpFeatures_v[line];
for (int m = 0, m_max = (int)a_lineJumpFeature.size(); m < m_max; m++)
{
int px = a_lineJumpFeature[m].jumpPos2D.x;
int py = a_lineJumpFeature[m].jumpPos2D.y;
SSG_featureClusteringInfo& a_featureInfo = featureInfoMask[px][py];
a_featureInfo.clusterID = 0;
a_featureInfo.featurType = 1;
a_featureInfo.featureIdx_v = m;
a_featureInfo.featureIdx_h = 0;
a_featureInfo.lineIdx = px;
a_featureInfo.ptIdx = py;
a_featureInfo.flag = 0;
SVzNL3DPoint& a_feature3D = feature3DInfo[px][py];
a_feature3D = a_lineJumpFeature[m].jumpPos;
scanLines[px][py].nPointIdx = 1;
}
}
//水平标注
for (int line = 0; line < lineNum_h_raw; line++)
{
std::vector<SSG_basicFeature1D>& a_lineJumpFeature = lineJumpFeatures_h[line];
for (int m = 0, m_max = (int)a_lineJumpFeature.size(); m < m_max; m++)
{
int py = a_lineJumpFeature[m].jumpPos2D.x;
int px = a_lineJumpFeature[m].jumpPos2D.y;
SSG_featureClusteringInfo& a_featureInfo = featureInfoMask[px][py];
if (a_featureInfo.featurType == 0)
{
a_featureInfo.clusterID = 0;
a_featureInfo.lineIdx = px;
a_featureInfo.ptIdx = py;
a_featureInfo.flag = 0;
}
a_featureInfo.featurType += 2;
a_featureInfo.featureIdx_h = m;
SVzNL3DPoint& a_feature3DValue = feature3DInfo[px][py];
a_feature3DValue = { a_lineJumpFeature[m].jumpPos.y, a_lineJumpFeature[m].jumpPos.x, a_lineJumpFeature[m].jumpPos.z };
scanLines[px][py].nPointIdx += 2;
}
}
//聚类
//采用迭代思想,回归思路进行高效聚类
std::vector<std::vector< SVzNL2DPoint>> clusters; //只记录位置
std::vector<SVzNL3DRangeD> clustersRoi3D;
int clusterID = 1;
int clusterCheckWin = 3;
for (int y = 0; y < lineNum_h_raw; y++)
{
for (int x = 0; x < lineNum; x++)
{
SSG_featureClusteringInfo& a_featureInfo = featureInfoMask[x][y];
if ((0 == a_featureInfo.featurType) || (a_featureInfo.clusterID > 0)) //非特征或已经处理
continue;
SVzNL3DPoint& a_feature3DValue = feature3DInfo[x][y];
SVzNL3DRangeD a_clusterRoi;
a_clusterRoi.xRange.min = a_feature3DValue.x;
a_clusterRoi.xRange.max = a_feature3DValue.x;
a_clusterRoi.yRange.min = a_feature3DValue.y;
a_clusterRoi.yRange.max = a_feature3DValue.y;
a_clusterRoi.zRange.min = a_feature3DValue.z;
a_clusterRoi.zRange.max = a_feature3DValue.z;
SVzNL2DPoint a_seedPos = { x, y };
std::vector< SVzNL2DPoint> a_cluster;
a_cluster.push_back(a_seedPos);
wd_gridPointClustering(
featureInfoMask,//int记录特征标记和clusterID附加一个flag
feature3DInfo,//double,记录坐标信息
clusterCheckWin, //搜索窗口
algoParam.growParam,//聚类条件
clusterID, //当前Cluster的ID
a_cluster, //result
a_clusterRoi
);
clusters.push_back(a_cluster);
clustersRoi3D.push_back(a_clusterRoi);
clusterID++;
}
}
int clusterNum = (int)clusters.size();
//投影和标注。投影的目的是用于模板匹配时的特征处理。以1mm为单位.记录clusterID
SVzNL3DRangeD roi3D = sg_getScanDataROI_vector(scanLines);
double projectionScale = 1.0; //以1mm为投影尺度
int projecction_xw = (int)((roi3D.xRange.max - roi3D.xRange.min) / projectionScale) + 1;
int projecction_yh = (int)((roi3D.yRange.max - roi3D.yRange.min) / projectionScale) + 1;
std::vector<std::vector<int>> projectionClusters;
projectionClusters.resize(projecction_xw);
for (int i = 0; i < projecction_yh; i++)
projectionClusters[i].resize(projecction_yh);
for (int i = 0; i < clusterNum; i++)
{
std::vector< SVzNL2DPoint>& a_cluster = clusters[i];
for (int j = 0; j < (int)clusters.size(); j++)
{
SVzNL2DPoint& a_pt = a_cluster[i];
SVzNL3DPosition& a_pt3d = scanLines[a_pt.x][a_pt.y];
int px = (int)((a_pt3d.pt3D.x - roi3D.xRange.min) / projectionScale);
int py = (int)((a_pt3d.pt3D.y - roi3D.yRange.min) / projectionScale);
projectionClusters[px][py] = i + 1; //clusterID = index + 1
}
}
//聚类结果分析
//根据大小确定圆孔
std::vector<SVzNL3DPoint> clustersCenter;
clustersCenter.resize(clusters.size());
std::vector<int> validIndice;
double diameter_th = templateParam.holeDiameter * 0.1;
for (int i = 0; i < clusterNum; i++)
{
double xw = clustersRoi3D[i].xRange.max - clustersRoi3D[i].xRange.min;
double yh = clustersRoi3D[i].yRange.max - clustersRoi3D[i].yRange.min;
double xw_diff = abs(xw - templateParam.holeDiameter);
double yh_diff = abs(yh - templateParam.holeDiameter);
if ((xw_diff < diameter_th) && (yh_diff < diameter_th))
{
validIndice.push_back(i);
//计算中心点
}
}
//圆孔配对
//确定正反和抓取点
}

View File

@ -0,0 +1,67 @@
#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>
typedef struct
{
double holeDiameter; //薄片两端孔直径
double holeDistance; //薄片两端孔距离
double sheetThickness; //薄片厚度
double centerBossHeight; //薄片中央凸起高度
}SWD_sheetTemplateParam;
typedef struct
{
SSG_outlierFilterParam filterParam;
SSG_cornerParam cornerParam;
SSG_treeGrowParam growParam;
}SWD_sheetAlgoParam;
typedef struct
{
SVzNL3DPoint refPos;
}SWD_gripState;
typedef struct
{
bool isUpDownDir; //从上到下为上下方向
bool isFrontSide; //中间凸起为正面
SSG_6DOF opCenter; //抓取中心位置
}SWD_sheetGrasper;
//读版本号
SG_APISHARED_EXPORT const char* wd_sheetPositionVersion(void);
//计算一个平面调平参数。
//数据输入中可以有一个地平面和参考调平平面,以最高的平面进行调平
//旋转矩阵为调平参数,即将平面法向调整为垂直向量的参数
SG_APISHARED_EXPORT SSG_planeCalibPara wd_sheetPosition_getBaseCalibPara(
std::vector< std::vector<SVzNL3DPosition>>& scanLines);
//相机姿态调平,并去除地面
SG_APISHARED_EXPORT void wd_sheetPosition_lineDataR(
std::vector< SVzNL3DPosition>& a_line,
const double* camPoseR,
double groundH);
///数据输入必须是grid格式以进行水平方向和垂直方向的处理
//电机定子定位。
//算法逻辑:找到定子的高度->设置截取Z去掉底面->
// 投影(注意此时边框也同时投影)->距离变换->提取定子目标->
// 根据相邻和边框寻找最佳抓取目标和抓取点
SG_APISHARED_EXPORT void wd_YouJiang_getSheetPosition(
std::vector< std::vector<SVzNL3DPosition>>& scanLines,
const SWD_sheetTemplateParam statorParam,
const SSG_planeCalibPara groundCalibPara,
const SWD_sheetAlgoParam algoParam,
SWD_gripState* opState, //操作状态机。指示当前状态
int* errCode,
std::vector<SWD_sheetGrasper>& resultObjPositions);

View File

@ -39,8 +39,10 @@ typedef struct
SVzNL3DPoint objCenter;
}SG_fittingInfo;
std::string m_strVersion = "1.0.0";
const char* wd_particleSegVersion(void)
//version 1.0.0 : base version release to customer
//version 1.1.0 : opencv库由480版本调整为320版本
std::string m_strVersion = "1.1.0";
const char* wd_motorStatorVersion(void)
{
return m_strVersion.c_str();
}

View File

@ -41,7 +41,7 @@ typedef struct
}SWD_statorGriperState;
//读版本号
SG_APISHARED_EXPORT const char* wd_particleSegVersion(void);
SG_APISHARED_EXPORT const char* wd_motorStatorVersion(void);
//计算一个平面调平参数。
//数据输入中可以有一个地平面和参考调平平面,以最高的平面进行调平