SlideShare ist ein Scribd-Unternehmen logo
1 von 33
Downloaden Sie, um offline zu lesen
import processing.video.*;
Capture video;

void setup() {
	    size(640, 480);
	    //
	   video = new Capture(this, width, height);
}

void draw() {
	    //                 ?
	   if (video.available() == true) {
	   	   //
	   	   video.read();
	   	   //
	   	   image(video, 0, 0);
	   }
}
import processing.video.*;
int cols, rows;
Capture video;

void setup() {
	      size(640, 480, P3D);
	      frameRate(30);
	      video = new Capture(this, width, height);
}

void draw() {
	      if (video.available()) {
	      	    //
	     	     video.read();
	     	     //               (pixels)
	     	     video.loadPixels();
	     	     // (i)    (j)
	     	     for (int i = 0; i < width ; i++) {
	     	     	     for (int j = 0; j < height; j++) {
	     	     	     	     int loc = i + j*width;
	     	     	     	     color c = video.pixels[loc];
	     	     	     	     //
	     	     	     	     set(width-i, height-j, c);
	     	     	     }
	     	     }
	     }
}
import processing.video.*;
int cols, rows;
Capture video;

void   setup() {
	       size(640, 480, P3D);
	       frameRate(30);
	       colorMode(RGB, 255, 255, 255, 100);
	       video = new Capture(this, width, height, 12);
}

void   draw() {
	       if (video.available()) {
	       	   video.read();
	       	   video.loadPixels();
	       	
	       	   for (int i = 0; i < width / 2; i++) {
	       	   	    for (int j = 0; j < height; j++) {
	       	   	    	    int loc = i + j*width;
	       	   	    	    set(i, j, video.pixels[loc]);
	       	   	    	    set(video.width - i - 1, j, video.pixels[loc]);
	       	   	    }
	       	   }
	       }
}
import processing.video.*;
int cols, rows;
Capture video;

void setup() {
	     size(640, 480, P3D);
	     frameRate(30);
	     video = new Capture(this, width, height, 12);
	     background(0);
}

void draw() {
	     if (video.available()) {
	     	    video.read();
	     	    video.loadPixels();
	     	    for (int i = 0; i < width / 2; i++) {
	     	    	    for (int j = 0; j < height / 2; j++) {
	     	    	    	     int loc = i + j*width;
	     	    	    	     set(i, j, video.pixels[loc]);
	     	    	    	     set(video.width - i - 1, j, video.pixels[loc]);
	     	    	    	     set(i, video.height - j - 1, video.pixels[loc]);
	     	    	    	     set(video.width - i - 1, video.height - j - 1, video.pixels[loc]);
	     	    	    }
	     	    }
	     }
}
import processing.video.*;
int cols, rows;
Capture video;

void   setup() {
	      size(640, 480, P3D);
	      frameRate(30);
	      colorMode(RGB, 255, 255, 255, 100);
	      video = new Capture(this, width, height);
}
void   draw() {
	      if (video.available()) {
	      	   video.read();
	      	   video.loadPixels();
	      	
	      	   for (int i = 0; i < width ; i++) {
	      	   	   for (int j = 0; j < height; j++) {
	      	   	   	    int loc = i + j*width;
	      	   	   	    float r = red(video.pixels[loc]);
	      	   	   	    float g = green(video.pixels[loc]);
	      	   	   	    float b = blue(video.pixels[loc]);
	      	   	   	    color c = color(255 - r, 255 - g, 255 - b);
	      	   	   	    set(i, j, c);
	      	   	   }
	      	   }
	      }
}
import processing.video.*;
int cellSize = 20;
int cols, rows;
Capture video;

