A python port of Jared's vision code.