mirror of
https://github.com/eggplantlwj/VisionEdit.git
synced 2026-04-23 06:16:35 +08:00
添添加功能:1、增加采图工具 2、增加拖拽后值传递功能 3、
This commit is contained in:
162
CaliperTool/CaliperTool.cs
Normal file
162
CaliperTool/CaliperTool.cs
Normal file
@@ -0,0 +1,162 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using CommonMethods;
|
||||
using HalconDotNet;
|
||||
using static DataStruct.DataStruct;
|
||||
|
||||
namespace CaliperTool
|
||||
{
|
||||
[Serializable]
|
||||
public class CaliperTool:IToolInfo
|
||||
{
|
||||
public bool toolEnable = true;
|
||||
/// <summary>
|
||||
/// 输入姿态
|
||||
/// </summary>
|
||||
public PosXYU inputPose = new PosXYU();
|
||||
/// <summary>
|
||||
/// 制作模板时的输入位姿
|
||||
/// </summary>
|
||||
public PosXYU templatePose = new PosXYU();
|
||||
/// <summary>
|
||||
/// 卡尺
|
||||
/// </summary>
|
||||
public HObject contoursDisp = null;
|
||||
/// <summary>
|
||||
/// 箭头
|
||||
/// </summary>
|
||||
public HObject arrowDisp = null;
|
||||
/// <summary>
|
||||
/// 交点
|
||||
/// </summary>
|
||||
public HObject crossDisp = null;
|
||||
/// <summary>
|
||||
/// 期望矩形中心行坐标
|
||||
/// </summary>
|
||||
public HTuple expectRecStartRow = 200;
|
||||
/// <summary>
|
||||
/// 期望矩形中心列坐标
|
||||
/// </summary>
|
||||
public HTuple expectRecStartColumn = 200;
|
||||
/// <summary>
|
||||
/// 期望矩形起点方向
|
||||
/// </summary>
|
||||
public HTuple expectAngle = 0;
|
||||
/// <summary>
|
||||
/// 卡尺高
|
||||
/// </summary>
|
||||
public int length1 = 40;
|
||||
/// <summary>
|
||||
/// 卡尺宽
|
||||
/// </summary>
|
||||
public int length2 = 40;
|
||||
/// <summary>
|
||||
/// 找边极性,从明到暗或从暗到明
|
||||
/// </summary>
|
||||
public string polarity = "negative";
|
||||
/// <summary>
|
||||
/// 边阈值
|
||||
/// </summary>
|
||||
public int threshold = 30;
|
||||
/// <summary>
|
||||
/// 边Sigma
|
||||
/// </summary>
|
||||
public double sigma = 1.0;
|
||||
/// <summary>
|
||||
/// 选择所查找到的点
|
||||
/// </summary>
|
||||
public string edgeSelect = "all";
|
||||
/// <summary>
|
||||
/// 矩形框显示
|
||||
/// </summary>
|
||||
public bool dispRec = true;
|
||||
/// <summary>
|
||||
/// 交点显示
|
||||
/// </summary>
|
||||
public bool dispCross = true;
|
||||
/// <summary>
|
||||
/// 找到的线段
|
||||
/// </summary>
|
||||
public Point resultPoint = null;
|
||||
/// <summary>
|
||||
/// 显示的线
|
||||
/// </summary>
|
||||
public HObject LineDisp = null;
|
||||
/// <summary>
|
||||
/// 新的跟随姿态变化后的预期线信息
|
||||
/// </summary>
|
||||
HTuple newExpectLineStartRow = new HTuple(200), newExpectLineStartCol = new HTuple(200), newExpectLineEndRow = new HTuple(200), newExpectLineEndCol = new HTuple(600);
|
||||
/// <summary>
|
||||
/// 查找到的线的起点行坐标
|
||||
/// </summary>
|
||||
private HTuple _resultLineStartRow = 0;
|
||||
internal HTuple ResultLineStartRow
|
||||
{
|
||||
get
|
||||
{
|
||||
_resultLineStartRow = Math.Round((double)_resultLineStartRow, 3);
|
||||
return _resultLineStartRow;
|
||||
}
|
||||
set { _resultLineStartRow = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 查找到的线的起点列坐标
|
||||
/// </summary>
|
||||
private HTuple _resultLineStartCol = 0;
|
||||
internal HTuple ResultLineStartCol
|
||||
{
|
||||
get
|
||||
{
|
||||
_resultLineStartCol = Math.Round((double)_resultLineStartCol, 3);
|
||||
return _resultLineStartCol;
|
||||
}
|
||||
set { _resultLineStartCol = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 查找到的线的终点行坐标
|
||||
/// </summary>
|
||||
private HTuple _resultLineEndRow = 0;
|
||||
internal HTuple ResultLineEndRow
|
||||
{
|
||||
get
|
||||
{
|
||||
_resultLineEndRow = Math.Round((double)_resultLineEndRow, 3);
|
||||
return _resultLineEndRow;
|
||||
}
|
||||
set { _resultLineEndRow = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 查找到的线的终点列坐标
|
||||
/// </summary>
|
||||
private HTuple _resultLineEndCol = 0;
|
||||
internal HTuple ResultLineEndCol
|
||||
{
|
||||
get
|
||||
{
|
||||
_resultLineEndCol = Math.Round((double)_resultLineEndCol, 3);
|
||||
return _resultLineEndCol;
|
||||
}
|
||||
set { _resultLineEndCol = value; }
|
||||
}
|
||||
/// <summary>
|
||||
/// 查找到线的方向
|
||||
/// </summary>
|
||||
private HTuple _angle = 0;
|
||||
internal HTuple Angle
|
||||
{
|
||||
get
|
||||
{
|
||||
_angle = Math.Round((double)_angle, 3);
|
||||
return _angle;
|
||||
}
|
||||
set { _angle = value; }
|
||||
}
|
||||
|
||||
public HObject inputImage { get; set; } = null;
|
||||
|
||||
public ToolRunStatu toolRunStatu { get; set; } = ToolRunStatu.Not_Run;
|
||||
}
|
||||
}
|
||||
67
CaliperTool/CaliperTool.csproj
Normal file
67
CaliperTool/CaliperTool.csproj
Normal file
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{AABF8D49-FA00-4E25-9410-4A573D48DAB1}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>CaliperTool</RootNamespace>
|
||||
<AssemblyName>CaliperTool</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="halcondotnet">
|
||||
<HintPath>C:\Program Files\MVTec\HALCON-19.05-Progress\bin\dotnet20\halcondotnet.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CaliperTool.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\CommonMethods\CommonHelper.csproj">
|
||||
<Project>{1C8D0DDC-2086-48A9-9586-F2B643E2FC54}</Project>
|
||||
<Name>CommonHelper</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\DataStruct\DataStruct.csproj">
|
||||
<Project>{DF3D4D4C-02DF-4F92-9FD4-0A861F64B0EF}</Project>
|
||||
<Name>DataStruct</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
BIN
CaliperTool/Properties/AssemblyInfo.cs
Normal file
BIN
CaliperTool/Properties/AssemblyInfo.cs
Normal file
Binary file not shown.
BIN
CaliperTool/bin/Debug/CaliperTool.dll
Normal file
BIN
CaliperTool/bin/Debug/CaliperTool.dll
Normal file
Binary file not shown.
BIN
CaliperTool/bin/Debug/CaliperTool.pdb
Normal file
BIN
CaliperTool/bin/Debug/CaliperTool.pdb
Normal file
Binary file not shown.
BIN
CaliperTool/bin/Debug/CommonMethods.dll
Normal file
BIN
CaliperTool/bin/Debug/CommonMethods.dll
Normal file
Binary file not shown.
BIN
CaliperTool/bin/Debug/CommonMethods.pdb
Normal file
BIN
CaliperTool/bin/Debug/CommonMethods.pdb
Normal file
Binary file not shown.
BIN
CaliperTool/bin/Debug/DataStruct.dll
Normal file
BIN
CaliperTool/bin/Debug/DataStruct.dll
Normal file
Binary file not shown.
BIN
CaliperTool/bin/Debug/DataStruct.pdb
Normal file
BIN
CaliperTool/bin/Debug/DataStruct.pdb
Normal file
Binary file not shown.
BIN
CaliperTool/bin/Debug/halcondotnet.dll
Normal file
BIN
CaliperTool/bin/Debug/halcondotnet.dll
Normal file
Binary file not shown.
61480
CaliperTool/bin/Debug/halcondotnet.xml
Normal file
61480
CaliperTool/bin/Debug/halcondotnet.xml
Normal file
File diff suppressed because it is too large
Load Diff
BIN
CaliperTool/obj/Debug/CaliperTool.csproj.FileListAbsolute.txt
Normal file
BIN
CaliperTool/obj/Debug/CaliperTool.csproj.FileListAbsolute.txt
Normal file
Binary file not shown.
Binary file not shown.
BIN
CaliperTool/obj/Debug/CaliperTool.dll
Normal file
BIN
CaliperTool/obj/Debug/CaliperTool.dll
Normal file
Binary file not shown.
BIN
CaliperTool/obj/Debug/CaliperTool.pdb
Normal file
BIN
CaliperTool/obj/Debug/CaliperTool.pdb
Normal file
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user