void   setup() {
	      size(640, 480);
	      frameRate(30);
	      cols = width / cellSize;
	      rows = height / cellSize;
	      video = new Capture(this, width, height);
	      smooth();
	      background(0);
}
void   draw() {
	       if (video.available()) {
	       	   video.read();
	       	   video.loadPixels();
	       	
	       	   for (int i = 0; i < cols; i++) {
	       	   	    for (int j = 0; j < rows; j++) {
	       	   	    	    int x = i*cellSize;
	       	   	    	    int y = j*cellSize;
	       	   	    	    int loc = x + y*video.width;
	       	   	    	    float r = red(video.pixels[loc]);
	       	   	    	    float g = green(video.pixels[loc]);
	       	   	    	    float b = blue(video.pixels[loc]);
	       	   	    	    color c = color(r, g, b, 10);
	       	   	    	    pushMatrix();
	       	   	    	    translate(x+cellSize/2, y+cellSize/2);
	       	   	    	    noStroke();
	       	   	    	    fill(c);
	       	   	    	    float radius = brightness(c)/255 * cellSize * 2;
	       	   	    	    ellipse(0,0,radius,radius);
	       	   	    	    popMatrix();
	       	   	    }
	       	   }
	       }
}
import processing.video.*;
int cellSize = 20;
int cols, rows;
Capture video;

void   setup() {
	       size(640, 480);
	       frameRate(30);
	       cols = width / cellSize;
	       rows = height / cellSize;
	       video = new Capture(this, width, height);
	       smooth();
	       background(0);
}
void   draw() {
	       if (video.available()) {
	       	   video.read();
	       	   video.loadPixels();
	       	   for (int i = 0; i < cols; i++) {
	       	   	    for (int j = 0; j < rows; j++) {
	       	   	    	    int x = i*cellSize;
	       	   	    	    int y = j*cellSize;
	       	   	    	    int loc = x + y*video.width;
	       	   	    	    float r = red(video.pixels[loc]);
	       	   	    	    float g = green(video.pixels[loc]);
	       	   	    	    float b = blue(video.pixels[loc]);
	       	   	    	    color c = color(r, g, b, 10);
	       	   	    	    pushMatrix();
	       	   	    	    translate(x+cellSize/2, y+cellSize/2);
	       	   	    	    noStroke();
	       	   	    	    fill(c);
	       	   	    	    float radius = brightness(c)/255 * cellSize * 2;
	       	   	    	    ellipse(0,0,radius,radius);
	       	   	    	    popMatrix();
	       	   	    }
	       	   }
	       }
}
import processing.video.*;
Capture video;

void   setup() {
	      size(640, 480);
	      video = new Capture(this, width, height);
	      noStroke();
	      smooth();
}

void   draw() {
	      if (video.available()) {
	      	   video.read();
	      	   image(video, 0, 0, width, height);
	      	   int brightestX = 0;
	      	   int brightestY = 0;
	      	   float brightestValue = 0;
	      	   video.loadPixels();
	      	   int index = 0;
	      	   for (int y = 0; y < video.height; y++) {
	      	   	   for (int x = 0; x < video.width; x++) {
int pixelValue = video.pixels[index];
	   	   	   	    float pixelBrightness = brightness(pixelValue);
	   	   	   	    if (pixelBrightness > brightestValue) {
	   	   	   	    	   brightestValue = pixelBrightness;
	   	   	   	    	   brightestY = y;
	   	   	   	    	   brightestX = x;
	   	   	   	    }
	   	   	   	    index++;
	   	   	   }
	   	   }
	   	   fill(255,0,0,128);
	   	   ellipse(brightestX, brightestY, 100, 100);
	   }
}
import processing.video.*;
Capture video;

int videoSliceX;
int drawPositionX;

void   setup() {
	       size(900, 480);
	       video = new Capture(this, 640, 480);
	       videoSliceX = video.width / 2;
	       drawPositionX = 0;
	       background(0);
}

void   draw() {
	       if (video.available()) {
	       	   video.read();
	       	   //
	      	    video.loadPixels();
	      	    //
	      	    loadPixels();
	      	    for (int y = 0; y < video.height; y++){
	      	    	    //
	      	    	    int setPixelIndex = y*width + drawPositionX;
//
	   	   	    int getPixelIndex = y*video.width   + videoSliceX;
	   	   	    //
	   	   	    pixels[setPixelIndex] = video.pixels[getPixelIndex];
	   	   }
	   	   updatePixels();
	   	   //
	   	   drawPositionX++;
	   	   if (drawPositionX > width - 1) {
	   	   	    drawPositionX = 0;
	   	   }
	   }
}
Ssaw08 1118

