Jump to content

WebCam as BarCode Reader


andybiochem
 Share

Recommended Posts

WebCam as BarCode Reader

===================

This is a project I've just started to try to get my webcam to recognise barcodes.

Eventually I hope to be able to get the script to automatically detect barcodes of

any type, and quickly return the encoded text.

Ok, first some disclaimers:

1) This only works with simple CODE128 barcodes in code C at the moment.

2) It is not 100% effective, I get 1 in 5 reads as successful.

3) Upon exit, sometimes the script hangs (anyone know what I'm doing wrong???)

Consider this very much a work-in-progress.

Example useage:

This is a barcode I created using my Barcode Generator (see sig) and then printed out :

Note: the text in the barcode is "123456"

This is how it looks in the GUI having successfully 'read' the barcode:

post-29091-1233683043_thumb.jpg

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <Array.au3>
#Include <Color.au3>

Opt("GUIOnEventMode",1)
Opt("PixelCoordMode",2)

HotKeySet("{F1}","_Cap")

;************************************************
; Variables
;************************************************




;----- Open DLLs ----- 
$dAviCap32 = DllOpen("avicap32.dll")
$dUser32 = DllOpen("user32.dll")

;----- Arrays -----
Global $aPixels[321]
Global $aLabels[321]
Global $aSplit[1]

Global $aBC128[104]
$aBC128[1] = "0¬ ¬00¬11011001100"
$aBC128[2] = "1¬!¬01¬11001101100"
$aBC128[3] = '2¬"¬02¬11001100110'
$aBC128[4] = "3¬#¬03¬10010011000"
$aBC128[5] = "4¬$¬04¬10010001100"
$aBC128[6] = "5¬%¬05¬10001001100"
$aBC128[7] = "6¬&¬06¬10011001000"
$aBC128[8] = "7¬'¬07¬10011000100"
$aBC128[9] = "8¬(¬08¬10001100100"
$aBC128[10] = "9¬)¬09¬11001001000"
$aBC128[11] = "10¬*¬10¬11001000100"
$aBC128[12] = "11¬+¬11¬11000100100"
$aBC128[13] = "12¬,¬12¬10110011100"
$aBC128[14] = "13¬-¬13¬10011011100"
$aBC128[15] = "14¬.¬14¬10011001110"
$aBC128[16] = "15¬/¬15¬10111001100"
$aBC128[17] = "16¬0¬16¬10011101100"
$aBC128[18] = "17¬1¬17¬10011100110"
$aBC128[19] = "18¬2¬18¬11001110010"
$aBC128[20] = "19¬3¬19¬11001011100"
$aBC128[21] = "20¬4¬20¬11001001110"
$aBC128[22] = "21¬5¬21¬11011100100"
$aBC128[23] = "22¬6¬22¬11001110100"
$aBC128[24] = "23¬7¬23¬11101101110"
$aBC128[25] = "24¬8¬24¬11101001100"
$aBC128[26] = "25¬9¬25¬11100101100"
$aBC128[27] = "26¬:¬26¬11100100110"
$aBC128[28] = "27¬;¬27¬11101100100"
$aBC128[29] = "28¬<¬28¬11100110100"
$aBC128[30] = "29¬=¬29¬11100110010"
$aBC128[31] = "30¬>¬30¬11011011000"
$aBC128[32] = "31¬?¬31¬11011000110"
$aBC128[33] = "32¬@¬32¬11000110110"
$aBC128[34] = "33¬A¬33¬10100011000"
$aBC128[35] = "34¬B¬34¬10001011000"
$aBC128[36] = "35¬C¬35¬10001000110"
$aBC128[37] = "36¬D¬36¬10110001000"
$aBC128[38] = "37¬E¬37¬10001101000"
$aBC128[39] = "38¬F¬38¬10001100010"
$aBC128[40] = "39¬G¬39¬11010001000"
$aBC128[41] = "40¬H¬40¬11000101000"
$aBC128[42] = "41¬I¬41¬11000100010"
$aBC128[43] = "42¬J¬42¬10110111000"
$aBC128[44] = "43¬K¬43¬10110001110"
$aBC128[45] = "44¬L¬44¬10001101110"
$aBC128[46] = "45¬M¬45¬10111011000"
$aBC128[47] = "46¬N¬46¬10111000110"
$aBC128[48] = "47¬O¬47¬10001110110"
$aBC128[49] = "48¬P¬48¬11101110110"
$aBC128[50] = "49¬Q¬49¬11010001110"
$aBC128[51] = "50¬R¬50¬11000101110"
$aBC128[52] = "51¬S¬51¬11011101000"
$aBC128[53] = "52¬T¬52¬11011100010"
$aBC128[54] = "53¬U¬53¬11011101110"
$aBC128[55] = "54¬V¬54¬11101011000"
$aBC128[56] = "55¬W¬55¬11101000110"
$aBC128[57] = "56¬X¬56¬11100010110"
$aBC128[58] = "57¬Y¬57¬11101101000"
$aBC128[59] = "58¬Z¬58¬11101100010"
$aBC128[60] = "59¬[¬59¬11100011010"
$aBC128[61] = "60¬\¬60¬11101111010"
$aBC128[62] = "61¬]¬61¬11001000010"
$aBC128[63] = "62¬^¬62¬11110001010"
$aBC128[64] = "63¬_¬63¬10100110000"
$aBC128[65] = "64¬`¬64¬10100001100"
$aBC128[66] = "65¬a¬65¬10010110000"
$aBC128[67] = "66¬b¬66¬10010000110"
$aBC128[68] = "67¬c¬67¬10000101100"
$aBC128[69] = "68¬d¬68¬10000100110"
$aBC128[70] = "69¬e¬69¬10110010000"
$aBC128[71] = "70¬f¬70¬10110000100"
$aBC128[72] = "71¬g¬71¬10011010000"
$aBC128[73] = "72¬h¬72¬10011000010"
$aBC128[74] = "73¬i¬73¬10000110100"
$aBC128[75] = "74¬j¬74¬10000110010"
$aBC128[76] = "75¬k¬75¬11000010010"
$aBC128[77] = "76¬l¬76¬11001010000"
$aBC128[78] = "77¬m¬77¬11110111010"
$aBC128[79] = "78¬n¬78¬11000010100"
$aBC128[80] = "79¬o¬79¬10001111010"
$aBC128[81] = "80¬p¬80¬10100111100"
$aBC128[82] = "81¬q¬81¬10010111100"
$aBC128[83] = "82¬r¬82¬10010011110"
$aBC128[84] = "83¬s¬83¬10111100100"
$aBC128[85] = "84¬t¬84¬10011110100"
$aBC128[86] = "85¬u¬85¬10011110010"
$aBC128[87] = "86¬v¬86¬11110100100"
$aBC128[88] = "87¬w¬87¬11110010100"
$aBC128[89] = "88¬x¬88¬11110010010"
$aBC128[90] = "89¬y¬89¬11011011110"
$aBC128[91] = "90¬z¬90¬11011110110"
$aBC128[92] = "91¬{¬91¬11110110110"
$aBC128[93] = "92¬|¬92¬10101111000"
$aBC128[94] = "93¬}¬93¬10100011110"
$aBC128[95] = "94¬~¬94¬10001011110"
$aBC128[96] = "95¬del¬95¬10111101000"
$aBC128[97] = "96¬Fnc3¬96¬10111100010"
$aBC128[98] = "97¬Fnc2¬97¬11110101000"
$aBC128[99] = "98¬Shift¬98¬11110100010"
$aBC128[100] = "99¬Code C¬99¬10111011110"
$aBC128[101] = "100¬Fnc 4¬Code B¬10111101110"
$aBC128[102] = "101¬Code A¬Code A¬11101011110"
$aBC128[103] = "102¬Fnc 1¬Fnc 1¬11110101110"



;************************************************
; GUI
;************************************************

$GUI = GUICreate("",350,200)
GUISetOnEvent($GUI_EVENT_CLOSE,"_Close")



;************************************************
; WebCam
;************************************************

$dWebCam = DllCall($dAviCap32,"int","capCreateCaptureWindow","str","cap","int", _ 
BitOR($WS_CHILD,$WS_VISIBLE),"int",15,"int",15,"int",320,"int",50,"hwnd",$GUI,"int",1)
DllCall($dUser32,"int","SendMessage","hWnd",$dWebCam[0],"int",0x400 + 10,"int",0,"int",0)
DllCall($dUser32,"int","SendMessage","hWnd",$dWebCam[0],"int",0x400 + 50,"int",1,"int",0)
DllCall($dUser32,"int","SendMessage","hWnd",$dWebCam[0],"int",0x400 + 52,"int",1,"int",0)


;************************************************
; Labels
;************************************************

For $i = 1 to 320
    If IsInt($i / 50) Then
        $aLabels[$i] = GUICtrlCreateLabel("",14 + $i,80,1,10)
    Else
        $aLabels[$i] = GUICtrlCreateLabel("",14 + $i,80,1,5)
    EndIf
    GUICtrlSetBkColor(-1,0x000000)
Next

$interpretation = GUICtrlCreateLabel("",15,130,320,15)





GUISetState(@SW_SHOW)
;################################################################
; LOOP
;################################################################
While 1
    Sleep(100)
Wend
;################################################################
; END LOOP
;################################################################



Func _Cap()
    
;----- Stop WebCam -----
    DllCall($dUser32,"int","SendMessage","hWnd",$dWebCam[0],"int",0x400 + 52,"int",0,"int",0)
    
;----- Get pixels across center -----
    $sString = ""
    For $i = 1 to 320
        $aPixels[$i] = PixelGetColor(14 + $i, 15 + 25)
        GUICtrlSetBkColor($aLabels[$i], $aPixels[$i])
        If _ColorGetRed($aPixels[$i]) > 100 Then
            $sString &= 0
        Else
            $sString &= 1
        EndIf
    Next
    
;_ArrayDisplay($aPixels)
    
;----- split up -----
    $sString = StringReplace($sString,"10","1|0")
    $sString = StringReplace($sString,"01","0|1")
    
    $aSplit = StringSplit($sString,"|")
    
;----- get wdith -----
    $iWidth = StringLen($aSplit[2]) / 2
    
;----- apply width -----
    For $i = 1 to (UBound($aSplit) - 1)
        
        $iDiv = StringLen($aSplit[$i]) / $iWidth
        
        Select
            Case $iDiv <= 1.4
                $iDiv = 1
            Case $iDiv >= 2.5
                $iDiv = 3
            Case Else
                $iDiv = 2
        EndSelect
        
        $aSplit[$i] = $iDiv
        
    Next

;_ArrayDisplay($aSplit)
    
;----- keep only code -----
    _ArrayPop($aSplit)
    _ArrayDelete($aSplit,1)
    
;_ArrayDisplay($aSplit)
    
;----- build 1/0 code -----
    $sCode = ""
    $iBool = 1
    For $i = 1 to (UBound($aSplit) - 1)
        
        For $j = 1 to $aSplit[$i]
            $sCode &= $iBool
        Next
        
        If $iBool = 1 Then
            $iBool = 0
        Else
            $iBool = 1
        EndIf
    
    Next
    
;----- Split into array -----
    Dim $aSplit[1]
    For $i = 1 To StringLen($sCode)
        If IsInt($i / 11) Then _ArrayAdd($aSplit,StringMid($sCode,$i - 10,11))
    Next
    
;----- search barcode array -----
    $sCode = ""
    For $i = 1 to (UBound($aSplit) - 1)
        For $j = 1 to 103
            $aData = StringSplit($aBC128[$j],"¬")
            
            If $aSplit[$i] = $aData[4] Then $sCode &= $aData[3]
        Next
    Next
    
;----- display text -----
    GUICtrlSetData($interpretation,"Barcode text = " & StringTrimRight($sCode,2))
    
;----- Start WebCam -----
    DllCall($dUser32,"int","SendMessage","hWnd",$dWebCam[0],"int",0x400 + 52,"int",1,"int",0)
    

EndFunc





Func _Close()
;************************************************
; Exit
;************************************************
    DllCall($dUser32,"int","SendMessage","hWnd",$dWebCam[0],"int",0x400 + 181,"int",0,"int",0)
    DllCall($dUser32,"int","SendMessage","hWnd",$dWebCam[0],"int",0x400 + 11,"int",0,"int",0)
    DllClose($dUser32)
    DllClose($dAviCap32)
    
    Exit
    
EndFunc

Credits go to Rysiora for the basic DLL calls to get the WebCam in the GUI:

http://www.autoitscript.com/forum/index.ph...5&hl=webcam

Have fun.

Edited by andybiochem
- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!
Link to comment
Share on other sites

Looks interesting andbiochem, though I haven't tried it yet.

Arte you planning to be able to work out if the image needs to be rotated?

Why do think the reliability is not so good at the moment? (Looks like the result from the webcam is better than the original printout, is the print resolution the problem?)

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

I was planning on maybe one day thinking about doing this, but I stopped with what i had made, where you take an image and click on the left then on the right and it read it. The hardest part is pixelation.

Yeah, I saw your post (good job btw), but I thought this was significantly different and worth the post.

Looks interesting andbiochem, though I haven't tried it yet.

Arte you planning to be able to work out if the image needs to be rotated?

Why do think the reliability is not so good at the moment? (Looks like the result from the webcam is better than the original printout, is the print resolution the problem?)

'Rotated' as in upside-down? Hmmm, good point... hadn't thought about that to be honest.

Reliability not so good due to a couple of things:

1) each individual line's width (be it black or white) can be 1, 2, or 3 pixels. In Code128 the first 'bar' is 2 pixels wide, and in my algorithm I'm just dividing the detected number of pixels of the 1st line by 2 to get the 'single' bar width. This works well IF the cam is perfectly perpendicular to the page. If the barcode actually forms some sort of other shape other than rectangular (i.e. 4 x 90 right angles), then the algo fails somewhat. A good fix might be to read the 1st and last lines and check for equality in width and height, and only allow 'reading' when equality occurs.

