-
Notifications
You must be signed in to change notification settings - Fork 0
Dynamic Vision System
The Dynamic Vision System provides an easy-to-use automatic image processing which requires 0 code writing to process an image. Each image is processed through user-defined filters that filter out unwanted contours in several different ways. At the end of such process, the resulting contours are analysed and analysis data is returned to the user. Users can define filters in XML files for the system to use. The vision system uses openCV to perform the analysis, but it is possible to use the system with a different library, provided an interface is created.
Image processing is done by running filters over an image that filter out unwanted data. The remaining data is usually the wanted data, which is than used in different ways. The Dynamic Vision System works in a similar way, but spares the need to manually create filters, use them on an image and read the result.
There are a number of pre-made provided filters:
- Color filters: Filters out contours by their color range.
- Position filters: Filters out contours by their location in the frame. For example: contours furthest from the center, bottom, top, left, right, etc.
- Size filters: Filters out contours by their size. For example: largest filters, smallest filters, etc.
- Shape filters: Filters out contours by their shape. Approximate the geometric shape of each contour and compares it to the wanted shape.
- Ratio filters: Looks for certain position and size ratios between 2 contours. 2 contours that fit the given parameters best pass the filter.
Altough there is a huge range of filters available, it is always possible to manually create filters.
Filters for processing can be defined inside the code and using XML files. Meaning that it is not necessary to change your code in order to edit your filters. To use XML-defined filters, it is necessary to define loading data for the filters in the form of FilterCreator. FilterCreators provide identifiers for filters in XML.
Each filter has parameters which define specific data about the filtering operation. For position filters, the parameters are usually a position and the maximum amount of contours to keep. For color filters, the parameters will define the color range and color type (HSV/RGB). And so on. Parameters are defined as FilerParam. There are 3 types: floating-point data, integer data and boolean data.
Here is an example for a series of filters in XML format:
There are 2 filters defined here:
- Color filter. Notice the parameters:
- HSV: true
- Min1 (Min Hue): 0
- Max1 (Max Hue): 180
- Min2 (Min Saturation): 0
- Max2 (Max Saturation): 255
- Min3 (Min Value): 230
- Max3 (Max Value): 255
- Largest filter. Notice the parameter:
- Amount (The maximum amount of contours to leave after the operation): 10