Hi, <br><br>I'm using:<br>Python 2.7.2<br>Opencv 2.3.1<br>Windows 7 Ultimate SP1<br>(I know it's not debian, but this might help others in solving this problem)<br><br>Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win<br>
32<br>Type "help", "copyright", "credits" or "license" for more information.<br>>>> import cv<br>>>> cv.CreateHist(1, cv.CV_HIST_ARRAY, rango, 1)<br>Traceback (most recent call last):<br>
File "<stdin>", line 1, in <module><br>NameError: name 'rango' is not defined<br>>>> from array import array<br>>>> rango = ('f', [0, 255])<br>>>> cv.CreateHist(1, cv.CV_HIST_ARRAY, rango, 1)<br>
<br>this will make python.exe to stop working. The function makes python crash. I'm not sure if I am wrong or is the function that is making python crash.<br><br>So I tried to find what was going on. so i went to the library, and curiously checked the calchist.py sample. It was very interesting to found that the firs value dims, should be an array, else it would not work and return this error.<br>
<br>hist = cv.CreateHist([h_bins, s_bins], cv.CV_HIST_ARRAY, ranges, 1)<br><br>the first parameter is [h_bins, s_bins] and in the documentation doesn't specifies that it should be like that.<br><br>and the first parameter seems to be the number of bins.<br>
<br>So i did the same as in the example:<br><br>import <a href="http://cv2.cv">cv2.cv</a> as cv<br>and calling the function as this:<br>cv.CreateHist([number_of_bins], cv.CV_HIST_ARRAY, rango, 1)<br><br>I hope this helps others.<br>