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

alueError: shapes (3,3) and (1,1) not aligned: 3 (dim 1) != 1 (dim 0) #6

Open
archenroot opened this issue Jun 7, 2019 · 7 comments

Comments

@archenroot
Copy link

archenroot commented Jun 7, 2019

Hi, just tried out python3 cube_reconstruction.py and got:

True essential matrix: [[matrix([[0.]]) matrix([[-1.]]) matrix([[0.]])]
 [matrix([[-0.361547]]) matrix([[0.]]) matrix([[-3.14154162]])]
 [matrix([[0.]]) matrix([[3.]]) matrix([[0.]])]]
Computed essential matrix: [[-4.85388477e-05 -1.00000000e+00 -4.21762070e-04]
 [-3.62391216e-01 -3.38325541e-02 -3.14887717e+00]
 [ 1.45616543e-04  3.00000000e+00  1.26528621e-03]]
True fundamental matrix: [[matrix([[0.]]) matrix([[-1.11111111e-05]]) matrix([[0.00166667]])]
 [matrix([[-4.01718887e-06]]) matrix([[0.]]) matrix([[-0.00986923]])]
 [matrix([[0.00060258]]) matrix([[0.01166667]]) matrix([[-0.26961594]])]]
Traceback (most recent call last):
  File "cube_reconstruction.py", line 119, in <module>
    print('Computed fundamental matrix:', (F * true_F[2][2]))
  File "/home/zangetsu/proj/prometheus-core/demo/demo-20-3dreconstruction-flame/3Dreconstruction/venv3/lib/python3.6/site-packages/numpy/matrixlib/defmatrix.py", line 226, in __rmul__
    return N.dot(other, self)
ValueError: shapes (3,3) and (1,1) not aligned: 3 (dim 1) != 1 (dim 0)

@archenroot
Copy link
Author

Q: What version of opencv do you exactly use?

@Hemantr05
Copy link

I got the same error!
How do I resolve it?
I use the OpenCV4

@Aaronreb
Copy link

I am getting the same error.
Has anyone solved it?
Any help would be appreciated.
Thanks

@littlesquirrel2017
Copy link

Hi, just tried out python3 cube_reconstruction.py and got:

True essential matrix: [[matrix([[0.]]) matrix([[-1.]]) matrix([[0.]])]
 [matrix([[-0.361547]]) matrix([[0.]]) matrix([[-3.14154162]])]
 [matrix([[0.]]) matrix([[3.]]) matrix([[0.]])]]
Computed essential matrix: [[-4.85388477e-05 -1.00000000e+00 -4.21762070e-04]
 [-3.62391216e-01 -3.38325541e-02 -3.14887717e+00]
 [ 1.45616543e-04  3.00000000e+00  1.26528621e-03]]
True fundamental matrix: [[matrix([[0.]]) matrix([[-1.11111111e-05]]) matrix([[0.00166667]])]
 [matrix([[-4.01718887e-06]]) matrix([[0.]]) matrix([[-0.00986923]])]
 [matrix([[0.00060258]]) matrix([[0.01166667]]) matrix([[-0.26961594]])]]
Traceback (most recent call last):
  File "cube_reconstruction.py", line 119, in <module>
    print('Computed fundamental matrix:', (F * true_F[2][2]))
  File "/home/zangetsu/proj/prometheus-core/demo/demo-20-3dreconstruction-flame/3Dreconstruction/venv3/lib/python3.6/site-packages/numpy/matrixlib/defmatrix.py", line 226, in __rmul__
    return N.dot(other, self)
ValueError: shapes (3,3) and (1,1) not aligned: 3 (dim 1) != 1 (dim 0)

np.multiply(F , true_F[2][2])

@Agui-Noodles
Copy link

I got the same error,Has anyone solved it?
Thanks!

@dewirahmawati
Copy link

Hi, just tried out python3 cube_reconstruction.py and got:

True essential matrix: [[matrix([[0.]]) matrix([[-1.]]) matrix([[0.]])]
 [matrix([[-0.361547]]) matrix([[0.]]) matrix([[-3.14154162]])]
 [matrix([[0.]]) matrix([[3.]]) matrix([[0.]])]]
Computed essential matrix: [[-4.85388477e-05 -1.00000000e+00 -4.21762070e-04]
 [-3.62391216e-01 -3.38325541e-02 -3.14887717e+00]
 [ 1.45616543e-04  3.00000000e+00  1.26528621e-03]]
True fundamental matrix: [[matrix([[0.]]) matrix([[-1.11111111e-05]]) matrix([[0.00166667]])]
 [matrix([[-4.01718887e-06]]) matrix([[0.]]) matrix([[-0.00986923]])]
 [matrix([[0.00060258]]) matrix([[0.01166667]]) matrix([[-0.26961594]])]]
Traceback (most recent call last):
  File "cube_reconstruction.py", line 119, in <module>
    print('Computed fundamental matrix:', (F * true_F[2][2]))
  File "/home/zangetsu/proj/prometheus-core/demo/demo-20-3dreconstruction-flame/3Dreconstruction/venv3/lib/python3.6/site-packages/numpy/matrixlib/defmatrix.py", line 226, in __rmul__
    return N.dot(other, self)
ValueError: shapes (3,3) and (1,1) not aligned: 3 (dim 1) != 1 (dim 0)

np.multiply(F , true_F[2][2])

that's worked for me and the next guys, if you get error again. 'It is not currently possible to manually set the aspect '
NotImplementedError: It is not currently possible to manually set the aspect on 3D axes...

you can change line 26 cube_reconstruction.py to ax.set_aspect('auto').

worked.

@XBXiaoBei
Copy link

I change true_F[2][2] to true_F[2][2].item(),.
worked

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

7 participants