I'm using a raspberry pi compute module and my question is : Can we use the GPU to decode QRCODE ?

I am using my own function inspired by the one from QRTOOLS and by doing so the timing is divided by 3 or 4.

But it takes me approximately 700ms and it is way too long..

I already tried a lot of things, like zxing etc.. But zbar is the best for me.

Why I want to use the GPU? Because I'm not using it since I use SSH and I need the CPU for a lot of things.

Thank you !

1 Answer 1


In theory, you could use the OpenGL API to speed things up a bit. There's no implementation of OpenCL for now. You could design your code such that its calculations are a fragment shader according to this answer.

You should also take a look at this link.

But before you do any GPU magic, take note that this will impose some overhead on the CPU. Only do this when you're planning on doing simple, long running computations on the GPU (protein folding, image processing, etc.) so the CPU vs GPU load ratio is something significant. Doing things back and forth quickly places load on the CPU and GPU making your optimizations worthless.

In my opinion, 700ms is already fast and using the GPU to lower that time by a few milliseconds isn't worth it.

My Samsung phone with an Exynos 7420 Octa-core 2.1GHz processor with 3GB of RAM decodes QR codes in about 500ms using the ZXing barcode reader app. Think about that first.

  • @Tagadac No problem :)
    – Aloha
    Commented Mar 11, 2016 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.