Openframeworks 上图像处理的类型差异
Type difference on image processing on Openframeworks
Openframeworks、opencv、第三方分别提供了不同类型的图片(ofxCv、ofxOpenCv、ofImage、cv::Mat、IplImage ...等)。
我想知道是否有关于这些差异的详细文档。
谢谢
ofImage is the main image type in OpenFrameworks. Be sure to checkout ofPixels() (used for ofImage pixel access) and ofTexture(用于在屏幕上渲染 ofImage)
ofOpenCv 是 OpenFrameworks 的第一个 OpenCV 插件,它随附。
它具有图像格式:ofxCvImage 即
made to provide interoperability between the core OF imaging types,
ofImage and ofTexture, and OpenCv.
IplImage 是用于 OpenCV 图像的 format/structure,但基于较旧的 C API。
在 OpenCV 中,2.x 和 3.x 倾向于使用更简单的格式 cv::Mat
问题是 xOpenCv 是很久以前开发的,当时 IplImage 更常用。如果您正在使用基于 OpenCV C api 的旧代码,并且您想将其集成到 OpenFrameworks 项目中,请使用 ofxOpenCv 和 ofxCvImage,因为它们提供了 OpenCV 的 IplImage 和 openFrameworks 的图像格式之间的桥梁。
如果您现在开始使用 OpenCV 和 OpenFrameworks,我建议您使用较新的 OpenCV API 和 cv::Mat,它们 ofxCv 集成得非常好。
当我在 OpenFrameworks 中使用 OpenCV 时,我使用 ofxCv 并且我倾向于以 cv::Mat 格式完成大部分工作。只有在最后阶段,当我需要在 OpenFrameworks 中渲染 OpenCV 图像处理结果时,我才使用 ofxCv's utilties(请参阅实用程序、包装器和帮助器)在格式之间来回转换。我最常使用的是:
toCv()
从 OpenFrameworks 转换为 cv::Mat
格式
toOf()
很少从 cv::Mat
转换为 ofImage
drawMat()
经常渲染 cv::Mat
结果直接进入 openFrameworks
一定要通过 ofxCv 示例。他们很有趣,可以从他们身上学到很多东西。玩得开心!
更新 ofBook's Varieties of oF Image Containers (Data Structures) 部分还提供了有关 ofImage
、ofCvImage
和 cv::Mat
的详细信息。一定要看看!
To the greatest extent possible, the designers of openFrameworks (and addons for image processing, like ofxOpenCV and Kyle McDonald's ofxCv) have provided simple operators to help make it easy to exchange data between these containers.
Openframeworks、opencv、第三方分别提供了不同类型的图片(ofxCv、ofxOpenCv、ofImage、cv::Mat、IplImage ...等)。 我想知道是否有关于这些差异的详细文档。
谢谢
ofImage is the main image type in OpenFrameworks. Be sure to checkout ofPixels() (used for ofImage pixel access) and ofTexture(用于在屏幕上渲染 ofImage)
ofOpenCv 是 OpenFrameworks 的第一个 OpenCV 插件,它随附。 它具有图像格式:ofxCvImage 即
made to provide interoperability between the core OF imaging types, ofImage and ofTexture, and OpenCv.
IplImage 是用于 OpenCV 图像的 format/structure,但基于较旧的 C API。 在 OpenCV 中,2.x 和 3.x 倾向于使用更简单的格式 cv::Mat
问题是 xOpenCv 是很久以前开发的,当时 IplImage 更常用。如果您正在使用基于 OpenCV C api 的旧代码,并且您想将其集成到 OpenFrameworks 项目中,请使用 ofxOpenCv 和 ofxCvImage,因为它们提供了 OpenCV 的 IplImage 和 openFrameworks 的图像格式之间的桥梁。
如果您现在开始使用 OpenCV 和 OpenFrameworks,我建议您使用较新的 OpenCV API 和 cv::Mat,它们 ofxCv 集成得非常好。 当我在 OpenFrameworks 中使用 OpenCV 时,我使用 ofxCv 并且我倾向于以 cv::Mat 格式完成大部分工作。只有在最后阶段,当我需要在 OpenFrameworks 中渲染 OpenCV 图像处理结果时,我才使用 ofxCv's utilties(请参阅实用程序、包装器和帮助器)在格式之间来回转换。我最常使用的是:
toCv()
从 OpenFrameworks 转换为cv::Mat
格式toOf()
很少从cv::Mat
转换为ofImage
drawMat()
经常渲染cv::Mat
结果直接进入 openFrameworks
一定要通过 ofxCv 示例。他们很有趣,可以从他们身上学到很多东西。玩得开心!
更新 ofBook's Varieties of oF Image Containers (Data Structures) 部分还提供了有关 ofImage
、ofCvImage
和 cv::Mat
的详细信息。一定要看看!
To the greatest extent possible, the designers of openFrameworks (and addons for image processing, like ofxOpenCV and Kyle McDonald's ofxCv) have provided simple operators to help make it easy to exchange data between these containers.