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

example-calibration crash after camera calibration #2

Open
paul-ferragut opened this issue Feb 10, 2016 · 2 comments
Open

example-calibration crash after camera calibration #2

paul-ferragut opened this issue Feb 10, 2016 · 2 comments

Comments

@paul-ferragut
Copy link

at the end of camera calibration I get an error OpenCV Error: Null pointer (Null pointer to reader or destination array) in cvReadRawDataSlice, file ......\modules\core\src\persistence.cpp line 3245

the crash is when the app is changing state from CAMERA to PROJECTOR_STATIC or when running in PROJECTOR_STATIC state with my cameraCalibration file , however if I try to run in PROJECTOR_STATIC state using your cameraCalibration file the app is not crashing. I might be doing something wrong in the camera calibration, please let me know if you have any suggestions, this addon looks awesome would love to manage to use it.
thanks

@syn-kazuki-takata
Copy link

I faced the same problem and modified as follows to solve it.

In Calibration.cpp (in addons/ofxCv//libs/ofxCv/src), I changed
fs << "[:" << imagePoints[i] << "]";
to
fs << imagePoints[i];

If you use the code before modification, features was exported as follows in the calibrationCamera.yml.
features:
-[ [ 4.03665039e+02, 5.15171326e+02, 4.49520020e+02, 4.80329987e+02,
...
8.02705994e+02, 4.51542999e+02, 8.33743286e+02, 4.19411774e+02 ] ]
-[ [ 1.45415695e+02, 4.51887360e+02, 1.97437866e+02, 4.21586609e+02,
...
5.50285950e+02, 4.28862122e+02, 5.90773010e+02, 3.98728363e+02] ]

and if you use the code modified,
features:
-[ 4.03665039e+02, 5.15171326e+02, 4.49520020e+02, 4.80329987e+02,
...
8.02705994e+02, 4.51542999e+02, 8.33743286e+02, 4.19411774e+02 ]
-[ 1.45415695e+02, 4.51887360e+02, 1.97437866e+02, 4.21586609e+02,
...
5.50285950e+02, 4.28862122e+02, 5.90773010e+02, 3.98728363e+02]

@RZz96
Copy link

RZz96 commented Aug 23, 2019

I faced the same problem and modified as follows to solve it.

In Calibration.cpp (in addons/ofxCv//libs/ofxCv/src), I changed
fs << "[:" << imagePoints[i] << "]";
to
fs << imagePoints[i];

If you use the code before modification, features was exported as follows in the calibrationCamera.yml.
features:
-[ [ 4.03665039e+02, 5.15171326e+02, 4.49520020e+02, 4.80329987e+02,
...
8.02705994e+02, 4.51542999e+02, 8.33743286e+02, 4.19411774e+02 ] ]
-[ [ 1.45415695e+02, 4.51887360e+02, 1.97437866e+02, 4.21586609e+02,
...
5.50285950e+02, 4.28862122e+02, 5.90773010e+02, 3.98728363e+02] ]

and if you use the code modified,
features:
-[ 4.03665039e+02, 5.15171326e+02, 4.49520020e+02, 4.80329987e+02,
...
8.02705994e+02, 4.51542999e+02, 8.33743286e+02, 4.19411774e+02 ]
-[ 1.45415695e+02, 4.51887360e+02, 1.97437866e+02, 4.21586609e+02,
...
5.50285950e+02, 4.28862122e+02, 5.90773010e+02, 3.98728363e+02]

Hi , since you had success to run the code. would you please tell me what are the steps to make it work?
Many regards

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

3 participants