Skip to content

Commit f91ab35

Browse files
committed
Merge branch 'BlobImprovement'
2 parents f49cb20 + fd31c14 commit f91ab35

30 files changed

+311
-120
lines changed

nuget/OpenCvSharp-AnyCPU.nupkg

-86.9 KB
Binary file not shown.

nuget/OpenCvSharp-AnyCPU.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
33
<metadata>
44
<id>OpenCvSharp-AnyCPU</id>
5-
<version>2.4.8.20140607</version>
5+
<version>2.4.8.20140609</version>
66
<title>OpenCvSharp</title>
77
<authors>shimat</authors>
88
<licenseUrl>http://opensource.org/licenses/BSD-3-Clause</licenseUrl>

sample/CStyleSamplesCS/CStyleSamplesCS.csproj

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -94,25 +94,25 @@
9494
<ErrorReport>prompt</ErrorReport>
9595
</PropertyGroup>
9696
<ItemGroup>
97-
<Reference Include="OpenCvSharp">
98-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.dll</HintPath>
99-
<Private>True</Private>
97+
<Reference Include="OpenCvSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
98+
<SpecificVersion>False</SpecificVersion>
99+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.dll</HintPath>
100100
</Reference>
101-
<Reference Include="OpenCvSharp.Blob">
102-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.Blob.dll</HintPath>
103-
<Private>True</Private>
101+
<Reference Include="OpenCvSharp.Blob, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
102+
<SpecificVersion>False</SpecificVersion>
103+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.Blob.dll</HintPath>
104104
</Reference>
105-
<Reference Include="OpenCvSharp.CPlusPlus">
106-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.CPlusPlus.dll</HintPath>
107-
<Private>True</Private>
105+
<Reference Include="OpenCvSharp.CPlusPlus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
106+
<SpecificVersion>False</SpecificVersion>
107+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.CPlusPlus.dll</HintPath>
108108
</Reference>
109-
<Reference Include="OpenCvSharp.Extensions">
110-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.Extensions.dll</HintPath>
111-
<Private>True</Private>
109+
<Reference Include="OpenCvSharp.Extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
110+
<SpecificVersion>False</SpecificVersion>
111+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.Extensions.dll</HintPath>
112112
</Reference>
113-
<Reference Include="OpenCvSharp.UserInterface">
114-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.UserInterface.dll</HintPath>
115-
<Private>True</Private>
113+
<Reference Include="OpenCvSharp.UserInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
114+
<SpecificVersion>False</SpecificVersion>
115+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.UserInterface.dll</HintPath>
116116
</Reference>
117117
<Reference Include="PresentationCore">
118118
<RequiredTargetFramework>3.0</RequiredTargetFramework>
Binary file not shown.
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="OpenCvSharp-AnyCPU" version="2.4.8.20140607" targetFramework="net40" />
3+
<package id="OpenCvSharp-AnyCPU" version="2.4.8.20140609" targetFramework="net40" />
44
</packages>

sample/CStyleSamplesVB/CStyleSamplesVB.vbproj

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -103,25 +103,26 @@
103103
<MyType>WindowsFormsWithCustomSubMain</MyType>
104104
</PropertyGroup>
105105
<ItemGroup>
106-
<Reference Include="OpenCvSharp">
107-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.dll</HintPath>
108-
<Private>True</Private>
106+
<Reference Include="OpenCvSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
107+
<SpecificVersion>False</SpecificVersion>
108+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.dll</HintPath>
109109
</Reference>
110-
<Reference Include="OpenCvSharp.Blob">
111-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.Blob.dll</HintPath>
112-
<Private>True</Private>
110+
<Reference Include="OpenCvSharp.Blob, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
111+
<SpecificVersion>False</SpecificVersion>
112+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.Blob.dll</HintPath>
113113
</Reference>
114-
<Reference Include="OpenCvSharp.CPlusPlus">
115-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.CPlusPlus.dll</HintPath>
114+
<Reference Include="OpenCvSharp.CPlusPlus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
115+
<SpecificVersion>False</SpecificVersion>
116+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.CPlusPlus.dll</HintPath>
116117
<Private>True</Private>
117118
</Reference>
118-
<Reference Include="OpenCvSharp.Extensions">
119-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.Extensions.dll</HintPath>
120-
<Private>True</Private>
119+
<Reference Include="OpenCvSharp.Extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
120+
<SpecificVersion>False</SpecificVersion>
121+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.Extensions.dll</HintPath>
121122
</Reference>
122-
<Reference Include="OpenCvSharp.UserInterface">
123-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.UserInterface.dll</HintPath>
124-
<Private>True</Private>
123+
<Reference Include="OpenCvSharp.UserInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
124+
<SpecificVersion>False</SpecificVersion>
125+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.UserInterface.dll</HintPath>
125126
</Reference>
126127
<Reference Include="PresentationCore">
127128
<RequiredTargetFramework>3.0</RequiredTargetFramework>
Binary file not shown.
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="OpenCvSharp-AnyCPU" version="2.4.8.20140607" targetFramework="net40" />
3+
<package id="OpenCvSharp-AnyCPU" version="2.4.8.20140609" targetFramework="net40" />
44
</packages>

