image_output_1.png
import cv2

img = cv2.imread('/kaggle/input/brain-tumor-mri-images-44c/Carcinoma T2/112._big_gallery.jpeg')
print(img.shape)
gray_img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
print(gray_img.shape)
threshold_value = 70
max_value = 255
threshold_type = cv2.THRESH_BINARY
_, binary_img = cv2.threshold(gray_img, threshold_value, max_value, threshold_type)
print(binary_img.shape)