I am a newbie to openCV and I am stuck at this error with no resolution. I am trying to convert an image from BGR to grayscale format using this code-
img = cv2.
imagine you have a function called preprocessing() that preprocess your images with cv2, if you try to apply it as:
data = np.array(list(map(preprocessing,data)))
it won't work and that because np.array creates int64and you are trying to assign np.uint8 to it, what you should do instead is adding dtype parameter as follow:
data = np.array(list(map(preprocessing,data)), dtype = np.uint8)