jueves, 2 de junio de 2016

Python A Full Featured GUI Implementation of OpenCV

TPB

Projects By Theodore Paul Brown
Sun 01 February 2015

OpenCV Gui

Posted by TPB in Projects   
(OpenCV is an amazing library of computer vision tools written in C++ with Python wrappers).

Project Description

The app was designed with both ease of use and customization in mind.
The structure of this project relies on a basic model: an ImageProcessStep, which is the equivalent of many basic OpenCV methods. Most of these steps will take some sort of input (an image, Built-In Constants, or numeric values) and generally output an image. For this platform, each OpenCV function is treated as an individual step that takes an input and provides an output. The ImageProcess class keeps track of the order of each step and passes along necessary information from one step to another.
The ImageProcess is instantiated initially and acts as the Controller in the MVC space to keep track of each individual ImageProcessStep.

Usage Examples

Below is an example of a simple application which will read in a folder of images, and allow the user to quickly view the results of applying a color space conversion followed by a binary threshold.
:::python
app = QtGui.QApplication([])

process = ImageProcess()

fileIOArgs = {'input file path':'./Data/quickTest/',
                 'isDisplayed':False}
loadstep = loadBatchStep()
process.setupFileIO(loadstep,**fileIOArgs)

graystep = ColorConversion()
process.newStep(graystep)

bw = binaryThreshold()
process.newStep(bw)

process.doneAddingSteps()
mw = Main_Window(process)
mw.show()
app.exec_()
And this Will create a window like such:
Fig 1a.
After running the process (Ctrl+R):
Fig 1b.

Current Functionality

Gui Features

  • Image Expansion- Zoom in to pixel level
  • Histogram Visualization
  • Navigate between multiple images easily
  • Focus in on any step in the ImageProcess
  • Alternate between different Steps using an ImageProcessStepGroup

File IO

  • load image :load single file, all files in folder, or files in directory tree.
  • load video : load an avi and process each frame in the file

Color Space Conversion

  • cvtColor
  • binary Threshold
  • adaptive Threshold
  • otzu threshold
  • canny edge detection

Image Processing

  • guassianblurr
  • medianblurr
  • erode
  • dialate
  • top hat filter
  • histogram equilization
  • Contrast limited adaptive histogram equalization (CLAHE)

Advanced Methods

  • contour detection
  • chess board corner detection
  • motion tracing using calcOpticalFlowPyrLK and goodFeaturesToTrack

No hay comentarios:

Publicar un comentario