While not explicitly stated, there's a LOT of implication that elves had some form of perception beyond the usual visual spectrum. There's a passing remark during the meeting between Aragorn, Legolas, and Gimli versus Eomer and his riders, when Aragorn faced Eomer down, and Legolas perceived the phantom of a crown flickering on Aragorn's head. Later in the series, as Aragorn and his forces travel the paths of the dead, Legolas comments on how he could perceive the shades of the dead but was unfazed by them.
My guess is that this fairly vague description was distilled down into infravision and later low-light/darkvision, for RPGs.