Closed jackfairley closed 7 years ago
Can you copy the stack trace here? You can also put a breakpoint in the TakeCalibrationPicture function and see what line is causing the crash.
It is possible that either the HoloLens or the camera is not taking an image, then OpenCV is trying to process an image that is not there.
A few things to check now:
I suspect you're right about no picture being taken, but I'm not sure why.
1: No images whatsoever. 2: Yes. 3: Yes. 4: Yes. I've tried going over the network and going over USB to see if that caused the issue.
Are you building the release version of the calibration app? Are you able to take photos in the MRC tab of your device portal?
Yes, and yes.
Commenting out 172-175 and 182-185 in CalibrationApp.cpp stops that exception, and the photos are being taken normally on the hololens and camera. Trying to calibrate using the captured images immediately throws an exception. I'm guessing this means opencv is not working at all?
You are using OpenCV 3.1, with the x64 vc14 binaries, and VS 2015?
Yes, the prebuilt version of OpenCV 3.1, and VS Community 2015, with the updates and tools listed in the documentation.
Forgot to mention, the image from the camera capture has a blue tint, other capture software run on the same computer doesn't have that behavior.
We might get a better stack if we run TakeCalibrationPicture on the main thread,
Can you try commenting out lines 219, 220, and 222 so TakeCalibrationPIcture is not called inside a ppl task:
//pplx::create_task([=]()
//{
TakeCalibrationPicture();
//});
Then see what your callstack and output debug spew looks like.
Here's the call stack with only those lines commented out. call stack.txt
Let me know if there's output I'm missing somewhere, this is beyond my cursory familiarity with development.
It's crashing in findChessboardCorners, but without symbols it's hard to tell what is happening!
In your Output window, (Debug>Windows>Output) do you have any debug output saying what kind of exception this is?
If you put a breakpoint on line 242, do you have a non-null grayscaleImage?
You can also install ImageWatch to preview that grayscaleImage is actually the image your camera is producing.
Did you update GRID_CELLS_X or GRID_CELLS_Y to match your checkerboard's dimensions. This might throw if you have <= 3 in either of these values.
Going from a 4x3 to a 6x4 checkerboard stopped the throw on checking corners. Greyscale image is definitely there, confirmed with breakpoint and checking with ImageWatch
It doesn't throw any exceptions anymore, but it's not saving any captures. Commenting out 173-174 and 182-186 to disable the check for a chessboard makes it save images at the correct interval. opencv not recognizing the pattern?
Made a better chessboard and it's now taking captures. Bad arts and crafts skills cause bugs, apparently.
Looks like the 4x3 board was the issue - OpenCV will throw an exception if the checkerboard dimensions are <= 3.
Your assistance is greatly appreciated, I doubt I would have cracked this myself!
From: fieldsJacksonG notifications@github.com Sent: Friday, March 31, 2017 5:07:49 PM To: Microsoft/HoloLensCompanionKit Cc: jackfairley; State change Subject: Re: [Microsoft/HoloLensCompanionKit] Spectator View: calibration throws unhandled exception (#81)
Looks like the 4x3 board was the issue - OpenCV will throw an exception if the checkerboard dimensions are <= 3. My earlier statement was incorrect!
— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHubhttps://github.com/Microsoft/HoloLensCompanionKit/issues/81#issuecomment-290874990, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AZg40bEaaN9yUvC0EAYnWk9bMbKlrxLpks5rrZVVgaJpZM4MsUw1.
I've followed the documentation to build the Calibration solution, which completes without errors. When I run the solution, the window appears with a working camera feed, but after a couple seconds a breakpoint is triggered by the unhandled exception.
The stack looks like it starts at CalibrationApp::TakeCalibraitonPictureAtInterval and end with an exception from opencv_world310.dll. Let me know what information I can provide to shed light on this issue.