Weitere ähnliche Inhalte

Was ist angesagt?

OpenGL L07-Skybox and Terrian
OpenGL L07-Skybox and TerrianOpenGL L07-Skybox and Terrian
OpenGL L07-Skybox and TerrianMohammad Shaker
 
Graphics practical lab manual
Graphics practical lab manualGraphics practical lab manual
Graphics practical lab manualVivek Kumar Sinha
 
SE Computer, Programming Laboratory(210251) University of Pune
SE Computer, Programming Laboratory(210251) University of PuneSE Computer, Programming Laboratory(210251) University of Pune
SE Computer, Programming Laboratory(210251) University of PuneBhavesh Shah
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manualUma mohan
 
Writing SOLID C++ [gbgcpp meetup @ Zenseact]
Writing SOLID C++ [gbgcpp meetup @ Zenseact]Writing SOLID C++ [gbgcpp meetup @ Zenseact]
Writing SOLID C++ [gbgcpp meetup @ Zenseact]Dimitrios Platis
 
C graphics programs file
C graphics programs fileC graphics programs file
C graphics programs fileshubham kanojia
 
Game modeling
Game modelingGame modeling
Game modelingpriyank09
 
Paint program in c language
Paint program in c languagePaint program in c language
Paint program in c languagebit allahabad
 
Computer graphics lab assignment
Computer graphics lab assignmentComputer graphics lab assignment
Computer graphics lab assignmentAbdullah Al Shiam
 
Making Games in JavaScript
Making Games in JavaScriptMaking Games in JavaScript
Making Games in JavaScriptSam Cartwright
 
A basic introduction to open cv for image processing
A basic introduction to open cv for image processingA basic introduction to open cv for image processing
A basic introduction to open cv for image processingChu Lam
 
computer graphics practicals
computer graphics practicalscomputer graphics practicals
computer graphics practicalsManoj Chauhan
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manualAnkit Kumar
 
Computer graphics practical(jainam)
Computer graphics practical(jainam)Computer graphics practical(jainam)
Computer graphics practical(jainam)JAINAM KAPADIYA
 

Was ist angesagt? (20)

Lambda expressions in C++
Lambda expressions in C++Lambda expressions in C++
Lambda expressions in C++
 
OpenGL L07-Skybox and Terrian
OpenGL L07-Skybox and TerrianOpenGL L07-Skybox and Terrian
OpenGL L07-Skybox and Terrian
 
Graphics practical lab manual
Graphics practical lab manualGraphics practical lab manual
Graphics practical lab manual
 
Introduction to graphics programming in c
Introduction to graphics programming in cIntroduction to graphics programming in c
Introduction to graphics programming in c
 
SE Computer, Programming Laboratory(210251) University of Pune
SE Computer, Programming Laboratory(210251) University of PuneSE Computer, Programming Laboratory(210251) University of Pune
SE Computer, Programming Laboratory(210251) University of Pune
 
C# Assignmet Help
C# Assignmet HelpC# Assignmet Help
C# Assignmet Help
 
Cgm Lab Manual
Cgm Lab ManualCgm Lab Manual
Cgm Lab Manual
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 
Cgm Lab Manual
Cgm Lab ManualCgm Lab Manual
Cgm Lab Manual
 
Writing SOLID C++ [gbgcpp meetup @ Zenseact]
Writing SOLID C++ [gbgcpp meetup @ Zenseact]Writing SOLID C++ [gbgcpp meetup @ Zenseact]
Writing SOLID C++ [gbgcpp meetup @ Zenseact]
 
C graphics programs file
C graphics programs fileC graphics programs file
C graphics programs file
 
Game modeling
Game modelingGame modeling
Game modeling
 
