Canny and Morphological Approaches to Calculating Area and Perimeter of Two-Dimensional Geometry


  • Mustika Mentari State Polytechnic of Malang
  • Yan Watequlis Syaifudin State Polytechnic of Malang
  • Nobuo Funabiki Okayama University
  • Nadia Layra Aziza State Polytechnic of Malang
  • Tita Wijayanti State Polytechnic of Malang



Canny, morphology, area, perimeter, geometry


Calculating area and perimeter in real-world conditions has its challenges. The actual conditions include applications in the medical field to measure the presence of tumors or the condition of human organs and applications in geography to measure specific areas on a map; applications in architecture often calculate the area and perimeter of buildings, interior design, exterior design, and other uses. Technology can make it easier with automatic calculations. Mathematical methods and computer vision techniques are required to create automated systems. The Canny method is usually used, which is good enough for detecting edges but not sufficient for measuring irregular geometric shapes. This paper aims to calculate the area and perimeter of a geometric shape using the Canny method and geometry. Data samples in various forms are used in this study. Calculating area and perimeter using the Canny method involves obtaining the length (X,Y) of the RGB image converted to HSV. Edge detection values are used to calculate the area and perimeter of objects. The morphological method uses binary image input as input data. Then proceed to the convolution process with structuring and calculating the area and circumference of objects. Based on the research results, calculating the area and circumference of objects is more effective using morphological methods. However, the level of accuracy is affected by the selection of structuring elements (strels) which must be optimal and global.


D. Dumitru, A. Andreica, L. Dio?an, and Z. Bálint, "Robustness analysis of transferable cellular automata rules optimized for edge detection," Procedia Comput Sci, vol. 176, pp. 713–722, 2020, doi: 10.1016/j.procs.2020.09.044.

X. Hu and Y. Wang, "Monitoring coastline variations in the Pearl River Estuary from 1978 to 2018 by integrating Canny edge detection and Otsu methods using long time series Landsat dataset," Catena (Amst), vol. 209, p. 105840, Feb. 2022, doi: 10.1016/j.catena.2021.105840.

H. Zhao, G. Qin, and X. Wang, "Improvement of canny algorithm based on pavement edge detection," in 2010 3rd International Congress on Image and Signal Processing, Oct. 2010, pp. 964–967. doi: 10.1109/CISP.2010.5646923.

N. Zata and D. #1, "JEPIN (Jurnal Edukasi dan Penelitian Informatika) Morphological Edge Detection Algorithms on the Noisy Car Image Database", [Online]. Available:

T. R. Fujimoto, T. Kawasaki, and K. Kitamura, "Canny-Edge-Detection/Rankine-Hugoniot-conditions unified shock sensor for inviscid and viscous flows," J Comput Phys, vol. 396, pp. 264–279, Nov. 2019, doi: 10.1016/

A. Ratsakou, A. Skarlatos, C. Reboud, and D. Lesselier, "Shape reconstruction of delamination defects using thermographic infrared signals based on an enhanced Canny approach," Infrared Phys Technol, vol. 111, p. 103527, Dec. 2020, doi: 10.1016/j.infrared.2020.103527.

M. Huang, Y. Liu, and Y. Yang, "Edge detection of ore and rock on the surface of explosion pile based on improved Canny operator," Alexandria Engineering Journal, vol. 61, no. 12, pp. 10769–10777, Dec. 2022, doi: 10.1016/j.aej.2022.04.019.

B. S. Gandhi, S. A. U. Rahman, A. Butar, and A. Victor, "Brain tumor segmentation and detection in magnetic resonance imaging (MRI) using convolutional neural network," in Brain Tumor MRI Image Segmentation Using Deep Learning Techniques, Elsevier, 2022, pp. 37–57. doi: 10.1016/B978-0-323-91171-9.00002-8.

D. Chen et al., "Computed tomography reconstruction based on canny edge detection algorithm for acute expansion of epidural hematoma," J Radiat Res Appl Sci, vol. 15, no. 3, pp. 279–284, Sep. 2022, doi: 10.1016/j.jrras.2022.07.011.

Y. Lu, L. Duanmu, Z. (John) Zhai, and Z. Wang, "Application and improvement of Canny edge-detection algorithm for exterior wall hollowing detection using infrared thermal images," Energy Build, vol. 274, p. 112421, Nov. 2022, doi: 10.1016/j.enbuild.2022.112421.

Y. Meng, Z. Zhang, H. Yin, and T. Ma, "Automatic detection of particle size distribution by image analysis based on local adaptive canny edge detection and modified circular Hough transform," Micron, vol. 106, pp. 34–41, Mar. 2018, doi: 10.1016/j.micron.2017.12.002.

B. Saha Tchinda, D. Tchiotsop, M. Noubom, V. Louis-Dorr, and D. Wolf, "Retinal blood vessels segmentation using classical edge detection filters and the neural network," Inform Med Unlocked, vol. 23, p. 100521, 2021, doi: 10.1016/j.imu.2021.100521.

Z. Zhang, B. Xin, N. Deng, W. Xing, and Y. Chen, "An investigation of ramie fiber cross-section image analysis methodology based on edge-enhanced image fusion," Measurement, vol. 145, pp. 436–443, Oct. 2019, doi: 10.1016/j.measurement.2019.05.063.

T. Hu, J. Yuan, X. Zhou, lu Liu, and M. Ran, "A two-dimensional entropy-based method for detecting the degree of segregation in asphalt mixture," Constr Build Mater, vol. 347, p. 128450, Sep. 2022, doi: 10.1016/j.conbuildmat.2022.128450.

