1 / 11

Chap 03 視訊的互動技術

Chap 03 視訊的互動技術. 吳育龍 老師. Read video data. 1024. Screen Resolution : 1024 X 768. 768. Show Live Video. import processing.video.*; Capture video; void setup() { size(320, 240); video = new Capture(this, width, height, 30); } void draw() { if (video.available()) {

Download Presentation

Chap 03 視訊的互動技術

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chap 03 視訊的互動技術 吳育龍 老師 吳育龍老師

  2. Read video data 1024 Screen Resolution:1024 X 768 768

  3. Show Live Video import processing.video.*; Capture video; void setup() { size(320, 240); video = new Capture(this, width, height, 30); } void draw() { if (video.available()) { video.read(); image(video, 0, 0, width, height); } } 吳育龍老師

  4. Convert image to pixel array Screen Resolution 1024 X 768 0~1023 1024~2047 2048~3071 … 吳育龍老師

  5. loadPixels updatePixels Image Pixel Image 吳育龍老師

  6. PImage img = loadImage("Tulips.jpg"); • int index=0; • size(1024,768); • image(img, 0, 0,512,384); • img.loadPixels(); • for (int y = 0; y < img.height; y++) • for (int x = 0; x < img.width; x++) • { • int ic=img.pixels[index]; • float r=red(ic); • float g=green(ic); • float b=blue(ic); • if(r-b>80 && g-b>80) img.pixels[index]=color(255,0,0); //color(r-30,g-60,b+80); • index++; • } • img.updatePixels(); • image(img, 512, 0,512,384); 吳育龍老師

  7. 互動介面介紹 • 操作直覺,但亦受外在環境干擾 • 優點 • 直覺 • 不限人數 • 缺點 • 易受光源、環境影響,環境要求較嚴格 • 若校正不徹底,容易誤判 • 常需搭配藍幕 吳育龍老師

  8. 可應用的資訊 • 亮度改變 • 像素改變 • 顏色改變 • 注意 • 解析度 • 太小:資訊不足 • 太大:資料量太大,320 X 240 vs. 640 x 480 • 靈敏度 • 動作太快,會導致畫面模糊 吳育龍老師

  9. Show Live Video import processing.video.*; Capture video; void setup() { size(320, 240); String[] cameras = Capture.list(); video = new Capture(this,cameras[0]); video.start(); } void draw() { if (video.available()) { video.read(); image(video,0,0); } } 吳育龍老師

  10. Tracks red import processing.video.*; Capture video; void setup() { size(320, 240); String[] cameras = Capture.list(); video = new Capture(this,cameras[0]); video.start(); } void draw() { if (video.available()) { int index=0; video.read(); video.loadPixels(); for (int y = 0; y < video.height; y++) for (int x = 0; x < video.width; x++) { int ic=video.pixels[index]; float r=red(ic); float g=green(ic); float b=blue(ic); if(r-g>100 && r-b>100) video.pixels[index]=color(255,255,255); index++; } video.updatePixels(); image(video,0,0); } } 吳育龍老師

  11. Tracks moving • 程式碼 吳育龍老師

More Related