平面图图像的热图生成器 [英] Heat map generator of a floor plan image

查看:215
本文介绍了平面图图像的热图生成器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想生成地板的热图图像.我有以下东西:

I want to generate a heat map image of a floor. I have the following things:

  1. 黑色&地板的白色.png图像
  2. 存储在Matlab中的三列数组. -前两列表示X&地板图像的Y坐标 -第三个坐标表示该特定坐标的温度"
  1. A black & white .png image of the floor
  2. A three column array stored in Matlab. -- The first two columns indicate the X & Y coordinates of the floorpan image -- The third coordinate denotes the "temperature" of that particular coordinate

我想生成地板的热图,该热图将在这些坐标中显示温度"强度. 但是,我想在平面图的顶部显示热图,以便观众可以看到哪些房间导致了哪些温度".

I want to generate a heat map of the floor that will show the "temperature" strength in those coordinates. However, I want to display the heat map on top of the floor plan so that the viewers can see which rooms lead to which "temperatures".

有没有可以完成此工作的软件?我可以使用Matlab或Python来做到这一点吗?

Is there any software that does this job? Can I use Matlab or Python to do this?

谢谢

Nazmul

推荐答案

一种方法是:

1)使用Matlab或NumPy/matplotlib加载平面图图像.

1) Load in the floor plan image with Matlab or NumPy/matplotlib.

2)使用一些内置的边缘检测来定位平面图中的边缘像素.

2) Use some built-in edge detection to locate the edge pixels in the floor plan.

3)形成一个大的(x,y)位置列表,在平面图中可以找到一条边.

3) Form a big list of (x,y) locations where an edge is found in the floor plan.

4)绘制您的热图

5)散布平面图的点作为覆盖.

5) Scatterplot the points of the floor plan as an overlay.

听起来好像您知道如何分别执行每个步骤,所以您要做的就是查找一些有关如何将绘图叠加到同一轴上的知识,这在Matlab和matplotlib中都非常容易.

It sounds like you know how to do each of these steps individually, so all you'll need to do is look up some stuff on how to overlay plots onto the same axis, which is pretty easy in both Matlab and matplotlib.

如果您不熟悉,可以使用正确的命令,例如meshgridsurf,可能是contour及其类似的Python命令.我认为Matlab具有内置的Canny边缘检测功能.我相信这在Python中会更加困难,但是如果您使用PIL库,Mahotas库,scikits.image库以及其他一些专为图像处理量身定制的工具,那还不错.到目前为止,SciPy实际上可能已经具有边缘过滤器,因此请首先检查.

If you're unfamiliar, the right commands look at are things like meshgrid and surf, possibly contour and their Python equivalents. I think Matlab has a built-in for Canny edge detection. I believe this was more difficult in Python, but if you use the PIL library, the Mahotas library, the scikits.image library, and a few others tailored for image manipulation, it's not too bad. SciPy may actually have an edge filter by now though, so check there first.

唯一的问题是,温度的(x,y)数据不会与图像中的(x,y)像素位置对齐.在这种情况下,您将不得不使用一些x比例因子和y比例因子来将热图的坐标首先转换为像素坐标,然后绘制热图,然后覆盖层应该起作用.

The only sticking point will be if your (x,y) data for the temperature are not going to line up with the (x,y) pixel locations in the image. In that case, you'll have to play around with some x-scale factor and y-scale factor to transform your heat map's coordinates into pixel coordinates first, and then plot the heat map, and then the overlay should work.

这是一种技术含量较低的方法;我假设您只需要快速而肮脏的情节来说明某些事情是如何工作的.该方法的确具有优势,您可以轻松地更改平面图点的样式,从而使其更大,更粗,更细,不同的颜色或透明,具体取决于您希望其与热图交互的方式.但是,要真正做到这一点,请使用GIMP,Inkscape或Photoshop,然后在事实之后将热图覆盖到图像上.

This is a fairly low-tech way to do it; I assume you just need a quick and dirty plot to illustrate how something's working. This method does have the advantage that you can change the style of the floorplan points easily, making them larger, thicker, thinner, different colors, or transparent, depending on how you want it to interact with the heat map. However, to do this for real, use GIMP, Inkscape, or Photoshop and overlay the heatmap onto the image after the fact.

这篇关于平面图图像的热图生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