Paint program in c language
Paint program in c languagePaint program in c language
Paint program in c language
 
Computer graphics lab assignment
Computer graphics lab assignmentComputer graphics lab assignment
Computer graphics lab assignment
 
Making Games in JavaScript
Making Games in JavaScriptMaking Games in JavaScript
Making Games in JavaScript
 
A basic introduction to open cv for image processing
A basic introduction to open cv for image processingA basic introduction to open cv for image processing
A basic introduction to open cv for image processing
 
computer graphics practicals
computer graphics practicalscomputer graphics practicals
computer graphics practicals
 
Computer graphics lab manual
Computer graphics lab manualComputer graphics lab manual
Computer graphics lab manual
 
Computer graphics practical(jainam)
Computer graphics practical(jainam)Computer graphics practical(jainam)
Computer graphics practical(jainam)
 
OpenGL L03-Utilities
OpenGL L03-UtilitiesOpenGL L03-Utilities
OpenGL L03-Utilities
 

Andere mochten auch

CSI Handwriting Analysis
CSI Handwriting AnalysisCSI Handwriting Analysis
CSI Handwriting AnalysisMrs. Henley
 
Being president civics jamie
Being president civics jamieBeing president civics jamie
Being president civics jamiegatorgirlnc
 
Presentation Mi Retail Uk New
Presentation Mi Retail Uk NewPresentation Mi Retail Uk New
Presentation Mi Retail Uk NewMoupi
 
Timo De Los Melones
Timo De Los MelonesTimo De Los Melones
Timo De Los MelonesMaria Mar
 
Looking for a gender perspective in ICT4D: CCM presentation
Looking for a gender perspective in ICT4D: CCM presentationLooking for a gender perspective in ICT4D: CCM presentation
Looking for a gender perspective in ICT4D: CCM presentationOng 2.0
 
Patient Privacy Protections
Patient Privacy ProtectionsPatient Privacy Protections
Patient Privacy Protectionskwittman
 
O Professor E O Ensina A DistâNcia
O Professor E O Ensina A DistâNciaO Professor E O Ensina A DistâNcia
O Professor E O Ensina A DistâNciaguestfce34df9
 
Curriculum Vitaé
Curriculum VitaéCurriculum Vitaé
Curriculum VitaéCucu Wesseh
 
Cambiare il mondo con le ICT... si può?
Cambiare il mondo con le ICT... si può? Cambiare il mondo con le ICT... si può?
Cambiare il mondo con le ICT... si può? Ong 2.0
 
Malaria Mapping
Malaria MappingMalaria Mapping
Malaria MappingOng 2.0
 
Homero Fernando GonzáLez G
Homero Fernando GonzáLez GHomero Fernando GonzáLez G
Homero Fernando GonzáLez GHgonzalez
 
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 9 - Profe...
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 9 - Profe...ICPSR - Complex Systems Models in the Social Sciences - Lab Session 9 - Profe...
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 9 - Profe...Daniel Katz
 
Il futuro del lavoro in rete. Office on the cloud
Il futuro del lavoro in rete. Office on the cloudIl futuro del lavoro in rete. Office on the cloud
Il futuro del lavoro in rete. Office on the cloudOng 2.0
 
Webinar Pp2 WAPAMA
Webinar Pp2 WAPAMAWebinar Pp2 WAPAMA
Webinar Pp2 WAPAMAguested766f2
 
Nuestro Liceo
Nuestro LiceoNuestro Liceo
Nuestro LiceoProfejc
 
Tactical asset allocation models
Tactical asset allocation modelsTactical asset allocation models
Tactical asset allocation modelsgolf4
 
Apresentacao 2 Q07
Apresentacao 2 Q07Apresentacao 2 Q07
Apresentacao 2 Q07BRMALLS
 

Andere mochten auch (20)

CSI Handwriting Analysis
CSI Handwriting AnalysisCSI Handwriting Analysis
CSI Handwriting Analysis
 
Being president civics jamie
Being president civics jamieBeing president civics jamie
Being president civics jamie
 
