TypeError: img data type = 17 is not supported

asked 2014-06-26 03:39:28 -0600

newbyeofpython gravatar image

updated 2014-06-26 04:09:40 -0600

Some one please help me with this error:


    filename = path_save_img+"capture%.4d.bmp" % icount 
    saveimg = np.array(cap)
    cv2.imwrite( filename, saveimg, cv2.cv.CV_IMWRITE_PXM_BINARY )
TypeError: img data type = 17 is not supported
I try to save capture frame with this line, and I am geting error. How I can to know type of array ? np.dtype(cap) return error for me.
    12:34:11.658054
28
1
<module 'numpy.testing'="" from="" '="" usr="" lib64="" python2.7="" site-packages="" numpy="" testing="" __init__.pyc'="">
0
()
<videocapture 0x19b6af0="">
./capture/images/capture0028.bmp
<type 'numpy.ndarray'="">
Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib64/python2.7/lib-tk/Tkinter.py", line 1470, in __call__
    return self.func(*args)
  File "./svyatovit.py", line 107, in Gov_start_func
    Start_sig(ishow);
  File "./svyatovit.py", line 57, in Start_sig
    Saveimage(cap, icount);
  File "/home/xxx/xxx/xxx/database.py", line 31, in Saveimage
    cv2.imwrite( filename, saveimg, cv2.cv.CV_IMWRITE_PXM_BINARY )
TypeError: img data type = 17 is not supported
exit_sig func
edit retag flag offensive close merge delete

Comments

where is cap coming from ? are you reading that from a file ? how so ? can it be it is a pallettized bmp ?

berak gravatar imageberak ( 2014-06-26 04:23:42 -0600 )edit

cap = cv2.VideoCapture(-1)
ret, frame = cap.read()

I am capture from a cam. For know is dosnt matter in which formate it will be save.Its can be jpeg as well

newbyeofpython gravatar imagenewbyeofpython ( 2014-06-26 04:29:37 -0600 )edit

I found were I made error. Was used not correct array.

newbyeofpython gravatar imagenewbyeofpython ( 2014-06-26 05:58:48 -0600 )edit