





import cva
import numpy as np



class       A__     :





      def __init__(				self ,							A_ ,							A_     ):
       '''simple docstring'''




       if k in (0.04, 0.06):
        UpperCamelCase			:      int 			=     k
        UpperCamelCase			:      Dict 			=     window_size
       else:
        raise ValueError("invalid k value"     )





      def __str__(				self     ):
       '''simple docstring'''




       return str(self.k     )





      def  __UpperCamelCase(				self ,							A_     ):
       '''simple docstring'''




       UpperCamelCase			:      Optional[int] 			=     cva.imread(lowerCAmelCase__ ,							0     )
       UpperCamelCase			:      List[Any] 			=     img.shape
       UpperCamelCase			:      list[list[int]] 			=     []
       UpperCamelCase			:      List[Any] 			=     img.copy()
       UpperCamelCase			:      Union[str, Any] 			=     cva.cvtColor(lowerCAmelCase__ ,							cva.COLOR_GRAY2RGB     )
       UpperCamelCase			:      Optional[int] 			=     np.gradient(lowerCAmelCase__     )
       UpperCamelCase			:      int 			=     dx**2
       UpperCamelCase			:      Any 			=     dy**2
       UpperCamelCase			:      Any 			=     dx * dy
       UpperCamelCase			:      Dict 			=     0.04
       UpperCamelCase			:      List[Any] 			=     self.window_size // 2
       for y in range(lowerCAmelCase__ ,							h - offset     ):
        for x in range(lowerCAmelCase__ ,							w - offset     ):
         UpperCamelCase			:      List[str] 			=     ixx[
             y - offset : y + offset + 1, x - offset : x + offset + 1
         ].sum()
         UpperCamelCase			:      List[str] 			=     iyy[
             y - offset : y + offset + 1, x - offset : x + offset + 1
         ].sum()
         UpperCamelCase			:      Tuple 			=     ixy[
             y - offset : y + offset + 1, x - offset : x + offset + 1
         ].sum()

         UpperCamelCase			:      Any 			=     (wxx * wyy) - (wxy**2)
         UpperCamelCase			:      int 			=     wxx + wyy
         UpperCamelCase			:      List[str] 			=     det - k * (trace**2)
         # Can change the value
         if r > 0.5:
          corner_list.append([x, y, r]     )
          color_img.itemset((y, x, 0) ,							0     )
          color_img.itemset((y, x, 1) ,							0     )
          color_img.itemset((y, x, 2) ,							255     )
       return color_img, corner_list


if __name__ == "__main__":
    __lowerCamelCase :  int										=  HarrisCorner(0.0_4, 3)
    __lowerCamelCase :  str										=  edge_detect.detect("""path_to_image""")
    cva.imwrite("""detect.png""", color_img)









def 	A_       (  _lowerCAmelCase							,     _lowerCAmelCase  )		->				int:
 return int(input_a == input_a == 0  )



def 	A_       (  )		->				None:
 print("Truth Table of NOR Gate:"  )
 print("|   Input 1   |  Input 2  | Output |"  )
 print(F"""|      0      |    0      |  {nor_gate(0							,     0  )}     |"""  )
 print(F"""|      0      |    1      |  {nor_gate(0							,     1  )}     |"""  )
 print(F"""|      1      |    0      |  {nor_gate(1							,     0  )}     |"""  )
 print(F"""|      1      |    1      |  {nor_gate(1							,     1  )}     |"""  )


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    main()
