Download
http://webcamxtra.sourceforge.net/download.shtml


Reference
http://webcamxtra.sourceforge.net/reference.shtml


JMyron 활용
- Motion detection
- Color tracking


다운받은 파일에 포함되어 있는 Example 들입니다.

예제 - Motion detection
frame difference (현재프레임과 다음프레임 이미지의 차이)를 이용하여 움직임을 감지해
녹색원을 그려주는 예제.
frame difference 이미지에서 검출된 여러 glob(덩어리)들의 중심좌표값들을 평균하는 방식


Myron_CameraAsMouse.pde
---------------------------------------------------------------------------------------------------
/*
the green oval is an averaged position of all the detected dark movement in the camera's view.
physical setup:
  - make sure there is a strong value contrast between your hand and a white background.
  - set all camera settings to "manual" for the most stable results.
 last tested to work in Processing 0090

 JTNIMOY
*/

import JMyron.*;

JMyron m;//a camera object

//variables to maintain the floating green circle
float objx = 160;
float objy = 120;
float objdestx = 160;
float objdesty = 120;

void setup(){
  size(640,480);

  m = new JMyron(); // JMyron 개체 생성
  m.start(width,height); // JMyron 시작
  m.trackColor(255,255,255,256*3-100); // white 를 track color 로 지정
  m.update();
  m.adaptivity(10); // frame difference 의 반응속도 설정
  m.adapt(); // 최초 시작시는 바로 adapt
  println("Myron " + m.version());
  rectMode(CENTER);
  noStroke();
}


void draw(){
  background(0);
  m.update();  //update the camera view
  drawCamera();
 
  int[][] centers = m.globCenters(); // glob 의 중심좌표 값들을 centers 라는 2차원 배열에 저장

  float avX=0;
  float avY=0;
 
  // centers 좌표를 모두 더해서 avX 와 avY에 저장
  for(int i=0;i<centers.length;i++){
    avX += centers[i][0];
    avY += centers[i][1];
  }
  // centers.length 로 나누어 평균을 구한다
  if(centers.length-1>0){
    avX/=centers.length-1;
    avY/=centers.length-1;
  }

  // 평균점을 빨간색 사각형으로 표시
  fill(255,0,0);
  rect(avX,avY,5,5);

  // 새로운 평균점을 destination 좌표에 저장
  if(!(avX==0&&avY==0)&&centers.length>0){
    objdestx = avX;
    objdesty = avY;
  }

  // 물체의 좌표를 destination 좌표로 이동 하고 녹색원을 그린다
  // (급작스럽게 튀는 이동을 방지하기위해 easing 방식 으로 더해가면서 이동)
  objx += (objdestx-objx)/5.0f;
  objy += (objdesty-objy)/5.0f;
  fill(30,100,0);
  ellipseMode(CENTER);
  ellipse(objx,objy,30,30); // 원 그리기 : 이를 대체해서 원하는 것을 그릴 수 있습니다.
}

void drawCamera(){
  // 화면에 frame difference 이미지를 그려준다
  int[] img = m.differenceImage(); //get the normal image of the camera
  loadPixels();
  for(int i=0;i<width*height;i++){ //loop through all the pixels
    pixels[i] = img[i]; //draw each pixel to the screen
  }
  updatePixels();
}


public void stop(){
  m.stop();//stop the object
  super.stop();
}



예제 - Color tracking
trackColor 함수로 지정된 컬러를 traking 하여 box들로 그려줍니다.
참고로 reference 에 보시면 trackNotColor 라는 함수도 있어서 검출을 원하지 않는 컬러도
지정이 가능한듯 합니다.


Myron_tracking.pde
---------------------------------------------------------------------------------------------------
/*

This example shows a whole lot of different
tracking methods being rendered at one time.
Don't be surprised if this one runs really slowly.

 last tested to work in Processing 0090
 
 JTNIMOY
 
*/

import JMyron.*;

JMyron m;
 
