High precision optical encoders are used for many high end computerized numerical control machines. Main requirement for such systems are accuracy and time of measurement, therefore image processing are often performed by FPGA or DSP. This article will describe image processing algorithm for detecting and measuring pitch position on invar scale, which can be easily implemented on specified target hardware. The paper proposed to use a one-dimensional approach for pitch recognition and measure its position on the image. This algorithm is well suited for implementation on FPGA and DSP and provide accuracy 0.07 pixel.