opencv - Gnuplot,Opencv。从cv::Mat显示直方图

标签 opencv gnuplot data-presentation

是否可以在gnuplot中绘制类似于[v(1); ...; v(i-1); v(i)]的矩阵(直方图)。这是stringstream << cv::Mat()的标准输出。这是色相值0到180的y值。

[25; 0; 0; 0; 0; 0; 1; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 4; 0; 0; 0; 5; 0; 0; 0; 0; 0; 16; 0; 0; 0; 0; 0; 3; 0; 0; 0; 4; 0; 10; 0; 0; 1; 0; 0; 4; 0; 37; 3; 3; 0; 0; 11; 10; 7; 0; 0; 47; 0; 0; 16; 0; 18; 91; 8; 41; 34; 101; 22; 15; 149; 223; 45; 94; 25; 0; 312; 745; 53; 28; 166; 413; 253; 47; 682; 144; 63; 630; 48; 92; 222; 3; 253; 175; 1; 62; 7; 1; 80; 0; 40; 9; 0; 1; 0; 0; 2; 12; 0; 0; 0; 9; 1; 0; 0; 0; 0; 2; 0; 0; 0; 0; 0; 5; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 7; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0; 0]

关于如何为gnuplot呈现数据的简短指南会很好。

最佳答案

您有几种选择
(1)使用GNUPLOT-CPP包装器(在此处下载:http://code.google.com/p/gnuplot-cpp/)
这将通过其教程/文档进行自我指导

(2)简单的解决方案。将您的值保存到文件中,说“DATA.txt”,然后从cpp(exec命令)调用类似“plot.plt”的脚本,该脚本类似于:

    #!/usr/bin/gnuplot -persist

set terminal postscript
set output "TXTFILE.ps"
unset key

#set title "Titel"
set xlabel "cy/px"
set ylabel "SFR"
(...)
set grid

plot "DATA.txt" using 1:2 smooth csplines w l ls 1,\
    "DATA.txt" using 3:4 smooth csplines w l ls 2
#    EOF

如您所见,它将绘制刚刚输出的DATA.txt。将gnuplot脚本上的所有以前版本都使用google f.e.

关于opencv - Gnuplot,Opencv。从cv::Mat显示直方图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9350011/

相关文章:

java - GWT 中的海量数据网格

machine-learning - PCA 的输出是什么以及它有何用处?

html - 用于呈现表格数据的标记和 CSS

python - 在 OpenCV Python 中读入一个向量作为 CV_8UC*

c++ - opencv中基于ROI的KLT光学跟踪器

linux - 使用错误条绘制数据并使用 gnuplot 对它们进行排序

Gnuplot 多图 : Convenient method for creating more complex layouts

opencv - OpenCV轮廓检测中实现了什么算法?

c++ - 矩阵乘以它的转置返回零矩阵?

gnuplot - 我怎样才能在 gnuplot 中画一个箭头,使其在轴上?