finish photo-consistency math