Manipulating pixels

These days I»ve been learning how to manipulate pixels using openframeworks. The reason of why I»ve been doing this, is that I am going to use computer vision techniques for traking the laser and find hot spots in the image that will be captured from the cam. These techniques are based on pixel manipulation and pixel differences. So first I need to know how can I work with each one of the pixels that my camera is recording.

I am following a course that Zachary Lieberman taught last year at Parson»s school of Design that is called Magic++, and I»ve been doing some exercises from this course.

Here is the blog of the course with all the exercises, projects and homeworks that the students did:
Magic++

These are some of the exercises I»ve done so far, that corresponds to weeks from 1 to 5.

Pixel synthesizer
The first one I am going to show is about manipulating and playing with pixels. The goal was to do a kind of programm for creating images from synthesis, using gray scale tones.

code:

Counting pixels
In this one the information of each pixel is converted to a binary value, doing a threshold in the image, that is black or white. the goal is to minimize the information of each pixel so in the future will be easier to find differences between them. A boundry box is created to make visible the area that is being used by the pixels.

code:

Contrast
This exercise was about contrasting and image that didn»t have much information about white and black, only gray values.
There is also a historiogram for helping visualize what is happening and how is the distribution of the pixels in regard to the gray scale.

code:

Dinamic historiogram
This is just the historiogram that he saw before, but dinamic.

code:
_