32
Morphological Operations Applied to Digital Art Restoration M. Kirbie Dramdahl Division of Science and Mathematics University of Minnesota, Morris Morris, Minnesota, USA 29 April 2014 UMM CSci Senior Seminar Conference University of Minnesota, Morris Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 1 / 32

Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Morphological Operations Applied toDigital Art Restoration

M. Kirbie Dramdahl

Division of Science and MathematicsUniversity of Minnesota, Morris

Morris, Minnesota, USA

29 April 2014UMM CSci Senior Seminar Conference

University of Minnesota, Morris

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 1 / 32

Page 2: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Overview Outline

Why?

Art restoration preserves objects of artistic, cultural, or historical value.However, this process demands many resources.

Digital art restoration provides:a comparatively inexpensivealternative,a nondestructive tool, andan approximation of the initialappearance.

Cornelis et al

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 2 / 32

Page 3: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Overview Outline

Outline

1 Edge Detection

2 Morphological Operations

3 Methods of Crack Detection

4 Inpainting

5 Results

6 Conclusions

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 3 / 32

Page 4: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Edge Detection

Outline

1 Edge Detection

2 Morphological Operations

3 Methods of Crack Detection

4 Inpainting

5 Results

6 Conclusions

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 4 / 32

Page 5: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Edge Detection

Criteria

TermsEdge boundaries between areas of varying intensity

Intensity brightness or dullness of a color

1 Accuracy - low error rate2 Localization - minimal distance between detected and actual edge3 Uniqueness - only one response to a single edge

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 5 / 32

Page 6: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Edge Detection

Canny Algorithm I

1 Smooth image.2 Find jumps in intensity.3 Search regions for local maximum.

Wikipedia

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 6 / 32

Page 7: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Edge Detection

Canny Algorithm II

4 Compare intensity of remaining pixels to thresholds.

Original Image

Canny

Edge Mask

Canny

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 7 / 32

Page 8: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Morphological Operations

Outline

1 Edge Detection

2 Morphological OperationsErosionDilationOpeningClosing

3 Methods of Crack Detection

4 Inpainting

5 Results

6 ConclusionsDramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 8 / 32

Page 9: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Morphological Operations

Morphological Operations

Binary and Greyscale Images

Two Inputs:Original ImageStructuring Element

A

B

C

D

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 9 / 32

Page 10: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Morphological Operations Erosion

Erosion

Erosion removes foreground pixels.

g = f s

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 10 / 32

Page 11: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Morphological Operations Dilation

Dilation

Dilation adds foreground pixels.

g = f ⊕ s

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 11 / 32

Page 12: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Morphological Operations Opening

Opening

Opening removes foreground pixels... neatly.

g = f ◦ s = (f s)⊕ s

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 12 / 32

Page 13: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Morphological Operations Closing

Closing

Closing adds foreground pixels... neatly.

g = f • s = (f ⊕ s) s

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 13 / 32

Page 14: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Methods of Crack Detection

Outline

1 Edge Detection

2 Morphological Operations

3 Methods of Crack DetectionTop-Hat TransformAlternative Method

4 Inpainting

5 Results

6 Conclusions

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 14 / 32

Page 15: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Methods of Crack Detection Top-Hat Transform

Top-Hat Algorithm

Black Top-Hatdarker details onlighter background

BTH = (f • s)− f

Spagnolo and Somma

White Top-Hatlighter details ondarker background

WTH = f − (f ◦ s)

Spagnolo and Somma

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 15 / 32

Page 16: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Methods of Crack Detection Alternative Method

Alternative Method I

1 Compare pixels to threshold.2 Apply closing.

Original Image

Crack Mask

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 16 / 32

Page 17: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Methods of Crack Detection Alternative Method

Alternative Method II

3 Apply edge detection.4 Apply dilation.

Original Image

Edge Mask

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 17 / 32

Page 18: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Methods of Crack Detection Alternative Method

Alternative Method III

5 Join to form binary mask.6 Apply erosion.

Original Image

Crack Mask Edge Mask

Binary Mask

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 18 / 32

Page 19: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Inpainting

Outline

1 Edge Detection

2 Morphological Operations

3 Methods of Crack Detection

4 Inpainting

5 Results

6 Conclusions

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 19 / 32

Page 20: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Inpainting

Inpainting Process I

The image is broken down.

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 20 / 32

Page 21: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Inpainting

Inpainting Process II

For each defective pixel i :1 Find the context of i .2 Find most similar

neighborhood in region.

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 21 / 32

Page 22: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Inpainting

Inpainting Process III

3 Replace all defective pixelsin the neighborhood of iwith corresponding pixelsfrom most similarneighborhood.

OR

3 Replace pixel i with themedian value of allnon-defective pixels withinits neighborhood.

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 22 / 32

