[Haskell-cafe] Open CV or alternate image processing library for Haskell on windows?
jvlask at hotmail.com
Wed May 18 10:57:09 CEST 2011
On 18/05/2011 2:02 PM, Ville Tirronen wrote:
I have successfully* built HOpenCV on windows with openCV 2.0 on windows
* by successfully, I mean compiled and linked, library and test.hs. The
test did give
me an error:
test-hopencv.exe: user error (Failed to create camera)
which, I have not bothered to follow up any further.
The build process was as follows (your paths will differ):
1) I installed openCV to C:\apps\OpenCV2.0
2) I unzipped HOpenCV-0.1.2.2 to some directory
3) edited cabal file
edited the following entries to
and also edited the extra-libraries to ...
extra-libraries: highgui200, cv200, cxcore200
unless when installing OpenCV you added the install path to your path..
ghc Setup build "--hsc2hs-options=-L -Wl,-("
the "--hsc2hs-options=-L -Wl,-(" option is neccessary in order to ovoid
defined reference to `cvFree_'
for some reason (and I really can't understand why) gcc requires the
highgui200, cv200, cxcore200
libraries after the object (normally dosn't) and the "-L -Wl,-("
instructs hsc2hs to pass -Wl,-C
to gcc, which in turn instructs gcc to pas -( to the linker which in
turn tells the linker
to re-read the libraries to resolve the references. (somewhere something
is going wrong)
6) run the test ...
> Yes, I understand that - but if there is some install or usage dependency,
>> or install procedure, I would hope to see it documented somewhere; perhaps I
>> missed that?
> The only installation procedure I can document is how to do this in linux.
> My guess is that it must be similar with windows.
> 1. Get the opencv library from opencv.willowgarage.com
> 2. Install it and make a note where it installs
> 3. cabal install CV. If this fails with missing C libraries, then,
> (4). cabal install CV --with-extra-lib-dirs=where_the_opencv_libs_are
> However, wait few hours so I can push a new version to hackage. There are
> few things I've already discovered that fail to work with other people and I
> think I can fix them.
> The CV package is something I threw together, originally in pre-cabal times.
> Back then I arguably wasn't a very good haskell-programmer and the whole
> thing was under an nda. Since then I've casually evolved the library to suit
> my needs. After I saw CV-combinators library released I made a petition to
> publish my codes in hopes that it would help other people doing similar
> In short, although CV package is very very useful for me, it is not a
> perfect binding, and the implementation isn't really smart at places. I
> would like to make it great, however.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe