protected BinaryBitmap toBitmap(LuminanceSource source) {

        return new BinaryBitmap(new HybridBinarizer(source.invert()));
    }
Given an image source, convert to a binary bitmap.

Override this to use a custom binarizer.

@param source the image source
@return a BinaryBitmap
zxing-android-embedded/src/com/journeyapps/barcodescanner/InvertedDecoder.java