The pharmaceutical industry is considered to be significantly relevant and has many possibilities of innovation. This capability for innovation is recognized by both the professionals of information technology and pharmaceuticals. In some cases of pharmaceutical manufacturing processes, the ability of immediate intervention would be greatly needed to alter erroneous automated behaviors. For instance, pill manufacturing consists of several steps one of which means that machines are dosing different sorts of grains and thus creating a blend which is later examined and checked by professionals. This raises the problem that between the dosage and examination, potentially flawed blends are produced which are completely unserviceable. This means a waste of time, money and material.
The goal of my task was to find a way of minimizing the amount of waste by corrections during the dosage of grains operated by pharmaceutical machinery. In my way of dealing with the problem, I used image processing tools of OpenCVSharp library using C#. I used colour filtering in colour spaces both RGB and HSV. This was possible because different kinds of grains had differing colours. I processed a previously captured video frame by frame, keeping the concept of real-time processing in mind for the usability of the application in real manufacturing systems. I provided calibration for setting parameter values and diagnostic tools for checking on analysis details in cases of inappropriate dosages. Diagnostic features include diagrams of blend ratios and frames depicting invalid blend ratios. Broadcasting information of the need for correction in the dosages is handled by an event.
Observing the run-time of the application during and after implementation showed that it is suitable for real-time usage. The processing of one frame took about 0.0217 seconds on average, whereas the maximum allowed time would have been 0.0416 seconds considering a video using 24 FPS.
Considering all the above-mentioned, controlling grain dosages with software examination seems to be a promising direction of improving the accuracy, safety, speed and efficiency of medication dispensing.