Skip to content

Software

Gergely Pogány edited this page Apr 15, 2019 · 10 revisions

Installation

Documentation

Testing


Software

The two main components of the software are a classification algorithm to detect the colour of the falling glass and a menu system which allows for the calibration of certain parameters. The system is always in either of these states, depending if a bottle has been detected at the input or not.

Classification

OpenCV is used to process the captured images. Thresholding is carried out on HSV converted images to extract the levels of green and brown present. The number of pixels present of these colours is then found giving a value for the presence of that colour in the image. A second classification system is used to identify clear glass. The change between the most recently captured image and a base image is how this is quantified.

Bottle 3 Bottle 4 Bottle 5

Menu

The menu has three options:

  • calibrating the resting position of the exit chute,
  • the angle between the rest position and the positions the chute turns to upon detecting amber or green glasses
  • and the length of time the chute spends at each position after a bottle has been classified.

These calibration values are then saved and loaded upon the boot-up of the system. When a bottle is detected at the input the Menu is immediately terminated and the classification starts.

The Real-Time Aspect

The real-time responsiveness of the Glassify device is necessitated by the unimpeded fall of the bottles to be sorted. The software must be able to classify the images taken by the camera quickly enough to be able to signal the servo to move to the right angle before the bottle hits the bottom of the tube. The quick processing required for this is achieved by utilising threads to delegate tasks to in order to be able to run these simultaneously. The resolution of the images to be classified were also reduced in order to save processing time. The switch activating the classification upon the inputting of a bottle is polled continuously in order to be able to start sampling immediately after the bottle has entered the device.


Installation

Documentation

Testing

Clone this wiki locally