2007年4月3日のブックマーク (1件)

  • 色情報による領域抽出 - OpenCV@Chihara-Lab.

    概要 † カメラから得られる画像がカラー画像である場合,そのカラー情報を用いることで領域を抽出することができます.今回のサンプルでは,RGB表色系においてあらかじめ閾値を設定しておき,領域抽出を行います(一般的にHSVやL*a*b*などの他の表色系に変換した後に適用されます). ↑ #include <stdio.h> #include "cv.h" #include "cxcore.h" #include "highgui.h" #include "mask.h" // グローバル変数群 IplImage *img=0, *mask=0, *dst=0; int main( int argc, char** argv ){ // 画像ファイル読み込み char* filename = argc == 2 ? argv[1] : (char*)"fish.bmp"; if( (img =