Presentation Mi Retail Uk New
Presentation Mi Retail Uk NewPresentation Mi Retail Uk New
Presentation Mi Retail Uk New
 
Timo De Los Melones
Timo De Los MelonesTimo De Los Melones
Timo De Los Melones
 
Looking for a gender perspective in ICT4D: CCM presentation
Looking for a gender perspective in ICT4D: CCM presentationLooking for a gender perspective in ICT4D: CCM presentation
Looking for a gender perspective in ICT4D: CCM presentation
 
Patient Privacy Protections
Patient Privacy ProtectionsPatient Privacy Protections
Patient Privacy Protections
 
O Professor E O Ensina A DistâNcia
O Professor E O Ensina A DistâNciaO Professor E O Ensina A DistâNcia
O Professor E O Ensina A DistâNcia
 
Curriculum Vitaé
Curriculum VitaéCurriculum Vitaé
Curriculum Vitaé
 
Cambiare il mondo con le ICT... si può?
Cambiare il mondo con le ICT... si può? Cambiare il mondo con le ICT... si può?
Cambiare il mondo con le ICT... si può?
 
Leccion
LeccionLeccion
Leccion
 
Malaria Mapping
Malaria MappingMalaria Mapping
Malaria Mapping
 
Homero Fernando GonzáLez G
Homero Fernando GonzáLez GHomero Fernando GonzáLez G
Homero Fernando GonzáLez G
 
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 9 - Profe...
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 9 - Profe...ICPSR - Complex Systems Models in the Social Sciences - Lab Session 9 - Profe...
ICPSR - Complex Systems Models in the Social Sciences - Lab Session 9 - Profe...
 
Il futuro del lavoro in rete. Office on the cloud
Il futuro del lavoro in rete. Office on the cloudIl futuro del lavoro in rete. Office on the cloud
Il futuro del lavoro in rete. Office on the cloud
 
Webinar Pp2 WAPAMA
Webinar Pp2 WAPAMAWebinar Pp2 WAPAMA
Webinar Pp2 WAPAMA
 
Nuestro Liceo
Nuestro LiceoNuestro Liceo
Nuestro Liceo
 
Tactical asset allocation models
Tactical asset allocation modelsTactical asset allocation models
Tactical asset allocation models
 
plato
platoplato
plato
 
Educação e Internet
Educação e InternetEducação e Internet
Educação e Internet
 
Apresentacao 2 Q07
Apresentacao 2 Q07Apresentacao 2 Q07
Apresentacao 2 Q07
 

Ähnlich wie Ssaw08 1118

Browsers with Wings
Browsers with WingsBrowsers with Wings
Browsers with WingsRemy Sharp
 
Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Remy Sharp
 
Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02PL dream
 
HTML5って必要?
HTML5って必要?HTML5って必要?
HTML5って必要?GCS2013
 
HTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreHTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreRemy Sharp
 
Creating an Uber Clone - Part XXII.pdf
Creating an Uber Clone - Part XXII.pdfCreating an Uber Clone - Part XXII.pdf
Creating an Uber Clone - Part XXII.pdfShaiAlmog1
 
How to build a html5 websites.v1
How to build a html5 websites.v1How to build a html5 websites.v1
How to build a html5 websites.v1Bitla Software
 
Histogram dan Segmentasi
Histogram dan SegmentasiHistogram dan Segmentasi
Histogram dan SegmentasiLusiana Diyan
 
Histogram dan Segmentasi 2
Histogram dan Segmentasi 2Histogram dan Segmentasi 2
Histogram dan Segmentasi 2Lusiana Diyan
 
HTML5 Canvas - Let's Draw!
HTML5 Canvas - Let's Draw!HTML5 Canvas - Let's Draw!
HTML5 Canvas - Let's Draw!Phil Reither
 
HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?Ankara JUG
 
I phone勉強会 (2011.11.23)
I phone勉強会 (2011.11.23)I phone勉強会 (2011.11.23)
I phone勉強会 (2011.11.23)Katsumi Kishikawa
 

