Commit 6cf73433 张士柳

1 个父辈 2fc4e743
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="EyemLib.cs" /> <Compile Include="EyemLib.cs" />
<Compile Include="EyemLib.DotNet.cs" />
<Compile Include="EyemLibDemo.cs" /> <Compile Include="EyemLibDemo.cs" />
<Compile Include="log4cpp\ILog4CPP.cs" /> <Compile Include="log4cpp\ILog4CPP.cs" />
<Compile Include="log4cpp\Log4CPPBase.cs" /> <Compile Include="log4cpp\Log4CPPBase.cs" />
......

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.32602.291
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eyemLib.Control", "eyemLib.Control\eyemLib.Control.csproj", "{E46DBA02-311F-417A-9221-6F4172498595}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eyemLib.Control.Test", "eyemLib.Control.Test\eyemLib.Control.Test.csproj", "{73B3D8D8-0703-4DB8-8266-053D840BDACE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{E46DBA02-311F-417A-9221-6F4172498595}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release|Any CPU.Build.0 = Release|Any CPU
{73B3D8D8-0703-4DB8-8266-053D840BDACE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{73B3D8D8-0703-4DB8-8266-053D840BDACE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{73B3D8D8-0703-4DB8-8266-053D840BDACE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{73B3D8D8-0703-4DB8-8266-053D840BDACE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {862264CB-71CB-486C-B0FE-8E6FCDB50BB6}
EndGlobalSection
EndGlobal
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file \ No newline at end of file
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("eyemLib.Control")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("eyemLib.Control")]
[assembly: AssemblyCopyright("Copyright © 2022")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 将 ComVisible 设置为 false 会使此程序集中的类型
//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型
//请将此类型的 ComVisible 特性设置为 true。
[assembly: ComVisible(false)]
// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID
[assembly: Guid("e46dba02-311f-417a-9221-6f4172498595")]
// 程序集的版本信息由下列四个值组成:
//
// 主版本
// 次版本
// 生成号
// 修订号
//
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值
//通过使用 "*",如下所示:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" 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>{E46DBA02-311F-417A-9221-6F4172498595}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>eyemLib.Control</RootNamespace>
<AssemblyName>eyemLib.Control</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<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.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Histogram.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Service Include="{94E38DFF-614B-4cbd-B67C-F211BB35CE8B}" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Histogram.resx">
<DependentUpon>Histogram.cs</DependentUpon>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file \ No newline at end of file
 
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14 # Visual Studio Version 16
VisualStudioVersion = 14.0.23107.0 VisualStudioVersion = 16.0.32602.291
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eyemLib", "eyemLib\eyemLib.vcxproj", "{33D5F550-C799-4B05-8E14-ACA390DF5442}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eyemLib", "eyemLib\eyemLib.vcxproj", "{33D5F550-C799-4B05-8E14-ACA390DF5442}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eyemLib-Sharp", "eyemLib-Sharp\eyemLib-Sharp.csproj", "{C5284403-D4FD-4D83-BBAE-7A4020F1C01F}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eyemLib-Sharp", "eyemLib-Sharp\eyemLib-Sharp.csproj", "{C5284403-D4FD-4D83-BBAE-7A4020F1C01F}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject
{E46DBA02-311F-417A-9221-6F4172498595} = {E46DBA02-311F-417A-9221-6F4172498595}
{33D5F550-C799-4B05-8E14-ACA390DF5442} = {33D5F550-C799-4B05-8E14-ACA390DF5442} {33D5F550-C799-4B05-8E14-ACA390DF5442} = {33D5F550-C799-4B05-8E14-ACA390DF5442}
EndProjectSection EndProjectSection
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "eyemLib.Control", "eyemLib.Control\eyemLib.Control\eyemLib.Control.csproj", "{E46DBA02-311F-417A-9221-6F4172498595}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug_V455|Any CPU = Debug_V455|Any CPU Debug_V455|Any CPU = Debug_V455|Any CPU
...@@ -84,8 +87,41 @@ Global ...@@ -84,8 +87,41 @@ Global
{C5284403-D4FD-4D83-BBAE-7A4020F1C01F}.Release|x64.Build.0 = Release|Any CPU {C5284403-D4FD-4D83-BBAE-7A4020F1C01F}.Release|x64.Build.0 = Release|Any CPU
{C5284403-D4FD-4D83-BBAE-7A4020F1C01F}.Release|x86.ActiveCfg = Release|Any CPU {C5284403-D4FD-4D83-BBAE-7A4020F1C01F}.Release|x86.ActiveCfg = Release|Any CPU
{C5284403-D4FD-4D83-BBAE-7A4020F1C01F}.Release|x86.Build.0 = Release|Any CPU {C5284403-D4FD-4D83-BBAE-7A4020F1C01F}.Release|x86.Build.0 = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Debug_V455|Any CPU.ActiveCfg = Debug|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Debug_V455|Any CPU.Build.0 = Debug|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Debug_V455|x64.ActiveCfg = Debug|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Debug_V455|x64.Build.0 = Debug|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Debug_V455|x86.ActiveCfg = Debug|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Debug_V455|x86.Build.0 = Debug|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Debug|x64.ActiveCfg = Debug|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Debug|x64.Build.0 = Debug|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Debug|x86.ActiveCfg = Debug|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Debug|x86.Build.0 = Debug|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release_V420Qisda|Any CPU.ActiveCfg = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release_V420Qisda|Any CPU.Build.0 = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release_V420Qisda|x64.ActiveCfg = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release_V420Qisda|x64.Build.0 = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release_V420Qisda|x86.ActiveCfg = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release_V420Qisda|x86.Build.0 = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release_V455|Any CPU.ActiveCfg = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release_V455|Any CPU.Build.0 = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release_V455|x64.ActiveCfg = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release_V455|x64.Build.0 = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release_V455|x86.ActiveCfg = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release_V455|x86.Build.0 = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release|Any CPU.Build.0 = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release|x64.ActiveCfg = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release|x64.Build.0 = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release|x86.ActiveCfg = Release|Any CPU
{E46DBA02-311F-417A-9221-6F4172498595}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {06C492F5-AFB7-4B87-B91B-86076725DE66}
EndGlobalSection
EndGlobal EndGlobal
...@@ -8,28 +8,131 @@ ...@@ -8,28 +8,131 @@
#include "opencv2/dnn.hpp" #include "opencv2/dnn.hpp"
#include "opencv2/imgproc.hpp" #include "opencv2/imgproc.hpp"
class AZONNXWrapper class AZONNXWrapper
{ {
public: public:
AZONNXWrapper(); AZONNXWrapper();
~AZONNXWrapper(); ~AZONNXWrapper();
int init(const std::string& model_path); int init(const std::string& model_path);
float* forward(cv::Mat img, cv::Scalar mean, cv::Scalar std); float* forward(cv::Mat& img, cv::Scalar& mean, cv::Scalar& std); //ResNet18提取特征[1,512]
void forward(cv::Mat& img, cv::Mat& labels, cv::Mat& stats, cv::Mat& drawResult, cv::Scalar& mean, cv::Scalar& std); //Yolact实例分割
void forward(cv::Mat& img); //YOLOV7
void setInputParams(float, float, int);
private: private:
int targetSize = 550;
float fConfThreshold = 0.5; float fNmsThreshold = 0.5; int top_k = 200;
float* predictions = new float[512]; float* predictions = new float[512];
cv::dnn::Net net_; cv::dnn::Net net_;
};
class AZONNXWrapperEx const unsigned char colors[81][3] = {
{ {0, 255, 0},
public: {226, 255, 0},
AZONNXWrapperEx(); {0, 94, 255},
~AZONNXWrapperEx(); {0, 37, 255},
int init(const std::string& model_path); {0, 255, 94},
cv::Mat forward(cv::Mat& img); {255, 226, 0},
private: {0, 18, 255},
cv::dnn::Net net_; {255, 151, 0},
{170, 0, 255},
{0, 255, 56},
{255, 0, 75},
{0, 75, 255},
{0, 255, 169},
{255, 0, 207},
{75, 255, 0},
{207, 0, 255},
{37, 0, 255},
{0, 207, 255},
{94, 0, 255},
{0, 255, 113},
{255, 18, 0},
{255, 0, 56},
{18, 0, 255},
{0, 255, 226},
{170, 255, 0},
{255, 0, 245},
{151, 255, 0},
{132, 255, 0},
{75, 0, 255},
{151, 0, 255},
{0, 151, 255},
{132, 0, 255},
{0, 255, 245},
{255, 132, 0},
{226, 0, 255},
{255, 37, 0},
{207, 255, 0},
{0, 255, 207},
{94, 255, 0},
{0, 226, 255},
{56, 255, 0},
{255, 94, 0},
{255, 113, 0},
{0, 132, 255},
{255, 0, 132},
{255, 170, 0},
{255, 0, 188},
{113, 255, 0},
{245, 0, 255},
{113, 0, 255},
{255, 188, 0},
{0, 113, 255},
{255, 0, 0},
{0, 56, 255},
{255, 0, 113},
{0, 255, 188},
{255, 0, 94},
{255, 0, 18},
{18, 255, 0},
{0, 255, 132},
{0, 188, 255},
{0, 245, 255},
{0, 169, 255},
{37, 255, 0},
{255, 0, 151},
{188, 0, 255},
{0, 255, 37},
{0, 255, 0},
{255, 0, 170},
{255, 0, 37},
{255, 75, 0},
{0, 0, 255},
{255, 207, 0},
{255, 0, 226},
{255, 245, 0},
{188, 255, 0},
{0, 255, 18},
{0, 255, 75},
{0, 255, 151},
{255, 56, 0},
{245, 255, 0}
};
std::vector<std::string> class_namesd = { "background",
"barcode", "bicycle", "car", "motorcycle", "airplane", "bus",
"train", "truck", "boat", "traffic light", "fire hydrant",
"stop sign", "parking meter", "bench", "bird", "cat", "dog",
"horse", "sheep", "cow", "elephant", "bear", "zebra", "giraffe",
"backpack", "umbrella", "handbag", "tie", "suitcase", "frisbee",
"skis", "snowboard", "sports ball", "kite", "baseball bat",
"baseball glove", "skateboard", "surfboard", "tennis racket",
"bottle", "wine glass", "cup", "fork", "knife", "spoon", "bowl",
"banana", "apple", "sandwich", "orange", "broccoli", "carrot",
"hot dog", "pizza", "donut", "cake", "chair", "couch",
"potted plant", "bed", "dining table", "toilet", "tv", "laptop",
"mouse", "remote", "keyboard", "cell phone", "microwave", "oven",
"toaster", "sink", "refrigerator", "book", "clock", "vase",
"scissors", "teddy bear", "hair drier", "toothbrush"
};
protected:
const int conv_ws[5] = { 69, 35, 18, 9, 5 };
const int conv_hs[5] = { 69, 35, 18, 9, 5 };
const float aspect_ratios[3] = { 1.f, 0.5f, 2.f };
const float scales[5] = { 24.f, 48.f, 96.f, 192.f, 384.f };
const float var[4] = { 0.1f, 0.1f, 0.2f, 0.2f };
const int mask_h = 138;
const int mask_w = 138;
const float netAnchors[3][6] = { {12, 16, 19, 36, 40, 28},{36, 75, 76, 55, 72, 146},{142, 110, 192, 243, 459, 401} };//YOLOV7-P5
float* priorbox = NULL;
}; };
#endif/* __AZONNXWRAPPER_H */ #endif/* __AZONNXWRAPPER_H */
...@@ -7,5 +7,6 @@ ...@@ -7,5 +7,6 @@
#include "eyemLib.h" #include "eyemLib.h"
int eyemEdge1dFindLineInner(cv::Mat& image, EyemOcsDXY tpLineSt, EyemOcsDXY tpLineEd, int iCapLength, int iCapWidth, int nCalipers, int nFilterSize, int iSearchDirec, double dAmpThreshold, const char* ccTransition, std::vector<EyemOcsDXY>& hObject);
#endif/* __EYEM_EDGE1D_H */ #endif/* __EYEM_EDGE1D_H */
\ No newline at end of file \ No newline at end of file
...@@ -5,7 +5,7 @@ public: ...@@ -5,7 +5,7 @@ public:
Impl() {} Impl() {}
~Impl() {} ~Impl() {}
//ȡ //ȡ
std::vector<float> forward(const cv::Mat& img, cv::Scalar mean, cv::Scalar std); std::vector<float> forward(cv::Mat& img, cv::Scalar mean, cv::Scalar std);
//ȡ //ȡ
std::shared_ptr<AZONNXWrapper> extractor_; std::shared_ptr<AZONNXWrapper> extractor_;
}; };
...@@ -28,7 +28,7 @@ std::vector<float> Extractor::extract(cv::InputArray img) ...@@ -28,7 +28,7 @@ std::vector<float> Extractor::extract(cv::InputArray img)
} }
std::vector<float> Extractor::Impl::forward(const cv::Mat& img, cv::Scalar mean, cv::Scalar std) std::vector<float> Extractor::Impl::forward(cv::Mat& img, cv::Scalar mean, cv::Scalar std)
{ {
std::vector<float> predictions(512); std::vector<float> predictions(512);
float* outputs = extractor_->forward(img, mean, std); float* outputs = extractor_->forward(img, mean, std);
......
...@@ -10,7 +10,7 @@ void eyemFreeMemBlock(void* block) ...@@ -10,7 +10,7 @@ void eyemFreeMemBlock(void* block)
free(block); free(block);
} }
int eyemImageRead(const char *fileName, int iFlag, EyemImage *tpImage) int eyemImageRead(const char* fileName, int iFlag, EyemImage* tpImage)
{ {
cv::Mat _src = cv::imread(fileName, iFlag); cv::Mat _src = cv::imread(fileName, iFlag);
if (_src.empty()) if (_src.empty())
...@@ -25,55 +25,55 @@ int eyemImageRead(const char *fileName, int iFlag, EyemImage *tpImage) ...@@ -25,55 +25,55 @@ int eyemImageRead(const char *fileName, int iFlag, EyemImage *tpImage)
//图像信息 //图像信息
tpImage->iWidth = _src.cols; tpImage->iHeight = _src.rows; tpImage->iDepth = _src.depth(); tpImage->iChannels = _src.channels(); tpImage->iWidth = _src.cols; tpImage->iHeight = _src.rows; tpImage->iDepth = _src.depth(); tpImage->iChannels = _src.channels();
//内存尺寸 //内存尺寸
int _Size = tpImage->iWidth*tpImage->iHeight*tpImage->iChannels; int _Size = tpImage->iWidth * tpImage->iHeight * tpImage->iChannels;
//申请内存 //申请内存
switch (tpImage->iDepth) switch (tpImage->iDepth)
{ {
case CV_8U: case CV_8U:
_Size *= sizeof(uint8_t); _Size *= sizeof(uint8_t);
tpImage->vpImage = (uint8_t *)malloc(_Size); tpImage->vpImage = (uint8_t*)malloc(_Size);
if (NULL == tpImage->vpImage) if (NULL == tpImage->vpImage)
return FUNC_NOT_ENOUGH_MEM; return FUNC_NOT_ENOUGH_MEM;
memset(tpImage->vpImage, 0, _Size); memset(tpImage->vpImage, 0, _Size);
break; break;
case CV_8S: case CV_8S:
_Size *= sizeof(int8_t); _Size *= sizeof(int8_t);
tpImage->vpImage = (int8_t *)malloc(_Size); tpImage->vpImage = (int8_t*)malloc(_Size);
if (NULL == tpImage->vpImage) if (NULL == tpImage->vpImage)
return FUNC_NOT_ENOUGH_MEM; return FUNC_NOT_ENOUGH_MEM;
memset(tpImage->vpImage, 0, _Size); memset(tpImage->vpImage, 0, _Size);
break; break;
case CV_16U: case CV_16U:
_Size *= sizeof(uint16_t); _Size *= sizeof(uint16_t);
tpImage->vpImage = (uint16_t *)malloc(_Size); tpImage->vpImage = (uint16_t*)malloc(_Size);
if (NULL == tpImage->vpImage) if (NULL == tpImage->vpImage)
return FUNC_NOT_ENOUGH_MEM; return FUNC_NOT_ENOUGH_MEM;
memset(tpImage->vpImage, 0, _Size); memset(tpImage->vpImage, 0, _Size);
break; break;
case CV_16S: case CV_16S:
_Size *= sizeof(int16_t); _Size *= sizeof(int16_t);
tpImage->vpImage = (int16_t *)malloc(_Size); tpImage->vpImage = (int16_t*)malloc(_Size);
if (NULL == tpImage->vpImage) if (NULL == tpImage->vpImage)
return FUNC_NOT_ENOUGH_MEM; return FUNC_NOT_ENOUGH_MEM;
memset(tpImage->vpImage, 0, _Size); memset(tpImage->vpImage, 0, _Size);
break; break;
case CV_32S: case CV_32S:
_Size *= sizeof(int32_t); _Size *= sizeof(int32_t);
tpImage->vpImage = (int32_t *)malloc(_Size); tpImage->vpImage = (int32_t*)malloc(_Size);
if (NULL == tpImage->vpImage) if (NULL == tpImage->vpImage)
return FUNC_NOT_ENOUGH_MEM; return FUNC_NOT_ENOUGH_MEM;
memset(tpImage->vpImage, 0, _Size); memset(tpImage->vpImage, 0, _Size);
break; break;
case CV_32F: case CV_32F:
_Size *= sizeof(float_t); _Size *= sizeof(float_t);
tpImage->vpImage = (float_t *)malloc(_Size); tpImage->vpImage = (float_t*)malloc(_Size);
if (NULL == tpImage->vpImage) if (NULL == tpImage->vpImage)
return FUNC_NOT_ENOUGH_MEM; return FUNC_NOT_ENOUGH_MEM;
memset(tpImage->vpImage, 0, _Size); memset(tpImage->vpImage, 0, _Size);
break; break;
case CV_64F: case CV_64F:
_Size *= sizeof(double_t); _Size *= sizeof(double_t);
tpImage->vpImage = (double_t *)malloc(_Size); tpImage->vpImage = (double_t*)malloc(_Size);
if (NULL == tpImage->vpImage) if (NULL == tpImage->vpImage)
return FUNC_NOT_ENOUGH_MEM; return FUNC_NOT_ENOUGH_MEM;
memset(tpImage->vpImage, 0, _Size); memset(tpImage->vpImage, 0, _Size);
...@@ -87,30 +87,30 @@ int eyemImageRead(const char *fileName, int iFlag, EyemImage *tpImage) ...@@ -87,30 +87,30 @@ int eyemImageRead(const char *fileName, int iFlag, EyemImage *tpImage)
return FUNC_OK; return FUNC_OK;
} }
int eyemImageReadRaw(const char *filename, int iWidth, int iHeight, int iDepth, EyemImage *tpImage) int eyemImageReadRaw(const char* filename, int iWidth, int iHeight, int iDepth, EyemImage* tpImage)
{ {
if (std::strlen(filename) == 0) if (std::strlen(filename) == 0)
return FUNC_IMAGE_NOT_EXIST; return FUNC_IMAGE_NOT_EXIST;
// //
//tpImage->iChannels = 1; tpImage->iDepth = 2; tpImage->iWidth = iWidth; tpImage->iHeight = iHeight; //tpImage->iChannels = 1; tpImage->iDepth = 2; tpImage->iWidth = iWidth; tpImage->iHeight = iHeight;
FILE *fp = fopen(filename, "rb+"); FILE* fp = fopen(filename, "rb+");
if (NULL != fp) if (NULL != fp)
{ {
switch (iDepth) switch (iDepth)
{ {
case CV_8U: case CV_8U:
tpImage->vpImage = (uint8_t *)malloc(iWidth*iHeight * sizeof(uint8_t)); tpImage->vpImage = (uint8_t*)malloc(iWidth * iHeight * sizeof(uint8_t));
if (NULL == tpImage->vpImage) if (NULL == tpImage->vpImage)
return FUNC_NOT_ENOUGH_MEM; return FUNC_NOT_ENOUGH_MEM;
memset(tpImage->vpImage, 0, iWidth*iHeight * sizeof(uint8_t)); memset(tpImage->vpImage, 0, iWidth * iHeight * sizeof(uint8_t));
fread(tpImage->vpImage, sizeof(uint8_t), iWidth*iHeight, fp); fread(tpImage->vpImage, sizeof(uint8_t), iWidth * iHeight, fp);
break; break;
case CV_16U: case CV_16U:
tpImage->vpImage = (uint16_t *)malloc(iWidth*iHeight * sizeof(uint16_t)); tpImage->vpImage = (uint16_t*)malloc(iWidth * iHeight * sizeof(uint16_t));
if (NULL == tpImage->vpImage) if (NULL == tpImage->vpImage)
return FUNC_NOT_ENOUGH_MEM; return FUNC_NOT_ENOUGH_MEM;
memset(tpImage->vpImage, 0, iWidth*iHeight * sizeof(uint16_t)); memset(tpImage->vpImage, 0, iWidth * iHeight * sizeof(uint16_t));
fread(tpImage->vpImage, sizeof(uint16_t), iWidth*iHeight, fp); fread(tpImage->vpImage, sizeof(uint16_t), iWidth * iHeight, fp);
break; break;
default: default:
//不支持位深度 //不支持位深度
...@@ -124,7 +124,7 @@ int eyemImageReadRaw(const char *filename, int iWidth, int iHeight, int iDepth, ...@@ -124,7 +124,7 @@ int eyemImageReadRaw(const char *filename, int iWidth, int iHeight, int iDepth,
return FUNC_OK; return FUNC_OK;
} }
int eyemImageFromBitmap(void *vpScan0, int iWidth, int iHeight, int iDepth, int iChannels, EyemImage *tpImage) int eyemImageFromBitmap(void* vpScan0, int iWidth, int iHeight, int iDepth, int iChannels, EyemImage* tpImage)
{ {
cv::Mat image = cv::Mat(iHeight, iWidth, MAKETYPE(iDepth, iChannels), vpScan0).clone(); cv::Mat image = cv::Mat(iHeight, iWidth, MAKETYPE(iDepth, iChannels), vpScan0).clone();
//在这里重新创建 //在这里重新创建
...@@ -136,9 +136,9 @@ int eyemImageFromBitmap(void *vpScan0, int iWidth, int iHeight, int iDepth, int ...@@ -136,9 +136,9 @@ int eyemImageFromBitmap(void *vpScan0, int iWidth, int iHeight, int iDepth, int
//图像信息 //图像信息
tpImage->iWidth = image.cols; tpImage->iHeight = image.rows; tpImage->iDepth = image.depth(); tpImage->iChannels = image.channels(); tpImage->iWidth = image.cols; tpImage->iHeight = image.rows; tpImage->iDepth = image.depth(); tpImage->iChannels = image.channels();
//内存尺寸 //内存尺寸
int _Size = tpImage->iWidth*tpImage->iHeight*tpImage->iChannels * sizeof(uint8_t); int _Size = tpImage->iWidth * tpImage->iHeight * tpImage->iChannels * sizeof(uint8_t);
//分配内存 //分配内存
tpImage->vpImage = (uint8_t *)malloc(_Size); tpImage->vpImage = (uint8_t*)malloc(_Size);
if (NULL == tpImage->vpImage) if (NULL == tpImage->vpImage)
return FUNC_NOT_ENOUGH_MEM; return FUNC_NOT_ENOUGH_MEM;
memset(tpImage->vpImage, 0, _Size); memset(tpImage->vpImage, 0, _Size);
...@@ -147,80 +147,75 @@ int eyemImageFromBitmap(void *vpScan0, int iWidth, int iHeight, int iDepth, int ...@@ -147,80 +147,75 @@ int eyemImageFromBitmap(void *vpScan0, int iWidth, int iHeight, int iDepth, int
return FUNC_OK; return FUNC_OK;
} }
int eyemVideoCapture(const char *fileName, IntPtr *hObject, EyemImage **tpImages, int *ipNum) int eyemVideoCapture(const char* fileName, IntPtr* hObject, EyemImage** tpImages, int* ipNum)
{ {
cv::VideoCapture cap; cv::VideoCapture cap;
cap.open(fileName); cap.open(fileName);
if (!cap.isOpened()) if (!cap.isOpened())
return FUNC_CANNOT_CALC; return FUNC_CANNOT_CALC;
int totalFrmNum = (int)cap.get(cv::CAP_PROP_FRAME_COUNT); int totalFrmNum = (int)cap.get(cv::CAP_PROP_FRAME_COUNT);
std::vector<EyemImage>* pFrames = new std::vector<EyemImage>();
std::vector<EyemImage> *pFrames = new std::vector<EyemImage>();
cv::Mat nextImg; cv::Mat nextImg;
while (true) while (true)
{ {
cap >> nextImg; cap >> nextImg;
if (nextImg.empty()) if (nextImg.empty())
break; break;
//图像信息 //图像信息
EyemImage tpImage; EyemImage tpImage;
tpImage.iWidth = nextImg.cols; tpImage.iHeight = nextImg.rows; tpImage.iDepth = nextImg.depth(); tpImage.iChannels = nextImg.channels(); tpImage.iWidth = nextImg.cols; tpImage.iHeight = nextImg.rows; tpImage.iDepth = nextImg.depth(); tpImage.iChannels = nextImg.channels();
//内存尺寸 //内存尺寸
int _Size = tpImage.iWidth*tpImage.iHeight*tpImage.iChannels; int _Size = tpImage.iWidth * tpImage.iHeight * tpImage.iChannels;
//需要申请内存 //需要申请内存
switch (tpImage.iDepth) switch (tpImage.iDepth)
{ {
case CV_8U: case CV_8U:
_Size *= sizeof(uint8_t); _Size *= sizeof(uint8_t);
tpImage.vpImage = (uint8_t *)malloc(_Size); tpImage.vpImage = (uint8_t*)malloc(_Size);
if (NULL == tpImage.vpImage) if (NULL == tpImage.vpImage)
return FUNC_NOT_ENOUGH_MEM; return FUNC_NOT_ENOUGH_MEM;
memset(tpImage.vpImage, 0, _Size); memset(tpImage.vpImage, 0, _Size);
break; break;
case CV_8S: case CV_8S:
_Size *= sizeof(int8_t); _Size *= sizeof(int8_t);
tpImage.vpImage = (int8_t *)malloc(_Size); tpImage.vpImage = (int8_t*)malloc(_Size);
if (NULL == tpImage.vpImage) if (NULL == tpImage.vpImage)
return FUNC_NOT_ENOUGH_MEM; return FUNC_NOT_ENOUGH_MEM;
memset(tpImage.vpImage, 0, _Size); memset(tpImage.vpImage, 0, _Size);
break; break;
case CV_16U: case CV_16U:
_Size *= sizeof(uint16_t); _Size *= sizeof(uint16_t);
tpImage.vpImage = (uint16_t *)malloc(_Size); tpImage.vpImage = (uint16_t*)malloc(_Size);
if (NULL == tpImage.vpImage) if (NULL == tpImage.vpImage)
return FUNC_NOT_ENOUGH_MEM; return FUNC_NOT_ENOUGH_MEM;
memset(tpImage.vpImage, 0, _Size); memset(tpImage.vpImage, 0, _Size);
break; break;
case CV_16S: case CV_16S:
_Size *= sizeof(int16_t); _Size *= sizeof(int16_t);
tpImage.vpImage = (int16_t *)malloc(_Size); tpImage.vpImage = (int16_t*)malloc(_Size);
if (NULL == tpImage.vpImage) if (NULL == tpImage.vpImage)
return FUNC_NOT_ENOUGH_MEM; return FUNC_NOT_ENOUGH_MEM;
memset(tpImage.vpImage, 0, _Size); memset(tpImage.vpImage, 0, _Size);
break; break;
case CV_32S: case CV_32S:
_Size *= sizeof(int32_t); _Size *= sizeof(int32_t);
tpImage.vpImage = (int32_t *)malloc(_Size); tpImage.vpImage = (int32_t*)malloc(_Size);
if (NULL == tpImage.vpImage) if (NULL == tpImage.vpImage)
return FUNC_NOT_ENOUGH_MEM; return FUNC_NOT_ENOUGH_MEM;
memset(tpImage.vpImage, 0, _Size); memset(tpImage.vpImage, 0, _Size);
break; break;
case CV_32F: case CV_32F:
_Size *= sizeof(float_t); _Size *= sizeof(float_t);
tpImage.vpImage = (float_t *)malloc(_Size); tpImage.vpImage = (float_t*)malloc(_Size);
if (NULL == tpImage.vpImage) if (NULL == tpImage.vpImage)
return FUNC_NOT_ENOUGH_MEM; return FUNC_NOT_ENOUGH_MEM;
memset(tpImage.vpImage, 0, _Size); memset(tpImage.vpImage, 0, _Size);
break; break;
case CV_64F: case CV_64F:
_Size *= sizeof(double_t); _Size *= sizeof(double_t);
tpImage.vpImage = (double_t *)malloc(_Size); tpImage.vpImage = (double_t*)malloc(_Size);
if (NULL == tpImage.vpImage) if (NULL == tpImage.vpImage)
return FUNC_NOT_ENOUGH_MEM; return FUNC_NOT_ENOUGH_MEM;
memset(tpImage.vpImage, 0, _Size); memset(tpImage.vpImage, 0, _Size);
...@@ -238,7 +233,6 @@ int eyemVideoCapture(const char *fileName, IntPtr *hObject, EyemImage **tpImages ...@@ -238,7 +233,6 @@ int eyemVideoCapture(const char *fileName, IntPtr *hObject, EyemImage **tpImages
*tpImages = pFrames->data(); *tpImages = pFrames->data();
*ipNum = static_cast<int>(pFrames->size()); *ipNum = static_cast<int>(pFrames->size());
*hObject = reinterpret_cast<IntPtr>(pFrames); *hObject = reinterpret_cast<IntPtr>(pFrames);
return FUNC_OK; return FUNC_OK;
} }
...@@ -247,11 +241,11 @@ bool eyemVideoCaptureFree(IntPtr hObject) ...@@ -247,11 +241,11 @@ bool eyemVideoCaptureFree(IntPtr hObject)
if (NULL == hObject) if (NULL == hObject)
return true; return true;
std::vector<EyemImage> *tpImages = reinterpret_cast<std::vector<EyemImage>*>(hObject); std::vector<EyemImage>* tpImages = reinterpret_cast<std::vector<EyemImage>*>(hObject);
for (std::vector<EyemImage>::iterator it = tpImages->begin(); it != tpImages->end(); ++it) for (std::vector<EyemImage>::iterator it = tpImages->begin(); it != tpImages->end(); ++it)
{ {
EyemImage *tpImage = &(*it); EyemImage* tpImage = &(*it);
tpImage->iWidth = tpImage->iHeight = tpImage->iDepth = tpImage->iChannels = 0; tpImage->iWidth = tpImage->iHeight = tpImage->iDepth = tpImage->iChannels = 0;
free(tpImage->vpImage), tpImage->vpImage = NULL; free(tpImage->vpImage), tpImage->vpImage = NULL;
} }
...@@ -263,7 +257,45 @@ bool eyemVideoCaptureFree(IntPtr hObject) ...@@ -263,7 +257,45 @@ bool eyemVideoCaptureFree(IntPtr hObject)
return true; return true;
} }
void eyemImageFree(EyemImage &tpImage) void eyemNamedWindow(const char* winName)
{
cv::namedWindow(winName, cv::WINDOW_NORMAL);
}
void eyemDestroyAllWindows()
{
cv::destroyAllWindows();
}
void eyemImshow(const char* winName, EyemImage& tpImage)
{
CV_Assert(NULL != tpImage.vpImage);
cv::Mat _src = cv::Mat(tpImage.iHeight, tpImage.iWidth, MAKETYPE(tpImage.iDepth, tpImage.iChannels), tpImage.vpImage).clone();
cv::imshow(winName, _src);
}
void eyemWaitkey()
{
cv::waitKey(0);
}
void eyemDrawHistogramImage(EyemImage tpImage, EyemImage* tpDstImg, int color[3], int mean_color[3], const bool isDrawGrid, const bool isDrawStats, const int normValue)
{
cv::Mat image = cv::Mat(tpImage.iHeight, tpImage.iWidth, MAKETYPE(tpImage.iDepth, tpImage.iChannels), tpImage.vpImage).clone();
if (image.empty()) {
return;
}
cv::Mat src;
int incn = image.channels();
if (incn > 1) {
cv::cvtColor(image, src, cv::COLOR_BGR2GRAY);
}
else{
image.copyTo(src);
}
}
void eyemImageFree(EyemImage& tpImage)
{ {
tpImage.iWidth = tpImage.iHeight = tpImage.iDepth = tpImage.iChannels = 0; tpImage.iWidth = tpImage.iHeight = tpImage.iDepth = tpImage.iChannels = 0;
//释放 //释放
......
此文件类型无法预览
...@@ -170,4 +170,9 @@ ...@@ -170,4 +170,9 @@
<Filter>资源文件</Filter> <Filter>资源文件</Filter>
</ResourceCompile> </ResourceCompile>
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Include="eyemLib.def">
<Filter>源文件</Filter>
</None>
</ItemGroup>
</Project> </Project>
\ No newline at end of file \ No newline at end of file
此文件的差异太大,无法显示。
...@@ -18,51 +18,55 @@ extern double processLevel; ...@@ -18,51 +18,55 @@ extern double processLevel;
extern double fineTuning; extern double fineTuning;
extern std::map<std::string, EyemImage> imageMap; extern std::map<std::string, EyemImage> imageMap;
class PreSegtor {
public:
PreSegtor(const std::string& model_path);
PreSegtor() {};
//设置检测参数
cv::Mat extract(cv::InputArray img);
protected: #ifdef _V455
class Impl; //class PreSegtor {
cv::Ptr<Impl> p; //public:
}; // PreSegtor(const std::string& model_path);
// PreSegtor() {};
class PreSegtor::Impl { // //设置检测参数
public: // cv::Mat extract(cv::InputArray img);
Impl() {} //
~Impl() {} //protected:
//提取 // class Impl;
cv::Mat forward(cv::Mat& img); // cv::Ptr<Impl> p;
//特征提取器 //};
std::shared_ptr<AZONNXWrapperEx> extractor_; //
}; //class PreSegtor::Impl {
//public:
PreSegtor::PreSegtor(const std::string& model_path) // Impl() {}
{ // ~Impl() {}
p = cv::makePtr<PreSegtor::Impl>(); // //提取
if (!model_path.empty()) { // cv::Mat forward(cv::Mat& img);
p->extractor_ = std::make_shared<AZONNXWrapperEx>(); // //特征提取器
p->extractor_->init(model_path); // std::shared_ptr<AZONNXWrapperEx> extractor_;
} //};
else { //
p->extractor_ = NULL; //PreSegtor::PreSegtor(const std::string& model_path)
} //{
} // p = cv::makePtr<PreSegtor::Impl>();
// if (!model_path.empty()) {
cv::Mat PreSegtor::extract(cv::InputArray img) // p->extractor_ = std::make_shared<AZONNXWrapperEx>();
{ // p->extractor_->init(model_path);
return p->forward(img.getMat()); // }
} // else {
// p->extractor_ = NULL;
// }
cv::Mat PreSegtor::Impl::forward(cv::Mat& img) //}
{ //
return extractor_->forward(img); //cv::Mat PreSegtor::extract(cv::InputArray img)
} //{
// return p->forward(img.getMat());
//}
//
//
//cv::Mat PreSegtor::Impl::forward(cv::Mat& img)
//{
// return extractor_->forward(img);
//}
//
//cv::Ptr<PreSegtor> pSegtor;
#endif
cv::Ptr<PreSegtor> pSegtor;
#endif/* __EYEM_MISC_H */ #endif/* __EYEM_MISC_H */
...@@ -19,6 +19,8 @@ public: ...@@ -19,6 +19,8 @@ public:
void draw_match_shapes(); void draw_match_shapes();
cv::Mat getResultMat() { return showResult; }
private: private:
struct s_TemplData struct s_TemplData
{ {
...@@ -28,7 +30,7 @@ private: ...@@ -28,7 +30,7 @@ private:
std::vector<double> vecInvArea; std::vector<double> vecInvArea;
std::vector<BOOL> vecResultEqual1; std::vector<BOOL> vecResultEqual1;
BOOL bIsPatternLearned; BOOL bIsPatternLearned;
int iTopLayer; int iTopLayer, iWidth, iHeight;
void clear() void clear()
{ {
std::vector<cv::Mat>().swap(vecPyramid); std::vector<cv::Mat>().swap(vecPyramid);
...@@ -47,7 +49,7 @@ private: ...@@ -47,7 +49,7 @@ private:
s_TemplData() s_TemplData()
{ {
bIsPatternLearned = FALSE; bIsPatternLearned = FALSE;
iTopLayer = 0; iTopLayer = iWidth = iHeight = 0;
} }
}; };
struct s_MatchParameter struct s_MatchParameter
......
此文件太大,无法显示。
此文件类型无法预览
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!