Development of an automated method for the identification of defective hazelnuts based on RGB image analysis and colourgrams