Update to OpenCV plugin

729 views
Skip to first unread message

Rupert Brooks

unread,
Jul 31, 2013, 9:56:23 PM7/31/13
to pyth...@googlegroups.com
Hi,

Python XY is a great distro, very useful under windows.  Unfortunately the openCV plugin is a bit out of date - any update on the horizon?  I'd be willing to do at least some of the work, whats the process?

Thanks
Rupert

Gabi Davar

unread,
Aug 1, 2013, 10:38:26 AM8/1/13
to pyth...@googlegroups.com
Hi,

I've just recently completed rebuilding/updating OpenCV - It would be great if you could assist in at least testing it.

https://pythonxy.googlecode.com/files/OpenCV-2.4.6.1-1_py27.exe

The process if building OpenCV not trivial. The following was used to build from source using the following:
  1. Windows X64
  2. VS2008
  3. cmake
  4. Intel MKL + IPP
  5. Locally built libraries:
    1. expat
    2. freetype
    3. turbojpeg
    4. libpng
    5. zlib
    6. libtiff
    7. hdf5
    8. szip
  6. With externally build libraries:
    1. ffmpeg + custom patches (need to submit those)
    2. Qt
It took circa 8 hours to get the above to build and link and work with xy.

Hope this helps.

-gabi

pjaytycy

unread,
Aug 1, 2013, 11:00:22 AM8/1/13
to pyth...@googlegroups.com
This is certainly good news, and I am grateful for that, but why do you *have* to rebuild it?

It seems the official binaries work too, the only thing that is needed is to copy cv2.pyd to C:/Python27/lib/site-packages

Is there any reason why your compilation is needed?


Kind regards,

Pieter-Jan

Rupert Brooks

unread,
Aug 1, 2013, 9:16:37 PM8/1/13
to pyth...@googlegroups.com
Unfortunately, not working yet:
Inline image 1

Sorry for the screen shot, for some reason enhanced console window doesn't want to let me cut and paste.

Im using Windows 8, 64 bit.  I had installed the latest pythonxy (2.7.5).  I installed the baselibs, then the opencv installer that you linked to.

BTW, you'll see from the path that i have the opencv source, but i got it for the samples, i have not compiled and installed it over top.

Rupert

--------------------------------------------------------------
Rupert Brooks
rupert...@gmail.com


On Thu, Aug 1, 2013 at 8:45 PM, Rupert Brooks <rupert...@gmail.com> wrote:
I'm downloading to test now....

I cant answer why or whether it needs to be rebuilt specially to work with python XY.  But i definitely appreciate having the python Xy build available - I am planning to teach a workshop using OpenCV python - its very nice to be able to send the students to a distro like pythonXY and have things just work out of the box.

--Rupert

--------------------------------------------------------------
Rupert Brooks
rupert...@gmail.com


--
You received this message because you are subscribed to the Google Groups "python(x,y)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pythonxy+u...@googlegroups.com.
To post to this group, send email to pyth...@googlegroups.com.
Visit this group at http://groups.google.com/group/pythonxy.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


image.png

Rupert Brooks

unread,
Aug 1, 2013, 8:45:10 PM8/1/13
to pyth...@googlegroups.com
I'm downloading to test now....

I cant answer why or whether it needs to be rebuilt specially to work with python XY.  But i definitely appreciate having the python Xy build available - I am planning to teach a workshop using OpenCV python - its very nice to be able to send the students to a distro like pythonXY and have things just work out of the box.

--Rupert

--------------------------------------------------------------
Rupert Brooks
rupert...@gmail.com


On Thu, Aug 1, 2013 at 11:00 AM, pjaytycy <pieterjan....@gmail.com> wrote:

--

Gabi Davar

unread,
Aug 2, 2013, 4:41:54 AM8/2/13
to pyth...@googlegroups.com
Hi Rupert,

Does the target system has OpenCL.dll available? I've enabled support for it and unfortunately it requires a modern display card + drivers. 

Please try:

It has no dependencies on OpenCL. Feedback will be much appreciated.

-gabi

Gabi Davar

unread,
Aug 3, 2013, 8:15:57 AM8/3/13
to pyth...@googlegroups.com
Hi Pieter-Jan,

Reasons:
  • Enable features not enabled by default (tbb and ipp support for example).
  • Eliminate duplicate library dependencies (jpeg, png, tiff etc).
  • Run the test suite.
-gabi

Rupert Brooks

unread,
Aug 3, 2013, 9:18:28 AM8/3/13
to pyth...@googlegroups.com
Hi,

Success!  This works as far as i can tell - specifically, the module loads without incident, and at least the watershed and plane_ar examples run.  Its too bad - on systems where OpenCL is available it would be nice to have it.  This particular system is old and doesnt support either openCL or CUDA.

BTW - do you include the OpenCV examples somewhere in the python xy download - its not necessary, maybe not even desirable, but if they are already there i would use em directly, not make people download them separately.

Rupert

--------------------------------------------------------------
Rupert Brooks
rupert...@gmail.com

Gabi Davar

unread,
Aug 3, 2013, 1:31:55 PM8/3/13
to pyth...@googlegroups.com
Hi Rupert,

AFAIK OpenCL is pretty much standard in all current shipping drivers (Nvidia, Intel and AMD) - but not in virtual environments.

OpenCV plugin comes with the official PDF documentation and the python & python2 sample directories. In fact _all_ XY plugins come their complete set of documentation and samples (unlike typical binary packages).

You can find them in c:\Program Files (x86)\pythonxy\doc .

-gabi

Rupert Brooks

