Detecting topological invariants and revealing topological phase transitions in discrete-time photonic quantum walks