resolved conflicts, updated retina class interface and optimized a heavy retinacolor process
This commit is contained in:
@@ -10,3 +10,4 @@ The module contains some recently added functionality that has not been stabiliz
|
||||
stereo
|
||||
FaceRecognizer Documentation <facerec/index>
|
||||
Retina Documentation <retina/index>
|
||||
openfabmap
|
||||
|
@@ -42,18 +42,18 @@ In OpenCV 2.4 you only need :ocv:func:`applyColorMap` to apply a colormap on a g
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <opencv2/contrib/contrib.hpp>
|
||||
#include <opencv2/core/core.hpp>
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
#include <opencv2/contrib.hpp>
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/highgui.hpp>
|
||||
|
||||
using namespace cv;
|
||||
|
||||
int main(int argc, const char *argv[]) {
|
||||
// Get the path to the image, if it was given
|
||||
// if no arguments were given.
|
||||
string filename;
|
||||
String filename;
|
||||
if (argc > 1) {
|
||||
filename = string(argv[1]);
|
||||
filename = String(argv[1]);
|
||||
}
|
||||
// The following lines show how to apply a colormap on a given image
|
||||
// and show it with cv::imshow example with an image. An exception is
|
||||
|
@@ -30,10 +30,10 @@ a unified access to all face recongition algorithms in OpenCV. ::
|
||||
virtual void predict(InputArray src, int &label, double &confidence) const = 0;
|
||||
|
||||
// Serializes this object to a given filename.
|
||||
virtual void save(const string& filename) const;
|
||||
virtual void save(const String& filename) const;
|
||||
|
||||
// Deserializes this object from a given filename.
|
||||
virtual void load(const string& filename);
|
||||
virtual void load(const String& filename);
|
||||
|
||||
// Serializes this object to a given cv::FileStorage.
|
||||
virtual void save(FileStorage& fs) const = 0;
|
||||
@@ -52,7 +52,7 @@ I'll go a bit more into detail explaining :ocv:class:`FaceRecognizer`, because i
|
||||
|
||||
* So called “virtual constructor”. That is, each Algorithm derivative is registered at program start and you can get the list of registered algorithms and create instance of a particular algorithm by its name (see :ocv:func:`Algorithm::create`). If you plan to add your own algorithms, it is good practice to add a unique prefix to your algorithms to distinguish them from other algorithms.
|
||||
|
||||
* Setting/Retrieving algorithm parameters by name. If you used video capturing functionality from OpenCV highgui module, you are probably familar with :ocv:cfunc:`cvSetCaptureProperty`, :ocv:cfunc:`cvGetCaptureProperty`, :ocv:func:`VideoCapture::set` and :ocv:func:`VideoCapture::get`. :ocv:class:`Algorithm` provides similar method where instead of integer id's you specify the parameter names as text strings. See :ocv:func:`Algorithm::set` and :ocv:func:`Algorithm::get` for details.
|
||||
* Setting/Retrieving algorithm parameters by name. If you used video capturing functionality from OpenCV highgui module, you are probably familar with :ocv:cfunc:`cvSetCaptureProperty`, :ocv:cfunc:`cvGetCaptureProperty`, :ocv:func:`VideoCapture::set` and :ocv:func:`VideoCapture::get`. :ocv:class:`Algorithm` provides similar method where instead of integer id's you specify the parameter names as text Strings. See :ocv:func:`Algorithm::set` and :ocv:func:`Algorithm::get` for details.
|
||||
|
||||
* Reading and writing parameters from/to XML or YAML files. Every Algorithm derivative can store all its parameters and then read them back. There is no need to re-implement it each time.
|
||||
|
||||
@@ -113,7 +113,7 @@ Since every :ocv:class:`FaceRecognizer` is a :ocv:class:`Algorithm`, you can use
|
||||
// Create a FaceRecognizer:
|
||||
Ptr<FaceRecognizer> model = createEigenFaceRecognizer();
|
||||
// And here's how to get its name:
|
||||
std::string name = model->name();
|
||||
String name = model->name();
|
||||
|
||||
|
||||
FaceRecognizer::train
|
||||
@@ -251,7 +251,7 @@ FaceRecognizer::save
|
||||
|
||||
Saves a :ocv:class:`FaceRecognizer` and its model state.
|
||||
|
||||
.. ocv:function:: void FaceRecognizer::save(const string& filename) const
|
||||
.. ocv:function:: void FaceRecognizer::save(const String& filename) const
|
||||
|
||||
Saves this model to a given filename, either as XML or YAML.
|
||||
|
||||
@@ -265,7 +265,7 @@ Saves a :ocv:class:`FaceRecognizer` and its model state.
|
||||
|
||||
|
||||
Every :ocv:class:`FaceRecognizer` overwrites ``FaceRecognizer::save(FileStorage& fs)``
|
||||
to save the internal model state. ``FaceRecognizer::save(const string& filename)`` saves
|
||||
to save the internal model state. ``FaceRecognizer::save(const String& filename)`` saves
|
||||
the state of a model to the given filename.
|
||||
|
||||
The suffix ``const`` means that prediction does not affect the internal model
|
||||
@@ -276,13 +276,13 @@ FaceRecognizer::load
|
||||
|
||||
Loads a :ocv:class:`FaceRecognizer` and its model state.
|
||||
|
||||
.. ocv:function:: void FaceRecognizer::load( const string& filename )
|
||||
.. ocv:function:: void FaceRecognizer::load( const String& filename )
|
||||
.. ocv:function:: void FaceRecognizer::load( const FileStorage& fs ) = 0
|
||||
|
||||
Loads a persisted model and state from a given XML or YAML file . Every
|
||||
:ocv:class:`FaceRecognizer` has to overwrite ``FaceRecognizer::load(FileStorage& fs)``
|
||||
to enable loading the model state. ``FaceRecognizer::load(FileStorage& fs)`` in
|
||||
turn gets called by ``FaceRecognizer::load(const string& filename)``, to ease
|
||||
turn gets called by ``FaceRecognizer::load(const String& filename)``, to ease
|
||||
saving a model.
|
||||
|
||||
createEigenFaceRecognizer
|
||||
|
@@ -7,7 +7,7 @@ Face Recognition with OpenCV
|
||||
Introduction
|
||||
============
|
||||
|
||||
`OpenCV (Open Source Computer Vision) <http://opencv.willowgarage.com>`_ is a popular computer vision library started by `Intel <http://www.intel.com>`_ in 1999. The cross-platform library sets its focus on real-time image processing and includes patent-free implementations of the latest computer vision algorithms. In 2008 `Willow Garage <http://www.willowgarage.com>`_ took over support and OpenCV 2.3.1 now comes with a programming interface to C, C++, `Python <http://www.python.org>`_ and `Android <http://www.android.com>`_. OpenCV is released under a BSD license so it is used in academic projects and commercial products alike.
|
||||
`OpenCV (Open Source Computer Vision) <http://opencv.org>`_ is a popular computer vision library started by `Intel <http://www.intel.com>`_ in 1999. The cross-platform library sets its focus on real-time image processing and includes patent-free implementations of the latest computer vision algorithms. In 2008 `Willow Garage <http://www.willowgarage.com>`_ took over support and OpenCV 2.3.1 now comes with a programming interface to C, C++, `Python <http://www.python.org>`_ and `Android <http://www.android.com>`_. OpenCV is released under a BSD license so it is used in academic projects and commercial products alike.
|
||||
|
||||
OpenCV 2.4 now comes with the very new :ocv:class:`FaceRecognizer` class for face recognition, so you can start experimenting with face recognition right away. This document is the guide I've wished for, when I was working myself into face recognition. It shows you how to perform face recognition with :ocv:class:`FaceRecognizer` in OpenCV (with full source code listings) and gives you an introduction into the algorithms behind. I'll also show how to create the visualizations you can find in many publications, because a lot of people asked for.
|
||||
|
||||
|
@@ -6,7 +6,7 @@ project(facerec_cpp_samples)
|
||||
#SET(OpenCV_DIR /path/to/your/opencv/installation)
|
||||
|
||||
# packages
|
||||
find_package(OpenCV REQUIRED) # http://opencv.willowgarage.com
|
||||
find_package(OpenCV REQUIRED) # http://opencv.org
|
||||
|
||||
# probably you should loop through the sample files here
|
||||
add_executable(facerec_demo facerec_demo.cpp)
|
||||
|
@@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import sys
|
||||
import os.path
|
||||
|
||||
|
@@ -16,9 +16,9 @@
|
||||
* See <http://www.opensource.org/licenses/bsd-license>
|
||||
*/
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/contrib/contrib.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/contrib.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
|
||||
#include <iostream>
|
||||
|
@@ -16,9 +16,9 @@
|
||||
* See <http://www.opensource.org/licenses/bsd-license>
|
||||
*/
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/contrib/contrib.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/contrib.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
@@ -16,9 +16,9 @@
|
||||
* See <http://www.opensource.org/licenses/bsd-license>
|
||||
*/
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/contrib/contrib.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/contrib.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
@@ -16,9 +16,9 @@
|
||||
* See <http://www.opensource.org/licenses/bsd-license>
|
||||
*/
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/contrib/contrib.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/contrib.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
@@ -16,9 +16,9 @@
|
||||
* See <http://www.opensource.org/licenses/bsd-license>
|
||||
*/
|
||||
|
||||
#include "opencv2/contrib/contrib.hpp"
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/contrib.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
@@ -16,11 +16,11 @@
|
||||
* See <http://www.opensource.org/licenses/bsd-license>
|
||||
*/
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
#include "opencv2/contrib/contrib.hpp"
|
||||
#include "opencv2/highgui/highgui.hpp"
|
||||
#include "opencv2/imgproc/imgproc.hpp"
|
||||
#include "opencv2/objdetect/objdetect.hpp"
|
||||
#include "opencv2/core.hpp"
|
||||
#include "opencv2/contrib.hpp"
|
||||
#include "opencv2/highgui.hpp"
|
||||
#include "opencv2/imgproc.hpp"
|
||||
#include "opencv2/objdetect.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
openFABMAP
|
||||
OpenFABMAP
|
||||
========================================
|
||||
|
||||
.. highlight:: cpp
|
||||
|
@@ -16,7 +16,7 @@ Class which provides the main controls to the Gipsa/Listic labs human retina mo
|
||||
|
||||
**NOTE : See the Retina tutorial in the tutorial/contrib section for complementary explanations.**
|
||||
|
||||
The retina can be settled up with various parameters, by default, the retina cancels mean luminance and enforces all details of the visual scene. In order to use your own parameters, you can use at least one time the *write(std::string fs)* method which will write a proper XML file with all default parameters. Then, tweak it on your own and reload them at any time using method *setup(std::string fs)*. These methods update a *Retina::RetinaParameters* member structure that is described hereafter. ::
|
||||
The retina can be settled up with various parameters, by default, the retina cancels mean luminance and enforces all details of the visual scene. In order to use your own parameters, you can use at least one time the *write(String fs)* method which will write a proper XML file with all default parameters. Then, tweak it on your own and reload them at any time using method *setup(String fs)*. These methods update a *Retina::RetinaParameters* member structure that is described hereafter. ::
|
||||
|
||||
class Retina
|
||||
{
|
||||
@@ -49,12 +49,12 @@ The retina can be settled up with various parameters, by default, the retina can
|
||||
Size getOutputSize ();
|
||||
|
||||
// setup methods with specific parameters specification of global xml config file loading/write
|
||||
void setup (std::string retinaParameterFile="", const bool applyDefaultSetupOnFailure=true);
|
||||
void setup (String retinaParameterFile="", const bool applyDefaultSetupOnFailure=true);
|
||||
void setup (FileStorage &fs, const bool applyDefaultSetupOnFailure=true);
|
||||
void setup (RetinaParameters newParameters);
|
||||
struct Retina::RetinaParameters getParameters ();
|
||||
const std::string printSetup ();
|
||||
virtual void write (std::string fs) const;
|
||||
const String printSetup ();
|
||||
virtual void write (String fs) const;
|
||||
virtual void write (FileStorage &fs) const;
|
||||
void setupOPLandIPLParvoChannel (const bool colorMode=true, const bool normaliseOutput=true, const float photoreceptorsLocalAdaptationSensitivity=0.7, const float photoreceptorsTemporalConstant=0.5, const float photoreceptorsSpatialConstant=0.53, const float horizontalCellsGain=0, const float HcellsTemporalConstant=1, const float HcellsSpatialConstant=7, const float ganglionCellsSensitivity=0.7);
|
||||
void setupIPLMagnoChannel (const bool normaliseOutput=true, const float parasolCells_beta=0, const float parasolCells_tau=0, const float parasolCells_k=7, const float amacrinCellsTemporalCutFrequency=1.2, const float V0CompressionParameter=0.95, const float localAdaptintegration_tau=0, const float localAdaptintegration_k=7);
|
||||
@@ -208,7 +208,7 @@ Retina::getMagno
|
||||
Retina::getParameters
|
||||
+++++++++++++++++++++
|
||||
|
||||
.. ocv:function:: struct Retina::RetinaParameters Retina::getParameters()
|
||||
.. ocv:function:: Retina::RetinaParameters Retina::getParameters()
|
||||
|
||||
Retrieve the current parameters values in a *Retina::RetinaParameters* structure
|
||||
|
||||
@@ -248,7 +248,7 @@ Retina::getOutputSize
|
||||
Retina::printSetup
|
||||
++++++++++++++++++
|
||||
|
||||
.. ocv:function:: const std::string Retina::printSetup()
|
||||
.. ocv:function:: const String Retina::printSetup()
|
||||
|
||||
Outputs a string showing the used parameters setup
|
||||
|
||||
@@ -277,7 +277,7 @@ Retina::setColorSaturation
|
||||
Retina::setup
|
||||
+++++++++++++
|
||||
|
||||
.. ocv:function:: void Retina::setup(std::string retinaParameterFile = "", const bool applyDefaultSetupOnFailure = true )
|
||||
.. ocv:function:: void Retina::setup(String retinaParameterFile = "", const bool applyDefaultSetupOnFailure = true )
|
||||
.. ocv:function:: void Retina::setup(FileStorage & fs, const bool applyDefaultSetupOnFailure = true )
|
||||
.. ocv:function:: void Retina::setup(RetinaParameters newParameters)
|
||||
|
||||
@@ -291,7 +291,7 @@ Retina::setup
|
||||
Retina::write
|
||||
+++++++++++++
|
||||
|
||||
.. ocv:function:: void Retina::write( std::string fs ) const
|
||||
.. ocv:function:: void Retina::write( String fs ) const
|
||||
.. ocv:function:: void Retina::write( FileStorage& fs ) const
|
||||
|
||||
Write xml/yml formated parameters information
|
||||
@@ -336,8 +336,9 @@ Retina::RetinaParameters
|
||||
========================
|
||||
|
||||
.. ocv:struct:: Retina::RetinaParameters
|
||||
This structure merges all the parameters that can be adjusted threw the **Retina::setup()**, **Retina::setupOPLandIPLParvoChannel** and **Retina::setupIPLMagnoChannel** setup methods
|
||||
Parameters structure for better clarity, check explenations on the comments of methods : setupOPLandIPLParvoChannel and setupIPLMagnoChannel. ::
|
||||
|
||||
This structure merges all the parameters that can be adjusted threw the **Retina::setup()**, **Retina::setupOPLandIPLParvoChannel** and **Retina::setupIPLMagnoChannel** setup methods
|
||||
Parameters structure for better clarity, check explenations on the comments of methods : setupOPLandIPLParvoChannel and setupIPLMagnoChannel. ::
|
||||
|
||||
class RetinaParameters{
|
||||
struct OPLandIplParvoParameters{ // Outer Plexiform Layer (OPL) and Inner Plexiform Layer Parvocellular (IplParvo) parameters
|
||||
|
Reference in New Issue
Block a user