The waste of fish food has always been a serious problem in aquaculture. On one hand, the leftover fish food spawns a big waste in the aquaculture industry because fish food accounts for a large proportion of the investment. On the other hand, the left over fish food may pollute the water and make fishes sick. In general, the reason for fish food waste is that there is no feedback about the consumption of delivered fish food after feeding. So it is extremely difficult for fish farmers to determine the amount of feedstuff that should be delivered each time and the feeding intervals. In this paper, we propose an effective method using image processing techniques to solve this problem. During feeding events, we use an underwater camera with supplementary LED lights to obtain images of uneaten fish food pellets on the tank bottom. An algorithm is then developed to figure out the number of left pellets using adaptive Otsu thresholding and a linear-time component labeling algorithm. This proposed algorithm proves to be effective in handling the non-uniform lighting and very accurate number of pellets are counted in experiments.