a method is disclosed of decoding a code 39 barcode when distortion and noise are high , such as when a low - resolution line - scan camera is utilized . a window looks at five bars at a time to determine if they fit the requirements of a code 39 character , i . e ., 3 narrow bars and 2 wide bars . the breakpoint between a narrow and wide bar is set at 75 % of the width of the widest bar in the window . if the window does not match the requirements , the first bar is discarded and the window is moved down one bar . when a valid character is detected , it is stored and the window is incremented 5 bars .