...
The comparator must trip ~ halfway between those two voltage levels.
No, the delta change in illumination between a white dot and black dot is just a few %. The current through the phototransistor will be 100s of uA, e.g. 150uA, so with a white dot you might have 150uA, and with a black dot e.g. 140uA, so the two voltage levels might be only 10s of mV different....When the Phototransistor will be over the dot then it should be OFF...
The comparator must trip ~ halfway between those two voltage levels.