When I traveled to Europe last year they used a computer terminal to pre-screen all of us, compare our faces to our passport photos. For that process, they wanted all of us to take our glasses off. It made it easier for the facial recognition software to line facial features up. If the computer thought you were the same person as your passport photo, you got in one line, where they still asked questions, but were pretty confident you were who you said you were. If the computer wasn't sure, you had to get in a different line where they asked more questions to make sure you were who you said you were.
For this reason, I was advised to get my passport photo without my glasses on.