QR Code Recognition in Streaming Video

The customer has given us the following task: to implement an application for QR code recognition in streaming video. The main condition was a hard limit on time required to process one frame - no more than 20 milliseconds, and recognition accuracy of X%. Another condition, but not so hard, was to work on a Linux system, which is quite a common task for us.

As an input, we were provided with several video clips on which to test our application. However, due to the NDA, we cannot show these videos here. A little that we can tell you about the data is that it is a black and white video at 50 frames per second, where the QR code moves in the direction from right to left.

Experiments and implementation

To work with video, we immediately took OpenCV and decided to test the implementation of an empty processing loop in Python as the first option. After the first launch, we realized that the implementation of this idea would not bring the desired result, and we would spend too much time optimizing the code. It is worth noting that processing took an average of about 300 milliseconds, and this is with the missing processing code!

After this experiment, we immediately decided to use heavy artillery in the form of C++. Many teams think that using C++ for development is very labor intensive, but in practice, developing in C++ is not that difficult, although its standard is very bloated (our apologies to C++ adherents). Also note that if you use the latest features of the language, then writing software becomes much easier.

We divided the implementation of the program into three stages: the basic implementation, the code optimization stage, and the final version.

At the stage of the basic implementation, we wrote almost the same program code in Python, but at the same time we added QR code recognition based on the same OpenCV. On average, a frame was processed in 15 milliseconds, but there were large outliers up to 81 milliseconds, which did not fit into the given task framework.

The major complaints were about the QR code recognition code. Applying various approaches, we were faced with the fact that the QRCodeDetector class from the OpenCV library did not cope very well with recognition and did not behave very stable in terms of computing time.

Here we smoothly move on to the stage of code optimization. We decided to abandon QRCodeDetector and use the third-party quirc library. The decision turned out to be right, and we immediately got a good increase in processing speed - on average, it took from 10 to 11 milliseconds per frame, and the recognition accuracy became much higher.

Even although we achieved the result desired by the customer, and completed the main part of the task, we went a little further and improved the recognition accuracy even more. The simplest method by which we have slightly increased the accuracy of QR code recognition is the use of adaptive binarization using the mean metric.

The final version of the application has undergone a few more changes. Among the most significant are support for EAN codes recognition and adapting the application to work as a linux daemon.

Conclusion

We completed the project right on time. The client received an effective QR code recognition tool, which exceeds the initial accuracy requirements. Our software allowed the client to greatly optimize the production process and reduce costs.

With extensive experience in the implementation of non-standard and complex projects, the MST team is ready to develop even the most demanding software solutions to optimize business processes.

Отзыв клиента

В июле 2019 года компания ООО «Аэро-Трейд» искала подрядчика для выполнения работ по внедрению системы безналичной оплаты товаров самолетах авиакомпании «AZUR air». После тщательного изучения рынка, мы решили обратиться для реализации данного проекта в компанию ООО «МСТ Компани». Основной задачей было обеспечить каждый борт авиакомпании «AZUR air» терминалом, который сможет принимать платежи не только на земле, но и во время полёта.

В течении всего времени нашего сотрудничества, специалисты ООО «МСТ Компани» продемонстрировали отличные профессиональные навыки при подготовке проекта, и разработке документации. В результате мы получили гибкое и надёжное решение, которое удовлетворяет нашим требованиям.

По итогам работы с компанией ООО «МСТ Компани» хочется отметить соблюдение принципов делового партнерства, а также четкое соблюдение сроков работ и выполнение взятых на себя обязательств. ООО «Аэро-Трейд» выражает благодарность специалистам компании за проделанную работу в рамках внедрения системы безналичной оплаты на самолетах авиакомпании «AZUR air». И рекомендует компанию ООО «МСТ Компани» как надёжного партнёра в области платёжных решений.

Implementation of the Volna Technology with Mutual Authentication for Finopolis 2025

Implementation of the Volna Technology with Mutual Authentication for Finopolis 2025

Implementation of Biometric Age Verification for VTB Bank at FINOPOLIS 2025

Implementation of Biometric Age Verification for VTB Bank at FINOPOLIS 2025

JoinPAY Payment Solution Implementation at IRBIS Gas Stations

JoinPAY Payment Solution Implementation at IRBIS Gas Stations

Software Package for Forced Draft Units Calculations for KMZ JSC — Stage 4

Software Package for Forced Draft Units Calculations for KMZ JSC — Stage 4

Implementation of Biometric Acquiring for VTB Bank at Finopolis 2024

Implementation of Biometric Acquiring for VTB Bank at Finopolis 2024

Implementing Cross-Platform Software for Payment Terminals in AgroPromBank

Implementing Cross-Platform Software for Payment Terminals in AgroPromBank

Creating Information Datasets for Remote Earth Sensing

Creating Information Datasets for Remote Earth Sensing

Fuel Processing Payment Platform

Fuel Processing Payment Platform

An application for QR Code Recognition in Streaming Video

QR Code Recognition in Streaming Video — Stage 2

Developing of application for QR Code Recognition in Streaming Video

QR Code Recognition in Streaming Video

Developing of a neural network for comparing fingerprints

Neural Network for Fingerprint Comparison

Software Package for Forced Draft Units Calculations for KMZ JSC — Stage 2

Software Package for Forced Draft Units Calculations for KMZ JSC — Stage 2

Developing a software package for calculation of draft machines

Software package for calculation of draft machines for KMZ JSC — Stage 3

Development of cash application for RUS Priority company

Cash application for RUS Priority company

Development of a software for Forced Draft Units Design Calculations

Software Package for Forced Draft Units Design Calculations for KMZ JSC

SoftPOS for KamenskTelecom Provider

SoftPOS for KamenskTelecom Provider

Shop on Board for Red Wings Airlines

Shop on Board for Red Wings Airlines

The Cashless Payments has Become Available on Board the Aircraft of Izhavia Airline

The Cashless Payments has Become Available on Board the Aircraft of Izhavia Airline

Acceptance of cashless payments in Nur Sultan city buses

Acceptance of cashless payments in Nur Sultan city buses

Cashless payments on business park buses

Payment acceptance for shuttle buses of the Delovoy Kvartal international business park

QR Code Fare Payment System for the Public Transport

QR Code Fare Payment System for the Public Transport Company in Kamensk-Uralsky

Implementation of a cashless payment system on board an airplane

Cashless payments on AZUR Air’s airplanes

Cloud monitoring system of server rooms for Bank MIA

Cloud monitoring system of server rooms for Bank MIA

Accept non-cash payments on Kamensk-Uralsky public transport

Non-cash payments on Kamensk-Uralsky buses