[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] gsoc midterm report for the camera module
- To: pygame-users@xxxxxxxx
- Subject: [pygame] gsoc midterm report for the camera module
- From: el lauwer <el.lauwer@xxxxxxxxx>
- Date: Fri, 17 Jul 2009 16:09:59 +0200
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: pygame-users-outgoing@xxxxxxxx
- Delivered-to: pygame-users@xxxxxxxx
- Delivery-date: Fri, 17 Jul 2009 10:10:04 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :content-type:content-transfer-encoding:mime-version:subject:date :x-mailer; bh=Jy035Rgj23nuRzq2owrQYjhUQlNT4UHjkhUaJiYTpj8=; b=xKLt4sbj0FZG9JN4po8dU1LasaVsdLjFFAky3uKFDIOEuA11hUaioE6wL+3xzqkvo4 8nHUeWy2NpVcmX4kManhaczaqcRFHROOjwjVIhBzbuDKGuMH5noQf3EUYd6G7EJBDmw1 gEFnpmJxGkB64WCRFy7EQojdYoV+dD9JIyDRQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:content-transfer-encoding :mime-version:subject:date:x-mailer; b=fSBoYN376PvDP0UpRfrXhVpG4gDLKotGMIqtv/6rPGjdsFjlUQgkzOkuZn+5rPoQLh lGISBTeLhVJhIMvelJ2NRUn5anGH+GaiTfDzoCkuLl2WKmW7dbvWnewXHj8Tf/8OnSbd YvLoXIULdYqs+hZ541jbwbD1meDAJ6lm8FZpM=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
Midterm report
##############
With the midterm evaluation behind us I thought it would be useful to
post a update
on the progress on the camera module for Mac OSX. The current version on
github.com/ab3/pygame-mirror/ can read a frame from the camera and
copy it to
the surface. There is still something wrong with the colors, this has
probably
something to do with the masks in surf->format. I have tried out some
combination
but non seem to work, so if you have suggestion on how to get the
colors write pleas
post them on the pygame mailinglist.
I have thoroughly cleaned up the camera_mac.m file and have removed
all Cocoa
code because it caused to many problems. Only the
mac_gworld_to_nsimage used
Cocoa so I didn't have to trow away too much code. The following
functions are now
available:
* mac_list_cameras()
* mac_open_device ()
* mac_init_device()
* mac_close_device()
* mac_start_capturing()
* mac_stop_capturing ()
* mac_read_raw()
note: When I try to print the string I get nothing, this is probably
because
of a \0 byte in the array.
* mac_read_frame()
* mac_camera_idle()
* mac_copy_gworld_to_surface()
note: There is something wrong with the colors.
The PyCameraObject strct has altered a bit because I don't use a
ImageSequence
anymore because it was easier to get the frame copy the frame directly
instead of
recording a frame into a sequence and then decompressing a frame out
of it. In
addition to removing the ImageSequence I make use of the buffer
struct. Here is the
current PyCameraObject struct:
typedef struct {
PyObject_HEAD
char* device_name; // unique name of the device
SeqGrabComponent component; // A type used by the
Sequence Grabber API
SGChannel channel; // Channel of the Sequence
Grabber
GWorldPtr gworld; // Pointer to the struct that
holds the
// data of the captured image
Rect boundsRect; // bounds of the image frame
long size; // size of the image in our
buffer to draw
short bytes; // number of bytes in gworld
struct buffer pixels; // pixels
} PyCameraObject;
A usual you can find the latest version on github.com/ab3 so if you
would like to test
the latest changes or would like to help with the color problem or the
read_raw function,
you are always welcome.
ToDo
====
Here is a list of thing I still have to finish I still have to do:
* fix the colors of read_frame()
* fix read_raw()
* implement set_controller() and get_controller()
* add simple computer vision stuff
* thresholding with hysteresis
*...
* optimization, sbggr8_to_rgb???
* implement proof of concept game...
Conclusion
==========
So this concludes my midterm report, feel free to post any bugs,
comments and
suggestions
Slu