So here is the incomplete code
import cv2
import numpy as np
arr= np.zeros((30,30))
# bw_image = <missing part>
cv2.imshow("BW Image",bw_image)
cv2.waitKey(0)
cv2.destroyAllWindows()
#please use arr at 4th line to complete the code
I am actually new to this and don't know how to convert a given 2d array into a binary image using opencv.
Please use the name "arr" for the missing part, as in my code, the array is not a zeros array, instead it has some random values of 0 and 255 of 400x400 shape.