最終更新:2018-07-31 (火) 01:21:33 (2058d)
ofxCv
Top / ofxCv
Alternative approach to interfacing with OpenCV from openFrameworks.
https://github.com/kylemcdonald/ofxCv
インクルード
#include "ofxCv.h"
ofxCv/バージョン
OF stable (openFrameworks 0.9.8) use ofxCv/stable OpenCV 2.4.9 OF master (openFrameworks 0.10.0) use ofxCv/master OpenCV 3.1
インストール
- ofxOpenCvに含まれているヘッダ/ライブラリ(OpenCV 2.4.9)を参照しているのでofxOpenCvも必要
ヘッダファイル
- ofxCv.h?
ofxCv/クラス
画像の変換
toCv
戻り値 引数 cv::Mat toCv(cv::Mat& mat) cv::Mat toCv(ofMesh& mesh); cv::Point2f? toCv(ofVec2f? vec); cv::Point3f? toCv(ofVec3f? vec); cv::Rect toCv(ofRectangle? rect); std::vector<cv::Point2f?> toCv(const ofPolyline& polyline); std::vector<cv::Point2f?> toCv(const std::vector<ofVec2f?>& points); std::vector<cv::Point3f?> toCv(const std::vector<ofVec3f?>& points); cv::Scalar toCv(ofColor color);
toOf
cv::MatからofImageへの変換
- Either use Mat mat = toCv(img); to treat the ofImage as a Mat, modify the mat, then img.update() to upload the modified pixels to the GPU.
- もしくはtoOf(mat, img)
ディープコピー
ofxCv::imitate
imitate(mirror, original)
It works with Mat, ofImage, ofPixels, ofVideoGrabber, and anything else that extends ofBaseHasPixels. It will only reallocate memory if necessary. This means it can be used liberally.
関連
- ofxOpenCv - 標準で入ってる方