Yes, professor should be capitalized if it comes at the beginning of the sentence, if it comes as part of a title or if it replaces the name of the person, but it shouldn’t be capitalized if it comes as a general noun.
Examples: Professor is an important title.
Well done, Professor!
His name is Professor Jone.
You are the best professor here.