タグ

2012年3月13日のブックマーク (2件)

  • OpenCVで色認識 - wah-wah-hawahの日記

    OpenCVのサンプルをいじって簡単な色認識を作ってみた。 大まかな処理の流れ。 1.Webカメラの映像を画像として取り込む。 2.取り込んだ画像をRGBからHSVに変換する。 3.HSV色空間内の特定の範囲だけマスキングして表示する。 HSVの方が特定の色を抜き取りやすいらしい。 http://render.s73.xrea.com/pipe_render/2008/06/artoolkit-hsv.html こんな感じに一定の範囲の色を認識させる。 実行結果はこんな感じ。 ソースコード。 #include #include void GetMaskHSV(IplImage* src, IplImage* mask,int erosions, int dilations) { int x = 0, y = 0; uchar H, S, V; uchar minH, minS, minV,

    OpenCVで色認識 - wah-wah-hawahの日記
  • OpenCVメモ(2) - 昼下がりの数式

    今日は色を認識するところまでできました。 完全にopenFrameworks WikiのColorTrackingの頁の写経ですが、コメントをつけてうpします。 元ページ http://wiki.openframeworks.cc/index.php?title=Color_Tracking ヘッダファイル testApp.h #ifndef _TEST_APP #define _TEST_APP #include "ofMain.h" #include "ofxVectorMath.h" #include "ofxOpenCv.h" //色の基的な情報を持ったクラスを作ります。 class Color { public: float hue, sat, bri; ofxVec2f pos; }; class testApp : public ofBaseApp{ public: //こ

    OpenCVメモ(2) - 昼下がりの数式