RPi camera barcode decoding

  • Hi,

    I am quite new to this so forgive me if this is posted in the wrong group.

    I have an elderly relative who is not tech savvy and only partially sighted. The plan is to use LibreELEC on a RPi, which I have been using as my media player for quite some time. I can use the picamera module to take photos. The idea is to set up the camera so that it is fixed and points at a carriage into which she can insert a card with a picture of the cover of a DVD/CD that she wants to play. A barcode (QR) is superimposed on the cover. The camera is polled every 5 s. If a barcode is detected its value is compared with a list that points to the location of the media file to play. I should be able to send Kodi a command to play that file. There are many other logic steps here but they are not relevant to my current problem.

    My main problem is that the barcode decoder that I plan to use (ZBar) needs to be compiled from source. There is no way to do this under LibreELEC, as far as I can tell.

    Does anyone have any suggestions for either compiling or decoding barcodes under LibreELEC?

    Thank you.

  • A few points.

    1) You'd be better off using OSMC to test your application as it will allow you to install and compile what you need.

    2) Zbar has not been updated since 2009!. If you intend to use python, then LE 10 (Kodi 19) will only use Python 3 and I imagine the interface of Zbar is Python 2. So if it works now it possibly won't be upgradable. Have a look at OpenCV as that seems to work on Python 3.

    3) As LE is a R/O system, there is no way to install the required modules - hence 1)

    4) Not your original thought, but have a look at Yatse on a phone/tablet which has voice commands which may be just as good.

  • Sorry about the delay.

    In the end the LibreELEC/OSMC route became intractable.

    Instead I installed Raspbian, which allowed me to install Zbar (which is more recent than 2009). I then invoke VLC to play the media files. All this happens within a couple of bash scripts. A button on the device shuts down cleanly or starts from power-off. HDMI-CEC is used to control the TV. This is as simple as I am able to make it for my MIL and it works pretty well. She doesn't understand the concept of bar codes so every so often she'll place a normal CD case in the reader with the cover facing the camera.

    Speech recognition is not an option because her speech is somewhat unclear.

    Thanks for your considered response.