Help with Barcode reading!

9 visualizzazioni (ultimi 30 giorni)
Ali
Ali il 30 Nov 2013
Commentato: Image Analyst il 30 Nov 2013
So there is this barcodes matrix
barcodes = {':...:::.:.....::::....:..::.:..:.:..:.:..:..:.::...';
':.:.:...::.:...:::....::..:.:....::...:.:...::.:..:'};
I'm trying to associate specific dots and colons to a specific numeric value to be able to read the barcode.
Given:
1 = ...::
2 = ..:.:
3 = ..::.
4 = .:..:
5 = .:.:.
6 = .::..
7 = :...:
8 = :..:.
9 = :.:..
0 = ::...
How can I write a for loop function that coverts barcodes matrix into numbers?

Risposta accettata

Image Analyst
Image Analyst il 30 Nov 2013
I just answered this yesterday: http://www.mathworks.com/matlabcentral/answers/108076#answer_116773 with the very same codes. Perhaps megan is your classmates. So it looks like it must be homework, which, to be honest, means you should have tagged your post with a "homework" tag.
  3 Commenti
Ali
Ali il 30 Nov 2013
Hey,
I looked at your answer to Megan, but it's is a bit different than mine. How can I translate the whole code into sets of 10 digit numbers? (The codes each represent 10 digits)
Image Analyst
Image Analyst il 30 Nov 2013
You have to get each cell's contents. Evidently it's a string of 51 characters. Now somehow, I don't know how, but you're going to have to split that 51 characters up into substrings of 5 characters each.
% Get the k'th cell's contents in the cell array.
thisString = barcodes{k};
% Extract the first 5 characters.
thisSubstring = thisString(1:5); % and so on.
Then use the look up table approach I gave Megan.

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Shifting and Sorting Matrices in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by