GithubHelp home page GithubHelp logo

nvnvashisth / object-detection Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 2.0 23.3 MB

Object Detection using hog descriptor and Random forest

C++ 73.86% Jupyter Notebook 26.14%
object-detection opencv hog random-trees random-forest hog-descriptor detection classification predictions tree vote

object-detection's Introduction

Object-Detection

Task 1 Image processing and HOG descriptor

OpenCV is a famous and popular open source Computer Vision library. It is released under a BSD license and hence it’s free for both academic and commercial use. In this exercise, OpenCV for C++ is required for all the implementation. In this task, you’re required to master the basic usage of OpenCV on image processing and then use the built-in class HOGDescriptor to detect HOG descriptors on given images.

alt text

Task 2 Object classification

After extraction of HOG descriptors from a image, we can use it to train a classifier. In this task, we will use Binary Decision Tree and Random Forest to classify images using their HOG descriptors. A Random Forest is an ensemble of Random Trees. By aggregating all the predictions from different trees, a forest can in general yield a more robust prediction than a single tree. The relationship between a Random Tree and a Random Forest

For the implementation of Random Tree, we use the Binary Decision Tree provided by OpenCV. It is defined as cv::ml::DTrees8

• Create a decision tree – cv::ml::DTrees.create() • Some parameters to set: – void setCVFolds( int val ); // set num cross validation folds – void setMaxCategories( int val ); // set max number of categories – void setMaxDepth( int val ); // set max tree depth – void setMinSampleCount( int val ); // set min sample count

• Train a decision tree – cv::ml::DTrees.train() • Predict class using decision tree – cv::ml::DTrees.predict() After being able to do classification with one Binary Decision Tree, you’re required to implement a Random Forest class composed of a group of Binary Decision Trees. You have to implement at least those three methods: • create – construct a forest with a given number of trees and initialize all the trees with given parameters • train – train each tree with a random subset of the training data • predict – aggregate predictions from all the trees and vote for the best classification result as well as the confidence (percentage of votes for that winner class)

Task 3 Object detection

In this task, you will need to detect objects in images with random forest. In the training stage, you have images from different objects organized in different directories. Especially, there’s one background class, whose images are generated from the possible backgrounds you would see in the test images. You should train your Random Forest with the capability to distinguish between those images from different classes. Note that the data you have for training may not be sufficient enough, you may need to augment it (add rotation, flip etc.) to generate more samples for training.

alt text alt text alt text alt text alt text alt text

object-detection's People

Contributors

nvnvashisth avatar

Stargazers

 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.