Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

real-time frame stuff

28 views
Skip to first unread message

fma...@gmail.com

unread,
Dec 14, 2012, 11:31:03 AM12/14/12
to
Hello NG,

I'm new in this NG and pretty new to haskell too, so hi to everyone.

I am converting some of my image-processing routines from C to haskell,
as I found it faster to experiment like this.

First of all, I found a lot of libraries that do part of the stuff I need; what
I figured out is that the way to go is REPA.
Second, while working, I would have liked to have something like this:
(http://disciple-devel.blogspot.de/2011/03/real-time-edge-detection-in-haskell.html)
so, as I work on linux, I just took some v4l2 / glut libraries too, and started
trying them.

Now, I'm quite puzzled; I thought that would be pretty easy, but I see that
there will be a lot of type conversions happening all around, and maybe it's
not the right way to go.

How would you do this?
In the end I just want to have a program that, looping, just:
- grab a frame
- apply a trasformation
- output it on a window
in the fastest possible way (I don't ask for 60fps, just for an acceptable
speed for identity trasformations in the second step).

Any suggestions?

Ciao!

Dirk Thierbach

unread,
Dec 14, 2012, 3:00:21 PM12/14/12
to
fma...@gmail.com wrote:
> Hello NG,
>
> I'm new in this NG and pretty new to haskell too, so hi to everyone.
>
> I am converting some of my image-processing routines from C to haskell,
> as I found it faster to experiment like this.
>
> First of all, I found a lot of libraries that do part of the stuff I need; what
> I figured out is that the way to go is REPA.
> Second, while working, I would have liked to have something like this:
> (http://disciple-devel.blogspot.de/2011/03/real-time-edge-detection-in-haskell.html)
> so, as I work on linux, I just took some v4l2 / glut libraries too, and started
> trying them.
>
> Now, I'm quite puzzled; I thought that would be pretty easy, but I see that
> there will be a lot of type conversions happening all around, and maybe it's
> not the right way to go.

Did you try it with the type conversations? How fast is it? Is it
fast enough for you?

> How would you do this?
> In the end I just want to have a program that, looping, just:
> - grab a frame
> - apply a trasformation
> - output it on a window
> in the fastest possible way (I don't ask for 60fps, just for an acceptable
> speed for identity trasformations in the second step).
>
> Any suggestions?

I'm not familiar with REPA. According to

http://hackage.haskell.org/packages/archive/repa/3.2.3.1/doc/html/Data-Array-Repa.html

there seems to be quite a few possibilities for data. I'd do some
tests for transformations in REPA using different representations. Based on
that, decide which representations are fast enough for you. Then find
the best fitting representation among these for whatever libraries you
use to grab a frame and output it.

If in doubt, measure.

- Dirk

0 new messages