final homework

final

for your final homework — the trick you’ve been working on — do the following for all members of the group (meaning everyone should have this info on their page, even if it’s duplicated):

a) provide a thorough write up of the trick you made, and how the software works. Don’t worry about exposing too much. Keep in mind you’ve been thinking about this trick for a while now.

b) fully document the software you wrote, along with video / screenshots and photographs. Include a short manual for usage.

c) upload a zip of the source and the data folder. Make SURE that the code compiles against 0.05 (test on another computer). Please include in addition to the zip in your write up any snippets of code that are useful or meaningful.

d) write a list of the following:
– what you learned
– what was hard / what you struggled with
– what are the next steps to developing the trick further

e) please do your best (either before, or after the 7th) to document the trick working not just on a computer monitor. For some, this might be hard, but the best you can do to get it off the screen and document it, the better.
in addition, if you collected any research along the way, about hardware, software, illusion, etc, link it up.

thanks!!


code for color tracking

uses OF 0.05 - FAT version

please see the readme — you will need to fix the RGB RBG issue with the ofxCvColorImage that’s in the 0.05 rc.

here:
colortracking.zip


homework #8

8

homework 8 -

a) in your groups do the following:

– design and storyboard a trick based on one of the categories of illusion:

  • Production
  • Vanishing
  • Transformation
  • Restoration
  • Teleportation
  • Levitation
  • Penetration
  • Prediction

we talked about. think about how the things we’ve talked about in relationship to image processing and computer vision could be used. since you are are working as a group, please post the results on each members home work page (and let me know who else is in the group, and what the group “name” is).

b) create sample material movies for blob tracking. I would like you to film, with a camera that isn’t moving a short scene that includes as the first frame a “background” and multiple objects (cars, people, hands, balls, insects, etc) that are different from the background and move across the scene. videos should be at least 10 seconds, and festure objects that leave and enter the scene (so we can talk about logic). please make at least one, but if you get inspired make more. they should be .mov files (quicktime) preferably, and without a ton of compression artifacts.

c-1) create sample material for color tracking. I would like you to do two things for this. first is assmble a bunch of images that have alot of colors in them. they can be pictures from nature or synthetic, but they should have a ton of colors, with various levels of saturation (ie, bright colors or dull colors).

c-2) I would like you to shoot video like this:

http://www.candersonmiller.com/2008/03/color-tracking-object-for-open.html

 

where you use have a brightly colored object you would like to track (you don’t have to shoot from two sides but that’s a cool idea). Alternatively, you can shoot a green screen video, where put have a moving object in front of a very saturated and even background you’d like to remove. green screen inspiration : http://images.google.com/images?q=greenscreen

have fun!


homework #7

 7

ok - so don’t worry, we’ll take some time this week to work in class.   please come prepared with a camera (webcam, or otherwise) and/or some example movies to experiment with.  movies should:

a) have a clear “background” as the first few frames
b) should be stationary camera
c) one or several moving elements
d) not too much change in light

I would like you to work on the following things — we’ll do them in class, as well, so don’t stress:

–> use the contour detection routine and info you can get so far from the CV code to create a drawing tool that doesn’t just draw an image using pixels
–> use bg subtraction to create a live mask.  use the grayscale image you get from opencv (the thresholed diff image) as the alpha channel in an RGBA image which includes the video as RGB pixels.  You’ll have to take a look at the texture example that comes with OF.
–> use motion detection and countNonZeroInRegion to develop a motion based trigger that does something, like plays a sound, controls a movie, etc
–> do the same thing for position — using countNonZeroInRegion to create one or more triggers that do something (alter a sound, control the alpha a movie, etc)

have fun!
remember also the forum: openframeworks.cc/forum if you have questions…


more cv code

screenshot

this code has opencv examples for doing two things:

a) getting contour data from a thresholded image
b) using countNonZeroInRegion to get the number of white pixels in a given zone

hope you put it to good use!

here: cvCode2


homework #6

welcome to opencv land.

first, some info about opencv:
http://opencvlibrary.sourceforge.net/  (good faq, etc)
http://www.cs.iit.edu/~agam/cs512/lect-notes/opencv-intro/index.html
we are not using highgui, etc, just cxCore and cv.  There is alot in opencv, so useful to poke around and see what’s possible.

for homeworks:
a) install opencv following the instructions in class:  download the addon from openframeworks.cc/addons page.  Follow all the steps to adding it to your project (except if you want altering the testApp.cpp, testApp.h and main.cpp etc which I’ve included in the posts below).  Once it’s up, swap the computerVision code with the code thats in the top post of the of.cc/forums extend thread.   sorry for the hard work - 0.05 is alot easier and we have mac and pc finished here in UK.

b) make a better background subtractor by adding variables controllable by key command for threshold, the number of times to erode, the number of times to dilate, the thresholded image.   Show the bounding box and centroid of the white pixels in the thesholded image.

c) by comparing the previous frame with the current frame (instead of the backgorund)  make an example of motion detection.

d) you can accumulate the motion information (thresholded pixels identified as motion) into another image and have that image fade out over time to create a motion history image.  can you tell something interesting about what’s happened over time?

have fun!


opencv code —

opencv examples

have fun!

note: the openframeworks / opencv stuff seems to be missing invert, you can add to the ofCvGrayscaleImage class like this:

int h:
void invert();

in .cpp
void ofCvGrayscaleImage::invert(){
cvNot(cvImage, cvImage);
}


homework #5

  • (a) solve the “edge” problem we talked about (ie, our process code doesn’t deal with edge conditions, fix that)
  • (b) show good and bad examples of edge detection.  focus especially on getting edge detection to show you something meaningful about the image.  remember that you perform edge detection for different edges, so you might need to combine multiple passes of an image together.
  •  (c) get the image processing operations happening repetitively,  in order to hook up to a drawing tool (like your earlier assignment). Can you draw into an image that is being processed repetitively.
  • (d) on the topic of drawing and repetitive processing, implement conways game of life in an image.

bonus :  the heavy blur / text detection idea, blur out an image heavily and compare the blurred with original (via absolute diff) into a third image in order to segment text….

have fun!


code for kernels

processing code 2

also, good info about image processing / kernels :

http://www.mini.pw.edu.pl/~kotowski/Grafika/Images/Index.html 


homework #4

4

homework # 4:

a) take the histogram of an image.  likely you will need to normalize the results (ie, find the largest value in order to convert all values into the range of 0-1) in order to draw the results well.
b)  take the histogram before and after you contrast stretch an image.  Find a grayish image where the pixel are not in the range of 0-255.  find a way to convert the pixels to be in the range of 0-255.
c) take the histogram of several of the  “synthetic” images from the second homework
d) (optional) see if you can use the histogram to find a good value to threshold an image.  for example, are there certain kinds of histograms that will tell you where you can seperate bright objecst from a dark background?  can you think of a way to do this dynamically? (hint - think hills and valleys)

+

e)  using the NESW ideas we coded on the board, and the image processing code posted on the blog, please implement erosion and dilation of a binarized (thresholded) image.   Erosion = if you are a white pixel touching any black pixels (along the 8 connected edges) you become black.  Dilation = if you are a black pixel touching a white pixel you become white.
f) (optional) using the NESW & process code, can you perform median filtering on an image?  with median filtering, you need to take the 9 values (the pixel you are comparing the 8 connected) and sort them (using quick sort or another algorithm)  and take the middle value to be the pixel value in the new image.

have fun! please email if you have questions…