Summary of the Thesis This thesis deals with the advance in computer vision systems applied to the automatic inspection of the quality of fruits and vegetables in two scenarios, in which, up to these days, nobody has worked in depth, such as inspection of the product in the field before sending it to the packinghouses, and the automatic inspection of the quality of processed fruit. The general aim is to fill an important gap in the application of computer vision as a tool for industry in the inspection of fruits and vegetables. The development of computer vision techniques to inspect the quality of agricultural products, owing to the need to find an alternative to traditional manual inspection methods and to eliminate contact with the product, increase reliability and objectivity, besides of introducing flexibility to inspection lines and increasing the productivity and competitiveness of our companies. This technology is widely extended for the inspection of fresh fruit in packinghouses but, however, has not been applied in the orchards yet due to technical difficulties associated with this environment, and nor in the field of minimally processed fruit because of fragility, the sometimes stickiness of the product, the complexity of the inspection and the relatively lower economic value of this kind of product on fresh fruit. This thesis deals with the creation of a computer vision system coupled to an assistance platform for citrus harvesting, on which fruit is analysed whilst it is harvested attending to its colour, size and quality (presence of external defects). Major problems working in field are related to unstable lighting, movement and vibration, limited power or effects of weather. Thus, it is necessary to design a computer vision system that is compact, robust, fast and energetically very efficient. Also a very optimised algorithms have to be designed and oriented to work in outdoor conditions. The proposed solutions include, among others, a compact design, illumination by LED in a stroboscopic mode, or the use of an intelligent camera to minimise the electrical consumption. Regarding to the algorithms, they have to be capable of adapting to problems like the presence of stems or absence of calyx. The main objective of this system is to perform a first selection of the fruit with the aim of diverting the fruit directly to the proper market attending to its quality, shortening handling times and thus avoiding the expenses of use of machinery, water and other products like waxes or fungicides that are applied to fruit that finally will be routed to industry or waste. Additionally, given that consumer habits are changing, there is a more and more demand for minimally processed fruits and vegetables, with high quality, simple to prepare and eat, and with similar characteristics to fresh products. Industries of fruit processing have machines to automate most processes, but little progress has been made in the automation of the inspection and classification, which is a big part of the final cost. This thesis investigates the application of computer vision for inspection of processed fruit, focused on the development of systems adapted to two emerging products and great interest in Mediterranean agriculture such as satsuma segments and pomegranate arils ready for consumption, which have high nutritional quality and great health benefits. Both products have some common problems that should be addressed with different solutions. It is necessary to identify defects and the presence of foreign elements in the production lines, and classify the product according to their quality. The major problems are related to the complicated identification and transport of these small and sticky products, identifying their location in the conveyor belts, synchronizing the advance of the conveyors with the expulsion devices, and also the selection of the image acquisition and lighting devices. The most difficult task is the development of efficient image analysis algorithms that can distinguish between different quality levels due, among others, to the irregular shape of the mandarin segments and the similarity of the colors of the pomegranate arils, the small size of the products and the presence of water in the conveyor belts. The application must synchronize the entire system, from the advancement of the objects passing through the inspection until the final classification in different commercial categories. The main contributions of this research on the application of computer vision in these environments are summarised in the development of operational prototypes incorporating all the engineering and software solutions, which have been built ??and tested in real operating conditions. Furthermore, we have obtained several invention patents and published the results of this thesis in several scientific journals indexed in the JCR index, professional journals, conferences and international book chapters.