TypeError: img data type = 17 is not supported
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
where is cap coming from ? are you reading that from a file ? how so ? can it be it is a pallettized bmp ?
cap = cv2.VideoCapture(-1)
ret, frame = cap.read()
I am capture from a cam. For know is dosn
t matter in which formate it will be save.It
s can be jpeg as wellI found were I made error. Was used not correct array.