unread,
Aug 4, 2013, 6:23:45 PM8/4/13
to pyth...@googlegroups.com
hi Gabi

Great that the opencv samples are included!

i tried a few more variations
- I tried to get an update for the video card on the windows 8 machine i first tried on.  No dice.  its not going to have ocl. You may or may not decide to support machines beyond a certain age, but:
- I tried on an XP machine at my office (yes we still develop on XP).  Same problem as the windows 8 machine.  Build number 2 seems to work.  I was remote, so i will try more carefully tomorrow, but it seems ok.
- I tried on a Windows 7 machine - and both installers would load cv2 without dll problems, but would not run even the simplest examples, but with different errors than before.  This machine has a different version of OpenCV on it.  i removed that version from the path, so it should not be interfering but if things are stuck in the registry... who knows what it might do.

Errors were:
Inline image 1

Again, sorry about the image snapshot - for some reason enhanced console doesn't seem to allow cut and paste of text.  Unfortunately i dont really know what to tell you about this build at this point.  I will continue testing tomorrow on a different, clean, windows 7 machine.

best,
Rupert



--------------------------------------------------------------
Rupert Brooks
rupert...@gmail.com
Clipboard01.jpg

Rupert Brooks

unread,
Aug 5, 2013, 1:01:38 PM8/5/13
to pyth...@googlegroups.com
Hi,

I'm having a bit of trouble - on that XP machine i was mentioning, in the end, i get the same dll error with either build of the openCV plugin.

How can i go back to the old version of openCV?  I cant find a downloadable installer for it on the website.  Also, if from the python XY tool (Python(x,y) Home), i try to remove any plugins, it pops up the Add or Remove programs dialog, but the plugin itself is not there.  I could remove all of python xy, but i would rather just somehow add and remove plugins.

Just a link to the right doc is fine, clearly i am not reading the right thing.

Rupert



--------------------------------------------------------------
Rupert Brooks
rupert...@gmail.com
Clipboard01.jpg

Rupert Brooks

unread,
Aug 5, 2013, 5:12:44 PM8/5/13
to pyth...@googlegroups.com
One more update.  On a clean Windows 7 machine, with a modern graphics card, both installers work.

Rupert

--------------------------------------------------------------
Rupert Brooks
rupert...@gmail.com
Clipboard01.jpg

thomash

unread,
Sep 19, 2013, 12:01:24 PM9/19/13
to pyth...@googlegroups.com
Recently I held a course on video processing with Python and OpenCV, and I used the following instructions for installation. On my system, 64 bit Win7, and Python 2.7  (and the system of the conference organizers) these procedures worked reliably.

Install Python
==============

**Comment:**
This performs the basic Python installation, with all common toolboxes. As it
comes with OpenCV2.4.2 (and some of the applications there don't work for me)
we will skip the OpenCV package, and install it manually afterwards. Note that
this will take some time!

- Download "Python(x,y)-2.7.5.0.exe" from https://code.google.com/p/pythonxy/wiki/Downloads
- install Python(x,y), Version 2.7.5.0 as follows:
    - first choose the "Full" option
    - then unselect "OpenCV2.4.2"

Install OpenCV
==============

**Comment:**
This installs most of the functionality of OpenCV, including codecs required
to evaluate videos. Since the display of images still causes trouble
afterwards, we will replace some libraries with those from another build
below.

- From "http://www.lfd.uci.edu/~gohlke/pythonlibs/#opencv" download
  "opencv-python-2.4.6.win32-py2.7.exe", and run it.

Update some OpenCV-libraries
============================

**Comment:**
At least on my computer, I had to do this to display images properly. In a
pinch, this step could be skipped, and "imshow" from Matplotlib could be used
for the display of images. OpenCV also worked properly form me when I
re-compiled OpenCV by hand - but this takes quite a bit of time.

- Download http://sourceforge.net/projects/opencvlibrary/files/latest/download?source=files
- Run "OpenCV-2.4.6.0.exe", and unzip them e.g. to "C:\" (this will create an
    "openCV" directory there)
- Copy all files from "C:\openCV\build\x86\vc10\bin" to
    "C:\Python27\Lib\site-packages" (overwrite existing files)
- Copy "C:\openCV\build\python\2.7\cv2.pyd" to "C:\Python27\Lib\site-packages"
- If you are very short of space, you can delete the extracte "C:\openCV"
  directory now, as it takes up almost 3 GB of space. If you have the space,
  keep it for the moment, as it has some good sample files.


Rupert Brooks

unread,
Oct 20, 2013, 5:12:01 PM10/20/13
to pyth...@googlegroups.com
A small update on this, in case anyone is following along.  This error is caused when it cant load an image, and passes a null of some kind to an opencv function.  Its cryptic, but indicated in one case that an image could not be opened, in another, that the camera had timed out.  resolving those problems got rid of this crash.  So the installer worked on that win 7 machine as well.  Basically, winXP is not supported... and we can probably live with that.

--r

--------------------------------------------------------------
Rupert Brooks
rupert...@gmail.com
Clipboard01.jpg

Rupert Brooks

unread,
Nov 5, 2013, 9:55:01 AM11/5/13
to pyth...@googlegroups.com
Sorry to be so long to reply. On a Windows XP, 32-bit, i removed the opencv that was installed with python xy, and i installed the OpenCV from the installer directly (ie, i skipped over the step from


and went straight to the last step.)  

So far, seems to be working.  At least some of the example scripts run.

Rupert

--------------------------------------------------------------
Rupert Brooks
rupert...@gmail.com


Reply all
Reply to author
Forward
0 new messages