最終更新:2018-07-05 (木) 01:33:19 (2084d)
ofxCv/変換
toCv
- cv::Mat toCv(ofImage)
- cv::Mat toCv(ofImage).clone()
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
ofxCv::copy?
- works with any type supported by toCv():
- copy(src, dst);
ofxCv::imitate
- primarily used internally by ofxCv.
- imitate(mirror, original)
- It works with cv::Mat, ofImage, ofPixels, ofVideoGrabber, and anything else that extends ofBaseHasPixels?.
- It will only reallocate memory if necessary. This means it can be used liberally.
ofxCv::drawMat
- not the most optimal way of drawing images to the screen, because it creates a texture every time it draws.
ofImageをcv::Matとして扱う
- 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)