VahidN / OpenCVSharp-Samples

A collection of samples about using OpenCV in .NET applications.
Apache License 2.0
271 stars 122 forks source link

Sample 18 Access Violation #4

Closed M0J0R1S1NG closed 7 years ago

M0J0R1S1NG commented 7 years ago

When you run sample 18

thie line below from the DoOcr() function in SimpleOCR class

var detectedClass = (int)kNearest.FindNearest(result, 1, results, neighborResponses, dists);

cause memory violation.

Ive tried to fix but no luck yet.

BTW good work!

A

VahidN commented 7 years ago

Reported here.

VahidN commented 7 years ago

Try the latest beta version:

PM> Install-Package OpenCvSharp3-AnyCPU -Source https://ci.appveyor.com/nuget/opencvsharp -IncludePrerelease
M0J0R1S1NG commented 7 years ago

Fix works access violation gone. No other issues with sample 18 that I have found. Closing Good Work @VahidN

VahidN commented 7 years ago

It works. Just update your nuget packages.

VahidN commented 7 years ago

I tested it again and it works. This should be the content of your packages.config file:

<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="OpenCvSharp3-AnyCPU" version="3.2.0.20170419" targetFramework="net40" />
</packages>

Make sure you have installed the last version:

PM> Install-Package OpenCvSharp3-AnyCPU -Version 3.2.0.20170419
VahidN commented 7 years ago

That error means you should update your old NuGet Package Manager.

Go to Visual Studio > Tools > Extension and Updates Find Updates in left accordion menu, Go to Visual Studio Gallery. You will find a update for Nuget.