mirror of
https://github.com/eggplantlwj/VisionEdit.git
synced 2026-03-28 19:26:35 +08:00
增加查找线工具
This commit is contained in:
92
DataStruct/DataStruct.cs
Normal file
92
DataStruct/DataStruct.cs
Normal file
@@ -0,0 +1,92 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using HalconDotNet;
|
||||
|
||||
namespace DataStruct
|
||||
{
|
||||
public class DataStruct
|
||||
{
|
||||
/// <summary>
|
||||
/// XYU结果
|
||||
/// </summary>
|
||||
[Serializable]
|
||||
public class PosXYU
|
||||
{
|
||||
public double X;
|
||||
public double Y;
|
||||
public double U;
|
||||
/// <summary>
|
||||
/// 将XYU类型转化成格式化字符串
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
internal string ToFormatStr()
|
||||
{
|
||||
return (X >= 0 ? "+" + X.ToString("0000.000") : X.ToString("0000.000")) + "," + (Y >= 0 ? "+" + Y.ToString("0000.000") : Y.ToString("0000.000")) + "," + (U >= 0 ? "+" + U.ToString("0000.000") : U.ToString("0000.000"));
|
||||
}
|
||||
internal string ToShowTip()
|
||||
{
|
||||
return X.ToString() + " | " + Y.ToString() + " | " + U.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Line
|
||||
{
|
||||
public Point StartPoint;
|
||||
public Point EndPoint;
|
||||
internal string ToShowTip()
|
||||
{
|
||||
return StartPoint.Row.ToString() + " | " + StartPoint.Col.ToString() + " | " + EndPoint.Row.ToString() + " | " + EndPoint.Col.ToString();
|
||||
}
|
||||
private HTuple _angle;
|
||||
public double Angle
|
||||
{
|
||||
get
|
||||
{
|
||||
HOperatorSet.AngleLx(StartPoint.Row, StartPoint.Col, EndPoint.Row, EndPoint.Col, out _angle);
|
||||
return _angle;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class Point
|
||||
{
|
||||
public Point() { }
|
||||
public Point(double x, double y)
|
||||
{
|
||||
this.Row = x;
|
||||
this.Col = y;
|
||||
}
|
||||
public double Row;
|
||||
public double Col;
|
||||
/// <summary>
|
||||
/// 重写 -
|
||||
/// </summary>
|
||||
/// <param name="p1">点1</param>
|
||||
/// <param name="p2">点2</param>
|
||||
/// <returns></returns>
|
||||
public static Point operator -(Point p1, Point p2)
|
||||
{
|
||||
return new Point(p1.Row - p2.Row, p1.Col - p2.Col);
|
||||
}
|
||||
/// <summary>
|
||||
/// 获得点矢量长度
|
||||
/// </summary>
|
||||
public double GetDistance
|
||||
{
|
||||
get
|
||||
{
|
||||
return Math.Sqrt(Row * Row + Col * Col);
|
||||
}
|
||||
}
|
||||
public string ToShowTip()
|
||||
{
|
||||
return Row.ToString() + " | " + Col.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
57
DataStruct/DataStruct.csproj
Normal file
57
DataStruct/DataStruct.csproj
Normal file
@@ -0,0 +1,57 @@
|
||||
<?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>{DF3D4D4C-02DF-4F92-9FD4-0A861F64B0EF}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DataStruct</RootNamespace>
|
||||
<AssemblyName>DataStruct</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="DataStruct.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</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
DataStruct/Properties/AssemblyInfo.cs
Normal file
BIN
DataStruct/Properties/AssemblyInfo.cs
Normal file
Binary file not shown.
BIN
DataStruct/bin/Debug/DataStruct.dll
Normal file
BIN
DataStruct/bin/Debug/DataStruct.dll
Normal file
Binary file not shown.
BIN
DataStruct/bin/Debug/DataStruct.pdb
Normal file
BIN
DataStruct/bin/Debug/DataStruct.pdb
Normal file
Binary file not shown.
BIN
DataStruct/bin/Debug/halcondotnet.dll
Normal file
BIN
DataStruct/bin/Debug/halcondotnet.dll
Normal file
Binary file not shown.
61480
DataStruct/bin/Debug/halcondotnet.xml
Normal file
61480
DataStruct/bin/Debug/halcondotnet.xml
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,6 @@
|
||||
F:\VSCode\VisionEditTest\DataStruct\bin\Debug\DataStruct.dll
|
||||
F:\VSCode\VisionEditTest\DataStruct\bin\Debug\DataStruct.pdb
|
||||
F:\VSCode\VisionEditTest\DataStruct\bin\Debug\halcondotnet.dll
|
||||
F:\VSCode\VisionEditTest\DataStruct\bin\Debug\halcondotnet.xml
|
||||
F:\VSCode\VisionEditTest\DataStruct\obj\Debug\DataStruct.dll
|
||||
F:\VSCode\VisionEditTest\DataStruct\obj\Debug\DataStruct.pdb
|
||||
BIN
DataStruct/obj/Debug/DataStruct.dll
Normal file
BIN
DataStruct/obj/Debug/DataStruct.dll
Normal file
Binary file not shown.
BIN
DataStruct/obj/Debug/DataStruct.pdb
Normal file
BIN
DataStruct/obj/Debug/DataStruct.pdb
Normal file
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user