Page 23: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Results

Outline

1 Edge Detection

2 Morphological Operations

3 Methods of Crack Detection

4 Inpainting

5 Results

6 Conclusions

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 23 / 32

Page 24: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Results

Definitions

Categories:

true positives (tp)

false positives (fp)

true negatives (tn)

false negatives (fn)

Actual ValueCrack No Crack

Predicted ValueCrack True Positive False Positive

No Crack False Negative True Negative

Equations:

False and True Positive Rate

FP = fp/(fp + tn)

TP = tp/(tp + fn)

Precision and Recall

P = tp/(tp + fp)

R = tp/(tp + fn)

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 24 / 32

Page 25: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Results

Statistics I

Method Classification tp fn tn fp TP (or R) FP P

Top-Hat Transform

Crack Thickness - Thin 220 30 230 20 0.880 0.080 0.917Crack Thickness - Medium 232 18 231 19 0.928 0.076 0.924Crack Thickness - Thick 235 15 238 12 0.940 0.048 0.951Number of Cracks - Few 242 8 245 5 0.968 0.020 0.980Number of Cracks - Medium 245 5 241 9 0.980 0.036 0.965Number of Cracks - Many 243 7 243 7 0.972 0.028 0.972Crack Connectivity - Low 215 35 219 31 0.860 0.124 0.874Crack Connectivity - High 218 32 221 29 0.872 0.116 0.883

Alternative MethodEdge Information Lost - 1% - - - - 0.932 - 0.497Edge Information Lost - 30% - - - - 0.857 - 0.594Edge Information Lost - 70% - - - - 0.530 - 0.704

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 25 / 32

Page 26: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Results

Statistics II

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 26 / 32

Page 27: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Results

Results

Original Image

Cornelis et al

Restored Image

Cornelis et al

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 27 / 32

Page 28: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Conclusions

Outline

1 Edge Detection

2 Morphological Operations

3 Methods of Crack Detection

4 Inpainting

5 Results

6 Conclusions

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 28 / 32

Page 29: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Conclusions

Conclusions

The top-hat transform has been demonstrated to outperform thealternative examined here.

Further Work:Implement other methods of crack detection.Examine effects of various forms of edge detection and inpainting.Study the detection and removal of other defects.

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 29 / 32

Page 30: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

Conclusions

Thanks!

Contact:[email protected]

Questions?

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 30 / 32

Page 31: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

References

References I

Morphological image processing.Available at https://www.cs.auckland.ac.nz/courses/compsci773s1c /lectures/ImageProcessing-html/topic4.htm.

J. Canny.A computational approach to edge detection.Pattern Analysis and Machine Intelligence, IEEE Transactions on, PAMI-8(6):679–698, Nov 1986.

B. Cornelis, T. Ružic, E. Gezels, A. Dooms, A. Pižurica, L. Platiša, J. Cornelis, M. Martens, M. D. Mey, and I. Daubechies.Crack detection and inpainting for virtual restoration of paintings: The case of the ghent altarpiece.Signal Processing, 93(3):605 – 619, 2013.Image Processing for Digital Art Work.

S. Desai, K. Horadi, P. Navaneet, B. Niriksha, and V. Siddeshvar.Detection and removal of cracks from digitized paintings and images by user intervention.In Advanced Computing, Networking and Security (ADCONS), 2013 2nd International Conference on, pages 51–55, Dec2013.

N. Efford.Digital image processing: a practical introduction using Java.Addison-Wesley, 2000.

B. Green.Canny edge detection tutorial.Available at http://dasl.mem.drexel.edu/alumni/bGreen /www.pages.drexel.edu/_weg22/can_tut.html.

R. Haralick, S. R. Sternberg, and X. Zhuang.Image analysis using mathematical morphology.Pattern Analysis and Machine Intelligence, IEEE Transactions on, PAMI-9(4):532–550, July 1987.

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 31 / 32

Page 32: Morphological Operations Applied to Digital Art Restoration · However, this process demands many resources. Digital art restoration provides: a comparatively inexpensive alternative,

References

References II

N. Karianakis and P. Maragos.An integrated system for digital restoration of prehistoric theran wall paintings.In Digital Signal Processing (DSP), 2013 18th International Conference on, pages 1–6, July 2013.

A. W. R. Fisher, S. Perkins and E. Wolfart.Morphology.Available at http://homepages.inf.ed.ac.uk/rbf/HIPR2/morops.htm.

G. S. Spagnolo and F. Somma.Virtual restoration of cracks in digitized image of paintings.Journal of Physics: Conference Series, 249(1):012059, 2010.

Dramdahl (U of Minn, Morris) Morphology in Art Restoration April ’14, Sen. Sem., UMM 32 / 32