Skip to content

Commit a6de686

Browse files
committed
update to 4.7
1 parent a42e483 commit a6de686

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+41
-100
lines changed

CameraOpenCV/CameraOpenCV.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,13 @@
188188
</ItemGroup>
189189
<ItemGroup>
190190
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
191-
<Version>6.2.13</Version>
191+
<Version>6.2.14</Version>
192192
</PackageReference>
193193
<PackageReference Include="OpenCvSharp4">
194-
<Version>4.6.0.20220608</Version>
194+
<Version>4.7.0.20230112</Version>
195195
</PackageReference>
196196
<PackageReference Include="OpenCvSharp4.runtime.uwp">
197-
<Version>4.6.0.20220608</Version>
197+
<Version>4.7.0.20230112</Version>
198198
</PackageReference>
199199
</ItemGroup>
200200
<ItemGroup />

CameraOpenCV/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

54
// General Information about an assembly is controlled through the following

SampleBase/Interfaces/ITestManager.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
1+
using System.Collections.Generic;
32

43
namespace SampleBase.Interfaces
54
{

SampleBase/MyProcess.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Diagnostics;
4-
using System.Linq;
5-
using System.Text;
1+
using System.Diagnostics;
62

73
namespace SampleBase
84
{

SamplesCore.Windows/ISample.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Linq;
4-
using System.Text;
5-
6-
namespace SamplesCore.Windows
1+
namespace SamplesCore.Windows
72
{
83
interface ISample
94
{

SamplesCore.Windows/SamplesCore.Windows.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<ItemGroup>
2121
<PackageReference Include="OpenCvSharp4.runtime.win" Version="4.6.0.20220608" />
22-
<PackageReference Include="OpenCvSharp4.WpfExtensions" Version="4.6.0.20220608" />
22+
<PackageReference Include="OpenCvSharp4.WpfExtensions" Version="4.7.0.20230112" />
2323
</ItemGroup>
2424

2525
<ItemGroup>

SamplesCore/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using System.Reflection;
2-
using System.Runtime.CompilerServices;
32
using System.Runtime.InteropServices;
43

54
// General Information about an assembly is controlled through the following

SamplesCore/Samples/ArucoSample.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public override void RunTest()
1818

1919
using var src = Cv2.ImRead(ImagePath.Aruco);
2020

21-
var detectorParameters = DetectorParameters.Create();
21+
var detectorParameters = new DetectorParameters();
2222
detectorParameters.CornerRefinementMethod = CornerRefineMethod.Subpix;
2323
detectorParameters.CornerRefinementWinSize = 9;
2424

SamplesCore/Samples/CaffeSample.cs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
using System;
22
using System.IO;
33
using System.Linq;
4-
using System.Net;
5-
using System.Threading.Tasks;
4+
using System.Net.Http;
65
using OpenCvSharp;
76
using OpenCvSharp.Dnn;
87
using SampleBase;
@@ -14,6 +13,8 @@ namespace SamplesCore
1413
/// </summary>
1514
class CaffeSample : ConsoleTestBase
1615
{
16+
private static readonly HttpClient httpClient = new() { Timeout = TimeSpan.FromMinutes(10) };
17+
1718
public override void RunTest()
1819
{
1920
const string protoTxt = @"Data\Text\bvlc_googlenet.prototxt";
@@ -47,9 +48,14 @@ public override void RunTest()
4748

4849
private static byte[] DownloadBytes(string url)
4950
{
50-
var client = WebRequest.CreateHttp(url);
51-
using var response = client.GetResponseAsync().GetAwaiter().GetResult();
52-
using var responseStream = response.GetResponseStream();
51+
using var httpRequest = new HttpRequestMessage(HttpMethod.Get, url);
52+
#if NETFRAMEWORK
53+
using var response = httpClient.SendAsync(httpRequest).Result.EnsureSuccessStatusCode();
54+
using var responseStream = response.Content.ReadAsStreamAsync().Result;
55+
#else
56+
using var response = httpClient.Send(httpRequest).EnsureSuccessStatusCode();
57+
using var responseStream = response.Content.ReadAsStream();
58+
#endif
5359
using var memory = new MemoryStream();
5460
responseStream.CopyTo(memory);
5561
return memory.ToArray();
@@ -78,4 +84,4 @@ private static void GetMaxClass(Mat probBlob, out int classId, out double classP
7884
classId = classNumber.X;
7985
}
8086
}
81-
}
87+
}

SamplesCore/Samples/CameraCaptureSample.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
using System;
2-
using System.Threading.Tasks;
3-
using OpenCvSharp;
1+
using OpenCvSharp;
42
using SampleBase;
53

64
namespace SamplesCore

0 commit comments

Comments
 (0)