Visual surveillance and monitoring have aroused interest in the computer video community for many years. The main task of these applications is to identify (and track) moving targets. The traffic monitoring application we have developed requires that a large number of parameters is tuned in order to work properly. About thirty parameters concerning the detection algorithm have been considered as to be optimized. Accordingly, this paper shows how a Genetic Algorithm (GA) represents a powerful task in order to automatically compute sub-optimal parameter settings in a motion detection system. Besides, to our knowledge this work is the first attempt of using GAs to such a problem. Accurate experiments accomplished on a challenging test sequence show the relevant results attained in terms of qualitative performance. Keywords parameter optimization, genetic algorithm, motion analysis, motion detection, visual surveillance, background difference, traffic monitoring.