我是python的新手,我正在使用framegrabber捕获和显示图像。问题在于图像正在自动缩放和旋转。我想关闭这些图像操作,并以其原始大小和方向显示图像。我发现旋转图像的方法是将图像数组另存为图像文件,并且其方向与Qt GUI中显示的图像不同。 我的原始图像是200x200,但QT GUI中的输出大于200x200并已旋转。
........这是我的代码的实质........
#Setup the GUI outside while loop
pg.setConfigOption('imageAxisOrder','row-major')
app = QtGui.QApplication([])
## Create window with GraphicsView widget
win = pg.GraphicsLayoutWidget()
win.setWindowTitle('pyqtgraph example: ImageItem')
view = win.addViewBox()
### lock the aspect ratio so pixels are always square
view.setAspectLocked(True)
### Create image item
img = pg.ImageItem(border='k',autoDownsample=False,autoLevels=False,)
view.addItem(img)
### Set initial view bounds
view.setRange(QtCore.QRectF(0, 0, 200, 200))
view.invertY(False)
win.show() ## show widget alone in its own window
.
.
.
While loop
.
.
#Capture Image routine
.
.
img.setImage(im_rgb_8bit,autoLevels=False,autoDownsample= False)
view.invertY(False)