R. Firoz, Md. S. Ali, M. N. U. Khan, Md. K. Hossain, Md. K. Islam, and Md. Shahinuzzaman, “Medical Image Enhancement Using Morphological Transformation,” Journal of Data Analysis and Information Processing, vol. 04, no. 01, pp. 1–12, 2016, doi: 10.4236/jdaip.2016.41001.

C. Li, Z. Xie, Y. Qin, L. Jia, and Q. Chen, "A multi-scale image and dynamic candidate region-based automatic detection of foreign targets intruding the railway perimeter," Measurement, vol. 185, p. 109853, Nov. 2021, doi: 10.1016/j.measurement.2021.109853.

J. Forssén, A. Gustafson, M. B. Pont, M. Haeger-Eugensson, C. Achberger, and N. Rosholm, "Effects of urban morphology on traffic noise: A parameter study including indirect noise exposure and estimated health impact," Applied Acoustics, vol. 186, p. 108436, Jan. 2022, doi: 10.1016/j.apacoust.2021.108436.

X. Wang et al., "Morphological image analysis of biofilm evolution with quantitative analysis in a moving bed biofilm reactor," Science of The Total Environment, vol. 856, p. 159199, Jan. 2023, doi: 10.1016/j.scitotenv.2022.159199.

D. Bhaskar et al., "A methodology for morphological feature extraction and unsupervised cell classification Deducing dynamical rules using ML and topology View project A methodology for morphological feature extraction and unsupervised cell classification", doi: 10.1101/623793.

J. Zhang et al., "A comprehensive review of image analysis methods for microorganism counting: from classical image processing to deep learning approaches," Artif Intell Rev, vol. 55, no. 4, pp. 2875–2944, Apr. 2022, doi: 10.1007/s10462-021-10082-4.

A. H. Morad and H. M. Al-Dabbas, "Classification of Brain Tumor Area for MRI images," J Phys Conf Ser, vol. 1660, p. 012059, Nov. 2020, doi: 10.1088/1742-6596/1660/1/012059.

J. Leyh et al., "Classification of Microglial Morphological Phenotypes Using Machine Learning," Front Cell Neurosci, vol. 15, Jun. 2021, doi: 10.3389/fncel.2021.701673.

A. M. Abdulazeez, D. Q. Zeebaree, D. A. Zebari, and T. H. Hameed, "Leaf Identification Based on Shape, Color, Texture and Vines Using Probabilistic Neural Network," Computación y Sistemas, vol. 25, no. 3, Sep. 2021, doi: 10.13053/cys-25-3-3470.

R. Sharma, M. Kumar, and M. S. Alam, "Image processing techniques to estimate weight and morphological parameters for selected wheat refractions," Sci Rep, vol. 11, no. 1, Dec. 2021, doi: 10.1038/s41598-021-00081-4.

V. Kumar#, S. Pandey#, A. Pal#, and S. Sharma#, "Edge Detection Based Shape Identification," 2016.

R. Santiago?Montero, M. A. López?Morales, and J. H. Sossa, "Digital shape compactness measure by means of perimeter ratios," Electron Lett, vol. 50, no. 3, pp. 171–173, Jan. 2014, doi: 10.1049/el.2013.3685.

R. Sharma, M. Kumar, and M. S. Alam, "Image processing techniques to estimate weight and morphological parameters for selected wheat refractions," Sci Rep, vol. 11, no. 1, p. 20953, Dec. 2021, doi: 10.1038/s41598-021-00081-4.

W. Li, M. F. Goodchild, and R. Church, "An efficient measure of compactness for two-dimensional shapes and its application in regionalization problems," International Journal of Geographical Information Science, vol. 27, no. 6, pp. 1227–1250, Jun. 2013, doi: 10.1080/13658816.2012.752093.

G. S. Araujo, K. v. Bicalho, and F. A. Tristão, "Use of digital image analysis combined with fractal theory to determine particle morphology and surface texture of quartz sands," Journal of Rock Mechanics and Geotechnical Engineering, vol. 9, no. 6, pp. 1131–1139, Dec. 2017, doi: 10.1016/j.jrmge.2017.06.004.

A. Rabbani, S. Jamshidi, and S. Salehi, "Determination of Specific Surface of Rock Grains by 2D Imaging," Journal of Geological Research, vol. 2014, pp. 1–7, Apr. 2014, doi: 10.1155/2014/945387.

Y. Shen, T. Ai, and Y. He, “A New Approach to Line Simplification Based on Image Processing: A Case Study of Water Area Boundaries,” ISPRS Int J Geoinf, vol. 7, no. 2, p. 41, Jan. 2018, doi: 10.3390/ijgi7020041.

A. R. Jensen, I. Sifnaios, S. Furbo, and J. Dragsted, "Self-shading of two-axis tracking solar collectors: Impact of field layout, latitude, and aperture shape," Solar Energy, vol. 236, pp. 215–224, Apr. 2022, doi: 10.1016/j.solener.2022.02.023.

P. Soille, Morphological Image Analysis. Berlin, Heidelberg: Springer Berlin Heidelberg, 1999. doi: 10.1007/978-3-662-03939-7.




How to Cite

M. Mentari, Y. Watequlis Syaifudin, N. Funabiki, N. . Layra Aziza, and T. Wijayanti, “Canny and Morphological Approaches to Calculating Area and Perimeter of Two-Dimensional Geometry”, Jartel, vol. 12, no. 4, pp. 287-296, Dec. 2022.