
Hello Cafe, since I haven't found anything like that, I wrote a small library [1] to read from a webcam in Haskell, using V4L on Linux. It uses the v4l2 package and repa for images. Is anyone interested in contributing to that, or giving some hints on how it could be made faster (I am not sure if I use repa correctly for best performance at all times), or just in emitting any other constructive comments? If yes, please give me a shout. Cheers, Christian PS I would put the whole thing on hackage, but my cabal currently doesn't want to do an sdist. [1] https://github.com/cgo/hsimage

On 25 May 2012 06:20, .
Hello Cafe,
since I haven't found anything like that, I wrote a small library [1] to read from a webcam in Haskell, using V4L on Linux. It uses the v4l2 package and repa for images. Is anyone interested in contributing to that, or giving some hints on how it could be made faster (I am not sure if I use repa correctly for best performance at all times), or just in emitting any other constructive comments? If yes, please give me a shout.
PS I would put the whole thing on hackage, but my cabal currently doesn't want to do an sdist.
I've downloaded and built this. I had to also download Claude Heiland-Allen's v4l2 source from gitorious, as that package does not seem to be on hackage (though his other related packages are). I guess your package won't build on hackage until v4l2 is uploaded ... In any case I was able to run "cabal sdist". It gave a warning about no Setup.hs file; I've sent you a pull request which adds this, and also relaxes some library constraints in the cabal file. Two questions: * you've set the license to GPL3, but the C libraries it builds on are LGPL-2.1 (libv4l2) and repa and the haskell bindings it uses are BSD3. GPL3 seems a bit restrictive for a library. * the name hsimage is fairly broad, I'd suggest a simpler name like repa-v4l2. If you want to support other device APIs or add other software image processing routines, I think it would make more sense to put those in separate packages. cheers, Conrad.

On Fri, 2012-05-25 at 08:24 +0800, Conrad Parker wrote:
I've downloaded and built this. I had to also download Claude Heiland-Allen's v4l2 source from gitorious, as that package does not seem to be on hackage (though his other related packages are). I guess your package won't build on hackage until v4l2 is uploaded ...
You're right, I remember I had to do that too when I first started the thing.
In any case I was able to run "cabal sdist". It gave a warning about no Setup.hs file; I've sent you a pull request which adds this, and also relaxes some library constraints in the cabal file.
Thanks! I will add your suggestions (probably tonight) with pleasure.
Two questions:
* you've set the license to GPL3, but the C libraries it builds on are LGPL-2.1 (libv4l2) and repa and the haskell bindings it uses are BSD3. GPL3 seems a bit restrictive for a library.
The gpl is sort of my default license. I know it is a little restrictive, so if that keeps people (if any) from contributing, I will change the license. As far as I can see, I would be able to change it to lgpl then, but not to bsd.
* the name hsimage is fairly broad, I'd suggest a simpler name like repa-v4l2. If you want to support other device APIs or add other software image processing routines, I think it would make more sense to put those in separate packages.
That was indeed my intent. I first wanted something for image processing, but seeing that there was nothing like I wanted for webcams, I started doing that. I think your suggestion for a simpler name makes sense, will probably also do that. BTW, I could not find any "more or less standard" way to represent images in Haskell. Is there anything like that? I don't know if that would make sense except being able to interact with different potential imaging packages. Maybe it's good enough to just copy image data over in most cases. Thanks again for all your suggestions, that was very helpful! Christian

On Fri, May 25, 2012 at 3:07 AM, .
The gpl is sort of my default license. I know it is a little restrictive, so if that keeps people (if any) from contributing, I will change the license. As far as I can see, I would be able to change it to lgpl then, but not to bsd.
I'm no lawyer, but my understanding is that the code is yours and you are free to license it however you want. If you choose to license your code as BSD and depend on LGPL code, then *your users* are bound by both the BSD And LGPL licenses, which is effectively as "bad" as being bound by the LGPL. Your portion of the code is still BSD-licensed, though. The distinction would probably be more evident if someone then made a BSD replacement for your dependencies, in which case they would no longer be bound by the LGPL terms if they used your library. The Haskell community does seem to have a cultural attachment to more permissive licenses, so you'll likely see a lot more adoption if you do use BSD, but it's obviously up to you. -Dan

Hi there, On 25/05/12 08:07, . wrote:
On Fri, 2012-05-25 at 08:24 +0800, Conrad Parker wrote:
I've downloaded and built this. I had to also download Claude Heiland-Allen's v4l2 source from gitorious, as that package does not seem to be on hackage (though his other related packages are). I guess your package won't build on hackage until v4l2 is uploaded ...
I've uploaded the 'v4l2' package to hackage now. When I initially wrote it last year I had hoped to use it as a base for something similar to 'repa-v4l2' and perhaps 'opengl-v4l2' (*). Alas, I don't have a pressing need to access v4l2 devices at the moment, so I don't expect there to be rapid development or even prompt bug fixes (unless people provide patches) - if someone more involved than I am at present in video devices + Haskell on Linux wants to take over the maintainership of these v4l2-related packages, let me know: https://gitorious.org/hsv4l2 Thanks, Claude (*) I had written some code along those lines, though all I can find at the moment is a screenshot (live webcam video, processed to generate an overlay and displayed using opengl): http://claudiusmaximus.goto10.org/g/haskell/v4l2hist.png
participants (4)
-
.
-
Claude Heiland-Allen
-
Conrad Parker
-
Daniel Peebles