VOOZH about

URL: https://www.geeksforgeeks.org/python/pyqtgraph-image-view/

⇱ PyQtGraph – Image View - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

PyQtGraph – Image View

Last Updated : 25 May, 2022

The PyQtGraph module is a graphics and user interface library for Python that provides functionality commonly required in designing and science applications. Its primary goals are to provide fast, interactive graphics for displaying data (plots, video, etc.). Widget used for display and analysis of image data. Implements many features like displaying 2D and 3D image data. For 3D data, a z-axis slider is displayed allowing the user to select which frame is displayed. Displays histogram of image data with movable region defining the dark/light levels, editable gradient provides a color lookup table, frame slider may also be moved using left/right arrow keys as well as pgup, pgdn, home, and end.


Basic analysis features includes: 
1. ROI and embedded plot for measuring image values across frames 
2. Image normalization / background subtraction
We can create an image view with the help of command given below: 

# creating a pyqtgraph image view object
img = pg.ImageView()


Step-by-step Approach:

  1. Import pyqtgraph, pyqt5 and numpy modules.
  2. Create Main window class.
  3. Create an image view object.
  4. Create an image using numpy and gaussian filter of the pyqtgraph module.
  5. Create a custom color map and set it to the image view.
  6. Add the image video view to the grid layout with other widgets.
  7. Set grid layout widget as the central widget of main window.
     

Below is the implementation based on the above approach:

Output:

Comment
Article Tags: