VOOZH about

URL: https://www.geeksforgeeks.org/python/image-analysis-tool-using-pyqtgraph/

⇱ Image Analysis Tool using PyQtGraph - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Image Analysis Tool using PyQtGraph

Last Updated : 18 Nov, 2021

In this article we will see how we can perform common image analysis using PyQtGraph module in Python. PyQtGraph 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.) and second is to provide tools to aid in rapid application development (for example, property trees such as used in Qt Designer).

In order to install the PyQtGraph we use the command given below.

pip install pyqtgraph

Image analysis is the extraction of meaningful information from images; mainly from digital images by means of digital image processing techniques. Image analysis tasks can be as simple as reading bar coded tags or as sophisticated as identifying a person from their face.

In order to do this we have to do the following.

  1. Import the required libraries like pyqtgraph, pyqt5 and numpy.
  2. Create a main window class using pyqt5.
  3. Create a graphic window to add the widgets required to show the image analysis.
  4. Create two plot area and add a image item to it with the roi object to first plot area.
  5. Create an isocurve object and add it to the image item.
  6. Create a data for image and add it to the image item.
  7. Connect a update method to the roi object when the region is changed, inside the update method get the region and set it to the second plot area.
  8. Create a mouse move event and set the position, pixel value to the title according to the mouse position.
  9. Add this graph window to the main window layout with any additional widgets.

Below is the implementation 

Output:

Comment
Article Tags: