{"action":"created","issue":{"url":"https://api.github.com/repos/hovren/crisp/issues/2","labels_url":"https://api.github.com/repos/hovren/crisp/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/hovren/crisp/issues/2/comments","events_url":"https://api.github.com/repos/hovren/crisp/issues/2/events","html_url":"https://github.com/hovren/crisp/issues/2","id":102838204,"number":2,"title":"AssertionError in calibration.py","user":{"login":"sergiud","id":2170034,"avatar_url":"https://avatars.githubusercontent.com/u/2170034?v=3","gravatar_id":"","url":"https://api.github.com/users/sergiud","html_url":"https://github.com/sergiud","followers_url":"https://api.github.com/users/sergiud/followers","following_url":"https://api.github.com/users/sergiud/following{/other_user}","gists_url":"https://api.github.com/users/sergiud/gists{/gist_id}","starred_url":"https://api.github.com/users/sergiud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergiud/subscriptions","organizations_url":"https://api.github.com/users/sergiud/orgs","repos_url":"https://api.github.com/users/sergiud/repos","events_url":"https://api.github.com/users/sergiud/events{/privacy}","received_events_url":"https://api.github.com/users/sergiud/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-08-24T16:35:13Z","updated_at":"2015-08-25T15:07:07Z","closed_at":"2015-08-25T14:51:05Z","body":"I'm using the OpenCV camera model. After fixing several code issues and running crisp, I get the following error:\r\n\r\n```\r\nCreating video stream from /home/sergiu/Projects/test_sequences/building1.mp4\r\nCreating gyro stream from /home/sergiu/Projects/test_sequences/building1_gyro.csv\r\nCreating calibrator\r\nEstimating time offset and camera to gyroscope rotation. Guessing gyro rate = 200.00\r\nTraceback (most recent call last):\r\n  File \"parrot_ardrone_dataset.py\", line 70, in <module>\r\n    calibrator.initialize(gyro_rate=GYRO_RATE_GUESS)\r\n  File \"/home/sergiu/Projects/crisp/crisp/calibration.py\", line 125, in initialize\r\n    R = self.find_initial_rotation()\r\n  File \"/home/sergiu/Projects/crisp/crisp/calibration.py\", line 290, in find_initial_rotation\r\n    assert data.shape == (6, len(gyro_axes))\r\nAssertionError\r\n```\r\n\r\n`gyro_axes` remains empty. I assume that estimating the initial rotation fails resulting in the error. Is this correct?"},"comment":{"url":"https://api.github.com/repos/hovren/crisp/issues/comments/134616108","html_url":"https://github.com/hovren/crisp/issues/2#issuecomment-134616108","issue_url":"https://api.github.com/repos/hovren/crisp/issues/2","id":134616108,"user":{"login":"sergiud","id":2170034,"avatar_url":"https://avatars.githubusercontent.com/u/2170034?v=3","gravatar_id":"","url":"https://api.github.com/users/sergiud","html_url":"https://github.com/sergiud","followers_url":"https://api.github.com/users/sergiud/followers","following_url":"https://api.github.com/users/sergiud/following{/other_user}","gists_url":"https://api.github.com/users/sergiud/gists{/gist_id}","starred_url":"https://api.github.com/users/sergiud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergiud/subscriptions","organizations_url":"https://api.github.com/users/sergiud/orgs","repos_url":"https://api.github.com/users/sergiud/repos","events_url":"https://api.github.com/users/sergiud/events{/privacy}","received_events_url":"https://api.github.com/users/sergiud/received_events","type":"User","site_admin":false},"created_at":"2015-08-25T15:07:07Z","updated_at":"2015-08-25T15:07:07Z","body":"It does solve my problem in the sense that I get a message that tells me about failed initialization. So, basically I can't use the video sequence with your calibration approach.\r\n\r\nI tried another video sequence and now I get a different error:\r\n\r\n```\r\nCreating video stream from /home/sergiu/Projects/test_sequences/redsquare11.mp4\r\nCreating gyro stream from /home/sergiu/Projects/test_sequences/redsquare11_gyro.csv\r\nCreating calibrator\r\nEstimating time offset and camera to gyroscope rotation. Guessing gyro rate = 200.00\r\n/usr/lib/python2.7/site-packages/numpy/core/_methods.py:59: RuntimeWarning: Mean of empty slice.\r\n  warnings.warn(\"Mean of empty slice.\", RuntimeWarning)\r\n/usr/lib/python2.7/site-packages/numpy/core/_methods.py:71: RuntimeWarning: invalid value encountered in true_divide\r\n  ret = ret.dtype.type(ret / rcount)\r\n(6, 15)\r\n[array([ 0.14526438, -0.05357122, -0.98794149]), array([ 0.99412952, -0.01678371, -0.10688685]), array([-0.0611561 ,  0.64598077,  0.76089997]), array([-0.41998796, -0.80055735,  0.42745531]), array([-0.50649943, -0.19890679, -0.83898415]), array([ 0.07588637,  0.05336562,  0.99568739]), array([-0.6664287 , -0.74041999, -0.08747011]), array([ 0.20088705,  0.97777033, -0.06007977]), array([ 0.90378761,  0.42743605, -0.0215957 ]), array([ 0.75751925,  0.65242953,  0.02236749]), array([ 0.51498225, -0.8449579 , -0.14435866]), array([ 0.66171341, -0.34334071, -0.66652271]), array([ 0.92792801, -0.09279939,  0.36102338]), array([ 0.79558824,  0.60016459, -0.08271525]), array([-0.74115061, -0.66290071, -0.10610569])]\r\nRunning calibration. This can take a few minutes.\r\n/home/sergiu/Projects/crisp/crisp/calibration.py:188: UserWarning: Could not use the requested 1500 tracks, since only 15 were available in the slice data.\r\n  warnings.warn(\"Could not use the requested {} tracks, since only {} were available in the slice data.\".format(max_tracks, available_tracks))\r\nTraceback (most recent call last):\r\n  File \"parrot_ardrone_dataset.py\", line 77, in <module>\r\n    calibrator.calibrate()\r\n  File \"/home/sergiu/Projects/crisp/crisp/calibration.py\", line 199, in calibrate\r\n    leastsq_result = scipy.optimize.leastsq(optimization_func, x0, args=func_args, full_output=True, ftol=1e-10, xtol=1e-10, maxfev=max_eval)\r\n  File \"/usr/lib/python2.7/site-packages/scipy/optimize/minpack.py\", line 371, in leastsq\r\n    shape, dtype = _check_func('leastsq', 'func', func, x0, args, n)\r\n  File \"/usr/lib/python2.7/site-packages/scipy/optimize/minpack.py\", line 20, in _check_func\r\n    res = atleast_1d(thefunc(*((x0[:numinputs],) + args)))\r\n  File \"/home/sergiu/Projects/crisp/crisp/calibration.py\", line 434, in optimization_func\r\n    Y = camera.unproject(y)\r\n  File \"/home/sergiu/Projects/crisp/crisp/camera.py\", line 325, in unproject\r\n    undist_image_points = cv2.undistortPoints(np.concatenate(image_points).reshape(-1,1,2), self.camera_matrix, self.dist_coefs, P=self.camera_matrix)\r\nValueError: zero-dimensional arrays cannot be concatenated\r\n```\r\n\r\n`np.concatenate` was added by me, as OpenCV threw an exception without it. data.shape here is `(6, 15)`.\r\n\r\nDid you by any chance calibrate your camera using OpenCV and can provide me the camera intrinsic matrix along the lens distortion coefficients?"}}