How to display clickable RGB image similar to pyqtgraph ImageView?

后端 未结 2 1791
你的背包
你的背包 2021-01-15 01:41

Despite not being a proficient GUI programmer, I figured out how to use the pyqtgraph module\'s ImageView function to display an image that I can pan/zoom and click on to ge

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-15 02:19

    As pointed out by Luke, ImageView() does display RGB, provided the correct array shape is passed. In my sample program, I should have used photo.transpose([1,0,2]) to keep the RGB in the last dimension rather than just photo.transpose(). When ImageView is confronted with an array of dimension (3, W, H), it treats the array as a video consisting of 3 monochrome images, with a slider at the bottom to select the frame.

    (Corrected to incorporate followup comment by Luke, below)

提交回复
热议问题