{"id":16636779,"url":"https://github.com/takamin/cvimagepipeline","last_synced_at":"2026-04-27T18:31:13.253Z","repository":{"id":18206391,"uuid":"21340274","full_name":"takamin/cvImagePipeline","owner":"takamin","description":"OpenCVの画像処理ルーチンを組み合わせて、一連の画像処理を構成できるC++のクラスライブラリ。フィルタの構成はXMLからも与えられます","archived":false,"fork":false,"pushed_at":"2015-11-06T02:54:21.000Z","size":1656,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-22T01:39:14.977Z","etag":null,"topics":["cplusplus","filter-graph","opencv"],"latest_commit_sha":null,"homepage":"http://bicycle.life.coocan.jp/takamints/index.php/doc/cvImagePipeline/index","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/takamin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-06-30T05:16:09.000Z","updated_at":"2019-06-06T22:18:51.000Z","dependencies_parsed_at":"2022-07-26T21:32:01.673Z","dependency_job_id":null,"html_url":"https://github.com/takamin/cvImagePipeline","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/takamin/cvImagePipeline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takamin%2FcvImagePipeline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takamin%2FcvImagePipeline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takamin%2FcvImagePipeline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takamin%2FcvImagePipeline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/takamin","download_url":"https://codeload.github.com/takamin/cvImagePipeline/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/takamin%2FcvImagePipeline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32349329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T17:12:42.749Z","status":"ssl_error","status_checked_at":"2026-04-27T17:12:41.658Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cplusplus","filter-graph","opencv"],"created_at":"2024-10-12T06:22:49.369Z","updated_at":"2026-04-27T18:31:13.222Z","avatar_url":"https://github.com/takamin.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cvImagePipeline - OpenCV画像処理フィルタシーケンスライブラリ。\n\n## 概要\n\n__[cvImagePipeline](https://github.com/takamin/cvImagePipeline)\nはOpenCVを利用した、C++向けのライブラリ__です。\n\n__複数の画像処理ルーチンの入出力画像を接続して、\n一連の画像処理の流れをつくる__機能を提供します。\n\nC++で画像処理を記述したとき、その処理順序や内容の組み替え時に発生する手間を、\nなるべく少なくするために作成しました。\n\n### 通常の画像処理ルーチンにありがちな問題\n\n#### 一般的モデルのコーディングスタイル\n\n一般的な画像処理ルーチンは、多くの場合、その入力から出力までの間で\n、複数の画像処理関数を順次呼び出しています。\n\n個々の画像処理関数には、入力画像と処理内容に関するパラメータが渡され、\nそして処理結果としての画像が出力され、\nさらにこれが次の処理への入力画像として利用されるのです。\n\n#### 試行錯誤と煩雑さ\n\nしかし、多くのプロジェクトの初期段階では、この処理順は確立されておらず、\n完成までの間に、処理順序の入れ替えや、処理の追加・削除、\nそしてパラメータの変更など、試行錯誤が繰り返されることになります。\n\nこれら試行錯誤を繰り返すと、個々の処理と処理の間で、\n一時的な出力画像を保持するために、コードが煩雑になります。\n\n### 画像処理プロセッサ - パッケージ化された画像処理ルーチン\n\nこのライブラリでは、個々の画像処理ルーチンを、\n__画像処理プロセッサ__というクラスにパッケージ化し、\n一連の画像処理の流れを、\n__個々のプロセッサの出力を他のプロセッサの入力へ接続する__ということで実現します。\nこれにより、__簡単に画像処理の順序を入れ替えたり、バイパスできる__ようになるのです。\n\n#### 出力から入力への接続接続\n\n画像処理プロセッサは、入力画像（OpenCVのcv::Mat）に処理を加えて、画像を出力します。\n\nこの出力を、他の画像処理プロセッサの入力画像へ接続し、一連の画像処理の流れを形成します。\n（自分自身の入力ポートへ接続 ― フィードバックすることも可能）\nこの接続は、実行時に動的に変更可能です。\n\n#### 拡張性\n\n画像処理プロセッサは、単一の抽象クラスとして定義されているため、\n新たなプロセッサが必要になれば、これを実装して、\n具体的な独自の画像処理プロセッサを作成できます。\n\n#### 基本的なプロセッサ\n\nいくつかの汎用的で単純な画像処理プロセッサを既に実装しています（[⇒基本プロセッサ](#processor)）。\n\nそこには、カメラからのキャプチャ、画像の表示などのプロセッサも含まれています。\n\n#### 階層化・モジュール化\n\n複数の画像処理プロセッサを、ひとつの画像処理プロセッサとして扱えます。\n\n#### XMLファイルからの入力\n\n接続は動的に行え、プロセッサの多くは、実行時にクラス名による生成をサポートしているため、\nプロセッサの構成を[XMLファイル](https://github.com/takamin/cvImageBlock/blob/master/sample/sample.xml)に記述できます。\n詳細は[サンプルプログラム](#sample)を参照してください。\n\n## \u003ca name=\"sample\"\u003e\u003c/a\u003eXMLによる画像処理サンプル\n\nXMLを読み込んでカメラ画像を表示する[サンプルプログラム](https://github.com/takamin/cvImageBlock/blob/master/sample/capture.cpp)です。\n\n### 実行方法\n\nコマンドラインから画像処理プロセッサを定義したXMLファイルを指定して実行します。\n\n`$ sample sample.xml[enter]`\n\nXMLファイルの中身については、以下のサンプルXMLを参考にしてください。\n\n### サンプルXML\n\n以下に、カメラでキャプチャした画像に対して、順次処理を行い、途中段階の画像など6つを、ひとつのウィンドウにまとめて表示するXMLファイルの例を示しています。\n\n#### 実行中画面\n\n![`$sample sample/sample.xml`](doc/img/sample.jpg)\n\n##### 表示内容\n\n各画像は以下の画像（左上から右下へZ字状に）\n\n1. キャプチャ画像\n2. 1をグレイスケールに変換\n3. 2に対して、ヒストグラム均一化とガウシアンブラーを適用\n4. 3の過去18000フレーム分を平均\n5. 3と4の差分\n6. 5の二値化\n\n### XMLファイルの中身（[`sample.xml`](https://github.com/takamin/cvImageBlock/blob/master/sample/sample.xml)）\n\n```\n\u003ccvImagePipeline name=\"testProcessor\"\u003e\n  \u003cProcessor class=\"VideoCapture\" name=\"cap\"\u003e\n    \u003cProperty name=\"deviceIndex\" value=\"0\"/\u003e\n  \u003c/Processor\u003e\n  \u003cProcessor class=\"Flipper\" name=\"fripHoriz\"\u003e\n    \u003cProperty name=\"flipDir\" value=\"1\"/\u003e\n  \u003c/Processor\u003e\n  \u003cProcessor class=\"ImagePoint\" name=\"raw\"/\u003e\n  \u003cProcessor class=\"ColorConverter\" name=\"grayscale\"/\u003e\n  \u003cProcessor class=\"EqualizeHist\" name=\"equalizeHist\"/\u003e\n  \u003cProcessor class=\"GaussianBlur\" name=\"blur\"/\u003e\n  \u003cProcessor class=\"DepthTo32F\" name=\"depth32F\"/\u003e\n  \u003cProcessor class=\"ImagePoint\" name=\"pp\"/\u003e\n  \u003cProcessor class=\"RunningAvg\" name=\"background\"\u003e \n    \u003cProperty name=\"averageCount\" value=\"18000\"/\u003e\n  \u003c/Processor\u003e\n  \u003cProcessor class=\"AbsDiff\" name=\"diff\" autoBind=\"false\"\u003e\n    \u003cInput to=\"src1\" from=\"pp\"/\u003e\n    \u003cInput to=\"src2\" from=\"background\"/\u003e\n  \u003c/Processor\u003e\n  \u003cProcessor class=\"Convert\" name=\"to8UC\"\u003e\n    \u003cProperty name=\"rtype\" value=\"0\"/\u003e\n    \u003cProperty name=\"alpha\" value=\"255\"/\u003e\n    \u003cProperty name=\"beta\" value=\"0\"/\u003e\n  \u003c/Processor\u003e\n  \u003cProcessor class=\"Threshold\" name=\"binary\"\u003e\n    \u003cProperty name=\"type\" value=\"CV_THRESH_BINARY\"/\u003e\n    \t\u003c!--\n\tCV_THRESH_BINARY\n\tCV_THRESH_BINARY_INV\n\tCV_THRESH_TRUNC\n\tCV_THRESH_TOZERO\n\tCV_THRESH_TOZERO_INV\n\t--\u003e\n    \u003cProperty name=\"otsu\" value=\"1\"/\u003e\n    \u003cProperty name=\"thresh\" value=\"50\"/\u003e\n    \u003cProperty name=\"maxval\" value=\"255\"/\u003e\n  \u003c/Processor\u003e\n\n  \u003cProcessor class=\"FitInGrid\" name=\"integratedImage\" autoBind=\"false\"\u003e\n    \u003cProperty name=\"width\" value=\"960\"/\u003e\n    \u003cProperty name=\"height\" value=\"480\"/\u003e\n    \u003cProperty name=\"cols\" value=\"3\"/\u003e\n    \u003cProperty name=\"rows\" value=\"2\"/\u003e\n    \u003cProperty name=\"interleave\" value=\"0\"/\u003e\n    \u003cInput to=\"0\" from=\"raw\"/\u003e\n    \u003cInput to=\"1\" from=\"grayscale\"/\u003e\n    \u003cInput to=\"2\" from=\"blur\"/\u003e\n    \u003cInput to=\"3\" from=\"background\"/\u003e\n    \u003cInput to=\"4\" from=\"diff\"/\u003e\n    \u003cInput to=\"5\" from=\"binary\"/\u003e\n  \u003c/Processor\u003e\n  \u003cProcessor class=\"ImageWindow\" name=\"window\"\u003e\n    \u003cProperty name=\"windowName\" value=\"cvImagePipeline\"/\u003e\n    \u003cProperty name=\"showFPS\" value=\"1\"/\u003e\n  \u003c/Processor\u003e\n\u003c/cvImagePipeline\u003e\n```\n\n#### 簡単な説明\n\n* ルートエレメントは、cvImagePipelineです。\n* 画像処理プロセッサはProcessorタグの属性にクラス名と名前を記述して指定します。\n* 入出力はautoBind属性が`false`に設定されていない限り、上から順につながります。\n* `autoBind=false`の場合や、複数の入力を持つプロセッサは、子要素のInput要素で、他のプロセッサを参照して接続を行います。\n\n\n## ビルド\n\ncmakeを使用してください。Windows 7(32bit)Visual Studio 2010、Ubuntu 14.04 LTS で動作を確認しています。\nOpenCV 2.4が必要です。[DOWNLOADS|OpenCV](http://opencv.org/downloads.html)からダウンロードできます。\n\n__Windowsの場合のビルド例__\n```\nmkdir build\ncd build\ncmake -D OpenCV_DIR='path/to/opencv' -D CMAKE_INSTALL_PREFIX='C:/cvImagePipeline' ..\n```\n\n## 詳細\n\n### \u003ca name=\"processors\"\u003e\u003c/a\u003e基本プロセッサ\n\n以下のプロセッサが基本プロセッサです。\n\n|クラス\t\t\t\t|概要\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|\n|:---\t\t\t\t|:--\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|\n| ImageProcessor ([h](include/ImageProcessor.h),[cpp](source/ImageProcessor.cpp))    | 画像処理プロセッサの基本クラスです。複数の入力画像、ひとつの出力画像、複数の型付けされたプロパティを提供します。                          |\n| VideoCapture ([h](include/VideoCapture.h),[cpp](source/VideoCapture.cpp))\t\t| カメラまたは動画ファイルのキャプチャ(==`cv::VideoCapture`)\t|\n| ImageWindow ([h](include/ImageWindow.h),[cpp](source/ImageWindow.cpp))\t\t| 画面表示(== `imshow`)\t|\n| FitInGrid ([h](include/FitInGrid.h),[cpp](source/FitInGrid.cpp))\t\t\t| 複数の画像をパネル状に並べて1枚にまとめるプロセッサ。\t|\n| ImgProcSet ([h](include/ImgProcSet.h),[cpp](source/ImgProcSet.cpp))\t\t| 任意の画像処理プロセッサで構成可能な汎用の画像処理プロセッサ。\t|\n| ImagePoint ([h](include/ImagePoint.h),[cpp](source/ImagePoint.cpp))\t\t| 無処理(== `cv::copyTo`)。入力画像をそのまま出力します。画像の取り出しポイントとして利用可能。\t|\n\n### その他のプロセッサ。\n\n以下のクラスは、サンプル的に実装した単純な画像処理を行うプロセッサです。新たなプロセッサを作成するときなどにも参考にしてください。\n\n|クラス\t\t\t|概要\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|\n|:---\t\t\t\t|:--\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|\n| Convert ([h](include/Convert.h),[cpp](source/Convert.cpp)) | フォーマット変換(== `cv::Mat::convertTo`)\t| \n| ColorConverter ([h](include/ColorConverter.h),[cpp](source/ColorConverter.cpp))\t| チャンネル数変換(== `cv::cvtColor`)\t|\n| EqualizeHist ([h](include/EqualizeHist.h),[cpp](source/EqualizeHist.cpp))\t\t| ヒストグラム平坦化(== `cv::equalizeHist`)\t|\n| GaussianBlur ([h](include/GaussianBlur.h),[cpp](source/GaussianBlur.cpp))\t\t| ガウシアン平滑化(== `cv::GaussianBlur`)\t|\n| Flipper ([h](include/Flipper.h),[cpp](source/Flipper.cpp))\t\t\t| 反転。(== `cv::flip`)\t|\n| Resizer ([h](include/Resizer.h),[cpp](source/Resizer.cpp))\t\t\t| リサイズ(== `cv::resize`)\t|\n| RunningAvg ([h](include/RunningAvg.h),[cpp](source/RunningAvg.cpp))\t\t| 長期平均(== `cv::runningAvg`)\t|\n| AbsDiff ([h](include/AbsDiff.h),[cpp](source/AbsDiff.cpp))\t\t\t| 絶対値差分(== `cv::absdiff`)\t|\n| SubMat ([h](include/SubMat.h),[cpp](source/SubMat.cpp))\t\t\t| 差分(== `cv::sub`)\t|\n| Threshold ([h](include/Threshold.h),[cpp](source/Threshold.cpp))\t\t\t| 2値化(== `cv::threshold`)\t|\n| Dilate ([h](include/Dilate.h),[cpp](source/Dilate.cpp))\t\t\t| 画像の膨張(== `cv::dilate`)\t|\n\n### クラス名による実行時の動的インスタンス生成について\n\nクラス宣言で`DECLARE_CVFILTER`、定義時に`IMPLEMENT_CVFILTER` マクロを使用すれば、クラスの名前でインスタンスを生成できます。\n動的生成に対応していない場合は、XMLファイルからの構築はできません。\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakamin%2Fcvimagepipeline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftakamin%2Fcvimagepipeline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftakamin%2Fcvimagepipeline/lists"}