i could need some brainstorming with forming an algorithm for a quite complex bit of work.
it doesnt fit into game dev, so i try my luck here, perhaps i meet some image processing
geeks here (i’m really no fan of image analyzing).
so the task is to get a scan of an EAN-13 barcode, which can be rotated and has passed
many local/pixel-filters to clear the image from disturbances like salt&pepper effects (eg.
gaussian, laplace filters whatever). the barcode will be black on white ground.
to get you an impression heres a barcode what i could look like if the filters did great work
http://zeus.fh-brandenburg.de/~huellein/barcode_rotated.gif
what i have done so far is to scan the image from left to right for the first appeareance of
black pixels and to follow the edge, assuming it is a barcode line. out of the scanned
pixels i calculate the regression line, so that i know the rotation angle of the barcode.
when i have the slope of each barcode line i can find a normal vector to it and scan the
width of each barcode line to read the binary code.
for validating issues, i do not only scan one times i scan for barcode lines and calculate
their slopes many -times.
so far, so good.
now the problems. i have to assume that the image still have many disturbances so that
my algorithms need many security-checks.
but one by one:
the barcode has so called “guard lines” these are the longer ones marking the beginning
and the end of the barcode. additionally they are coded as 101 so that the black (binary 1)
lines indicate the width of each “1”- line.
but i have no concrete idea how to identify them. if i scan each row of the image for a appereance
of black pixels they dont have to be from the first/last barcode line (if it is rotated or even
parallel to the x-axis)
if i scan the width of the guard lines x-times for getting the average width, e.g. 3px, i cant
assume that every 3rd pixel a new barcode line starts. there could be abberace from the
scanning resoulution, perhaps a line would be 3.4px wide …
- i dont need to identify the digits, but if a scan line hits them it will try to form a regression
line out out the pixel cloud, not knowing it isnt a line …
i have much more problems, but enough for now.
i cant await your suggestions…