Ähnlich wie Ssaw08 1118 (20)

662305 LAB13
662305 LAB13662305 LAB13
662305 LAB13
 
Browsers with Wings
Browsers with WingsBrowsers with Wings
Browsers with Wings
 
Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)Is HTML5 Ready? (workshop)
Is HTML5 Ready? (workshop)
 
Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02Is html5-ready-workshop-110727181512-phpapp02
Is html5-ready-workshop-110727181512-phpapp02
 
HTML5って必要?
HTML5って必要?HTML5って必要?
HTML5って必要?
 
HTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymoreHTML5: where flash isn't needed anymore
HTML5: where flash isn't needed anymore
 
Moustamera
MoustameraMoustamera
Moustamera
 
Creating an Uber Clone - Part XXII.pdf
Creating an Uber Clone - Part XXII.pdfCreating an Uber Clone - Part XXII.pdf
Creating an Uber Clone - Part XXII.pdf
 
How to build a html5 websites.v1
How to build a html5 websites.v1How to build a html5 websites.v1
How to build a html5 websites.v1
 
662305 10
662305 10662305 10
662305 10
 
662305 11
662305 11662305 11
662305 11
 
Shootting Game
Shootting GameShootting Game
Shootting Game
 
Histogram dan Segmentasi
Histogram dan SegmentasiHistogram dan Segmentasi
Histogram dan Segmentasi
 
Histogram dan Segmentasi 2
Histogram dan Segmentasi 2Histogram dan Segmentasi 2
Histogram dan Segmentasi 2
 
HTML5 Canvas - Let's Draw!
HTML5 Canvas - Let's Draw!HTML5 Canvas - Let's Draw!
HTML5 Canvas - Let's Draw!
 
HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?HTML5 - Daha Flash bir web?
HTML5 - Daha Flash bir web?
 
Managing console
Managing consoleManaging console
Managing console
 
I phone勉強会 (2011.11.23)
I phone勉強会 (2011.11.23)I phone勉強会 (2011.11.23)
I phone勉強会 (2011.11.23)
 
Animations & swift
Animations & swiftAnimations & swift
Animations & swift
 
A More Flash Like Web?
A More Flash Like Web?A More Flash Like Web?
A More Flash Like Web?
 

Mehr von Atsushi Tadokoro

「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望Atsushi Tadokoro
 
プログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめようプログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめようAtsushi Tadokoro
 
Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2Atsushi Tadokoro
 
coma Creators session vol.2
coma Creators session vol.2coma Creators session vol.2
coma Creators session vol.2Atsushi Tadokoro
 
Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1Atsushi Tadokoro
 
Interactive Music II Processingによるアニメーション
Interactive Music II ProcessingによるアニメーションInteractive Music II Processingによるアニメーション
Interactive Music II ProcessingによるアニメーションAtsushi Tadokoro
 
Interactive Music II Processing基本
Interactive Music II Processing基本Interactive Music II Processing基本
Interactive Music II Processing基本Atsushi Tadokoro
 
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携Atsushi Tadokoro
 
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス Atsushi Tadokoro
 
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)Atsushi Tadokoro
 
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描くiTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描くAtsushi Tadokoro
 
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリメディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリAtsushi Tadokoro
 
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使うAtsushi Tadokoro
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2Atsushi Tadokoro
 
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得Atsushi Tadokoro
 
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3DプログラミングWebデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3DプログラミングAtsushi Tadokoro
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1Atsushi Tadokoro
 
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画するiTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画するAtsushi Tadokoro
 
Media Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替えMedia Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替えAtsushi Tadokoro
 

Mehr von Atsushi Tadokoro (20)

「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
「クリエイティブ・ミュージック・コーディング」- オーディオ・ビジュアル作品のための、オープンソースなソフトウエア・フレームワークの現状と展望
 
プログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめようプログラム初級講座 - メディア芸術をはじめよう
プログラム初級講座 - メディア芸術をはじめよう
 
Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2Interactive Music II ProcessingとSuperColliderの連携 -2
Interactive Music II ProcessingとSuperColliderの連携 -2
 
