Giter Club home page Giter Club logo

cpp-examples-ml's Introduction

C++ Machine Learning OpenCV 2.4.x Teaching Examples

OpenCV C/C++ Interface Machine Learning legacy 2.4.x interface examples used for teaching, instruction and reference over the years (2010-2013) -

Uses older C++ interface to OpenCV ML library, with additional code - as these examples pre-date the new C++ OpenCV 3.x ML interface.

All tested with OpenCV 2.4.x and GCC (Linux) and known to work with MS Visual Studio 200x on Win32 / Win64.

N.B. due to changes in the OpenCV API these do not generically work with OpenCV > 2.4.x by default (except from the genetic algorithm (GA) example).


Background:

If I taught you between 2010 and 2013 at Cranfield University or ESTIA - these are the C++ examples from class.

Demo source code is provided "as is" to aid your learning and understanding.

For a long time, the in absence of other fully worked examples for the OpenCV machine learning components became the de facto reference for the use of these OpenCV routines (any conceptual errors or bad choices of parameters made here have propagated widely).


How to download and run:

In each sub-directory:

  • .cpp file(s) - code for the example
  • .name file - an explanation of the data and its source
  • .data file - the original and complete set of data (CSV file format)
  • .train file - the data to be used for training (CSV file format)
  • .test file - the data to be used for testing (CSV file format)
  • .xml, .yml - example data files for testing some tools

All dataset examples are taken and reproduced from the UCI Machine Learning Repository.

Download each file as needed or to download the entire repository and run each try:

git clone https://github.com/tobybreckon/cpp-examples-ml.git
cd cpp-examples-ml
cmake .
make
cd <sub directory of one of the examples>
./<insert name of executable>

The genetic algorithm (GA; inside directory ga_ex/) example runs with a webcam connected or from a command line supplied video file of a format OpenCV supports on your system (otherwise edit the code to provide your own image source). N.B. you may need to change the line near the top that specifies the camera device to use on this example - change "0" if you have one webcam, I have it set to "1" to skip my built-in laptop webcam and use the connected USB camera.


If referencing these examples in your own work please use:

@TechReport{breckon2010,
  author =       {Breckon, T.P. and Barnes, S.E.},
  title =        {Machine Learning - MSc Course Notes},
  institution =  {Cranfield University},
  year =         {2010},
  address =      {Bedfordshire, UK},
}

If you find any bugs please raise an issue (or better still submit a pull request, please) - [email protected]

"may the source be with you" - anon.

cpp-examples-ml's People

Contributors

tobybreckon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  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.