title: Overlay a heatmap on an image from streaming FHD video in Python
body: <p>I would like to make a QT based GUI program which overlays a heatmap on an image from 20fps streaming FHD video. 
  The target image looks like this</p>
  
  <p><img src="https://i.stack.imgur.com/Gvvl2.jpg" alt=""></p>
  
  <p>(Additionally, a colorbar beside an overlayed image shall also be displayed.)</p>
  
  <p>The size of heatmap source for each image is 100x40, and therefore interpolation for FHD(1920x1080) is needed per frame.
  (FYI, The min and max values of heatmap source are around 10 and 100000, respectively.)</p>
  
  <p>First of all, I used cv2.VideoCapture function in Opencv to get images from video. And then, I googled some examples to combine image and heatmap using Matplotlib such as:</p>
  
  <ul>
  <li><a href="https://github.com/durandtibo/heatmap" rel="nofollow noreferrer">https://github.com/durandtibo/heatmap</a></li>
  <li><a href="https://stackoverflow.com/questions/42481203/heatmap-on-top-of-image">Heatmap on top of image</a></li>
  <li><a href="https://stackoverflow.com/questions/31877353/overlay-an-image-segmentation-with-numpy-and-matplotlib">Overlay an image segmentation with numpy and matplotlib</a></li>
  </ul>
  
  <p>The problem that I faced is processing speed to meet 20fps for FHD resolution.</p>
  
  <p>It seemed that Opencv is more adequete rather than Matplotlib for real-time processing. 
  (I couldn't find the good way to show heatmap and colorbar using Pyqtgraph even though it provides high speed.)</p>
  
  <p>So, I searched another way using cv2.applyColorMap and cv2.resize.
  It looks like cv2.applyColorMap function doesn't automatically adjust the range of values unlike imshow function in Matplotlib, and therefore the color of result image is strange.</p>
  
  <p>Moreover, Opencv image needs to be adopted to QtWidget using QtGui.QImage and QtGui.QPixmap which results additional delay.
  Finally, the overall processing time of the method I searched can not meet the requirement.</p>
  
  <p>Please show me the way for the solution.</p>
  
  <p>Thanks in advance.</p>