Crack detection and inpainting for virtual restoration of paintings: the case of the Ghent altarpiece