Morpher Morpher Definition Content Morpher Combination Demonstration Conclusion Conclusion Questions Bibliography Erosion Definition ”All the pixels are replaced by the minimum value of the pixels around.” 5 / 21
Morpher Morpher Definition Content Morpher Combination Demonstration Conclusion Conclusion Questions Bibliography Naive Boolean 2D Version // Loop through a l l the v a l i d image p i x e l s f o r ( x = 0; x < img width ; ++x ) f o r ( y = 0; y < img height ; ++y ) // I n i t i a l i z e the output image new image [ x ] [ y ] = TRUE; // Loop through a l l the neighborhood p i x e l s neighborhood : f o r ( i = −neighb width ; i <= neighb width ; ++i ) f o r ( j = −n e i g h b h e i g h t ; j <= n e i g h b h e i g h t ; ++j ) i f (( x + i >= 0 && x + i < img width ) && ( y + j >= 0 && y + j < img height )) /∗ Algorithm ∗/ i f ( old image [ x + i ] [ y + j ] == FALSE) new image [ x ] [ y ] = FALSE ; break neighborhood ; 8 / 21
Morpher Morpher Definition Content Morpher Combination Demonstration Conclusion Conclusion Questions Bibliography Genericity Issues Image Structure Neighborhood 8-connexity 4-connexity Custom Algorithm • Difference between erosion and dilation? Min / Max • Accumulator • Black Box: Many inputs, Compute a result Value Type • Bool, Gray, RGB, ... • Specialize the Accumulator 9 / 21
Morpher Morpher Definition Content Morpher Combination Demonstration Conclusion Conclusion Questions Bibliography Final Version ( defun e r o s i o n ( img neighb ) ( image−map img ( accu−reduce neighb ( min−accu ) ) ) ) Readable Algorithm Small Functions: Easily Unit Testable Extensible Write Once, Support Everything 10 / 21
Morpher Morpher Definition Content Morpher Combination Demonstration Conclusion Conclusion Questions Bibliography Definition Alter communication protocol Non intrusive, Transparent, Memory Free Glue between Objects Value Morpher Image Accumulator Site Set f Update f get value next result Query set value take 12 / 21
Morpher Morpher Definition Content Morpher Combination Demonstration Conclusion Conclusion Questions Bibliography Content Morpher Work on Sets Restriction Content Morpher Restriction f Site Set Site Site Site Site • Custom-shaped Site Set • Cropped Image Addition • Image Border Ordering 14 / 21
Morpher Morpher Definition Content Morpher Combination Demonstration Conclusion Conclusion Questions Bibliography Demonstration ( defparameter l e n a ( load−image ” l e n a . png” : magick )) ( defparameter gray ( make−direct−value−morpher−image l e n a ( lambda ( gray ) ( v e c t o r gray gray gray )) ( lambda ( rgb ) (/ ( reduce #’+ rgb ) 3 ) ) ) ) ( defparameter c8 (make−box ( make−point −1 −1) ( make−point 1 1 ) ) ) ( defparameter c4 ( site−set−mask c8 #∗010111010)) ( defparameter ero ( e r o s i o n gray c4 )) ( defparameter d i l ( d i l a t i o n gray c4 )) ( defparameter d i f f ( image−combine−values #’− d i l ero )) ( defparameter f i n a l ( image−combine−values ( lambda ( rgb edge ) ( i f (> edge 50) ( v e c t o r 255 0 0) rgb )) l e n a d i f f )) ( save−image f i n a l ” f i n a l . png” : png ) Lena Gray Erosion Dilation Diff Final 17 / 21
Morpher Morpher Definition Content Morpher Combination Demonstration Conclusion Conclusion Questions Bibliography Bibliography Soille, P. (1999). Morphological Image Analysis - Principles and Applications. Springer-Verlag. Geraud, T. and Levillain, R. (2008). Semantics-driven genericity: A sequel to the static c++ object-oriented programming paradigm (Scoop 2). In 6th International Workshop on Multiparadigm Programming with Object-Oriented Languages. Ballas, N. (2008). Image taxonomy in milena. Technical report, EPITA Research and Development Laboratory (LRDE). Denuziere, L. (2009). CLIMB: A dynamic approach to generic image processing. Technical report, EPITA Research and Development Laboratory (LRDE). Denuziere, L. (2010). Property-based genericity: A dynamic approach. Technical report, EPITA Research and Development Laboratory (LRDE). 21 / 21