sample/CppStyleSamplesCS/CppStyleSamplesCS.csproj

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,22 +77,24 @@
7777
</PropertyGroup>
7878
<ItemGroup>
7979
<Reference Include="OpenCvSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
80-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.dll</HintPath>
80+
<SpecificVersion>False</SpecificVersion>
81+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.dll</HintPath>
8182
</Reference>
8283
<Reference Include="OpenCvSharp.Blob, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
8384
<SpecificVersion>False</SpecificVersion>
84-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.Blob.dll</HintPath>
85+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.Blob.dll</HintPath>
8586
</Reference>
8687
<Reference Include="OpenCvSharp.CPlusPlus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
8788
<SpecificVersion>False</SpecificVersion>
88-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.CPlusPlus.dll</HintPath>
89+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.CPlusPlus.dll</HintPath>
8990
</Reference>
9091
<Reference Include="OpenCvSharp.Extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
9192
<SpecificVersion>False</SpecificVersion>
92-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.Extensions.dll</HintPath>
93+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.Extensions.dll</HintPath>
9394
</Reference>
9495
<Reference Include="OpenCvSharp.UserInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
95-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.UserInterface.dll</HintPath>
96+
<SpecificVersion>False</SpecificVersion>
97+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.UserInterface.dll</HintPath>
9698
</Reference>
9799
<Reference Include="PresentationCore" />
98100
<Reference Include="System" />
Binary file not shown.
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="OpenCvSharp-AnyCPU" version="2.4.8.20140607" targetFramework="net40" />
3+
<package id="OpenCvSharp-AnyCPU" version="2.4.8.20140609" targetFramework="net40" />
44
</packages>

sample/CppStyleSamplesVB/CppStyleSamplesVB.vbproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,23 +107,23 @@
107107
<ItemGroup>
108108
<Reference Include="OpenCvSharp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
109109
<SpecificVersion>False</SpecificVersion>
110-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.dll</HintPath>
110+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.dll</HintPath>
111111
</Reference>
112112
<Reference Include="OpenCvSharp.Blob, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
113113
<SpecificVersion>False</SpecificVersion>
114-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.Blob.dll</HintPath>
114+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.Blob.dll</HintPath>
115115
</Reference>
116116
<Reference Include="OpenCvSharp.CPlusPlus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
117117
<SpecificVersion>False</SpecificVersion>
118-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.CPlusPlus.dll</HintPath>
118+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.CPlusPlus.dll</HintPath>
119119
</Reference>
120120
<Reference Include="OpenCvSharp.Extensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
121121
<SpecificVersion>False</SpecificVersion>
122-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.Extensions.dll</HintPath>
122+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.Extensions.dll</HintPath>
123123
</Reference>
124124
<Reference Include="OpenCvSharp.UserInterface, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6adad1e807fea099, processorArchitecture=MSIL">
125125
<SpecificVersion>False</SpecificVersion>
126-
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140607\lib\net40\OpenCvSharp.UserInterface.dll</HintPath>
126+
<HintPath>..\packages\OpenCvSharp-AnyCPU.2.4.8.20140609\lib\net40\OpenCvSharp.UserInterface.dll</HintPath>
127127
</Reference>
128128
<Reference Include="PresentationCore" />
129129
<Reference Include="System" />
Binary file not shown.
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="OpenCvSharp-AnyCPU" version="2.4.8.20140607" targetFramework="net40" />
3+
<package id="OpenCvSharp-AnyCPU" version="2.4.8.20140609" targetFramework="net40" />
44
</packages>

src/OpenCvSharp.Blob/CvBlob.cs

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ namespace OpenCvSharp.Blob
66
/// <summary>
77
/// Struct that contain information about one blob.
88
/// </summary>
9-
public class CvBlob
9+
[Serializable]
10+
public class CvBlob : ICloneable
1011
{
1112
#region Init
1213
/// <summary>
@@ -154,11 +155,11 @@ public CvRect Rect
154155
/// <summary>
155156
/// Hu moment 1.
156157
/// </summary>
157-
public double P1;
158+
public double P1 { get; set; }
158159
/// <summary>
159160
/// Hu moment 2.
160161
/// </summary>
161-
public double P2;
162+
public double P2 { get; set; }
162163

163164
/// <summary>
164165
/// Contour
@@ -250,5 +251,49 @@ public void SetMoments()
250251
}
251252
#endregion
252253
#endregion
254+
255+
#region ICloneable
256+
257+
/// <summary>
258+
///
259+
/// </summary>
260+
/// <returns></returns>
261+
public CvBlob Clone()
262+
{
263+
return new CvBlob
264+
{
265+
Area = Area,
266+
CentralMoments = CentralMoments,
267+
Centroid = Centroid,
268+
Contour = Contour.Clone(),
269+
InternalContours = new List<CvContourChainCode>(InternalContours),
270+
Label = Label,
271+
M00 = M00,
272+
M01 = M01,
273+
M02 = M02,
274+
M10 = M10,
275+
M11 = M11,
276+
M20 = M20,
277+
MaxX = MaxX,
278+
MaxY = MaxY,
279+
MinX = MinX,
280+
MinY = MinY,
281+
N02 = N02,
282+
N11 = N11,
283+
N20 = N20,
284+
P1 = P1,
285+
P2 = P2,
286+
U02 = U02,
287+
U11 = U11,
288+
U20 = U20,
289+
};
290+
}
291+
292+
object ICloneable.Clone()
293+
{
294+
return Clone();
295+
}
296+
297+
#endregion
253298
}
254299
}

0 commit comments

Comments
 (0)