Jan-03-2021, 05:31 PM
This is the code for opening .tif on a PyQT window:
import sys from PyQt5.QtWidgets import QApplication, QMainWindow app = QApplication(sys.argv) window = QMainWindow() window.show() def getFrame(self): fp = r'/home/UbuntuUser/Desktop/UAV.tif' self.img = cv2.imdecode(np.fromfile(fp, dtype=np.uint8), cv2.IMREAD_UNCHANGED) print(self.img) self.getFrame() # Start the event loop. app.exec_()Why do I get this error??
Error:Traceback (most recent call last):
File "mycode.py", line 14, in <module>
self.getFrame()
NameError: name 'self' is not defined
Thank you