{"id":858,"date":"2018-09-12T01:30:23","date_gmt":"2018-09-12T01:30:23","guid":{"rendered":"http:\/\/muthu.co\/?p=858"},"modified":"2021-05-24T03:03:26","modified_gmt":"2021-05-24T03:03:26","slug":"sobel-feldman-operator-or-sobel-filter","status":"publish","type":"post","link":"http:\/\/write.muthu.co\/sobel-feldman-operator-or-sobel-filter\/","title":{"rendered":"Sobel Feldman operator or Sobel filter"},"content":{"rendered":"\n
Sobel operator is used in computer vision particularly in edge detection algorithms. The operator uses two 3\u00d73 kernels which are convolved with the original image to calculate the image derivatives \u2013 one for horizontal changes, and one for vertical. If we define A<\/em> as the original image, and Gx<\/em> and Gy<\/em> are two images which at each point contain the horizontal and vertical derivative approximations respectively, the computations are as follows:<\/p>\n\n\n\n The image output is:<\/p>\n\n\n\n#Let A denote a grayscale image\nA = np.array([[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0],\n [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0],\n [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0],\n [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0],\n [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0],\n [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],\n [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]])<\/code><\/pre>\n\n\n\n