They did trial something on Stealth which counted people entering the queue and then leaving at the exit, I guess this would give them a real time throughput and work out a queue length but the equipment is long gone so I assume it didn't work too well.
They are not usually that far off with queue times, they have a member of staff walking round updating them. Imo it's always better to slightly over estimate the queue length too... If stealths queue States 30 minutes but you get on in 20 your happy, if it says 30 but it takes longer people are much more likely to complain.