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

from digital_image_processing.filters.convolve import img_convolve





def    _a (						lowerCamelCase							):
 lowerCamelCase		:     Tuple          =				np.array([[-1, 0, 1], [-2, 0, 2], [-1, 0, 1]]							)
 lowerCamelCase		:     Any          =				np.array([[1, 2, 1], [0, 0, 0], [-1, -2, -1]]							)

 lowerCamelCase		:     List[Any]          =				np.abs(img_convolve(lowerCamelCase,     lowerCamelCase							)							)
 lowerCamelCase		:     Union[str, Any]          =				np.abs(img_convolve(lowerCamelCase,     lowerCamelCase							)							)
 # modify the pix within [0, 255]
 lowerCamelCase		:     Optional[int]          =				dst_x * 255 / np.max(lowerCamelCase							)
 lowerCamelCase		:     int          =				dst_y * 255 / np.max(lowerCamelCase							)

 lowerCamelCase		:     str          =				np.sqrt((np.square(lowerCamelCase							)) + (np.square(lowerCamelCase							))							)
 lowerCamelCase		:     str          =				dst_xy * 255 / np.max(lowerCamelCase							)
 lowerCamelCase		:     Tuple          =				dst_xy.astype(np.uinta							)

 lowerCamelCase		:     Tuple          =				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)






from collections import defaultdict





def    _a (						lowerCamelCase							):
 lowerCamelCase		:     defaultdict[str, int]          =				defaultdict(lowerCamelCase							)
 # Creating a dictionary containing count of each word
 for word in sentence.split():
  occurrence[word] += 1
 return occurrence


if __name__ == "__main__":
      for word, count in word_occurrence("""INPUT STRING""").items():
            print(f'''{word}: {count}''')




