added 16-bit support to Bayer2RGB & Bayer2Gray (ticket #686); fixed bug in cv.CreateHist() when no ranges are passed (ticket #990)

This commit is contained in:
Vadim Pisarevsky
2011-06-03 15:45:50 +00:00
parent 2609df00bd
commit 2c1e913b2d
3 changed files with 231 additions and 204 deletions

View File

@@ -2965,16 +2965,20 @@ static PyObject *pycvCreateHist(PyObject *self, PyObject *args, PyObject *kw)
}
cvhistogram_t *h = PyObject_NEW(cvhistogram_t, &cvhistogram_Type);
args = Py_BuildValue("Oi", dims, CV_32FC1);
memset(&h->h, 0, sizeof(h->h));
h->bins = pycvCreateMatND(self, args);
Py_DECREF(args);
if (h->bins == NULL) {
return NULL;
}
h->h.type = CV_HIST_MAGIC_VAL;
h->h.type = CV_HIST_MAGIC_VAL + CV_HIST_UNIFORM_FLAG;
if (!convert_to_CvArr(h->bins, &(h->h.bins), "bins"))
return NULL;
ERRWRAP(cvSetHistBinRanges(&(h->h), r.rr, uniform));
if(r.rr)
{
ERRWRAP(cvSetHistBinRanges(&(h->h), r.rr, uniform));
}
return (PyObject*)h;
}