2) my webcam is rubbish, and so resolution is not great. I'm suprised it works AT ALL.

Print resolution is spot on. The image of the printout is from the webcam too!

Edited by andybiochem
- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!
Link to comment
Share on other sites

Print resolution is spot on. The image of the printout is from the webcam too!

:) I hadn't thought of that.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Don't get me wrong, I wasn't saying mine was better or worse or anything.

Don't worry I didn't think that, just like I said; our algos are quite different, and I wanted a system that would act like your typical supermarket cashier barcode reader, i.e. you just 'wave' the barcode in front of the reader (in this case a webcam), and then it automatically picks up and translates the code to string.

This project has got me thinking about the possibilities of using a webcam in autoit, you could have face-recognition, motion detection (I know there's a thread on this already), barcode readers, OCR, etc.

AutoIt is ace.

- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!
Link to comment
Share on other sites

With the rotation comment I made in post #3 I was thinking about how you would deal with the barcode being at any angle. If it was at 45 degrees then you would have a problem reading it wouldn't you? If it is completely upside down then you can just try scanning left to right and then right to left to see which way gives a valid code.

I wondered about how to deal with the angle, assuming it is a problem.

You could check every pixel along a line and every time you find a pixel which is black you count up 1. So you end up with an value for every line. If the code is lined up correctly the values would be something like 0,0,0,100,100,100,100,0,0,0 say. But if it's at an angle you will get 0,1,3,10,30,50,80,60,40,30,10,0 maybe. So you rotate untill you get as near as you can to sudden change to a fixed value and a sudden change to nothing again.

Or, you scan along a line until you hit a black pixel. Then you find the next pixel which is adjacent and also next to a white pixel. With a few conditions you should be able to pick out the edge of a line at the end of the code. Once you have that you can decide the best straight line through those points and get the angle. Maybe related to finding outlines.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

With the rotation comment I made in post #3 I was thinking about how you would deal with the barcode being at any angle. If it was at 45 degrees then you would have a problem reading it wouldn't you? If it is completely upside down then you can just try scanning left to right and then right to left to see which way gives a valid code.

I wondered about how to deal with the angle, assuming it is a problem.

oh ok, I misunderstood. I'm not sure if it's really a problem to be honest, for the following reason; most commercial barcode scanners also require that the barcode is parallel to the reading sensor. Perhaps it's possible like you said, but I think maybe it'd be wasted effort. I don't think it would be too much of a hassle to get the user to align the barcode to the webcam properly.

The current script allows a certain degree of rotation anyway, as long as all the bars are visible along a straight line.

e.g. Both these barcodes will be read successfully (the red line is the 'reading plane'):

post-29091-1233783957_thumb.jpg

- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!
Link to comment
Share on other sites

oh ok, I misunderstood. I'm not sure if it's really a problem to be honest, for the following reason; most commercial barcode scanners also require that the barcode is parallel to the reading sensor. Perhaps it's possible like you said, but I think maybe it'd be wasted effort. I don't think it would be too much of a hassle to get the user to align the barcode to the webcam properly.

The current script allows a certain degree of rotation anyway, as long as all the bars are visible along a straight line.

e.g. Both these barcodes will be read successfully (the red line is the 'reading plane'):

post-29091-1233783957_thumb.jpg

OK, in fact maybe the one at 45 degrees can be read more accurately because the code is spread over a few more pixels.
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

@andybiochem

Good work, keep at it!

You've just given me another reason to get a WebCam.

Thanks for sharing!

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Link to comment
Share on other sites

To get better results, I suggest a statistical approach:

- reading the barcode x times, if 70/80/90% percent come back with the same result, the result will be pretty reliable. If it comes to 40/50/60% the result is unspecific.

- considering the many webcams there are, u might want the user to choose x and percentage.

The problem of the angle towards the object maybe solved by - but this is only a wild guess - if u look for the sum of the bars as a complete picture. You know it is rectangular so you maybe come up with a solution to counter a strange angle with a single algorythm.

ciao, Wiegand

Link to comment
Share on other sites

Where can I get get avicap32.dll ? I got some file "avicap32.dll", but have ERROR

D:\au3\webcam.au3(78,91) : WARNING: $WS_CHILD: possibly used before declaration.
$cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\systeming\autosale\webcam.au3(78,103) : WARNING: $WS_VISIBLE: possibly used before declaration.
$cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD,$WS_VISIBLE)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


~~^
D:\systeming\autosale\webcam.au3(78,91) : ERROR: $WS_CHILD: undeclared global variable.
$cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
D:\systeming\autosale\webcam.au3 - 1 error(s), 2 warning(s)
Edited by Andrey777
Link to comment
Share on other sites

Link to comment
Share on other sites

  • 2 weeks later...

To get better results, I suggest a statistical approach:

- reading the barcode x times, if 70/80/90% percent come back with the same result, the result will be pretty reliable. If it comes to 40/50/60% the result is unspecific.

- considering the many webcams there are, u might want the user to choose x and percentage.

The problem of the angle towards the object maybe solved by - but this is only a wild guess - if u look for the sum of the bars as a complete picture. You know it is rectangular so you maybe come up with a solution to counter a strange angle with a single algorythm.

ciao, Wiegand

The end reliability of the barcode content will always be 100% correct once I introduce the check-digit step (all barcodes end in a modulus based checking character to ensure that the scan was made correctly).

However, before I did this I wanted to make sure that the underlying 'reading' worked ok...which it doesn't, yet.

- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!
Link to comment
Share on other sites

  • 10 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...