M
M
Michael_Trofimov2016-09-26 17:41:10
IIS
Michael_Trofimov, 2016-09-26 17:41:10

Emgu.CV.CvInvoke exception in iisexpress.exe, how to overcome the error in this process?

I'm using the opencv plugin for C# EMGU: 3.1.0.2282 in my ASP.NET MVC5 project. More specifically, I take the Emgu.CV.World library from there (I make a link to it in the project, it itself lies in another directory in the EMGU directory in the bin folder). And the x86 folder, with cv assemblies, again from the bin directory.
When you run the method, cat. accesses CvInvoke.Threshold() from EMGU, an error occurs:
"An exception is thrown at 0x2AF630B1 (cvextern.dll) in iisexpress.exe: 0xC0000005: Access violation reading location 0x00000000."
What is important, this project with the same libraries was launched earlier without errors, some connection with the assemblies may have been broken, but all I did was copy the same project to the same directory, but with a different folder name in the cat. he is, launched it and got this error, after that the previous project began to issue it.
For testing, a WindowsForms project was created with the same functionality and the same libraries, it does not give any errors.
I tried adding the x64 folder to the project, changing the launch settings (Any cpu, x86, x64), all in vain.
IIS Express 10 vs 2015 community.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael_Trofimov, 2016-09-27
@Michael_Trofimov

The answer is still found. The reason for the error was a line not noticed during the last refactoring: imgGray.Dispose();

imageRotate = imgGray.Rotate(-avg, new Gray(255));
            }
            else
            {
                imageRotate = imgGray;
            }
            imgGray.Dispose();
            
            //return imageRotate.Bitmap;
            return BlackFilterImage(imageRotate);
        }

        private static Bitmap BlackFilterImage(Image<Gray, byte> img)
        {
            UMat resultImg = new UMat();
            CvInvoke.Threshold(img, resultImg, 105, 255, ThresholdType.BinaryInv); //Ошибка возникала тут

Unfortunately, the nature of the error led me initially on the wrong track.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question