VuongNM / cvblob

Automatically exported from code.google.com/p/cvblob
GNU Lesser General Public License v3.0
0 stars 0 forks source link

error when i use cvblob python swig interface in ubuntu opencv test.py #26

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. install Opencv-2.3.1a from http://sourceforge.net/projects/opencvlibrary/
change ffmpeg version  0.8.5, install cvblob from  
http://cvblob.googlecode.com/svn/branches/0.10.4_pythonswig (compile /example 
and run ok) 

2. compile _cvblob.so OK but when i run test.py :

What is the expected output? What do you see instead?

cvblob-read-only/interfaces/swig/python$ python test.py 
Traceback (most recent call last):
  File "test.py", line 43, in <module>
    result = cvb.cvLabel(grey,labelImg,blobs)
  File "/home/biogene/projet/cvbloub/cvblob-read-only/interfaces/swig/python/cvblob.py", line 246, in cvLabel
    return _cvblob.cvLabel(*args)
TypeError: %%typemap: could not convert input argument to an IplImage

What version of the product are you using? On what operating system?

 ubuntu version 11.10 (oneiric) / Linux biogene 3.0.0-12-generic-pae #20-Ubuntu SMP Fri Oct 7 16:37:17 UTC 2011 i686 i686 i386 GNU/Linux

Please provide any additional information below.
i arleady had cvblob in last version of ubuntu 11.04 and this error didn't 
exist yet... surely du to new opencv version ???? or i missed a library during 
installation

Original issue reported on code.google.com by biogenem...@gmail.com on 31 Oct 2011 at 1:27

GoogleCodeExporter commented 8 years ago
The Python/swig branch currently only supports OpenCV-2.1.0.

All bets are off for more recent versions of OpenCV.

Original comment by zorzalzi...@gmail.com on 31 Oct 2011 at 10:56

GoogleCodeExporter commented 8 years ago
To solve this error that you are getting you need to edit the 
cvblob_pytypemaps.i file found at CVBLOB_ROOT_DIR/interfaces/swig/python and 
change the is_iplimage function to be 

return (strcmp(o->ob_type->tp_name,"cv2.cv.iplimage") == 0);

Note the difference in the compare string it now has a prefix of cv2.

This will make the python bindings works with opencv 2.3.1a

Then to apply the fix run

make clean
make
sudo make install

The test.py program will then run successfully.

Original comment by busb...@gmail.com on 1 Jul 2012 at 5:43