This document describes the development of an automatic sorting system for raisins using computer vision. The system uses a camera to capture images of raisins on a conveyor belt. An algorithm was developed in MATLAB and Python to segment the raisins from the background, extract color features, and sort the raisins by color. The algorithm first removes the background to isolate the raisins, then determines the average color of each raisin to classify it. The sorted raisins are directed to different exits controlled by motors based on their classified color. The system aims to provide an affordable automatic sorting solution for small farmers and traders compared to existing expensive commercial machines.