A method for the elimination of cracks in infrared reflectograms is presented. Infrared reflectograms show the underdrawing – the basic concept of the artist drawn on the ground layer – in ancient wood panel paintings. Caused by different mechanical behaviour of the panel and the covering ground layer during the aging of the painting, cracks appear. Cracks not only disturb the appearance of a painting, but are also a problem for segmenting the lines and strokes of the underdrawing. A method based on mathematical morphology, namely morphological reconstruction with viscosity, is used to eliminate the cracks while keeping as much detail as possible in the brush strokes. A priori information that the cracks are usually thinner than the brush strokes and have a preferred orientation is taken into account.