The attached diff (against trunk @183) corrects a few issues with some
histogram related functions.
First, cvQueryHistValue_1D has an extra argument.
Second, the use of "hist.bins" in the cvQuery/GetHist* functions don't work
given the use of ByRefArg (through CvArr_r) and the declaration of CvArr.
You get an OpenCV error about invalid array.
Although under the covers the bins member and the mat member of CvHistogram
both point to the same memory, taking the byref(bins) gives the address of
the pointer and not the value of the pointer. Switching to using
"hist.bins.contents" cleans this up, but for that to avoid a ctypes error,
there needs to be a _fields_ member of CvArr, even if empty.
And third, even though the wrapper declaration permits None for the ranges
parameter to cvCreateHist, the ListPOINTER2 ctypes wrapper doesn't. I
added a check for None there to permit it to pass through.
-- David
Original issue reported on code.google.com by db3l.em...@gmail.com on 9 Jan 2009 at 12:14
Original issue reported on code.google.com by
db3l.em...@gmail.com
on 9 Jan 2009 at 12:14Attachments: