reading QR codes on parts

365 views
Skip to first unread message

Ryan Kim

unread,
Nov 18, 2022, 11:53:52 AM11/18/22
to OpenPnP
Hello,

First post! I'm hoping to read QR codes (picture attached) from our parts using the down-facing camera before picking them up. If I want to have openpnp read this and save relevant information from it, how should I go about this? Could you let me know or at least point me toward any existing posts or wiki? Thanks so much for your time and help.

Sincerely,
Ryan Kim
qr_code.jpg

bert shivaan

unread,
Nov 18, 2022, 1:01:55 PM11/18/22
to ope...@googlegroups.com
it seems to me there is a way to read the QR information. I think this is how the rapid feeder works and maybe Jason or others was able to do that. Assuming that is true, I would think you want to invoke a script to write the information to a file. I am making big broad assumptions here. Likek the data could be stored as a string with no paring needed. and that it could be stored in a text file.


--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/548e074e-e552-4f4b-ac02-a6c451e789ecn%40googlegroups.com.

Litterio Andrea Guainella

unread,
Nov 18, 2022, 2:37:46 PM11/18/22
to OpenPnP
Hi,
the decoded datamatrix is "3205DCTST100014".
If the intent is to build a feeder from the qrcode information I think it's a bit complicated unless you intend to use BlindFeeder.
Otherwise, if the intent is to detect the data from the qrcode to do something else, perhaps it is possible to use an ad hoc script (which does something) and also reads the datamatrix (or qrcode in general).
For this I think is useful read this class.
Try to give a few more details on what you would like to do maybe I can help you

LAG

Mark

unread,
Nov 20, 2022, 6:43:55 AM11/20/22
to ope...@googlegroups.com

Hi Ryan

do I understand it correctly, that each of your parts has its own QR code?

And if yes, does this just identify the part from the finite list that you added/imported in OpenPnP beforehand?

As LAG pointed out, the  SimpleOCR stage gives you the capability to read an OCR in a vision pipeline, but so far this is only used to identify the feeder (ReferencePushPullFeeder and BlindsFeeder), not the individual part.

_Mark

Ryan Kim

unread,
Nov 22, 2022, 4:11:22 PM11/22/22
to OpenPnP
Hi all,

Thank you for the responses so far. To provide a little more detail on what we are doing, we have thousands of these parts that will be placed in groups of 64 on plastic circuit boards which we call modules. Our pick and place machine will pick up the part from a part tray (feeder), measure its dimensions using the vision pipeline which we save it to a .csv file using our own script, then place it on the module in the correct orientation and order.

To answer the question, yes, each of our part will have its own QR code on it already, with the decoded datamatrix acting as a "serial number" for the part. Before we pick up each part, we want the machine to be able to read this QR code, decode it, and save the string in either the same .csv we already output or a new text file in the order of the parts being placed by the machine. There will be a separate database which we can access later which includes this decoded datamatrix already along with other relevant information for the part. 

It sounds like maybe SimpleOCR is what we need, but I didn't quite understand the point about identifying the feeder vs identifying the part. Could you explain this a little bit more?

Thank you!
Ryan

Mark

unread,
Nov 23, 2022, 1:05:44 AM11/23/22
to ope...@googlegroups.com

Hi Ryan,

As implemented today, the QR identifies the type of part (e.g. R100k) loaded in a feeder, not the feeder as such and also not the individual part. If you load a new part type into an existing feeder, you can stick a new QR label on it and OpenPnP can automatically detect that, in the preparatory phase of the assembly job.

Feeders with QR are typically employed when the feeders can be removed and remounted on the machine (individually or as arrays/slates), in different slots or locations. The QR is then read to discover new or existing feeders at swapped slots/locations, or at least to confirm that the configured feeders are where they should be, and/or that they have the right parts loaded.

Your application is obviously quite different, and you would have to write scripts to do all this.

_Mark

Ryan Kim

unread,
Nov 23, 2022, 2:41:57 PM11/23/22
to OpenPnP
Hi Mark,

Thanks, I understand better what you mean. It sounds like at the least reading of the QR code isn't a problem and we'll just have to write scripts for what we want our machine to do specifically for our application. Could you point me towards code where OpenPnP detects the QR code? When you say preparatory phase of the assembly job, where in the code is this written and carried out? If we can look off of some base code to see how the QR detection is done then I think we should be able to implement our own scripts for the job. Thanks!

Ryan

Mark

unread,
Nov 24, 2022, 2:57:42 AM11/24/22
to ope...@googlegroups.com

QR codes (and other types of barcodes) are currently just treated as a variant of OCR (optical character recognition) where humand readable text is recognized. In many DIY scenarios it is more practical that the user can read the label too.

So if you search for OCR you will find the code:

https://github.com/openpnp/openpnp/search?q=OCR&type=code

If you focus on one application like the BlindsFeeder, it shows you the steps needed.

For a more direct approach, you can interactively create a pipeline in OpenPnP using the SimpleOcr stage. Set the font name to "[Barcode]" to switch it over to QR/Barcode mode. The result of that stage then directly contains the recognized text, inside its wrapper object. The Pipeline can be copied as XML and you could use it as such from a script.

> When you say preparatory phase of the assembly job, where in the code is this written and carried out?

It is a feeder oriented preparation (overrides in the feeders). From the description of your plans I doubt it fits the use case.

But see for yourself, for example here:

_Mark
Reply all
Reply to author
Forward
0 new messages