OK. I'm thoroughly confused. I have a binary image. The values are (allegedly) 0 and 1. I read it in Matlab, to verify:
binaryImage = imread('binary.png');
maxValue = max(binaryImage(:));
minValue = max(binaryImage(:));
from scipy.misc import imread
li = img.flatten()
# check each value
for s in li:
print s
matlab supports logical arrays and scipy converts the image to grayscale. Depending on what you want to do you can convert the grayscale image to logicals
bit_img = img > 127
or convert the logical array to int8 in matlab
img = int8(binary_image) * 255