Some agricultural tasks consist of applying chemical treatment to the crops, but the products are applied throughout the field in most cases. In order to automate these tasks, and to apply the products more accurately, an autonomous vehicle can be used. The vehicle is intended to navigate autonomously through a field where plants are arranged in rows, following the crop rows. Its main sensor is a camera which takes perspective images of the area close to and in front of the vehicle. The vehicle is equipped with a treating device consisting of a bar with thirty spray nozzles. When the plants, that have been identified at some distance in front of the vehicle, reach the position of the treating device, the nozzles which are over a plant are switched on, thus applying the treatment. The typical vehicle speed is 1 metre per second and the video frame rate is 10 Hz. A distributed system, consisting of several processors interconnected by serial links, is used, where each module accomplishes a different task: vehicle control, guidance information, image segmentation, map building and nozzle switching. The work explained in this paper is mainly focused on the latter parts of the system, map building and nozzle switching, and stresses the methods used to fit the time requirements. Real-time performance is achieved. Some results and time measurements are given.