Image analysis and processing using operations of mathematical morphology, python and OPEV library

Mathematical morphology is a theory that originated back in 1964, when George Materon was studying the relationship between the geometry of a porous medium and their permeability. At the same time, Jean Serra attempted to quantify the petrography (i.e. macroscopic and microscopic studies of rocks) of iron ores, as well as the results of Serra's 1982 study.





            Mathematical morphology initially implies set theory and all operations were defined on sets, today we will look at how you can use this theory for image processing and analysis.





In theory, mathematical morphology can be applied to any area of ​​image processing where shape plays a role. This can be object processing, noise processing, edge extraction, segmentation, texture analysis, classification, shape description, etc.





            To master the material, it is assumed that the reader has minimal knowledge in the field of:





  • Digital image processing.





  • Set theory.





  • Representation of various images on a computer.





  • Python and libraries NumPy, Matplotlib, OpenCV.





            . 1 ( ) 0 ( ), .. ( ).





            – - :





y (m, n) = Φ {x (k, l), (km, nl) ∈D}

,





x (k, l)

 – , D – (). D –





  , . (0,0). –





, . , ( , , ) .





- , . . , - , , .





- . , , ..





, , .





 









, . , , , .., , , .





, .





, .





- (n, n), «0» «1». , «0» «1» .





, , . , .





numpy, OpenCV python.





– , . . 1, 1 , , , 1 , , , .





L   ,









, U





 





 , .













, .





, .









. , , .





- . . p, 1, 0. , . :





- , , .





- , , .





- . , , , .





, .





, , , .





.

            . salt&pepper .





, .





, , . - , - .





, . , , . , .





, , , .





, , , , .. .





:





( OpenCV )





 https://github.com/yaroslavtsepkov/nta-math-morph 





( )





https://github.com/yaroslavtsepkov/image-analysis-processing/blob/main/02-lab-tsepkov-yaroslav.ipynb





OpenCV





https://docs.opencv.org/master/d9/d61/tutorial_py_morphological_ops.html








All Articles