Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 3 (2025) https://internationalpubls.com 1142 An Edge Detection Algorithm based on Second Order Difference Maheshkumar D. Kudre1, Narendrakumar R. Dasre2 and Pritam Gujarathi-Wani 3* 1Pillai College of Engineering, Panvel, Navi Mumbai-410206 and 1, 2, 3*. Department of Engineering Sciences, Ramrao Adik Institute of Technology, D. Y. Patil deemed to be University, Nerul, Navi Mumbai-400706 1. mkudre@mes.ac.in , 2. narendasre@rait.ac.in , 3*. pritam.wani@rait.ac.in Article History: Received:11-02-2025 Revised: 24-02-2025 Accepted:11-03-2025 Abstract: Edge detection is an important technique in image processing. Mathematics is the foundation of the edge detection algorithm. In this article, the relation of mathematics and edge detection algorithms is discussed. Also, the different edge detection algorithms like Canny, Sobel, Prewitt, Roberts etc. are discussed with their mathematical foundations. In this article, a new edge detection algorithm is proposed based on second order forward difference with the equidistance points. The second order forward difference of the image intensity of each pixel is calculated. It is calculated in horizontal direction (x-direction) and vertical direction (y-direction) say 𝑀π‘₯ π‘Žπ‘›π‘‘ 𝑀𝑦 . The resultant kernel (M) is obtained by combining both horizontal and vertical values at each pixel by 𝑀 = βˆšπ‘€π‘₯ 2 + 𝑀𝑦 2 . This algorithm uses M as a mask for grey scale image. The effectiveness of the algorithm is tested for different images and compared with the other existing edge detection algorithms. Keywords: Image Processing, Signal Processing, Edge Detection, Mask, Operator 1 Introduction: Image processing plays an important role in extracting the features from the images. These features are the useful information for different applications. Edge detection is very popular area in image processing. Edge detection has many applications in industry, like finding the cracks in pipeline, structures, finding hairline fractures in medical images, finding the boundaries in images, finding the shapes of objects in images are few to list. These edge detection algorithms require a good foundation of mathematics. The connection of mathematics and edge detection algorithms is discussed in this article. The different edge detection algorithms like Sobel, Roberts, Canny, Prewitt, etc. are discussed with their mathematical foundations. These edge detection algorithms are useful in computer vision, image processing, signal processing and many applications. These algorithms use the mathematical concepts like Numerical Analysis, Approximations, and Linear Algebra. Our emphasize is on exploring the mathematical background of these algorithms. In this article, the edges are detected using the above algorithms and the results are compared. Literature Survey : In this section, the different edge detection algorithms are discussed with their mathematical form. Many researchers have used various these operators [7, 11, 14], including Laplacian of Gaussian (LoG), Prewitt, Scharr, Sobel, Robert, and Canny for edge detection. The classification of these edge detection algorithms is based on Gradient and Gaussian. This classification is as follows: mailto:mkudre@mes.ac.in mailto:narendasre@rait.ac.in mailto:pritam.wani@rait.ac.in Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 3 (2025) https://internationalpubls.com 1143 Edges [1] are local features of an image i.e. local regions with spatial features and characteristics. Edges are pixels that have significant local variations in intensity. So edges are having large gradient of the intensity. Edges occur at the boundaries between two different intensities of the image. These edge detection techniques perform important role of finding Edges, lines, curves etc. These edge detection algorithms are discussed in [3, 4, 5]. Steps for edges detection are: 1. Smoothing: minimizes noise while protecting real edges to the greatest extent. 2. Enhancement: applies a filter on the picture to improve the quality of the edges which sharpens edges. 3. Detection: using thresholding the pixels of edges are chosen and the noise is removed. 4. Localization: determines the exact positioning of an edge. This step usually involves thinning and joining the edges. In mathematics, derivatives are used to describe continuous changes in function. In 2D image, partial derivatives represent changes in image intensity. The pixel on edge are detected through detection of 1. the local minima or maxima of the derivative of the first order and 2. the zero-crossing of the derivative of the second order. Edge Detection in an image: Consider the 3x3 neighbourhood of the pixel 𝑓(π‘₯, 𝑦) defined as 𝑓3Γ—3(π‘₯, 𝑦) = [ 𝑓(π‘₯ βˆ’ 1, 𝑦 βˆ’ 1) 𝑓(π‘₯ βˆ’ 1, 𝑦) 𝑓(π‘₯ βˆ’ 1, 𝑦 + 1) 𝑓(π‘₯, 𝑦 βˆ’ 1) 𝑓(π‘₯, 𝑦) 𝑓(π‘₯, 𝑦 + 1) 𝑓(π‘₯ + 1, 𝑦 βˆ’ 1) 𝑓(π‘₯ + 1, 𝑦) 𝑓(π‘₯ + 1, 𝑦 + 1) ] and the 3x3 mask as 𝑖. 𝑒.𝑀 = [ 𝑀1 w2 w3 𝑀4 w5 w6 𝑀7 w8 w9 ] After applying the mask M to the image, the resultant pixel at f(x, y) is given as g(x, y) = 𝑓3Γ—3(π‘₯, 𝑦) β‹… 𝑀 Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 3 (2025) https://internationalpubls.com 1144 = f(x – 1, y – 1) Γ— w1 + f(x – 1, y) Γ— w2 + f(x – 1, y + 1) Γ— w3 + f(x, y – 1) Γ— w4 + f(x, y) Γ— w5 + ….……+ f(x + 1, y + 1) Γ— w9 Consider a 8Γ—8 pseudo image which is represented as 𝐼 = [ 0 0 0 0 20 0 0 0 0 0 0 0 20 0 0 0 0 0 0 0 20 0 0 0 0 0 0 0 20 0 0 0 0 20 20 20 20 20 20 0 0 0 0 0 20 0 0 0 0 0 0 0 20 0 0 0 0 0 0 0 20 0 0 0] After applying the Sobel Operator Mask Mx = [ βˆ’1 0 1 βˆ’2 0 2 βˆ’1 0 1 ] in X-direction, The resultant image becomes 𝑀π‘₯ βˆ— 𝐼 = [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 60 60 40 60 80 60 0 0 0 0 0 0 0 0 0 0 βˆ’60 βˆ’60 βˆ’40 βˆ’60 βˆ’80 βˆ’60 0 0 0 0 0 0 0 0 0 ] Using threshold value 0, all the values less than 0 become 0. After making negative number as zero we get horizontal edge as [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 60 60 40 60 80 60 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0] Similarly, one can find the vertical edge using the mask My = [ βˆ’1 βˆ’2 βˆ’1 0 0 0 1 2 1 ] in Y-direction. Here we proposed 2 categories of edge detection operators. The general structure of the edge detection operator as 𝑀π‘₯ = [ π‘Ž 0 βˆ’π‘Ž 𝑏 0 βˆ’π‘ 𝑐 0 βˆ’π‘ ] in X-direction and 𝑀𝑦 = (𝑀π‘₯) 𝑑 = [ π‘Ž 𝑏 𝑐 0 0 0 βˆ’π‘Ž βˆ’π‘ βˆ’π‘ ] in Y-direction is one of the category. We define this category of operators as β€œTranspose Operators” The following special cases can be derived from above form as: Case 1: Let a= -1, b= -1 and c= -1 then Mx = [ βˆ’1 0 1 βˆ’1 0 1 βˆ’1 0 1 ] and My = [ βˆ’1 βˆ’1 βˆ’1 0 0 0 1 1 1 ] Which is also known as Prewitt operator [1, 9] Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 3 (2025) https://internationalpubls.com 1145 Case 2: Let a= -1, b= -2 and c= -1 then Mx = [ βˆ’1 0 1 βˆ’2 0 2 βˆ’1 0 1 ] and My = [ βˆ’1 βˆ’2 βˆ’1 0 0 0 1 2 1 ] Which is also known as Sobel Operator [1, 6, 12] The proposed second category of the edge detection operators is defined as 𝑀π‘₯ = [ π‘Ž 0 βˆ’π‘Ž 𝑏 0 βˆ’π‘ 𝑐 0 βˆ’π‘ ] in X-direction and as 𝑀𝑦 = βˆ’(𝑀π‘₯) 𝑑 = [ βˆ’π‘Ž βˆ’π‘ βˆ’π‘ 0 0 0 π‘Ž 𝑏 𝑐 ] in Y-direction. We define this category of operators as β€œSkew-Transpose Operators.” The following special cases can be derived from above form as: Case 1: Let π‘Ž = βˆ’ 3 32 , b = βˆ’ 10 32 and c = βˆ’ 3 32 then Mx = 1 32 [ βˆ’3 0 3 βˆ’10 0 10 βˆ’3 0 3 ] and My = 1 32 [ 3 10 3 0 0 0 βˆ’3 βˆ’10 βˆ’3 ] Which is also known as Scharr Operator [18] Case 2: Let a= -1, b= -2 and c= -1 then Mx = [ βˆ’1 0 1 βˆ’2 0 2 βˆ’1 0 1 ] and My = [ 1 2 1 0 0 0 βˆ’1 βˆ’2 βˆ’1 ] Which is also known as Sobel Operator [17] Proposed operator: Let 𝑓(π‘₯) be the function of x. and Ξ” be the forward difference operator. The forward difference of 𝑓(π‘₯) is defined as Δ𝑓(π‘₯) = 𝑓(π‘₯ + β„Ž) βˆ’ 𝑓(π‘₯), where h is the difference between two consecutive observations. Now we have, Ξ”2𝑓(π‘₯) = Ξ”(Δ𝑓(π‘₯)) = Ξ”(𝑓(π‘₯ + β„Ž) βˆ’ 𝑓(π‘₯)) = Δ𝑓(π‘₯ + β„Ž) βˆ’ Δ𝑓(π‘₯) = (𝑓(π‘₯ + 2β„Ž) βˆ’ 𝑓(π‘₯ + β„Ž)) βˆ’ (𝑓(π‘₯ + β„Ž) βˆ’ 𝑓(π‘₯)) = 𝑓(π‘₯ + 2β„Ž) βˆ’ 𝑓(π‘₯ + β„Ž) βˆ’ 𝑓(π‘₯ + β„Ž) + 𝑓(π‘₯) Ξ”2𝑓(π‘₯) = 𝑓(π‘₯ + 2β„Ž) βˆ’ 2𝑓(π‘₯ + β„Ž) + 𝑓(π‘₯) Considering the coefficients in the expansion of Ξ”2𝑓(π‘₯), we get the triad as (1, -2, 1). Proposed Mask 1: Based on the above triad, the new mask of β€˜Transpose Operator’ category is defined as below. Let a= 1, b= -2 , and c = 1, we have the mask as 𝑀π‘₯ = [ 1 0 βˆ’1 βˆ’2 0 2 1 0 βˆ’1 ] and 𝑀𝑦 = (𝑀π‘₯) 𝑑 = [ 1 βˆ’2 1 0 0 0 βˆ’1 2 βˆ’1 ] Proposed Mask 2: Based on the above triad, the new mask of β€˜Skew Transpose Operator’ category is defined as below. Let a= 1, b= -2 , and c = 1, we have the mask as 𝑀π‘₯ = [ 1 0 βˆ’1 βˆ’2 0 2 1 0 βˆ’1 ] and 𝑀𝑦 = βˆ’(𝑀π‘₯) 𝑑 = [ βˆ’1 2 βˆ’1 0 0 0 1 βˆ’2 1 ] The proposed marks arte implemented with the help of MATLAB software. The results are as shown in the Table 1. First row of the Table 1 shows the names of the images used for experiments. Second Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 3 (2025) https://internationalpubls.com 1146 row of the Table 1 shows the original images used for experiments. The third row shows the edges detected using Roberts Operator for Lena, Peppers, Cameraman, and Mandril images. The fourth row shows the edges detected using Sobel Operator for Lena, Peppers, Cameraman, and Mandril images. The fifth row shows the edges detected using Prewitt Operator for Lena, Peppers, Cameraman, and Mandril images. The sixth row shows the edges detected using Scharr Operator for Lena, Peppers, Cameraman, and Mandril images. The seventh row shows the edges detected using Proposed Operator-I for Lena, Peppers, Cameraman, and Mandril images. The last row shows the edges detected using Proposed Operator-II for Lena, Peppers, Cameraman, and Mandril images. Experimental Results: Edge Detection Operators Images Lena Peppers Cameraman Mandril Robert Sobel Prewitt Scharr Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 3 (2025) https://internationalpubls.com 1147 Proposed Operator 1 Proposed Operator 2 Conclusion: In this article, the general categories of 3x3 operators are proposed as Transpose Operators and Skew- Transpose Operators. Here 2 new edge detection operators are proposed and implemented successfully. This operators are based on the second order forward differences with the equidistance points. Proposed Operator-I is of the Transpose Category and Proposed Operator-II is of the Skew- Transpose Category. The Image is a discrete signal and all pixels are equidistance hence implementation of the proposed masks becomes interesting. After applying the proposed masks, the experimental results are shown and compared in the form of images. It can be seen that the proposed operators perform better that the existing operators. Acknowledgements: We are thankful to Dr. M. D. Patil, Principal, RAIT and Dr. S. M. Joshi, Principal, PCE for their support and encouragement throughout this research work. References: 1. Savant, Shubhashree, β€œA Review on Edge Detection Techniques for Image Segmentation.” (2014). 2. S. Xie and Z. Tu, β€œHolistically-Nested Edge Detection,” 2015 IEEE International Conference on Computer Vision (ICCV), Santiago, Chile, 2015, pp. 1395-1403, doi: 10.1109/ICCV.2015.164. 3. Jonathan M. Blackledge, Digital β€œImage Processing: Mathematical and Computational Methods” First Edition, HORWOOD PUBLISHING LIMITED, 2005 4. Muthukrishnan. R and M. Radha, β€œEDGE DETECTION TECHNIQUES FOR IMAGE SEGMENTATION”, International Journal of Computer Science and Information Technology (IJCSIT), Vol 3, No 6, Dec 2011 3. 5. Zheng, Wen-kui and Kun Liu. β€œResearch on Edge Detection Algorithm in Digital Image Processing.”, 2nd Iternational Conference on Material Science, Machinary and Energy Engineering (MSMEE 2017), https://doi.org/10.2991/msmee-17.2017.227 (2017). 6. Suxia Cui, Yonghui Wang, Xiaoquing Qian and Zhengtao Deng, β€œImage processing techniques in shockwave detection and modelling”, Journal of Signal and Information Processing (2013), Vol. 4, pp-109-113. 7. P. Ganesan and G. Sajiv, β€œA comprehensive study of edge detection for image processing applications,” 2017 International Conference on Innovations in Information, Embedded and Communication Systems (ICIIECS), Coimbatore, India, 2017, pp. 1-6, doi: 10.1109/ICIIECS.2017.8275968. 8. R. C. Gonzalez and R. E. Woods, Digital Image Processing, Pearson; 4th Edition, New York (2018). Communications on Applied Nonlinear Analysis ISSN: 1074-133X Vol 32 No. 3 (2025) https://internationalpubls.com 1148 9. Dr. Bijith Marakarkandy and Dr. Sajeev Ghosh, β€œDigital Image Processing and Machine Vision”, Tech-Neo Publications (2018). 10. Dhananjay K. Thekedath, β€œDigital Signal and Image Processing”, Tech-Max Publications, 2018 11. Howard Anton, Chris Rorres, β€œElementary Linear Algebra”, 11th Edition, Wiley Publication (2014). 12. Z. Yu, C. Feng, M. -Y. Liu and S. Ramalingam, β€œCASENet: Deep Category- Aware Semantic Edge Detection,” 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, 2017, pp. 1761-1770,doi: 10.1109/CVPR.2017.191. 13. Mohd. Aquib Ansari, Diksha Kurchaniya and Manish Dixit, β€œA Comprehensive Analysis of Image Edge Detection Techniques”, International Journal of Multimedia and Ubiquitous Engineering, Vol.12, No.11 (2017), pp.1-12 14. Bin Tian, Wei Wei, β€œResearch Overview on Edge Detection Algorithms Based on Deep Learning and Image Fusion”, Security and Communication Networks, vol. 2022, Article ID 1155814, 11 pages, 2022. https://doi.org/10.1155/2022/1155814 15. Scharr, β€œOptimal operators in digital image processing”, Ph. D. Thesis, University of Heidelberg, Germany (2000). DOI: 10.11588/heidok.00000962 16. Sobel Irwin, β€œAn Isotropic 3Γ—3 Image Gradient Operator”, Presentation at Stanford A.I. Project (1968).