Abeocracy

Home · GitHub · PyGame · Facebook · Disqus

A blog about my work on the camera module for pygame as part of the GSOC project.

September 25, 2009 at 12:56am
0 notes

GSOC meeting @ HSB

The coming Tuesday (29.09.09) there will be meeting of all the GSOC’ders in the Benelux. This meeting will be at the HSB in Brussels during TechTue25 (more info at HSB). There will be a lot of other people from outside of GSOC so you are always welcome if you would like to connect with technical minded people and share ideas.

PS Bring you GSOC-tshirt if it arives on time!

Comments (View)
September 9, 2009 at 5:32pm
0 notes

Belgium media and police still not entirely sure just how the internetz work...

I was quite shocked this morning when I read on deredactie.be about a terror alert aimed at a local school in the Belgium city “Mechelen”. A total of 333 police agents where dispatched, 9 arrest where made and there was even a helicopter circling the airspace in search of possible killers.

Only later this day I learned that the source of all this commotion, was a message posted on 4chan.org saying: “293 days to go until I strike at KTA Lyceum Mechelen, watch the news”.

That’s correct, 4chan the internet community famous for several internet memes like Rick’Roll, Chocolate Rain, the Sarah Palin email hack, spamming YouTube with porn, claiming Steve Job died of a heart attack, spamming the swastika symbol into Google Hot Trends, the Project Chanology, the pedo bear, threatening to bomb several football stadiums with dirty bombs, posting pictures of mock pipe bombs, and several other ‘joke’ threads.

Well on this 4chan someone threatens to harm a school almost 9 months after the posting the actual message on a site that could be considered the social dumpster of the internet. The only thing this overreaction the can ensure is just more jokes of 4chan….

Comments (View)
August 4, 2009 at 9:22am
0 notes

I just added a comment system to my blog...

From now on you can post comment on this blog thank to the friendly people of Disqus. Adding Disqus to Tumblr (or any other bog system for that matter) is very simple, and I can’t recommend enough to anyone who wants to add comments to his/her blog.

PS The comment section’s layout is still a bit ugly, I will fix that later…

Comments (View)
July 31, 2009 at 10:40pm
0 notes
The color masks of the camera are working correctly now…

The color masks of the camera are working correctly now…

Comments (View)
July 17, 2009 at 4:27pm
0 notes

GSOC 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 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 please 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: This function gives

The PyCameraObject struct 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 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

Comments (View)
1:25am
0 notes
This is a screenshot of the pygame camera module for Mac OSX at work. I was finally able to get the image from the camera onto the game surface.

PS The reason that I am blue is not because I am a night elf but because there is still something wrong with the color masks of the surface.

This is a screenshot of the pygame camera module for Mac OSX at work. I was finally able to get the image from the camera onto the game surface.

PS The reason that I am blue is not because I am a night elf but because there is still something wrong with the color masks of the surface.

Comments (View)
June 22, 2009 at 5:19pm
0 notes

GSOC Week 3-4

The past two weeks I was busy studying for my examinations, so I didn’t have much time to work on my GSOC project. However I was able to do a lot of work to get the PyCameraObject struct integrated in the existing code and implemented some additional functions.

Here is the definition of this struct, it isn’t completed yet because some “types” I would like to put into it cause compile errors.

PyCameraObject:

typedef struct {
    PyObject_HEAD
    char* device_name;              // unieke 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
} PyCameraObject;

In addition of implementing the PyCameraObject struct, I have writen the folowing functions.

  • mac_device_init():
    This function initializes the sequence grabber component and prepares it for capturing images.
  • mac_device_close():
    I have extended this function so it works with the PyCameraObject struct.
  • mac_start_capturing():
    At this moment this function
  • camera_start():
    This function just calls the above functions.
  • camera_get_size():
    Simple function that returns the size of the image frame.

Schedule for this week

This week I am planning to finish the mac_start_capturing function so that I can capture images from my camera an put then in a SDL_Surface object. As usional you can folow my work on my github account.

Comments (View)
June 1, 2009 at 1:50pm
0 notes

GSOC Week 1

Hello,

Welcome to my weekly address to the PyGame Nation. This is the first of many entries about my work on the camera module for Mac OSX.

This week I have written the following ‘simple’ functions:

  • mac_list_camera:
    On the module for Linux, a list of available cameras in made by trying out every potential device. On the OSX module I use the FindNextComponent function to search for Components of the SeqGrabComponentType type.
  • mac_device_open:
    A simple function that open a camera, it uses OpenComponent.
  • mac_device_close:
    A simple function that closes a camera, it uses CloseComponent.

The remaining time I have spend on build problems and bugs :(

Schedule for next week

The coming week I will spend my time on defining and implementing a camera class specific to Mac OSX, because the existing class is to much intertwined with v4l. When I have done that I will be able to integrate the above functions into the python module.

As usual you can follow my progress on my github account

PS I still have to add a comment system to this blog, so if you would like to comment on something I suggest you do this on the pygame mailing list.

Comments (View)
May 17, 2009 at 5:22pm
0 notes
Those of you who where wondering what the explanation for the name of my blog is, will find the above comic very illuminating…

original comic.

Those of you who where wondering what the explanation for the name of my blog is, will find the above comic very illuminating…

original comic.

Comments (View)
5:13pm
0 notes

Hello, world!

Welcome to my new blog. I will use this blog as a way to keep the outside word updated on my work on porting the camera module of pygane to Mac OSX, as part of the GSOC 2009 project.

You can follow the progress on the camera module at my personal github account. For more information on pygame please visit the official site.

In addition to pygame related stuff, I will post on other programming related topics and random jokes

PS you will be able to visit this blog at abeocracy.be in the near future, when the DNS is updated…

Comments (View)