GNUPLOT 中的调色板映射表面视图或热图帮助
我有一个从图像派生的平均 RGB 值的数据集。该图像的尺寸为 1729 x 981,我使用 imagemagick 对每个 170x98 像素部分进行平均,并输出包含数据的 CSV。这给了我 153 条线,代表横向 17 个部分,向下 9 个部分。
我想要实现但失败的是,基本上创建一个热图,或者图像的托盘映射表面视图,并使用 GNUPLOT 在 17 x 9 部分显示平均数据。
我的假设是我的数据格式不正确。但我对gnupolot也知之甚少。所以就是这样。
这是我正在使用的数据集。
https://www.dropbox.com/s/1mfhgkrdbo5xdrj/RNST_SDI_20220303_145749.DPX_DATA.csv?dl=0
非常感谢任何帮助。
I have a data set of average RGB values derived from an image. The image is 1729 x 981 and I've used imagemagick to average each 170x98 pixel section and output a CSV with the data. this gives me 153 lines representing the 17 sections across and 9 down.
What I'm trying to achieve, and failing at, is creating basically a heat map, or pallet mapped surface view of the image with the average data shown across the 17 x 9 sections using GNUPLOT.
My assumption is that my data is formatted incorrectly. But I also know very little about gnupolot. So there's that.
Here is the data set I'm using.
https://www.dropbox.com/s/1mfhgkrdbo5xdrj/RNST_SDI_20220303_145749.DPX_DATA.csv?dl=0
Any help is greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我将把我的评论改写为初步答案。
您想要的命令的形式是
plot DATA using x:y:R:G:B with rgbimage
但从您的描述中并不完全清楚如何导出 R/G/B 分量。您链接的文件的第 2/3/4 列中的值范围大致包含 450 - 550 范围内的值。通常颜色分量的范围为 0.0 - 1.0 或 0 - 255。出于说明目的,我将将您的值转换为 0.0-1.0 范围内的数字并显示绘图命令。我们将从行号导出 x 和 y 分量,忽略第 1 列的内容,并将第 2/3/4 列缩放到 0-1 范围。您没有说明您希望如何用像素坐标、标题等标记结果,因此我将所有内容保留为默认值。
扩展答案
有几种方法可以从命令行将附加参数传递到 gnuplot 中。不幸的是,我不熟悉 bash 脚本,所以我无法帮助构建您在评论中显示的命令行。我能做的是展示如何从 gnuplot 内部读取环境变量 NAME:
I will rephrase my comment as a preliminary answer.
The form of the command you want is
plot DATA using x:y:R:G:B with rgbimage
but it is not entirely clear from your description how to derive the R/G/B components. The range of values in columns 2/3/4 of the file you linked to contain values roughly in the range 450 - 550. Usually the color components either run from 0.0 - 1.0 or from 0 - 255. For the purpose of illustration I will convert yours into numbers in the range 0.0-1.0 and show the plot command.We will derive the x and y components from the line number, ignore the content of column 1, and scale columns 2/3/4 to the range 0-1. You don't say how you want the result marked up with pixel coordinates, titles, or the like so I just leave everything to default.
Expanded answer
There are several ways to pass additional parameters into gnuplot from the command line. Unfortunately I am not conversant with bash scripting so I can't help with construction of the command line as you show it in your comment. What I can do is show how to read an environmental variable NAME from inside gnuplot: