[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[pygame] Camera module change proposal



Hello all,

With 1.9 coming out soon, I think it is best that we decide on a final
API for the camera module to use going forward.  The current module
was designed largely for v4l2 on low performance fixed point CPUs, and
the API reflects that.  With OS X support coming this summer from
Werner, and Windows support coming soon, we should decide on something
that works well across all platforms.

1.  Remove colorspace conversion from the camera module:
Currently, the camera module can "capture" images as RGB, YUV, or HSV.
 There are a lot of conversion shortcuts going on under the hood to
get the quickest path from raw pixel data to the desired colorspace.
Unfortunately, this also multiplies the amount of code and work
necessary to bring the camera module to other platforms.  The use
cases for this feature are also fairly limited, since anyone doing
serious computer vision is better off using OpenCV.  I propose having
the camera module do the more relevant task of just capturing RGB
images, and have a seperate colorspace conversion function, either the
transform or the color module, which takes any RGB surface and outputs
an HSV or YUV surface.

2.  Camera controls:
I'm not sure what to do here.  V4l2 controls are very useful to have,
but there doesn't seem to be a Windows or OS X equivalent as far as I
can tell.

Any ideas on either?

Nirav