【问题标题】:How to draw a Heatmap in a image using the coordinates in Python OpenCV?如何使用 Python OpenCV 中的坐标在图像中绘制热图?
【发布时间】:2020-12-05 14:35:55
【问题描述】:

我有很多人在街上行走的坐标 (x,y) 列表,我喜欢使用这些坐标 (x,y) 来设计热图,即它应该看起来像 this。我想要一个点中的多个坐标有很多热点,较热意味着红色点。我试过this,但最终得到了一个像this 这样的热图,不是我所期望的,也不是一开始提到的网站(维基百科热图)。这是我试过的代码,

import cv2
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
x,y = [230,150,200],[200,100,150]
plt.imshow(img)
ax = sns.kdeplot(x,y, cmap = "Blues", shade= True, shade_lowest=False)
ax.set_frame_on(False)
plt.axis('off')
plt.savefig('heatmap_pic.png')

此代码还使结果图像尺寸更小,实际图像要大得多。我是 OpenCV 和 Matplotlib 的新手,有人请帮我解决这个问题,使用一堆坐标在图像中绘制热图(like this)。

【问题讨论】:

    标签: python numpy opencv matplotlib heatmap


    【解决方案1】:

    您需要拍摄图像、创建热图并将其叠加。
    检查thisthis

    【讨论】:

      猜你喜欢
      • 2018-09-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-17
      • 2020-03-31
      • 2021-06-21
      • 1970-01-01
      相关资源
      最近更新 更多