Drawing_in_video Progress

Posted on Thursday 17 November 2005


So as anyone in my ICM class may remember I have been working in this video area of processing where I am having processing track colors and leave a line or drawing on the screen. Below is the latest code that I have put together with the help of Dan Shiffman and Dano.

//help from Dan Shiffman allows this code to draw lines from mouse positions, next step is to combine this with
//the video tracking code to use the tracking variable

//currently lines are drawing pretty well but color selection is not very discerning, how can I limit the color to a larger range.
//Also, do I import video to limit color variation??

import processing.video.*;

Capture video;

float targetRed = 255.0;
float targetGreen =255.0;
float targetBlue = 0.0;

int [] xPoses = new int [20];
int [] yPoses = new int [20];
int whereToInsert = 0;

void setup(){
video = new Capture(this, 320, 240, 12); //initiate the video, resolution and frame rate
size(320, 240);

void captureEvent(Capture camera)

void draw(){
float worldRecord = 1000.0; //intialize the worldrecord
int xFound = 0; // initialize the location of the yellow tracking ball
int yFound = 0;

for(int j=0; j= xPoses.length){ //if array fills up set it back to 0 to avoid out of bounds error
whereToInsert = 0;
if (whereToInsert >= yPoses.length){
whereToInsert = 0;
for(int k=0; k

Sorry, the comment form is closed at this time.