This code uses images in bmp format. Algorithm first find the offset value(in which byte will the pixels start) of bmp file which is the 10th byte.Then starting from that byte, it process pixels. This can be observed in following photograph.
Then the code prepares the histogram of green. Since steak, salam and currant can be recognized based on histogram of green component. And from histogram, the mode value will be calculeted which can be observed in following graph.
In following chart you can see that how different are the mode values. Figure1 : currant and figure2: steak
And in the end this program can classify images of currant, steal and salam based on their mode values of histograms.