Closed bpinaya closed 7 years ago
I'm getting the same error. See also: https://github.com/mikeudacity/robo-pace-betatest/issues/52
I am also getting the same error when i try to test run the code.
Dont think an Introductory lesson to openCV is necessary, but the comment should include that the values represent RGB
Thank, I believe I fixed this issue (and created an error message that needs to be fixed.)
There is an error while trying to compile and test the code: Traceback (most recent call last): File "vm_main3.py", line 47, in
import main
File "/tmp/vmuser_tkbqbcfvko/main.py", line 2, in
import studentMain
File "/tmp/vmuser_tkbqbcfvko/studentMain.py", line 122, in
import tt
File "/tmp/vmuser_tkbqbcfvko/tt.py", line 17, in
cv2.imshow('frame',frame)
File "/tmp/vmuser_tkbqbcfvko/studentMain.py", line 80, in cv2_imshow
output_image(name, ext, bytes)
File "/tmp/vmuser_tkbqbcfvko/studentMain.py", line 90, in output_image
data['bytes'] = base64.encodestring(bytes)
File "/usr/lib/python3.4/base64.py", line 548, in encodestring
return encodebytes(s)
File "/usr/lib/python3.4/base64.py", line 536, in encodebytes
_input_type_check(s)
File "/usr/lib/python3.4/base64.py", line 530, in _input_type_check
raise TypeError(msg)
TypeError: expected 1-D data, not 2-D data from ndarray
Also, while the code itself is self-explanatory, it could be useful to give students an introductory lesson on OpenCV, otherwise they will just be changing values without knowing what they are actually doing.