void setup(){
  int w = 640;
  int h = 480;
 
  size(w,h);
  m = new JMyron();
  m.start(640,480);
  m.findGlobs(1);
  println("Myron " + m.version());
}

void mousePressed(){
  m.settings();
}

void draw(){
  m.trackColor(180,180,120,255); // track하고자 하는 컬러 지정 (r,g,b,tolerance)

  m.update();
  int[] img = m.image();
 
  //first draw the camera view onto the screen
  loadPixels();
  for(int i=0;i<width*height;i++){
      pixels[i] = img[i];
  }
  updatePixels();
 
 
  // 마우스 포인터 영역 근처의 컬러 평균값으로 네모 그리기
  noStroke();
  int c = m.average(mouseX-20,mouseY-20,mouseX+20,mouseY+20);
  fill(red(c),green(c),blue(c));
  rect(mouseX-20,mouseY-20,40,40);

  noFill();
  int[][] a;


  // 검출된 glob 들의 중심점을 노란색으로 찍기
  a = m.globCenters();
  stroke(255,255,0);
  for(int i=0;i<a.length;i++){
    int[] p = a[i];
    point(p[0],p[1]);
    println("p[0]="+p[0]+", p[1]="+p[1]);
  }
 

  // 검출된 glob 을 사각형으로 그리기
  a = m.globBoxes();
  stroke(255,0,0);
  for(int i=0;i<a.length;i++){
    int[] b = a[i];
    rect(b[0], b[1], b[2], b[3]); // 위의 p[0],p[1] 이나 이 b[0], b[1] 등의 값들을 활용해서 작업.
  }


}

public void stop(){
  m.stop();
  super.stop();
}


Posted by 알 수 없는 사용자
Etc/참고2008. 7. 14. 16:43
사용자 삽입 이미지
사용자 삽입 이미지
Posted by 알 수 없는 사용자
Etc/참고2008. 7. 14. 16:39
사용자 삽입 이미지
사용자 삽입 이미지
사용자 삽입 이미지
Posted by 알 수 없는 사용자
Etc/site2008. 7. 12. 23:47
다들 잘 아시는
존마에다 관련 영상입니다. 즐감하세욧!!!!!!!!


http://www.ted.com/index.php/talks/john_maeda_on_the_simple_life.html
Posted by chacolina
Etc/참고2008. 7. 11. 09:59

사용자 삽입 이미지

토론토, 시카고, 할리우드, 암스테르담에서 성공적인 이벤트를 개최한 FITC는 2008년 서울 FITC를 시작으로 아시아에 첫발을 내딛습니다. 이번 이벤트는 세계 최정상 디자이너들의 작품 속 컨셉과 법칙을 탐험합니다. 디자인을 디지털 세계로 이끌어줄 영감과 경험과 기회가 가득한 이번 행사에 여러분을 초대합니다.
강연사들:
Joshua Davis / Erik Natzke / Kyle Cooper / Richard Galvan / Euna Seol / Ralph Hauwert / Marcos Weskamp

세션 일정

8:30   등록  
9:20 - 9:30   개회사  
9:30 - 10:30   리차드 갤반  
10:40 - 11:40   설은아  
11:50 - 12:50   에릭 나츠케  
12:50 - 14:10   점심식사 / 휴식  
14:10 - 15:10   마코스 웨스캠프  
15:20 - 16:20   랄프 하워드  
16:30 - 17:30   죠슈아 데이비스  
17:40 - 18:40   카일 쿠퍼  
     
20:00   FITC 파티

TICKETS

일반인/General
학생/Student
할인표 8월 1일 전
W 80,000
W 60,000
보통 8월 1일 후
W 120,000
W 90,000
입장권 입구 매표소 (10월 14일)
W 150,000
W 120,000


-------------------------------------------------------------------------------------

공식사이트

http://www.fitcseoul.com/index_kr.html


일정

2008년 10월 14일(화) 코엑스 오리토리옴

Posted by 알 수 없는 사용자