Classification of polyps in the human colorectum is a hot topic of gastroenterology. The current advancements in devices of endoscopy made it possible to product high resolution images of polyps with different light filters, e.g. with narrow band imaging (NBI) system. There exists several human classification methods that helps the doctor to decide whether a specific polyp is risky (i.e. it can be turn into cancer) or not. To overcome the limits of human classification skill, a digital image processing method was developed by the authors of this paper. This paper summarizes the preprocessing method of this software, which is not a trivial task, because during the inspection of a patient, the diagnostician has limited control of light and geometry. Therefore the surface of the polyp is not uniformly illuminated, and prominent flares could appear on the images quite often. These circumstances makes it hard to detect the surface patterns precisely. In this paper a lot of variants for this preprocessing task is presented. The best of them appears to reproduce the geometrical parameters of the patterns in 1-5% relative error which is enough for the classification method. The proposed method can be applied to another problems, where the precise measurement of patterns in highly variable illuminating conditions is needed.