A system for sorting packaged products, said system being provided with: - at least one conveyor belt configured to transport the packaged products from an entry area to an exit area; - at least one linear image capture means, configured to capture images of the light reflected or transmitted in the visible spectrum by the packaged products along a predefined image capture line; - at least one linear illumination means configured to emit light in the visible light spectrum and illuminate the image capture line; said system being characterised in that it further comprises: - at least one linear hyperspectral image capture means, configured to capture hyperspectral images of the light reflected or transmitted in different bands of the infrared spectrum by the packaged products along the predefined image capture line; - at least one linear hyperspectral illumination means configured to emit light in the infrared light spectrum and only illuminate the image capture line; - first image processing means, configured to determine the spectral signature of each pixel of the hyperspectral images in different predefined bands of the infrared light spectrum, in order to compare the spectral signature of each pixel of the hyperspectral images with a reference pattern and in order to colour the hyperspectral images in a pre-established tone depending on the result of the comparison of the spectral signature thereof with the reference pattern, giving rise to coloured hyperspectral images; - second image processing means, configured to analyse at least one predetermined control area region of each image acquired from the linear image capture means and of each coloured hyperspectral image obtained from the first image processing means; to compare at least said control area of each of said images to at least one reference pattern; to sort said images depending on said comparison with the reference pattern and send sorting instructions to actuation means; and - actuation means, configured to receive the sorting instructions and actuate sorting means for the packaged products based on said sorting instructions, the sorting means being arranged in the exit area. - at least one conveyor belt configured to transport the packaged products from an entry area to an exit area; - at least one linear image capture means, configured to capture images of the light reflected or transmitted in the visible spectrum by the packaged products along a predefined image capture line; - at least one linear illumination means configured to emit light in the visible light spectrum and illuminate the image capture line; - at least one linear hyperspectral image capture means, configured to capture hyperspectral images of the light reflected or transmitted in different bands of the infrared spectrum by the packaged products along the predefined image capture line; - at least one linear hyperspectral illumination means configured to emit light in the infrared light spectrum and only illuminate the image capture line; - first image processing means, configured to determine the spectral signature of each pixel of the hyperspectral images in different predefined bands of the infrared light spectrum, in order to compare the spectral signature of each pixel of the hyperspectral images with a reference pattern and in order to colour the hyperspectral images in a pre-established tone depending on the result of the comparison of the spectral signature thereof with the reference pattern, giving rise to coloured hyperspectral images; - second image processing means, configured to analyse at least one predetermined control area region of each image acquired from the linear image capture means and of each coloured hyperspectral image obtained from the first image processing means; to compare at least said control area of each of said images to at least one reference pattern; to sort said images depending on said comparison with the reference pattern and send sorting instructions to actuation means; and - actuation means, configured to receive the sorting instructions and actuate sorting means for the packaged products based on said sorting instructions, the sorting means being arranged in the exit area.