[Pkg-scicomp-devel] Bug#607499: Bug#607499: segment fault in python-opencv

Nobuhiro Iwamatsu iwamatsu at nigauri.org
Thu Jan 6 06:34:35 UTC 2011


Hi,

Thanks for your report!

2010/12/19 Lingfeng Xiong <whitebear at freebearmail.org>:
> Package: python-opencv
> Version: 2.1.0-3
>
> The new python interface of OpenCV seems work well except the
> cv.CreateHist. If I call this function, it would told me "segment
> fault" and python crashed.
>
> [code]
> bear at bear:~$ python
> Python 2.6.6 (r266:84292, Oct  9 2010, 12:24:52)
> [GCC 4.4.5] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import cv
>>>> cv.Createhist(2,cv.CV_HIST_ARRAY)
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
> AttributeError: 'module' object has no attribute 'Createhist'
>>>> cv.CreateHist(2,cv.CV_HIST_ARRAY)
> segment fault
> bear at bear:~$
> [/code]
>
> The old interface seems not work either. Whatever dimensions I
> supplied, it always told me "Number of dimensions is out of range".
> [code]
> bear at bear:~$ python
> Python 2.6.6 (r266:84292, Oct  9 2010, 12:24:52)
> [GCC 4.4.5] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import opencv
>>>> opencv.cv.cvCreateHist(2, opencv.cv.CV_HIST_ARRAY)
> Traceback (most recent call last):
>  File "<stdin>", line 1, in <module>
>  File "/usr/lib/pymodules/python2.6/opencv/cv.py", line 6803, in cvCreateHist
>    return _cv.cvCreateHist(*args)
> RuntimeError:  openCV Error:
>        Status=Unknown error code -19
>        function name=cvCreateHist
>        error message=Number of dimensions is out of range
>        file_name=/tmp/buildd/opencv-2.1.0/src/cv/cvhistogram.cpp
>        line=1478
>>>>
> [/code]
>
> I hope you can fix the "segment fault" error as soon as possible :)

This is NOT a bug. if you want to use cvCreateHist by Python,
You need to use the first argument a list.

e.g.
opencv.cv.cvCreateHist([2], opencv.cv.CV_HIST_ARRAY)

Best regards,
  Nobuhiro

-- 
Nobuhiro Iwamatsu
   iwamatsu at {nigauri.org / debian.org}
   GPG ID: 40AD1FA6





More information about the Pkg-scicomp-devel mailing list