Friday, July 23, 2010

How to set up OpenCV version 2.2

If you have been using OpenCV all the time by getting the code straight out of the SVN, you may or may not know that it has reach version 2.2 recently. There has been some big changes to version 2.2 and most of your code is likely won't be able to compile. But, fret not, as I'm going to show you how to get back up again.

First of all, if you used to be doing this:
#include <cv.h>
#include <highgui.h>

just change it to:
#include <opencv2/opencv.hpp>


Secondly, if you used to link against:
cv.lib cxcore.lib highgui.lib
or
cv{version}.lib cxcore{version}.lib or highgui{version}.lib


just change it to:
opencv_calib3d220.lib opencv_contrib220.lib opencv_core220.lib opencv_features2d220.lib opencv_ffmpeg220.lib opencv_flann220.lib opencv_gpu220.lib opencv_haartraining_engine.lib opencv_highgui220.lib opencv_imgproc220.lib opencv_legacy220.lib opencv_ml220.lib opencv_objdetect220.lib opencv_video220.lib
(Some of these libs may not be needed if you did not use the features, but I don't think you will get any linking errors if you put it anyway.)


NOTE: as of the latest in the svn, the version is 2.2. Hence the "220" in "opencv_calib3d220.lib". If the version number changes, you may have the update the number accordingly.


Thirdly, in your "Projects and Solutions" "VC++ Directories" Options diaglog box, add this for "Include files":
{Path to your OpenCV SVN root folder}\include
{Path to your OpenCV SVN root folder}\modules\calib3d\include
{Path to your OpenCV SVN root folder}\modules\contrib\include
{Path to your OpenCV SVN root folder}\modules\core\include
{Path to your OpenCV SVN root folder}\modules\features2d\include
{Path to your OpenCV SVN root folder}\modules\ffmpeg
{Path to your OpenCV SVN root folder}\modules\flann\include
{Path to your OpenCV SVN root folder}\modules\gpu\include
{Path to your OpenCV SVN root folder}\modules\haartraining
{Path to your OpenCV SVN root folder}\modules\highgui\include
{Path to your OpenCV SVN root folder}\modules\imgproc\include
{Path to your OpenCV SVN root folder}\modules\legacy\include
{Path to your OpenCV SVN root folder}\modules\ml\include
{Path to your OpenCV SVN root folder}\modules\objdetect\include
{Path to your OpenCV SVN root folder}\modules\python
{Path to your OpenCV SVN root folder}\modules\traincascade
{Path to your OpenCV SVN root folder}\modules\video\include


Thirdly, in your "Projects and Solutions" "VC++ Directories" Options diaglog box, add this for "Library files":
{Path to your OpenCV SVN root folder}\{The name of the folder you created when building with CMake}\lib\{Release or Debug}

That's all that is to it. Good luck!

Sunday, January 17, 2010

Table of results for MNIST dataset

This is a table documenting some of the best results some paper obtained in MNIST dataset.

Results shown indicates the error obtained by training on all 60,000 samples and testing on 10,000 samples.
  1. Multi-column Deep Neural Networks for Image Classification (CVPR 2012)
    Cited 9 times. 0.23%

    Supplemental materialTechnical Report
  2. Deep Big Simple Neural Nets Excel on Handwritten Digit Recognition (2010)
    Cited 1 time. 0.35%
    Additional info: 6-layer NN 784-2500-2000-1500-1000-500-10 (on GPU) [elastic distortions]
  3. Efficient Learning of Sparse Representations with an Energy-Based Model (2006)
    Cited 109 times. 0.39%
    Additional info: large conv. net, unsup pretraining [elastic distortions]
  4. Stochastic Pooling for Regularization of Deep Convolutional Neural Networks (2013)
    Cited 1 times. 0.47%
    Additional info: Stochastic Pooling
  5. Best Practices for Convolutional Neural Networks Applied to Visual Document Analysis (2003)
    Cited 190 times. 0.4%
  6. What is the Best Multi-Stage Architecture for Object Recognition? (ICCV 2009)
    Cited 39 times. 0.53%
    Additional info: large conv. net, unsup pretraining [no distortions]
  7. Deformation Models for Image Recognition (PAMI 2007)
    Cited 46 times. 0.54%
    Additional info: K-NN with non-linear deformation (IDM) (Preprocessing: shiftable edges)
  8. A trainable feature extractor for handwritten digit recognition (2007)
    Cited 38 times. 0.54%
    Additional info: Trainable feature extractor + SVMs [affine distortions]
  9. Training Invariant Support Vector Machines (2002)
    Cited 281 times. 0.56%
    Additional info: Virtual SVM, deg-9 poly, 2-pixel jittered (Preprocessing: deskewing)
  10. Simple Methods for High-Performance Digit Recognition Based on Sparse Coding (TNN 2008)
    0.59%
    Additional info: unsupervised sparse features + SVM, [no distortions]
  11. Unsupervised learning of invariant feature hierarchies with applications to object recognition (CVPR 2007)
    Cited 119 times. 0.62%
    Additional info: large conv. net, unsup features [no distortions]
  12. Shape matching and object recognition using shape contexts (PAMI 2002)
    Cited 2089 times. 0.63%
    Additional info: K-NN, shape context matching (preprocessing: shape context feature extraction)
  13. Beyond Spatial Pyramids: Receptive Field Learning for Pooled Image Features (2012)
    Cited 0 times. 0.64%
  14. Convolutional Deep Belief Networks for Scalable Unsupervised Learning of Hierarchical Representations (2009)
    0.82%
  15. Large-Margin kNN Classification using a Deep Encoder Network (2009)
    0.94%
  16. Deep Boltzmann Machines (2009)
    0.95%
  17. CS81: Learning words with Deep Belief Networks (2008)
    1.12%
  18. Convolutional Neural Networks (2003)
    1.19%
    More info: The ConvNN is based on the paper "Best Practices for Convolutional Neural Networks Applied to Visual Document Analysis".
  19. Reducing the dimensionality of data with neural networks (2006)
    1.2%
  20. Deep learning via semi-supervised embedding (2008)
    1.5%