Illusion is a kind of visual error. When people observe an object, because the object is interfered by shape, light, and color, plus people's physical and psychological reasons, they misrecognize the object, which will produce judgments that are inconsistent with the reality.
According to the above definition, the illusion of seeing trees moving outside the window while sitting on a moving train is not an illusion.