

"""simple docstring"""





def     _A    (    UpperCamelCase_	:			int)      ->		str:
   '''simple docstring'''


   if not isinstance(UpperCamelCase_,     UpperCamelCase_):
      __lowercase								=		(
          "operation can not be conducted on a object of type "
          F"""{type(UpperCamelCase_).__name__}"""
      )
      raise TypeError(UpperCamelCase_)
   __lowercase								=		""
   for _ in range(0,     32):
      bit_string += str(number % 2)
      __lowercase								=		number >> 1
   return bit_string




def     _A    (    UpperCamelCase_	:			int)      ->		str:
   '''simple docstring'''


   if number < 0:
      raise ValueError("the value of input must be positive")
   elif isinstance(UpperCamelCase_,     UpperCamelCase_):
      raise TypeError("Input value must be a 'int' type")
   elif isinstance(UpperCamelCase_,     UpperCamelCase_):
      raise TypeError("'<' not supported between instances of 'str' and 'int'")
   __lowercase								=		0
   # iterator over [1 to 32],since we are dealing with 32 bit integer
   for _ in range(1,     33):
      # left shift the bits by unity
      __lowercase								=		result << 1
      # get the end bit
      __lowercase								=		number % 2
      # right shift the bits by unity
      __lowercase								=		number >> 1
      # add that bit to our ans
      __lowercase								=		result | end_bit
   return get_reverse_bit_string(UpperCamelCase_)


if __name__ == "__main__":
   import doctest

   doctest.testmod()







"""simple docstring"""





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

from digital_image_processing.filters.convolve import img_convolve




def     _A    (    UpperCamelCase_	:			int)      ->		str:
   '''simple docstring'''


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

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

   __lowercase								=		np.sqrt((np.square(UpperCamelCase_)) + (np.square(UpperCamelCase_)))
   __lowercase								=		dst_xy * 255 / np.max(UpperCamelCase_)
   __lowercase								=		dst_xy.astype(np.uinta)

   __lowercase								=		np.arctana(UpperCamelCase_,     UpperCamelCase_)
   return dst, theta


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

   _a ,		_a					 =				sobel_filter(gray)

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




