Git Product home page Git Product logo

calorie-estimation-from-food-images-opencv's Introduction

Calorie-estimation-from-food-images-opencv

An ML model which is trained to recognise food images, calculate volume and estimate calorie content May 13, 2016

To Run: python learn.py
learn.py calls two functions - training and testing. Once training is done, the model gets saved as a file. The same model is used for testing on a different set of images.

Description: A set of 10 classes of food items were used. We use various image processing and classification techniques to identify the food, calculate the volume and the nutritional content. A mixture of methods including canny edge detection, watershed segmentation, morphological operators and Otsu’s method were used to segment the food item to obtain the contour of the fruit and the contour of the thumb. We use the thumb finger for calibration purposes. The thumb is placed next to the dish while clicking the photo and this thumb gives us the estimate of the real-life size of the food item and helps estimate volume accurately.

Once the food item is extracted from the image, we extract the feature vector of the image for training/testing purposes. The feature vector is calculated by using hsv histogram for color features, Gabor filters for texture features, and hu moments for shape, and the area for size. The feature vector is a 95x1 dimensional vector. We used Support Vector Machine model for training the images using our 95 dimensional feature vector. We obtained an accuracy of 94% in the classification of food item.

Once the food item is identified, we were able to calculate the volume of food items by approximating it to a geometric shape like sphere, cylinder, etc. Once we have the volume, the mass of the food item is calculated using standard density tables. Using already available information of nutritional content of the given class of food, the total calorie content in the food image can be estimated.

calorie-estimation-from-food-images-opencv's People

Contributors

meghanamreddy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.