In a method for position decoding, a position is calculated on the basis
of information determined from a partial area, imaged by a sensor, of a
position-coding pattern. If the position calculation fails, the
information from the partial area recorded by the sensor is matched with
information about how the position-coding pattern is designed in a
plurality of matching partial areas, which each define a position in the
position-coding pattern. The position of the positions defined by the
matching partial areas, which according to the matching step is the most
probable position in the position-coding pattern for the imaged partial
area is accepted as the decoded position.A device and a computer program
for carrying out the method are also described.