The application Read a video file ".avi" and measure the size and average color of the rice grain presence in the frame.there are 3 methods each one with different quantity of information.The app measure the size of the kernel in # of pixels,the average color of each grain is measure and plotted in the respective area and in the left corner compare with the wanted color if the color is darker than the base the reference change to green.
http://arizawilmer.blogspot.com.au/2012/09/software-matlab-toolboxes-image-toolbox.html