coma Creators session vol.2
coma Creators session vol.2coma Creators session vol.2
coma Creators session vol.2
 
Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1Interactive Music II ProcessingとSuperColliderの連携1
Interactive Music II ProcessingとSuperColliderの連携1
 
Interactive Music II Processingによるアニメーション
Interactive Music II ProcessingによるアニメーションInteractive Music II Processingによるアニメーション
Interactive Music II Processingによるアニメーション
 
Interactive Music II Processing基本
Interactive Music II Processing基本Interactive Music II Processing基本
Interactive Music II Processing基本
 
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
Interactive Music II SuperCollider応用 2 - SuperColliderとPure Dataの連携
 
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス Media Art II openFrameworks  アプリ間の通信とタンジブルなインターフェイス
Media Art II openFrameworks アプリ間の通信とタンジブルなインターフェイス
 
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
Interactive Music II SuperCollider応用 - SuperColliderと OSC (Open Sound Control)
 
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描くiTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
iTamabi 13 ARTSAT API 実践 5 - 衛星の軌道を描く
 
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリメディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
メディア芸術基礎 II 第11回:HTML5実践 表現のための様々なJavaScriptライブラリ
 
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う芸術情報演習デザイン(Web)  第8回: CSSフレームワークを使う
芸術情報演習デザイン(Web) 第8回: CSSフレームワークを使う
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 2
 
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
iTamabi 13 第9回:ARTSAT API 実践 3 ジオコーディングで衛星の位置を取得
 
Tamabi media131118
Tamabi media131118Tamabi media131118
Tamabi media131118
 
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3DプログラミングWebデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
Webデザイン 第10回:HTML5実践 Three.jsで3Dプログラミング
 
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
Interactive Music II SuperCollider応用 JITLib - ライブコーディング 1
 
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画するiTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
iTamabi 13 第8回:ARTSAT API 実践 2 衛星アプリを企画する
 
Media Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替えMedia Art II openFrameworks 複数のシーンの管理・切替え
Media Art II openFrameworks 複数のシーンの管理・切替え
 

