computer vision - "Adaptive" normalization to 0-1? Decoding the 0s and 1s from an array of values (low level barcode decoding) -


i working on decoder of black-white tag (very similar bar code).

what decoder gets separated cells of barcode , each 1 white , black reference cell.

the basic idea calculate mean brightness of each cell , compare reference values, in order tell whether 0 or 1. problem inconsistent lightning, white cell on e.g. left can grayish black cell on right. values like:

80, 81, 79, 47, 77, 80, 68, 82... (which represent w,w,w,b,w,w,b,w...). 68 closer white reference value, since there 80 , 82 left , right, has black.

what elegant way decode 0s , 1s not comparing them strictly 2 reference values, pattern of values?

best, pawel

an "elegant" solution:

  1. apply sort of blur matrix you've been given.
  2. subtract blurred matrix original matrix.
  3. add difference, scaled factor, original matrix.

steps 1 , 2 create matrix values representing difference nearby values. combining data original values gives original matrix information.


Comments