2

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

(Additionally, a colorbar beside an overlayed image shall also be displayed.)

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.)

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:

The problem that I faced is processing speed to meet 20fps for FHD resolution.

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.)

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.

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.

Please show me the way for the solution.

Thanks in advance.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
jee
  • 21
  • 1
  • 2

0 Answers0