type = CV_16SC1;
else if (pai->itemsize == 4)
type = CV_32SC1;
+ else if (pai->itemsize == 8) {
+ PyErr_SetString(PyExc_TypeError, "OpenCV cannot handle 64-bit integer arrays");
+ return NULL;
+ }
break;
case 'u':
break;
}
+ assert(type != -1);
if (!allowND) {
cvmat_t *m = PyObject_NEW(cvmat_t, &cvmat_Type);
def convert(numpydims):
""" Create a numpy array with specified dims, return the OpenCV CvMat """
- a1 = numpy.array([1] * reduce(operator.__mul__, numpydims)).reshape(*numpydims)
+ a1 = numpy.array([1] * reduce(operator.__mul__, numpydims)).reshape(*numpydims).astype(numpy.float32)
return cv.fromarray(a1)
def row_col_chan(m):
col = m.cols