
'''simple docstring'''







from cva import COLOR_BGR2GRAY, cvtColor, imread, imshow, waitKey
from numpy import array, dot, pad, ravel, uinta, zeros







def   lowerCAmelCase(  a__    :  Optional[Any]      , a__    :  Optional[int]      ):







       '''simple docstring'''






       lowerCamelCase__				   =      image.shape
       lowerCamelCase__				   =      cols - block_size[1] + 1
       lowerCamelCase__				   =      rows - block_size[0] + 1
       lowerCamelCase__				   =      zeros((dst_height * dst_width, block_size[1] * block_size[0])      )
       lowerCamelCase__				   =      0
       for i in range(0      , __lowercase      ):
              for j in range(0      , __lowercase      ):
                     lowerCamelCase__				   =      ravel(image[i : i + block_size[0], j : j + block_size[1]]      )
                     lowerCamelCase__				   =      window
                     row += 1

       return image_array







def   lowerCAmelCase(  a__    :  int      , a__    :  Tuple      ):







       '''simple docstring'''






       lowerCamelCase__				   =      image.shape[0], image.shape[1]
       lowerCamelCase__				   =      filter_kernel.shape[0]
       lowerCamelCase__				   =      k_size // 2
       # Pads image with the edge values of array.
       lowerCamelCase__				   =      pad(__lowercase      , __lowercase      , mode="edge"      )

       # im2col, turn the k_size*k_size pixels into a row and np.vstack all rows
       lowerCamelCase__				   =      imacol(__lowercase      , (k_size, k_size)      )

       #  turn the kernel into shape(k*k, 1)
       lowerCamelCase__				   =      ravel(__lowercase      )
       # reshape and get the dst image
       lowerCamelCase__				   =      dot(__lowercase      , __lowercase      ).reshape(__lowercase      , __lowercase      )
       return dst


if __name__ == "__main__":
    # read original image
    lowerCAmelCase_      =   imread(R"../image_data/lena.jpg")
    # turn image in gray scale value
    lowerCAmelCase_      =   cvtColor(img, COLOR_BGR2GRAY)
    # Laplace operator
    lowerCAmelCase_      =   array([[0, 1, 0], [1, -4, 1], [0, 1, 0]])
    lowerCAmelCase_      =   img_convolve(gray, Laplace_kernel).astype(uinta)
    imshow("Laplacian", out)
    waitKey(0)






def 						snake_case__							(       __lowercase = 1_0_0_0							)		->		int:







						"""simple docstring"""

						A__						:				int         =			0
						A__						:				Optional[int]         =			0
						while 1:
												num += 3
												if num >= n:
																		break
												total += num
												num += 2
												if num >= n:
																		break
												total += num
												num += 1
												if num >= n:
																		break
												total += num
												num += 3
												if num >= n:
																		break
												total += num
												num += 1
												if num >= n:
																		break
												total += num
												num += 2
												if num >= n:
																		break
												total += num
												num += 3
												if num >= n:
																		break
												total += num
						return total


if __name__ == "__main__":
		print(f"""{solution() = }""")