We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Image, Pixels & Arrays
Page Index Toggle Pages: 1
Image, Pixels & Arrays (Read 242 times)
Image, Pixels & Arrays
Nov 19th, 2008, 4:20pm
 
Hi Everyone,
How can I make a video scan that gets the central line from an image. Do I nedd to have several arrays? One for the colors, other for the stroke? Is There a easy way?
Thx
Re: Image, Pixels & Arrays
Reply #1 - Nov 21st, 2008, 6:59pm
 
this extracts and draws only the middle line of the video:
Code:

import processing.video.*;
Movie myMovie;
void setup() {
size(160, 120);
myMovie = new Movie(this, "station.mov");
myMovie.loop();
}

void movieEvent(Movie myMovie) {
myMovie.read();
}

void draw() {
for (int i=0;i<width;i++){
stroke(myMovie.get(i,height/2));
point(i, height/2);
}
}
Page Index Toggle Pages: 1