Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. Convert Python numpy array to PyQt QPixmap image result in noise image
Forum Updated to NodeBB v4.3 + New Features

Convert Python numpy array to PyQt QPixmap image result in noise image

Scheduled Pinned Locked Moved Unsolved Qt for Python
1 Posts 2 Posters 3.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Ludicrous Gray
    wrote on last edited by
    #1

    Hello, I have 2 image data that are same but the first one has gone through pre-processing while the second one is from direct cv.imread . Both of this data are numpy array and has range between [0-255] . But I keep having blank/noisy result for my first data when I try to show it on my label , while the second data can show up without any problem. This is the code that I used, normal is the image data.

    height, width, channel = normal.shape
    bytesPerLine = 3 * width
    qImg = QtGui.QImage(normal.data, width, height, bytesPerLine, QtGui.QImage.Format_RGB32)
    self.normalImage = QtGui.QPixmap(qImg)
    self.ui.normalDisplay.setPixmap(self.normalImage)
    

    I hope someone can give me hint for my problem

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved