OpenCVとの戦い、とりあえずピクセルの情報を入手する。

↓の記事の最低限のコードのWhile部分のみを抜粋
http://d.hatena.ne.jp/sakusan_net/20080626/1214449256

  while (1) {
    frame = cvQueryFrame (capture);
    cvShowImage ("Capture", frame);

    unsigned char **pimage = new unsigned char *[frame->height];
    for(int i = 0; i < frame->height; i++){
      pimage[i] = (unsigned char *)frame->imageData + i*frame->widthStep;
    }
    for (y = 0; y < frame->height; y++) {
    	for (x = 0; x < frame->width; x++) {
            int r = pimage[y][x*3+2];
            int g = pimage[y][x*3+1];
            int b = pimage[y][x*3];  
             //ここらへんで適当に処理したりバッファしたりする
        }
    }
    delete pimage;

    c = cvWaitKey (10);
    if (c == '\x1b') break;
  }

とりあえずこれで指定ピクセルのRGBがintで取れる。
RGBさえ取れてしまえばあとは結構どうにでも使えるので便利

ちなみにその他のピクセルアクセス方法は以下を参照
http://opencv.jp/sample/basic_structures.html#access_pixels
行数は少なくまとめられてるけど読みにくいのが難