How to speed up barcode + OCR pipeline (ADB + Python + PHP queue) for real-time processing? [closed]

5 hours ago 1
ARTICLE AD BOX

I built a system to process Aadhaar card data using the following pipeline:

1. Mobile camera captures image

2. Python script uses ADB to pull image from /sdcard/DCIM/Camera

3. Barcode (AWB) + text (pincode/state) extracted using pytesseract

4. Data is sent to PHP backend via API

5. PHP inserts into MySQL queue (FIFO)

6. Frontend polls queue every 2 seconds and processes it

Problem:

The system is slow (30 seconds per scan), mainly due to:

- ADB image transfer

- Full image OCR processing

- Polling delay

Goal:

I want near real-time performance (1–2 seconds).

Questions:

1. What is the best way to eliminate ADB delay?

2. Any suggestions to optimize pytesseract performance?

3.Or is there better option than this

Constraints:

- No mobile app (preferred)

connected without internet and also through USB Cable

What would be the best architecture for this?

I am open to redesign the architechture if needed for performance.

Read Entire Article