Cheers,
Minh-Tri
On 29/07/2010 08:11, info gabor wrote:
> I had some difficulties with the calcHist interface, using the one given in
> the API documentation:
>
> /calcHist( (object)images, (Mat)channels, (Mat)mask, (SparseMat)hist,
> (Mat)histSize, (object)ranges [, (bool)uniform=True [,
> (bool)accumulate=False]]) -> None :/
>
> with, e.g.
> / Argument 'images':/
> / C/C++ type: ::cv::Mat const *./
> / Python type: list of MatND, e.g. [MatND(), MatND(), MatND()]./
>
> Following the error report of Python I got it working. Example follows:
> Starting with some single-chanel image img0 and a corresponding mask msk0
>
> / imgs=cv.vector_Mat()/
> / imgs.append(img0)/
> / channels=cv.vector_int()/
> / channels.append(0)/
> / mask=msk/
> / hist=cv.MatND()/
> / histSize=cv.vector_int()/
> / histSize.append(255)/
> / f=cv.vector_float32()/
> / f.append(0.)/
> / f.append(255.)/
> / ranges=cv.vector_vector_float32()/
> / ranges.append(f)/
> /
> /
> / cv.calcHist(imgs,channels,mask,hist,histSize,ranges)/
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "ctypes-opencv" group.
> To post to this group, send email to ctypes...@googlegroups.com.
> To unsubscribe from this group, send email to
> ctypes-openc...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/ctypes-opencv?hl=en.
--
Dr. Minh-Tri Pham
Research Fellow, University of Surrey, UK
Email: t.p...@surrey.ac.uk or pmt...@gmail.com
Mob: +44 (0) 778 774 1089 | Tel: +44 (0) 148 368 4711