在 OpenCV 中绘制图表
OpenCV 是否提供了如何绘制和绘制图形的函数?
我发现了 Shervin Emami http://www.shervinemami.info/graphs.html 的链接是他自己创造的。
Does OpenCV provide a function on how to draw and plot a graph?
I found this link by Shervin Emami http://www.shervinemami.info/graphs.html which was created by himself.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
你可以试试这个:
https://code.google.com/p/cvplot/
OpenCV 的 Matlab 风格绘图函数,基于highgui。
顺便说一句,它仅适用于 C++。
它是开源的。
you can try this:
https://code.google.com/p/cvplot/
Matlab style plot functions for OpenCV, based on highgui.
By the way, it's for C++ only.
It's open source.
据我所知,OpenCV 没有提供一个函数作为其 API 的一部分来以 cvDrawPlot(cvMat* data, other args...) 的形式绘制和绘制图形。
大多数绘图示例仅使用 OpenCV 函数调用来绘制绘图,就好像使用
cvCreateImage
绘制任何其他图像一样。然后,它们迭代数据并使用 OpenCV 基元(如 cvRectangle、cvLine、cvCircle 和 cvPoint)填充图像。
然后他们调用
cvShowImage
来显示创建的绘图图像。如果您找到的库满足您的要求,那么您就可以使用它。
您还可以将数据写入文件并调用外部绘图工具(如 gnuplot)或调用使用其他可视化或绘图库(如 VTK 或 plplot)绘制和绘制图形的函数。
除了您找到的库之外,另一个库是 cvplot。
From what I can see OpenCV doesn't provide a function as part of its API to draw and plot graphs, in the form of cvDrawPlot(cvMat* data, other args...).
Most plotting samples seen using only OpenCV function calls involving making a plot as if were any other image with
cvCreateImage
.Then they iterate through data and fill the image with OpenCV primites like
cvRectangle
,cvLine
,cvCircle
andcvPoint
.Then they call
cvShowImage
to display the created plot image.If the library you found does what you want then you can use it.
You can also write the data to a file and call an external plotting tool like gnuplot or call functions that draw and plot graphs using other visualisation or plotting libraries like VTK or plplot.
Another library other than the one you have found is cvplot.
一种相当粗糙但自己动手的方法,需要在 cv::Mat 图像上绘制折线图:
用法示例:
然后可以使用
imshow
或 图像观察查看图表A rather crude but do-it-yourself approach, would be entail plotting the line graph on cv::Mat image:
Usage example:
One can then use
imshow
or Image Watch to view the graph不,事实并非如此。有一个 plot contrib 模块,但它非常基本。
您可以尝试 Profactor CvPlot https://github.com/Profactor/cv-plot。 (我是开发商)。它非常容易集成,完全基于 opencv,并且可以使用自定义控件进行扩展。这是绘制 cv::Mat 或使用交互式查看器显示图表的方法:
您可能还想尝试 Leonardvandriel 的CV图。它的工作原理类似,但不能使用自定义绘图进行扩展。
No. It does not. There is a plot contrib module, but it is very basic.
You could try Profactor CvPlot https://github.com/Profactor/cv-plot. (I am the developer). It is very easy to integrate, purely opencv based and can be extended with custom controls. This is how you can plot to a cv::Mat or show a diagram with an interactive viewer:
You may also want to try Leonardvandriel's cvplot. It works similar but cannot be extended with custom drawables.
看看 https://github.com/leonardvandriel/cvplot。您只需很少的配置即可绘制图表,并且它支持在单个窗口中显示多个图表。 (注:公然自我推销)。
Take a look at https://github.com/leonardvandriel/cvplot. You can plot graphs with little configuration and it supports multiple graphs in a single window. (Note: blatant self-promotion).