[Haskell-cafe] Open CV or alternate image processing library for Haskell on windows?

Gregory Guthrie guthrie at mum.edu
Tue May 17 05:47:41 CEST 2011

Below is the install result. It does claim that "You must install OpenCV (development packages) prior to installing this package."
I don't' see any Haskell /cabal opencv package, so am not sure what this means one has to do.

I am not familiar enough with the Haskell install and make environment to go hacking into it, I was hoping for a simple cabal install!

Thanks for the note and pointers. I am a bit surprised at the lack of graphics and Image processing libraries. I found several for Unix/Linux only, and their installs on Windows fail.

I also love Linux, but windows is the 93% market share, and our student labs are all windows. I am trying to advocate using FP in more of our undergraduate level courses, and thought this might be a good area; perhaps not.

Are the two packages for Hopencv the two on the hackage page? It looked to me like only one was claimed to be current and mostly complete.

C:\Users\guthrie>cabal install hopencv
Resolving dependencies...
Configuring HOpenCV-
Warning: 'include-dirs: /usr/include/opencv' directory does not exist.
Warning: 'include-dirs: /usr/include/opencv' directory does not exist.
cabal: Missing dependencies on foreign libraries:
* Missing C libraries: cv, highgui, cv, highgui
This problem can usually be solved by installing the system packages that
provide these libraries (you may need the "-dev" versions). If the libraries
are already installed but in a non-standard location then you can use the
flags --extra-include-dirs= and --extra-lib-dirs= to specify where they are.
cabal: Error: some packages failed to install:
HOpenCV- failed during the configure step. The exception was:
ExitFailure 1

C:\Users\guthrie>cabal install cv
Resolving dependencies...
Configuring unix-
cabal: The package has a './configure' script. This requires a Unix
compatibility toolchain such as MinGW+MSYS or Cygwin.
cabal: Error: some packages failed to install:
CV- depends on unix- which failed to install.
JYU-Utils- depends on unix- which failed to install.
unix- failed during the configure step. The exception was:
ExitFailure 1

C:\Users\guthrie>cabal install highgui
cabal: There is no package named 'highgui'.
You may need to run 'cabal update' to get the latest list of available

> -----Original Message-----
> From: Casey McCann [mailto:syntaxglitch at gmail.com]
> Sent: Monday, May 16, 2011 1:18 PM
> To: Gregory Guthrie
> Cc: haskell-cafe at haskell.org
> Subject: Re: [Haskell-cafe] Open CV or alternate image processing library for Haskell on
> windows?
> On Mon, May 16, 2011 at 8:37 AM, Gregory Guthrie <guthrie at mum.edu> wrote:
> > I wanted to look into using Haskell for an introductory Image Processing class, but the main
> package used for such things (OpenCV) does not appear to be available for windows systems.
> >
> > Is there some other good option for image processing in Haskell, or has anyone ported
> openCV to a windows Leksah environment?
> Which package are you having difficulty with? OpenCV is a library written in C/C++ and
> appears to work on Windows, and there looks to be two different packages on Hackage
> providing bindings to it, neither of which seems to have any issues with Windows. One does
> rely on the unix package, but my understanding is that Cygwin is sufficient for that--not
> certain about the details, though. I haven't used any of these packages or OpenCV itself
> personally, so there may be further issues I'm not seeing, but I would guess that any
> difficulty you've encountered was a matter of build tools and system configuration, not the
> libraries themselves.
> I have found it necessary on multiple occasions to do manual tweaks and jury-rigging when
> installing FFI bindings from Hackage on Windows, as opposed to the typically seamless
> process of installing an external library from standard repositories on Ubuntu and then
> bindings from Hackage. Admittedly this may be due in large part to the horrendous condition
> of build tools on my Windows system. I believe I have two different GHCs and no less than
> four copies of GCC in different locations and I've given up on making sense of it since I'm
> rarely on my Windows machine when coding Haskell anyway.
> Incidentally, have you looked at what functionality the bindings packages offer? Both that I
> saw on Hackage seem to advertise themselves as emphatically not production-ready code and
> probably don't expose all the features of OpenCV. Before you put a lot of time into fixing
> build problems, you may want to verify that they even provide what you need. As a last
> resort, writing your own Haskell FFI bindings to a C library is sometimes tedious but not
> usually difficult, and there are tools to help automate the task.
> I'm not aware of any other existing packages in Haskell for image processing or computer
> vision. Depending on what you need, you could write FFI bindings (to OpenCV or something
> else) or, if you mostly want to work with raw data instead of using algorithms provided by the
> library, there was actually a question on Stack Overflow recently that may be relevant:
> http://stackoverflow.com/questions/6006304
> - C.

More information about the Haskell-Cafe mailing list