in an optical scanner , an optical scanner optically scans a bar code to obtain signal strength of light reflected from black bars and white bars of the bar code , an extracting unit extracts edge data , which includes a plurality of edges and the signal strength of which changes corresponding to a change from a black bar to a white bar and vice versa , an edge - emphasizing unit that emphasizes edge data of an edge that satisfies a predetermined condition , a ternary judgment unit that makes a ternary judgment of each edge based on the edge emphasized to obtain a ternarizing result , and a decoder that decodes bar - code characters from the ternarizing result .