Ssaw08 1118

  • 1.
  • 2.
  • 3.
  • 4. import processing.video.*; Capture video; void setup() { size(640, 480); // video = new Capture(this, width, height); } void draw() { // ? if (video.available() == true) { // video.read(); // image(video, 0, 0); } }
  • 5.
  • 6.
  • 7. import processing.video.*; int cols, rows; Capture video; void setup() { size(640, 480, P3D); frameRate(30); video = new Capture(this, width, height); } void draw() { if (video.available()) { // video.read(); // (pixels) video.loadPixels(); // (i) (j) for (int i = 0; i < width ; i++) { for (int j = 0; j < height; j++) { int loc = i + j*width; color c = video.pixels[loc]; // set(width-i, height-j, c); } } } }
  • 8.
  • 9.
  • 10. import processing.video.*; int cols, rows; Capture video; void setup() { size(640, 480, P3D); frameRate(30); colorMode(RGB, 255, 255, 255, 100); video = new Capture(this, width, height, 12); } void draw() { if (video.available()) { video.read(); video.loadPixels(); for (int i = 0; i < width / 2; i++) { for (int j = 0; j < height; j++) { int loc = i + j*width; set(i, j, video.pixels[loc]); set(video.width - i - 1, j, video.pixels[loc]); } } } }
  • 11.
  • 12.
  • 13. import processing.video.*; int cols, rows; Capture video; void setup() { size(640, 480, P3D); frameRate(30); video = new Capture(this, width, height, 12); background(0); } void draw() { if (video.available()) { video.read(); video.loadPixels(); for (int i = 0; i < width / 2; i++) { for (int j = 0; j < height / 2; j++) { int loc = i + j*width; set(i, j, video.pixels[loc]); set(video.width - i - 1, j, video.pixels[loc]); set(i, video.height - j - 1, video.pixels[loc]); set(video.width - i - 1, video.height - j - 1, video.pixels[loc]); } } } }
  • 14.
  • 15.
  • 16. import processing.video.*; int cols, rows; Capture video; void setup() { size(640, 480, P3D); frameRate(30); colorMode(RGB, 255, 255, 255, 100); video = new Capture(this, width, height); }
  • 17. void draw() { if (video.available()) { video.read(); video.loadPixels(); for (int i = 0; i < width ; i++) { for (int j = 0; j < height; j++) { int loc = i + j*width; float r = red(video.pixels[loc]); float g = green(video.pixels[loc]); float b = blue(video.pixels[loc]); color c = color(255 - r, 255 - g, 255 - b); set(i, j, c); } } } }
  • 18.
  • 19.
  • 20. import processing.video.*; int cellSize = 20; int cols, rows; Capture video; void setup() { size(640, 480); frameRate(30); cols = width / cellSize; rows = height / cellSize; video = new Capture(this, width, height); smooth(); background(0); }
  • 21. void draw() { if (video.available()) { video.read(); video.loadPixels(); for (int i = 0; i < cols; i++) { for (int j = 0; j < rows; j++) { int x = i*cellSize; int y = j*cellSize; int loc = x + y*video.width; float r = red(video.pixels[loc]); float g = green(video.pixels[loc]); float b = blue(video.pixels[loc]); color c = color(r, g, b, 10); pushMatrix(); translate(x+cellSize/2, y+cellSize/2); noStroke(); fill(c); float radius = brightness(c)/255 * cellSize * 2; ellipse(0,0,radius,radius); popMatrix(); } } } }
  • 22.
  • 23. import processing.video.*; int cellSize = 20; int cols, rows; Capture video; void setup() { size(640, 480); frameRate(30); cols = width / cellSize; rows = height / cellSize; video = new Capture(this, width, height); smooth(); background(0); }
  • 24. void draw() { if (video.available()) { video.read(); video.loadPixels(); for (int i = 0; i < cols; i++) { for (int j = 0; j < rows; j++) { int x = i*cellSize; int y = j*cellSize; int loc = x + y*video.width; float r = red(video.pixels[loc]); float g = green(video.pixels[loc]); float b = blue(video.pixels[loc]); color c = color(r, g, b, 10); pushMatrix(); translate(x+cellSize/2, y+cellSize/2); noStroke(); fill(c); float radius = brightness(c)/255 * cellSize * 2; ellipse(0,0,radius,radius); popMatrix(); } } } }
  • 25.
  • 26.
  • 27. import processing.video.*; Capture video; void setup() { size(640, 480); video = new Capture(this, width, height); noStroke(); smooth(); } void draw() { if (video.available()) { video.read(); image(video, 0, 0, width, height); int brightestX = 0; int brightestY = 0; float brightestValue = 0; video.loadPixels(); int index = 0; for (int y = 0; y < video.height; y++) { for (int x = 0; x < video.width; x++) {
  • 28. int pixelValue = video.pixels[index]; float pixelBrightness = brightness(pixelValue); if (pixelBrightness > brightestValue) { brightestValue = pixelBrightness; brightestY = y; brightestX = x; } index++; } } fill(255,0,0,128); ellipse(brightestX, brightestY, 100, 100); } }
  • 29.
  • 30.
  • 31. import processing.video.*; Capture video; int videoSliceX; int drawPositionX; void setup() { size(900, 480); video = new Capture(this, 640, 480); videoSliceX = video.width / 2; drawPositionX = 0; background(0); } void draw() { if (video.available()) { video.read(); // video.loadPixels(); // loadPixels(); for (int y = 0; y < video.height; y++){ // int setPixelIndex = y*width + drawPositionX;
  • 32. // int getPixelIndex = y*video.width + videoSliceX; // pixels[setPixelIndex] = video.pixels[getPixelIndex]; } updatePixels(); // drawPositionX++; if (drawPositionX > width - 1) { drawPositionX = 0; } } }