Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aruco Detector crashes #35

Closed
johnbuluba opened this issue Jun 30, 2017 · 9 comments
Closed

Aruco Detector crashes #35

johnbuluba opened this issue Jun 30, 2017 · 9 comments

Comments

@johnbuluba
Copy link

Hello
I am trying to use the aruco detector from opencv contrib with images from a kinect, but it crashes all the time.
Even the example crashes (using a standard logitech webcam) and i tested both the precompiled executable and running from source

Has anyone succeded detecting aruco markers, if yes how ?
Thanks a lot !

@ETLang
Copy link

ETLang commented Aug 14, 2017

I'm seeing the same crash. Other demos work ok, but Aruco crashes. Easiest repro is to run the sample and click the "Print Aruco Board" button. Crash occurs on call to ArucoInvoke.cveArucoGridBoardCreate.

Exception details:
Unhandled exception at 0x770F9AAA (ntdll.dll) in Aruco.exe: 0xC0000374: A heap has been corrupted (parameters: 0x771358E8).

Looks like the P/Invoke signature is incompatible with the definition in cvextern. I'd get the original source and try twiddling with it myself but EMGU website is apparently down and I can't access it.

emgucv added a commit that referenced this issue Aug 15, 2017
@emgucv
Copy link
Owner

emgucv commented Aug 15, 2017

Fixed in the above commit. Website has a database issue yesterday and has been fixed too.

Thanks for pointing that out.

@ETLang
Copy link

ETLang commented Aug 15, 2017

Did the trick! Thank you!

@okazolab
Copy link

okazolab commented Aug 16, 2017

The Aruco demo crashes on my PC with random exceptions, during calls of various functions in Emgu.CV.Aruco namespace. I did not recompile 3.3 with the above fix, but I tried to call cveArucoDictionaryCreate1() via the public Dictionary(int nMarkers, int markerSize) constructor with the 3.2 x86 binaries. The demo crashes there too, during the call or later, in GridBoard,Draw(), ArucoInvoke.DetectMarkers(), etc. The most typical exception is "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

@cwule
Copy link

cwule commented Aug 31, 2017

I have the same issue like okazolab. Got EmguCV via NuGet though, will try to build the newest commit.

@cwule
Copy link

cwule commented Sep 1, 2017

The error also occurs for the latest commit. I get the message "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." for the ArucoInvoke.DetectMarkers method:

     Mat mat = imageCV.Mat;
     Mat imageCopy = new Mat();
     mat.CopyTo(imageCopy);
     VectorOfInt markerIds = new VectorOfInt(); 
     DetectorParameters decParameters = new DetectorParameters();
     decParameters.AdaptiveThreshWinSizeMax = 23;
     VectorOfVectorOfPoint markerCorners = new VectorOfVectorOfPoint();
     ArucoInvoke.DetectMarkers(mat, dictionary, markerCorners, markerIds, decParameters);

The same thing happens for the Aruco example. If ArucoInvoke.DetectMarkers is commented out, both run without crashing.

@emgucv
Copy link
Owner

emgucv commented Sep 7, 2017

This commit should have it fixed:
24d44b4

@cwule
Copy link

cwule commented Sep 7, 2017

Awesome, that works!
Thanks a lot.

@emgucv
Copy link
Owner

emgucv commented Oct 7, 2017

Closing issue now.

@emgucv emgucv closed this as completed Oct 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants