A method of error correction of a two-dimensional, 2D, symbol, the method comprising: accessing, by a processor, a plurality of codewords in the 2D symbol; determining, by the processor, a contrast threshold associated with each codeword of the plurality of codewords; determining, by the processor, a minimum interior contrast level for each codeword of the plurality of codewords, wherein determining the minimum interior contrast level comprises: determining, within a codeword of the plurality of codewords, a space cell having a smallest space cell reflectance value and a bar cell having a largest bar cell reflectance value; and determining an erasure gap for bars and an erasure gap for spaces, wherein the erasure gap for bars is determined based on the largest bar cell reflectance value and the contrast threshold, and wherein the erasure gap for spaces is determined based on the smallest space cell reflectance value and the contrast threshold; identifying, by the processor, an optically ambiguous codeword of the plurality of codewords in the 2D symbol, wherein the optically ambiguous codeword corresponds to a codeword having a lowest minimum interior contrast level amongst the minimum interior contrast levels for each codeword of the plurality of codewords; and correcting, by the processor, errors in the optically ambiguous codeword based on a location of the optically ambiguous codeword and an erroneous decoded value associated with the optically ambiguous codeword. accessing, by a processor, a plurality of codewords in the 2D symbol; determining, by the processor, a contrast threshold associated with each codeword of the plurality of codewords; determining, by the processor, a minimum interior contrast level for each codeword of the plurality of codewords, wherein determining the minimum interior contrast level comprises: determining, within a codeword of the plurality of codewords, a space cell having a smallest space cell reflectance value and a bar cell having a largest bar cell reflectance value; and determining an erasure gap for bars and an erasure gap for spaces, wherein the erasure gap for bars is determined based on the largest bar cell reflectance value and the contrast threshold, and wherein the erasure gap for spaces is determined based on the smallest space cell reflectance value and the contrast threshold; determining, within a codeword of the plurality of codewords, a space cell having a smallest space cell reflectance value and a bar cell having a largest bar cell reflectance value; and determining an erasure gap for bars and an erasure gap for spaces, wherein the erasure gap for bars is determined based on the largest bar cell reflectance value and the contrast threshold, and wherein the erasure gap for spaces is determined based on the smallest space cell reflectance value and the contrast threshold; identifying, by the processor, an optically ambiguous codeword of the plurality of codewords in the 2D symbol, wherein the optically ambiguous codeword corresponds to a codeword having a lowest minimum interior contrast level amongst the minimum interior contrast levels for each codeword of the plurality of codewords; and correcting, by the processor, errors in the optically ambiguous codeword based on a location of the optically ambiguous codeword and an erroneous decoded value associated with the optically ambiguous codeword.