

def       snake_case__    (       lowerCAmelCase_	):





     """simple docstring"""







     SCREAMING_SNAKE_CASE										=len(lowerCAmelCase_	)

     # Set the gap value to be decreased by a factor of 1.3
     # after each iteration
     SCREAMING_SNAKE_CASE										=1.3

     # Continue sorting until the gap is 1
     while gap > 1:
          # Decrease the gap value
          SCREAMING_SNAKE_CASE										=int(gap / shrink	)

          # Sort the elements using insertion sort
          for i in range(lowerCAmelCase_,   len(lowerCAmelCase_	)	):
               SCREAMING_SNAKE_CASE										=collection[i]
               SCREAMING_SNAKE_CASE										=i
               while j >= gap and collection[j - gap] > temp:
                    SCREAMING_SNAKE_CASE										=collection[j - gap]
                    j -= gap
               SCREAMING_SNAKE_CASE										=temp

     return collection


if __name__ == "__main__":
 import doctest

 doctest.testmod()




import numpy as np
from cva import COLOR_BGR2GRAY, cvtColor, imread, imshow, waitKey

from digital_image_processing.filters.convolve import img_convolve







def       snake_case__    (       lowerCAmelCase_      ):





     """simple docstring"""







     SCREAMING_SNAKE_CASE										=np.array([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]]      )
     SCREAMING_SNAKE_CASE										=np.array([[1, 2, 1], [0, 0, 0], [-1, -2, -1]]      )

     SCREAMING_SNAKE_CASE										=np.abs(img_convolve(lowerCAmelCase_,   lowerCAmelCase_      )      )
     SCREAMING_SNAKE_CASE										=np.abs(img_convolve(lowerCAmelCase_,   lowerCAmelCase_      )      )
     # modify the pix within [0, 255]
     SCREAMING_SNAKE_CASE										=dst_x * 255 / np.max(lowerCAmelCase_      )
     SCREAMING_SNAKE_CASE										=dst_y * 255 / np.max(lowerCAmelCase_      )

     SCREAMING_SNAKE_CASE										=np.sqrt((np.square(lowerCAmelCase_      )) + (np.square(lowerCAmelCase_      ))      )
     SCREAMING_SNAKE_CASE										=dst_xy * 255 / np.max(lowerCAmelCase_      )
     SCREAMING_SNAKE_CASE										=dst_xy.astype(np.uinta      )

     SCREAMING_SNAKE_CASE										=np.arctana(lowerCAmelCase_,   lowerCAmelCase_      )
     return dst, theta


if __name__ == "__main__":
 # read original image
 _lowerCamelCase								=imread("../image_data/lena.jpg")
 # turn image in gray scale value
 _lowerCamelCase								=cvtColor(img, COLOR_BGR2GRAY)

 _lowerCamelCase	,			_lowerCamelCase								=sobel_filter(gray)

 # show result images
 imshow("sobel filter", sobel_grad)
 imshow("sobel theta", sobel_theta)
 waitKey(0)

