Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

New answers tagged


If the distinct contents/ingredients really have different colors than you just have to take a picture, always in the same location/distance, and then count the amount of pixels for each color. You can transform your RGB image to the HSV color space to make it easy to identify specific colors. Some pseudocode: image_hsv = rgb2hsv(image_rgb) greenmax = ...

Top 50 recent answers are included