I built my image with cv2.THRESH_BINARY and the function
ret, im_thresh = cv2.threshold( gray_image, 40, 255, cv2.THRESH_BINARY )
BUT White must be 1 to Work with my program.
To help I made:
height = int(np.size(im_thresh, 0)) width = int(np.size(im_thresh, 1)) for x in range(height): for y in range(width): if im_thresh[x,y]==255: im_thresh[x,y] = 1
My question: Have any way to do this faster in python?