pull/223/head
Alexandre Benoit 11 years ago
commit 3ce36d6380
  1. 6
      doc/tutorials/cvv/table_of_content_cvv/table_of_content_cvv.rst
  2. 8
      modules/bioinspired/include/opencv2/bioinspired/retina.hpp
  3. 8
      modules/bioinspired/include/opencv2/bioinspired/retinafasttonemapping.hpp
  4. 36
      modules/bioinspired/include/opencv2/bioinspired/transientareassegmentationmodule.hpp
  5. 11
      modules/ccalib/src/ccalib.cpp
  6. 91
      modules/cvv/doc/Ueberblick-tut.md
  7. 34
      modules/cvv/doc/code_example/CMakeLists.txt
  8. 5
      modules/cvv/doc/code_example/README.md
  9. 137
      modules/cvv/doc/code_example/main.cpp
  10. 11
      modules/cvv/doc/cvv.rst
  11. 85
      modules/cvv/doc/cvv_api/index.rst
  12. 24
      modules/cvv/doc/cvv_gui/index.rst
  13. 35
      modules/cvv/doc/filterfunction-tut.md
  14. 106
      modules/cvv/doc/filterquery-ref.md
  15. BIN
      modules/cvv/doc/images_example/filter_tab_default.png
  16. BIN
      modules/cvv/doc/images_example/match_tab_line.png
  17. BIN
      modules/cvv/doc/images_example/match_tab_translations_2.png
  18. BIN
      modules/cvv/doc/images_example/match_translations.png
  19. BIN
      modules/cvv/doc/images_example/match_translations_2_70percent.png
  20. BIN
      modules/cvv/doc/images_example/overview_all.png
  21. BIN
      modules/cvv/doc/images_example/overview_matches_filtered.png
  22. BIN
      modules/cvv/doc/images_example/overview_single_call.png
  23. BIN
      modules/cvv/doc/images_example/overview_two_calls.png
  24. BIN
      modules/cvv/doc/images_example/raw_view.png
  25. BIN
      modules/cvv/doc/images_example/single_filter_deep_zoom.png
  26. BIN
      modules/cvv/doc/images_example/single_filter_gray.png
  27. BIN
      modules/cvv/doc/images_example/single_filter_right_two_imgs_unselected.png
  28. BIN
      modules/cvv/doc/images_example/single_image_tab.png
  29. BIN
      modules/cvv/doc/images_tut/dilate_calltab_defaultfview.PNG
  30. BIN
      modules/cvv/doc/images_tut/dilate_overview.PNG
  31. BIN
      modules/cvv/doc/images_ueberblick/DefaultFilterViewTab.PNG
  32. BIN
      modules/cvv/doc/images_ueberblick/DualfilterViewDiffImg.PNG
  33. BIN
      modules/cvv/doc/images_ueberblick/LineMatchViewTab.PNG
  34. BIN
      modules/cvv/doc/images_ueberblick/LineMatchViewZoomed.PNG
  35. BIN
      modules/cvv/doc/images_ueberblick/MainWindow.PNG
  36. BIN
      modules/cvv/doc/images_ueberblick/MainWindowFull.PNG
  37. BIN
      modules/cvv/doc/images_ueberblick/MainwindowTwoCalls.PNG
  38. BIN
      modules/cvv/doc/images_ueberblick/OverviewFilterQueryGroupByID.PNG
  39. BIN
      modules/cvv/doc/images_ueberblick/RawViewTab.PNG
  40. BIN
      modules/cvv/doc/images_ueberblick/SingleImageTab.PNG
  41. BIN
      modules/cvv/doc/images_ueberblick/TranslationMatchViewTab.PNG
  42. 122
      modules/cvv/doc/index.md
  43. 41
      modules/cvv/doc/introduction-tut.md
  44. 9
      modules/cvv/doc/topics.yml
  45. 40
      modules/cvv/doc/views-ref.md
  46. 4
      modules/datasets/CMakeLists.txt
  47. 105
      modules/datasets/doc/datasets.rst
  48. 29
      modules/datasets/doc/datasets/ar_hmdb.rst
  49. 14
      modules/datasets/doc/datasets/ar_sports.rst
  50. 27
      modules/datasets/doc/datasets/fr_lfw.rst
  51. 18
      modules/datasets/doc/datasets/gr_chalearn.rst
  52. 16
      modules/datasets/doc/datasets/gr_skig.rst
  53. 16
      modules/datasets/doc/datasets/hpe_parse.rst
  54. 16
      modules/datasets/doc/datasets/ir_affine.rst
  55. 15
      modules/datasets/doc/datasets/ir_robot.rst
  56. 16
      modules/datasets/doc/datasets/is_bsds.rst
  57. 16
      modules/datasets/doc/datasets/is_weizmann.rst
  58. 16
      modules/datasets/doc/datasets/msm_epfl.rst
  59. 16
      modules/datasets/doc/datasets/msm_middlebury.rst
  60. 18
      modules/datasets/doc/datasets/or_imagenet.rst
  61. 16
      modules/datasets/doc/datasets/or_mnist.rst
  62. 18
      modules/datasets/doc/datasets/or_sun.rst
  63. 23
      modules/datasets/doc/datasets/pd_caltech.rst
  64. 16
      modules/datasets/doc/datasets/slam_kitti.rst
  65. 16
      modules/datasets/doc/datasets/slam_tumindoor.rst
  66. 18
      modules/datasets/doc/datasets/tr_chars.rst
  67. 16
      modules/datasets/doc/datasets/tr_svt.rst
  68. 8
      modules/datasets/include/opencv2/datasets/ar_hmdb.hpp
  69. 8
      modules/datasets/include/opencv2/datasets/ar_sports.hpp
  70. 6
      modules/datasets/include/opencv2/datasets/dataset.hpp
  71. 8
      modules/datasets/include/opencv2/datasets/fr_lfw.hpp
  72. 8
      modules/datasets/include/opencv2/datasets/gr_chalearn.hpp
  73. 8
      modules/datasets/include/opencv2/datasets/gr_skig.hpp
  74. 8
      modules/datasets/include/opencv2/datasets/hpe_parse.hpp
  75. 8
      modules/datasets/include/opencv2/datasets/ir_affine.hpp
  76. 8
      modules/datasets/include/opencv2/datasets/ir_robot.hpp
  77. 8
      modules/datasets/include/opencv2/datasets/is_bsds.hpp
  78. 8
      modules/datasets/include/opencv2/datasets/is_weizmann.hpp
  79. 8
      modules/datasets/include/opencv2/datasets/msm_epfl.hpp
  80. 8
      modules/datasets/include/opencv2/datasets/msm_middlebury.hpp
  81. 8
      modules/datasets/include/opencv2/datasets/or_imagenet.hpp
  82. 8
      modules/datasets/include/opencv2/datasets/or_mnist.hpp
  83. 8
      modules/datasets/include/opencv2/datasets/or_sun.hpp
  84. 84
      modules/datasets/include/opencv2/datasets/pd_caltech.hpp
  85. 8
      modules/datasets/include/opencv2/datasets/slam_kitti.hpp
  86. 8
      modules/datasets/include/opencv2/datasets/slam_tumindoor.hpp
  87. 0
      modules/datasets/include/opencv2/datasets/tinyxml2/tinyxml2.h
  88. 8
      modules/datasets/include/opencv2/datasets/tr_chars.hpp
  89. 8
      modules/datasets/include/opencv2/datasets/tr_svt.hpp
  90. 12
      modules/datasets/include/opencv2/datasets/util.hpp
  91. 4
      modules/datasets/samples/ar_hmdb.cpp
  92. 276
      modules/datasets/samples/ar_hmdb_benchmark.cpp
  93. 4
      modules/datasets/samples/ar_sports.cpp
  94. 4
      modules/datasets/samples/fr_lfw.cpp
  95. 175
      modules/datasets/samples/fr_lfw_benchmark.cpp
  96. 4
      modules/datasets/samples/gr_chalearn.cpp
  97. 4
      modules/datasets/samples/gr_skig.cpp
  98. 4
      modules/datasets/samples/hpe_parse.cpp
  99. 4
      modules/datasets/samples/ir_affine.cpp
  100. 4
      modules/datasets/samples/ir_robot.cpp
  101. Some files were not shown because too many files have changed in this diff Show More

@ -5,7 +5,7 @@
Here you will learn how to use the cvv module to ease programming computer vision software through visual debugging aids.
.. include:: ../../definitions/tocDefinitions.rst
.. include:: ../../definitions/tocDefinitions.rst
+
.. tabularcolumns:: m{100pt} m{300pt}
@ -27,9 +27,9 @@ Here you will learn how to use the cvv module to ease programming computer visio
:width: 90pt
.. raw:: latex
.. raw:: latex
\pagebreak
\pagebreak
.. toctree::
:hidden:

@ -301,12 +301,12 @@ public:
*/
CV_WRAP virtual void activateContoursProcessing(const bool activate)=0;
};
CV_EXPORTS Ptr<Retina> createRetina(Size inputSize);
CV_EXPORTS Ptr<Retina> createRetina(Size inputSize, const bool colorMode, int colorSamplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const double reductionFactor=1.0, const double samplingStrenght=10.0);
CV_EXPORTS_W Ptr<Retina> createRetina(Size inputSize);
CV_EXPORTS_W Ptr<Retina> createRetina(Size inputSize, const bool colorMode, int colorSamplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const double reductionFactor=1.0, const double samplingStrenght=10.0);
#ifdef HAVE_OPENCV_OCL
CV_EXPORTS Ptr<Retina> createRetina_OCL(Size inputSize);
CV_EXPORTS Ptr<Retina> createRetina_OCL(Size inputSize, const bool colorMode, int colorSamplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const double reductionFactor=1.0, const double samplingStrenght=10.0);
Ptr<Retina> createRetina_OCL(Size inputSize);
Ptr<Retina> createRetina_OCL(Size inputSize, const bool colorMode, int colorSamplingMethod=RETINA_COLOR_BAYER, const bool useRetinaLogSampling=false, const double reductionFactor=1.0, const double samplingStrenght=10.0);
#endif
}
}

@ -93,7 +93,7 @@ namespace bioinspired{
* regarding spatio-temporal filter and the bigger retina model :
* Vision: Images, Signals and Neural Networks: Models of Neural Processing in Visual Perception (Progress in Neural Processing),By: Jeanny Herault, ISBN: 9814273686. WAPI (Tower ID): 113266891.
*/
class CV_EXPORTS RetinaFastToneMapping : public Algorithm
class CV_EXPORTS_W RetinaFastToneMapping : public Algorithm
{
public:
@ -103,7 +103,7 @@ public:
@param inputImage the input image to process RGB or gray levels
@param outputToneMappedImage the output tone mapped image
*/
virtual void applyFastToneMapping(InputArray inputImage, OutputArray outputToneMappedImage)=0;
CV_WRAP virtual void applyFastToneMapping(InputArray inputImage, OutputArray outputToneMappedImage)=0;
/**
* setup method that updates tone mapping behaviors by adjusing the local luminance computation area
@ -111,10 +111,10 @@ public:
* @param ganglioncellsNeighborhoodRadius the second stage local adaptation area
* @param meanLuminanceModulatorK the factor applied to modulate the meanLuminance information (default is 1, see reference paper)
*/
virtual void setup(const float photoreceptorsNeighborhoodRadius=3.f, const float ganglioncellsNeighborhoodRadius=1.f, const float meanLuminanceModulatorK=1.f)=0;
CV_WRAP virtual void setup(const float photoreceptorsNeighborhoodRadius=3.f, const float ganglioncellsNeighborhoodRadius=1.f, const float meanLuminanceModulatorK=1.f)=0;
};
CV_EXPORTS Ptr<RetinaFastToneMapping> createRetinaFastToneMapping(Size inputSize);
CV_EXPORTS_W Ptr<RetinaFastToneMapping> createRetinaFastToneMapping(Size inputSize);
}
}

@ -83,12 +83,12 @@ namespace cv
namespace bioinspired
{
class CV_EXPORTS TransientAreasSegmentationModule: public Algorithm
class CV_EXPORTS_W TransientAreasSegmentationModule: public Algorithm
{
public:
// parameters structure
struct SegmentationParameters{
struct CV_EXPORTS_W SegmentationParameters{
SegmentationParameters():
thresholdON(100),
thresholdOFF(100),
@ -101,16 +101,16 @@ public:
// context neighborhood energy filtering parameters : the aim is to get information about the energy on a wide neighborhood area to filtered out local effects
contextEnergy_temporalConstant(1),
contextEnergy_spatialConstant(75){};// default setup
float thresholdON, thresholdOFF;
float localEnergy_temporalConstant, localEnergy_spatialConstant;
float neighborhoodEnergy_temporalConstant, neighborhoodEnergy_spatialConstant;
float contextEnergy_temporalConstant, contextEnergy_spatialConstant;
CV_PROP_RW float thresholdON, thresholdOFF;
CV_PROP_RW float localEnergy_temporalConstant, localEnergy_spatialConstant;
CV_PROP_RW float neighborhoodEnergy_temporalConstant, neighborhoodEnergy_spatialConstant;
CV_PROP_RW float contextEnergy_temporalConstant, contextEnergy_spatialConstant;
};
/**
* @return the sze of the manage input and output images
*/
virtual Size getSize()=0;
CV_WRAP virtual Size getSize()=0;
/**
* try to open an XML segmentation parameters file to adjust current segmentation instance setup
@ -119,7 +119,7 @@ public:
* @param retinaParameterFile : the parameters filename
* @param applyDefaultSetupOnFailure : set to true if an error must be thrown on error
*/
virtual void setup(String segmentationParameterFile="", const bool applyDefaultSetupOnFailure=true)=0;
CV_WRAP virtual void setup(String segmentationParameterFile="", const bool applyDefaultSetupOnFailure=true)=0;
/**
* try to open an XML segmentation parameters file to adjust current segmentation instance setup
@ -128,7 +128,7 @@ public:
* @param fs : the open Filestorage which contains segmentation parameters
* @param applyDefaultSetupOnFailure : set to true if an error must be thrown on error
*/
virtual void setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFailure=true)=0;
CV_WRAP virtual void setup(cv::FileStorage &fs, const bool applyDefaultSetupOnFailure=true)=0;
/**
* try to open an XML segmentation parameters file to adjust current segmentation instance setup
@ -137,55 +137,55 @@ public:
* @param newParameters : a parameters structures updated with the new target configuration
* @param applyDefaultSetupOnFailure : set to true if an error must be thrown on error
*/
virtual void setup(SegmentationParameters newParameters)=0;
CV_WRAP virtual void setup(SegmentationParameters newParameters)=0;
/**
* @return the current parameters setup
*/
virtual SegmentationParameters getParameters()=0;
CV_WRAP virtual SegmentationParameters getParameters()=0;
/**
* parameters setup display method
* @return a string which contains formatted parameters information
*/
virtual const String printSetup()=0;
CV_WRAP virtual const String printSetup()=0;
/**
* write xml/yml formated parameters information
* @rparam fs : the filename of the xml file that will be open and writen with formatted parameters information
*/
virtual void write( String fs ) const=0;
CV_WRAP virtual void write( String fs ) const=0;
/**
* write xml/yml formated parameters information
* @param fs : a cv::Filestorage object ready to be filled
*/
virtual void write( cv::FileStorage& fs ) const=0;
CV_WRAP virtual void write( cv::FileStorage& fs ) const=0;
/**
* main processing method, get result using methods getSegmentationPicture()
* @param inputToSegment : the image to process, it must match the instance buffer size !
* @param channelIndex : the channel to process in case of multichannel images
*/
virtual void run(InputArray inputToSegment, const int channelIndex=0)=0;
CV_WRAP virtual void run(InputArray inputToSegment, const int channelIndex=0)=0;
/**
* access function
* @return the last segmentation result: a boolean picture which is resampled between 0 and 255 for a display purpose
*/
virtual void getSegmentationPicture(OutputArray transientAreas)=0;
CV_WRAP virtual void getSegmentationPicture(OutputArray transientAreas)=0;
/**
* cleans all the buffers of the instance
*/
virtual void clearAllBuffers()=0;
CV_WRAP virtual void clearAllBuffers()=0;
};
/**
* allocator
* @param Size : size of the images input to segment (output will be the same size)
*/
CV_EXPORTS Ptr<TransientAreasSegmentationModule> createTransientAreasSegmentationModule(Size inputSize);
CV_EXPORTS_W Ptr<TransientAreasSegmentationModule> createTransientAreasSegmentationModule(Size inputSize);
}} // namespaces end : cv and bioinspired

@ -93,10 +93,11 @@ bool CustomPattern::init(Mat& image, const float pixel_size, OutputArray output)
if (!detector) // if no detector chosen, use default
{
detector = FeatureDetector::create("ORB");
detector->set("nFeatures", 2000);
detector->set("scaleFactor", 1.15);
detector->set("nLevels", 30);
Ptr<ORB> orb = ORB::create();
orb->setMaxFeatures(2000);
orb->setScaleFactor(1.15);
orb->setNLevels(30);
detector = orb;
}
detector->detect(img_roi, keypoints);
@ -108,7 +109,7 @@ bool CustomPattern::init(Mat& image, const float pixel_size, OutputArray output)
refineKeypointsPos(img_roi, keypoints);
if (!descriptorExtractor) // if no extractor chosen, use default
descriptorExtractor = DescriptorExtractor::create("ORB");
descriptorExtractor = ORB::create();
descriptorExtractor->compute(img_roi, keypoints, descriptor);
if (!descriptorMatcher)

@ -1,91 +0,0 @@
#Über CVVisual
CVVisual ist eine Debug-Bibliothek für OpenCV, die verschiedene Möglichkeiten der Darstellung von Bildern und Ergebnissen von beispielsweise Filter- und Match-Operationen von OpenCV anbietet.
##Benutzung: Beispiel
Ist die Bibliothek eingebunden, das CVVISUAL\_DEBUG-Makro definiert und die benötigten Header in den Code eingebunden, kann durch den Aufruf einer CVVisual-Funktion mit den von OpenCV gelieferten Daten als Argumenten das CVV-Hauptfenster geöffnet werden.
Beispielsweise könnte ein Codestück folgendermaßen aussehen:
//...
cvv::debugDMatch(src, keypoints1, src, keypoints2, match, CVVISUAL\_LOCATION);
![](../images_ueberblick/MainWindow.PNG)
Die Bilder werden zusammen mit Informationen und Metadaten in der Overview-Tabelle angezeigt.
Ein Doppelklick darauf öffnet ein Tab, in dem die Bilder und Matches groß angezeigt werden.
![](../images_ueberblick/LineMatchViewTab.PNG)
In dieser Ansicht, genannt *Line Match View* werden die KeyPoints der Matches, d.h. die von OpenCV gelieferten ähnlichen Bildpunkte, durch Linien verbunden. Im Akkordeonmenü kann man beispielsweise deren Farbe änder. `Strg + Mausrad` erlaubt, zu zoomen.
![](../images_ueberblick/LineMatchViewZoomed.PNG)
Die Art der Darstellung kann im `View`-Dropdown-Menü geändert werden; so können die Matches etwa auch als Translationslinien angezeigt werden.
![](../images_ueberblick/TranslationMatchViewTab.PNG)
Zudem gibt es bei Matches auch die Möglichkeit, die Daten in einer Tabelle anzuzeigen, im sogenannten
*Raw View*. Die Daten können hier über einen Linksklick als JSON oder CSV ins Clipboard kopiert
werden.
![](../images_ueberblick/RawviewTab.PNG)
Wird `Step` geklickt wird die Ausführung des zu debuggenden Programmes, das beim Aufruf des Hauptfensters angehalten wurde fortgesetzt, bis es auf eine weitere CVVisual-Funktion
stößt:
//...
cvv::debugFilter(src, dest, CVVISUAL\_LOCATION, filename);
Das Hauptfenster erscheint erneut, wobei der neuen Datensatz der Tabelle hinzugefügt wird.
![](../images_ueberblick/MainWindowTwoCalls.PNG)
Da es sich hier um eine Filter-Operation handelt, ist die Anzeige im Tab eine andere:
![](../images_ueberblick/DefaultFilterViewTab.PNG)
Auch die möglichen Anzeigen unterscheiden sich von denen für Match-Operationen.
Der *Dual Filter View* erlaubt zum Beispiel zusätzlich, ein Differenzbild der beiden übergebenen anzuzeigen.
![](../images_ueberblick/DualfilterViewDiffImg.PNG)
Nach einem *fast-forward* (`>>`) über die weiteren Schritte des Programms
//...
cvv::debugDMatch(src, keypoints1, src, keypoints2, match, CVVISUAL\_LOCATION)
//...
cvv::debugFilter(src, dest, CVVISUAL\_LOCATION, filename);
//...
cvv::debugFilter(src, dest, CVVISUAL\_LOCATION, filename);
//...
cvv::debugDMatch(src, keypoints1, src, keypoints2, match, CVVISUAL\_LOCATION);
//...
cvv::showImage(img, CVVISUAL\_LOCATION);
//...
cvv::finalShow();
ergibt sich im Overview folgendes Bild:
![](../images_ueberblick/MainWindowFull.PNG)
Dabei wird durch den letzten Aufruf nur ein einziges Bild zur Anzeige übergeben:
![](../images_ueberblick/SingleImageTab.PNG)
Mithilfe der Textzeile lassen sich durch Kommandos der *Filter Query Language* von CVVisual die Datensätze ordnen, filtern und gruppieren. Hier wurde nach ID gruppiert:
![](../images_ueberblick/OverviewFilterQueryGroupByID.PNG)
Dies funktioniert auch im *Raw View*.
Hinter dem letzten Aufruf einer regulären CVVisual-Funktion muss, wie oben gesehen, `finalShow` aufgerufen werden:
//...
cvv::finalShow();
//...
Es wird ein weiteres Mal das Hauptfenster angezeigt; wird jedoch der nun der einzige verbleibende, der `Close`-Knopf betätigt, wird das Hauptfenster endgültig geschlossen.
Dies beschließt die Debug-Sitzung.
[Quelle des zur Demonstration benutzten Bildes.](http://commons.wikimedia.org/wiki/File:PNG-Gradient.png)

@ -1,34 +0,0 @@
cmake_minimum_required(VERSION 2.8)
project(cvvisual_test)
SET(CMAKE_PREFIX_PATH ~/software/opencv/install)
SET(CMAKE_CXX_COMPILER "g++-4.8")
SET(CMAKE_CXX_FLAGS "-std=c++11 -O2 -pthread -Wall -Werror")
OPTION(CVV_DEBUG_MODE "cvvisual-debug-mode" ON)
if(CVV_DEBUG_MODE MATCHES ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCVVISUAL_DEBUGMODE")
endif()
FIND_PACKAGE(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
FIND_PACKAGE(Qt5Core REQUIRED)
include_directories(${Qt5Core_INCLUDE_DIRS})
FIND_PACKAGE(Qt5Widgets REQUIRED)
include_directories(${Qt5Widgets_INCLUDE_DIRS})
add_definitions(${QT_DEFINITIONS})
SET(OpenCVVisual_DIR "$ENV{HOME}/<<<SET ME>>>")
include_directories("${OpenCVVisual_DIR}/include")
link_directories("${OpenCVVisual_DIR}/build/release")
add_executable(cvvt main.cpp)
target_link_libraries(cvvt
opencv_core opencv_highgui opencv_imgproc opencv_features2d
opencv_cvv
Qt5Core Qt5Widgets Qt5Gui
)

@ -1,5 +0,0 @@
This is a tiny example of how to use CVVisual. It requires a webcam.
Note that the paths in CMakeLists.txt have to be set manually.
cvvisual_test was created by Andreas Bihlmaier.

@ -1,137 +0,0 @@
// system includes
#include <getopt.h>
#include <iostream>
// library includes
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/cvv/debug_mode.hpp>
#include <opencv2/cvv/show_image.hpp>
#include <opencv2/cvv/filter.hpp>
#include <opencv2/cvv/dmatch.hpp>
#include <opencv2/cvv/final_show.hpp>
template<class T> std::string toString(const T& p_arg)
{
std::stringstream ss;
ss << p_arg;
return ss.str();
}
void
usage()
{
printf("usage: cvvt [-r WxH]\n");
printf("-h print this help\n");
printf("-r WxH change resolution to width W and height H\n");
}
int
main(int argc, char** argv)
{
cv::Size* resolution = nullptr;
// parse options
const char* optstring = "hr:";
int opt;
while ((opt = getopt(argc, argv, optstring)) != -1) {
switch (opt) {
case 'h':
usage();
return 0;
break;
case 'r':
{
char dummych;
resolution = new cv::Size();
if (sscanf(optarg, "%d%c%d", &resolution->width, &dummych, &resolution->height) != 3) {
printf("%s not a valid resolution\n", optarg);
return 1;
}
}
break;
default: /* '?' */
usage();
return 2;
}
}
// setup video capture
cv::VideoCapture capture(0);
if (!capture.isOpened()) {
std::cout << "Could not open VideoCapture" << std::endl;
return 3;
}
if (resolution) {
printf("Setting resolution to %dx%d\n", resolution->width, resolution->height);
capture.set(CV_CAP_PROP_FRAME_WIDTH, resolution->width);
capture.set(CV_CAP_PROP_FRAME_HEIGHT, resolution->height);
}
cv::Mat prevImgGray;
std::vector<cv::KeyPoint> prevKeypoints;
cv::Mat prevDescriptors;
int maxFeatureCount = 500;
cv::ORB detector(maxFeatureCount);
cv::BFMatcher matcher(cv::NORM_HAMMING);
for (int imgId = 0; imgId < 10; imgId++) {
// capture a frame
cv::Mat imgRead;
capture >> imgRead;
printf("%d: image captured\n", imgId);
std::string imgIdString{"imgRead"};
imgIdString += toString(imgId);
cvv::showImage(imgRead, CVVISUAL_LOCATION, imgIdString.c_str());
// convert to grayscale
cv::Mat imgGray;
cv::cvtColor(imgRead, imgGray, CV_BGR2GRAY);
cvv::debugFilter(imgRead, imgGray, CVVISUAL_LOCATION, "to gray");
// detect ORB features
std::vector<cv::KeyPoint> keypoints;
cv::Mat descriptors;
detector(imgGray, cv::noArray(), keypoints, descriptors);
printf("%d: detected %zd keypoints\n", imgId, keypoints.size());
// match them to previous image (if available)
if (!prevImgGray.empty()) {
std::vector<cv::DMatch> matches;
matcher.match(prevDescriptors, descriptors, matches);
printf("%d: all matches size=%zd\n", imgId, matches.size());
std::string allMatchIdString{"all matches "};
allMatchIdString += toString(imgId-1) + "<->" + toString(imgId);
cvv::debugDMatch(prevImgGray, prevKeypoints, imgGray, keypoints, matches, CVVISUAL_LOCATION, allMatchIdString.c_str());
// remove worst (as defined by match distance) bestRatio quantile
double bestRatio = 0.8;
std::sort(matches.begin(), matches.end());
matches.resize(int(bestRatio * matches.size()));
printf("%d: best matches size=%zd\n", imgId, matches.size());
std::string bestMatchIdString{"best " + toString(bestRatio) + " matches "};
bestMatchIdString += toString(imgId-1) + "<->" + toString(imgId);
cvv::debugDMatch(prevImgGray, prevKeypoints, imgGray, keypoints, matches, CVVISUAL_LOCATION, bestMatchIdString.c_str());
}
prevImgGray = imgGray;
prevKeypoints = keypoints;
prevDescriptors = descriptors;
}
cvv::finalShow();
return 0;
}

@ -0,0 +1,11 @@
*********************************************************************
cvv. GUI for Interactive Visual Debugging of Computer Vision Programs
*********************************************************************
The module provides an interactive GUI to debug and incrementally design computer vision algorithms. The debug statements can remain in the code after development and aid in further changes because they have neglectable overhead if the program is compiled in release mode.
.. toctree::
:maxdepth: 2
CVV API Documentation <cvv_api/index>
CVV GUI Documentation <cvv_gui/index>

@ -0,0 +1,85 @@
CVV : the API
*************
.. highlight:: cpp
Introduction
++++++++++++
Namespace for all functions is **cvv**, i.e. *cvv::showImage()*.
Compilation:
* For development, i.e. for cvv GUI to show up, compile your code using cvv with *g++ -DCVVISUAL_DEBUGMODE*.
* For release, i.e. cvv calls doing nothing, compile your code without above flag.
See cvv tutorial for a commented example application using cvv.
API Functions
+++++++++++++
showImage
---------
Add a single image to debug GUI (similar to :imshow:`imshow <>`).
.. ocv:function:: void showImage(InputArray img, const CallMetaData& metaData, const string& description, const string& view)
:param img: Image to show in debug GUI.
:param metaData: Properly initialized CallMetaData struct, i.e. information about file, line and function name for GUI. Use CVVISUAL_LOCATION macro.
:param description: Human readable description to provide context to image.
:param view: Preselect view that will be used to visualize this image in GUI. Other views can still be selected in GUI later on.
debugFilter
-----------
Add two images to debug GUI for comparison. Usually the input and output of some filter operation, whose result should be inspected.
.. ocv:function:: void debugFilter(InputArray original, InputArray result, const CallMetaData& metaData, const string& description, const string& view)
:param original: First image for comparison, e.g. filter input.
:param result: Second image for comparison, e.g. filter output.
:param metaData: See :ocv:func:`showImage`
:param description: See :ocv:func:`showImage`
:param view: See :ocv:func:`showImage`
debugDMatch
-----------
Add a filled in :basicstructures:`DMatch <dmatch>` to debug GUI. The matches can are visualized for interactive inspection in different GUI views (one similar to an interactive :draw_matches:`drawMatches<>`).
.. ocv:function:: void debugDMatch(InputArray img1, std::vector<cv::KeyPoint> keypoints1, InputArray img2, std::vector<cv::KeyPoint> keypoints2, std::vector<cv::DMatch> matches, const CallMetaData& metaData, const string& description, const string& view, bool useTrainDescriptor)
:param img1: First image used in :basicstructures:`DMatch <dmatch>`.
:param keypoints1: Keypoints of first image.
:param img2: Second image used in DMatch.
:param keypoints2: Keypoints of second image.
:param metaData: See :ocv:func:`showImage`
:param description: See :ocv:func:`showImage`
:param view: See :ocv:func:`showImage`
:param useTrainDescriptor: Use :basicstructures:`DMatch <dmatch>`'s train descriptor index instead of query descriptor index.
finalShow
---------
This function **must** be called *once* *after* all cvv calls if any.
As an alternative create an instance of FinalShowCaller, which calls finalShow() in its destructor (RAII-style).
.. ocv:function:: void finalShow()
setDebugFlag
------------
Enable or disable cvv for current translation unit and thread (disabled this way has higher - but still low - overhead compared to using the compile flags).
.. ocv:function:: void setDebugFlag(bool active)
:param active: See above

@ -0,0 +1,24 @@
CVV : the GUI
*************
.. highlight:: cpp
Introduction
++++++++++++
For now: See cvv tutorial.
Overview
++++++++
Filter
------
Views
++++++++

@ -1,35 +0,0 @@
#Introduction to filter function widgets
##The class, functions and types
If you want to enable the user to provide input to a filter you can inherit the virtual class FilterFunctionWidget<In,Out>.
It provides an interface for a filter accepting In images as an input and Out images as output.
The input images are passed using:
```cpp
InputArray = std::array<util::Reference<const cv::Mat>,In>
```
and the output is provided with an output parameter of the type:
```cpp
OutputArray = std::array<util::Reference<cv::Mat>,Out>
```
You should override following functions:
```cpp
virtual void applyFilter(InputArray in,OutputArray out) const;
virtual std::pair<bool, QString> checkInput(InputArray in) const;
```
`applyFilter` has to apply your filter and `checkInput` should check weather the filter can be applied (the first member of the returned pair).
In case the filter can not be applied the second member of the returned pair should contain a message for the user.
If user input changes the setting of the filter the function _emitSignal()_ of the member _signFilterSettingsChanged__ should be called.
For a detailed example look at _CVVisual/src/qtutil/filter/grayfilterwidget.{hpp, cpp}_
https://github.com/CVVisualPSETeam/CVVisual/blob/master/src/qtutil/filter/grayfilterwidget.hpp
https://github.com/CVVisualPSETeam/CVVisual/blob/master/src/qtutil/filter/grayfilterwidget.cpp

@ -1,106 +0,0 @@
#Filter query language
The filter query language is the query language used in the overview and the raw match view to simply the task of filtering, sorting and grouping data sets in a table UI.
The following is a description of the simple syntax and the supported commands.
Just type `#` into the search field to see some supported commands, using the suggestions feature (it's inspired by the awesome z shell).
##Syntax
A query consist basically of many subqueries starting with a `#`:
`[raw filter subquery] #[subquery 1] [...] #[subquery n]`
The optional first part of the query doesn't start with a `#`, it's short for `#raw [...]`.
There three different types of subqueries:
###Sort query
A sort query has the following structure:
`sort by [sort subquery 1], [...], [sort subquery n]`
A sort subquery consist of a sort command (aka "the feature by which you want to sort the table") and a sort order:
- `[command]`: equivalent to `[command] asc`
- `[command] asc`: sorts in ascending order
- `[command] desc`: sorts in descending order
(The sort command is typically a single word.)
For your interest: The `[subquery n]` has higher priority than the `[subquery n+1]`.
###Group query
A group query has the following structure:
`group by [command 1], [...], [command n]`
A group command is a single word declaring the feature you want to group the data sets in the table by.
The group header consist of the `n` items.
For your interest: The raw view currently doesn't support group queries.
###Filter query
A filter query is the basic type of query, allowing you to filter the data sets by several criterias.
It has the following structure:
`#[filter command] [argument]`
It also supports several arguments for one filter command (via the comma seperated filters feature):
`#[cs filter command] [argument 1], [...], [argument n]`
####Range filter query
A range filter query uses basically a comma seperated filter command with two arguments, allowing you to
filter for a range of elements (`[lower bound]` <= `element` <= `[upper bound]`).
It has the following structure:
`#[filter command] [lower bound], [upper bound]`
##Overview
The following commands are supported in the overview:
feauture/command | sorting supported | grouping supported | filtering supported | description
-----------------|:-----------------:|:------------------:|:--------------------|:---------------------
id | yes | yes | yes, also range |
raw | yes | yes | only basic filter | alias for description
description | yes | yes | only basic filter |
image_count | yes | yes | yes, also range | number of images
function | yes | yes | yes | calling function
file | yes | yes | yes | inheriting file
line | yes | yes | yes, also range |
type | yes | yes | yes | call type
##Rawview
The following command are supported in the raw (match) view:
feauture/command | numeric type | description/property
-----------------|:-------------|:---------------------------------------------
match_distance | float | match distance
img_idx | integer | match img idx
query_idx | integer | match query idx
train_idx | integer | match train idx
x_1 | float | x coordinate of the "left" key point
y_1 | float | y coordinate of the "left" key point
size_1 | float | size of the "left" key point
angle_1 | float | angle of the "left" key point
response_1 | float | response (or strength) of the "left" key point
octave_1 | integer | octave of the "left" key point
x_2 | float | x coordinate of the "right" key point
y_2 | float | y coordinate of the "right" key point
size_2 | float | size of the "right" key point
angle_2 | float | angle of the "right" key point
response_2 | float | response (or strength) of the "right" key point
octave_2 | integer | octave of the "right" key point
All commands support range filtering, sorting and grouping and therefore only the used numeric type
(integer or float) is given.
See the opencv documentation for more information about the features.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 298 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 172 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 149 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 290 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

@ -1,122 +0,0 @@
#CVVisual Example
CVVisual is a debug visualization for OpenCV; thus, its main purpose is to offer different ways to visualize
the results of OpenCV functions to make it possible to see whether they are what the programmer had in mind;
and also to offer some functionality to try other operations on the images right in the debug window.
This text wants to illustrate the use of CVVisual on a code example.
Image we want to debug this program:
[code_example/main.cpp](https://github.com/CVVisualPSETeam/CVVisual/tree/master/doc/code_example/main.cpp)
Note the includes for CVVisual:
10 #include <opencv2/debug_mode.hpp>
11 #include <opencv2/show_image.hpp>
12 #include <opencv2/filter.hpp>
13#include <opencv2/dmatch.hpp>
14 #include <opencv2/final_show.hpp>
It takes 10 snapshots with the webcam.
With each, it first shows the image alone in the debug window,
97 cvv::showImage(imgRead, CVVISUAL_LOCATION, imgIdString.c_str());
then converts it to grayscale and calls CVVisual with the original and resulting image,
101 cv::cvtColor(imgRead, imgGray, CV_BGR2GRAY);
102 cvv::debugFilter(imgRead, imgGray, CVVISUAL_LOCATION, "to gray");
detects the grayscale image's ORB features
107 detector(imgGray, cv::noArray(), keypoints, descriptors);
and matches them to those of the previous image, if available. It calls cvv::debugDMatch() with the results.
113 matcher.match(prevDescriptors, descriptors, matches);
...
117 cvv::debugDMatch(prevImgGray, prevKeypoints, imgGray, keypoints, matches, CVVISUAL_LOCATION, allMatchIdString.c_str());
Finally, it removes the worst (as defined by match distance) 0.8 quantile of matches and calls cvv::debugDMatch() again.
121 std::sort(matches.begin(), matches.end());
122 matches.resize(int(bestRatio * matches.size()));
...
126 cvv::debugDMatch(prevImgGray, prevKeypoints, imgGray, keypoints, matches, CVVISUAL_LOCATION, bestMatchIdString.c_str());
After we started the program, the CVVisual Main Window opens with one _Call_, that is, the first image that a `cvv::showImage()` was called with (the program execution was halted at this call).
![](../images_example/overview_single_call.png)
The image is shown as a small thumbnail in the _Overview table_, together with additional information on it, like the line of the call and the description passed as a parameter.
We double-click it, and a tab opens, where the image is shown bigger. It looks like the webcam worked, so we press `Step` and go to the _Overview_.
![](../images_example/single_image_tab.png)
The window shows up again, this time with the first _Call_ to `cvv::debugFilter()` added.
![](../images_example/overview_two_calls.png)
We open its tab, too, because, say, the grayscale image does not exactly look like what we wanted.
![](../images_example/filter_tab_default.png)
After switching to _SingleFilterView_, which will be more useful to us here, we select to not show the right two images - the grayscale image and the one below, where results of filter operations in this tab are depicted.
![](../images_example/single_filter_right_two_imgs_unselected.png)
In `Select a filter`, a gray filter can be applied with different parameters.
![](../images_example/single_filter_gray.png)
This looks more like what we wanted.
Rechecking `Show image` for the unselected result image of the actual filter operation and zooming (`Ctrl` + `Mouse wheel`) into all images synchronously deeper than 60% shows the different values of the pixels.
![](../images_example/single_filter_deep_zoom.png)
Sadly, we can't do anything about this situation in this session, though, so we just continue.
As stepping through each single _Call_ seems quite tedious, we use the _fast-forward_ button, `>>`.
The program runs until it reaches `finalShow()`, taking images with the webcam along the way.
This saved us some clicking; on the downside, we now have quite an amount of _Calls_ in the table.
![](../images_example/overview_all.png)
Using the [filter query language](http://cvv.mostlynerdless.de/ref/filters-ref.html), the _Calls_ to `debugDMatch()` can be filtered out as they have the specific type "match".
![](../images_example/overview_matches_filtered.png)
We open the tab of the last such _Call_, and find ourselves greeted with a dense bundle of lines across both images, which represent the matches between the two.
![](../images_example/match_tab_line.png)
It is a bit unclear where there actually are matches in this case, so we switch to _TranslationMatchView_, which is a little bit better (especially after scrolling a bit to the right in the left image).
![](../images_example/match_translations.png)
_TranslationMatchView_ shows how the matching _KeyPoints_ are moved in the respective other image.
It seems more fitting for this debug session than the _LineMatchView_, thus, we `Set`it `as default`.
Still, there are too many matches for our taste.
Back in the _Overview_, we open the _Call_ before the last, which is the one where the upper 80% of matches were not yet filtered out.
![](../images_example/match_tab_translations_2.png)
Here, the best 70% of matches can be chosen. The result looks more acceptable, and we take a mental note to change the threshold to 0.7.
![](../images_example/match_translations_2_70percent.png)
The matches can also be shown in a table, the so called _RawView_:
![](../images_example/raw_view.png)
Here, you could copy a selection of them as CSV, JSON, Ruby or Python to the clipboard.
We don't need that in the moment, though; we just close the window, and the program finishes.
We now know what we might want to change in the program.
Finally, a little note on the `cvv::finalShow()` function:
It needs to be there in every program using CVVisual, after the last call to another CVVisual function, er else, the program will crash in the end.
Hopefully, this example shed some light on how CVVisual can be used.
If you want to learn more, refer to the [API](http://cvv.mostlynerdless.de/api) or other documentation on the [web page](http://cvv.mostlynerdless.de/).
Credit, and special thanks, goes to Andreas Bihlmaier, supervisor of the project, who provided the example code.

@ -1,41 +0,0 @@
#Introduction to using CVVisual
##Enabling debug mode
Define the CVV\_DEBUG_MODE macro somewhere in the translation unit.
##Opening the debug window
Open the debug window by putting one of the functions from the [CVVisual API](http://cvv.mostlynerdless.de/api) into your code.
In this example, we want to debug a call to 'dilate' (line.1) which is a filter, so we use debugFilter.
###Example: Code
src, dest and the structuring element elem are of type cv::Mat (see the OpenCV doc on [dilate()](http://docs.opencv.org/modules/imgproc/doc/filtering.html#dilate));
CVVISUAL\_LOCATION is a special macro that inserts the location of the code and description and view can be either string-literals or std::strings. The later three are all optional.
```cpp
#include <filter.hpp>
//...
cv::dilate(src, dest, elem);
cvv::debugFilter(src, dest, CVVISUAL_LOCATION, description, view);
```
When executing the code, the debugFilter function will open the window and halt the execution.
##The Overview Tab
![](images_tut/dilate_overview.PNG)
You are now in the overview tab. Each time you call one of the CVVisual functions, a *Call* is added to the table.
You can see the images you passed to the funtion as well as metadata and additional information.
The text field allows you to sort or group the Calls by different criteria; see the [filter query language documentation](http://cvv.mostlynerdless.de/ref/filterquery-ref.html) on how to use it.
Now double-click on the Call or select `Open in 'CVVisual|main window'` from the context menu.
(You can also choose to remove the Call or open it in a new window there)
##Debugging a filter operation
![](images_tut/dilate_calltab_defaultfview.PNG)
A *CallTab* opens. In the center, there are the images from the call.
In the `View` drop-down menu you find different *Views* of the Call, that is, different visualizations of it. The accordion menu on the left offers information on the images and additional options depending on the View and the type of the Call.
Important here might be that `ImageInformation` offers the possibility to zoom (you can also use `Ctrl` plus the mouse wheel); if you zoom in more than 60%, the image pixels will be overlaid with the channel values, in a 3-channel image usually in order (top-down) BGR.
As our dilate seems to have produced acceptable results, we want to continue through the code.
So, we push the `Step` button in the upper left.
The window will comes up again the next time one of the CVVisual functions is called.
Then, we see two Calls in the Overview table, the one from before and the new one.
You need to put `finalShow()` after the last regular CVVisual function. If the program reaches it, `Step` and the fast-forward button `>>` will vanish, so we press `Close`, which does exactly what it says.
([Source](http://commons.wikimedia.org/wiki/File:PNG-Gradient.png) of the image used for demonstration.
Note that the screenshots were taken during development and may not depict all features of the current version.)

@ -1,9 +0,0 @@
filterquery: filterquery-ref.md
SingleImageView: views-ref.md#toc_2
DefaultFilterView: views-ref.md#toc_4
DualFilterView: views-ref.md#toc_5
SingleFilterView: views-ref.md#toc_6
DepthMatchView: views-ref.md#toc_8
LineMatchView: views-ref.md#toc_9
RawView: views-ref.md#toc_10
TranslationMatchView: views-ref.md#toc_11

@ -1,40 +0,0 @@
#Views
##General information:
Most views offer an `ImageInformation` collapsable in their accordion menus.
The zoom can be found here.
`Ctrl`+`Mouse wheel` is also zoom; `Ctrl`+`Shift`+`Mouse wheel` is a slower zoom.
If the zoom is deeper than 60%, the image's pixels will be overlaid with their channel values; usually, the order is BGR[+alpha] from the top.
##Single Image View:
Associated with the `debugSingleImage()` function.
Shows one single image with no features other than `Image Information`.
##Filter Views:
Associated with the `debugFilter()` function.
###DefaultFilterView:
Shows two images with only the basic features of `ImageInformation`, synchronized zoom and `Histogram`.
###DualFilterView:
Shows the two images given to the CVVisual function and _Result Image_ inbetween
which represents the result of a filter that was applied to the others via the `Filter selection` collapsable,
like a difference image between the two.
###SingleFilterView:
Allows to apply filters to the images it shows via the `Select a filter` collapsable.
##Match Views:
Associated with the `debugDMatch()` function.
###PointMatchView:
Interprets the translation of matches as depth value.
###LineMatchView:
Connects matching key points in the images with lines.
###Rawview:
Shows in a table data of the matches.
The table entries can be filtered, sorted and grouped by using commands from CVVisual's [filter query language](filterquery-ref.html) in the text box.
###TranslationMatchView
Shows the distance between a keypoint in one image to its match in the other as an arrow or line in one image.

@ -0,0 +1,4 @@
set(the_description "datasets framework")
ocv_define_module(datasets opencv_core opencv_face opencv_ml opencv_flann)
ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4267) # flann, Win64

@ -0,0 +1,105 @@
*******************************************************
datasets. Framework for working with different datasets
*******************************************************
.. highlight:: cpp
The datasets module includes classes for working with different datasets: load data, evaluate different algorithms on them, etc.
.. toctree::
:hidden:
datasets/ar_hmdb
datasets/ar_sports
datasets/fr_lfw
datasets/gr_chalearn
datasets/gr_skig
datasets/hpe_parse
datasets/ir_affine
datasets/ir_robot
datasets/is_bsds
datasets/is_weizmann
datasets/msm_epfl
datasets/msm_middlebury
datasets/or_imagenet
datasets/or_mnist
datasets/or_sun
datasets/pd_caltech
datasets/slam_kitti
datasets/slam_tumindoor
datasets/tr_chars
datasets/tr_svt
Action Recognition
------------------
:doc:`datasets/ar_hmdb`
:doc:`datasets/ar_sports`
Face Recognition
----------------
:doc:`datasets/fr_lfw`
Gesture Recognition
-------------------
:doc:`datasets/gr_chalearn`
:doc:`datasets/gr_skig`
Human Pose Estimation
---------------------
:doc:`datasets/hpe_parse`
Image Registration
------------------
:doc:`datasets/ir_affine`
:doc:`datasets/ir_robot`
Image Segmentation
------------------
:doc:`datasets/is_bsds`
:doc:`datasets/is_weizmann`
Multiview Stereo Matching
-------------------------
:doc:`datasets/msm_epfl`
:doc:`datasets/msm_middlebury`
Object Recognition
------------------
:doc:`datasets/or_imagenet`
:doc:`datasets/or_mnist`
:doc:`datasets/or_sun`
Pedestrian Detection
--------------------
:doc:`datasets/pd_caltech`
SLAM
----
:doc:`datasets/slam_kitti`
:doc:`datasets/slam_tumindoor`
Text Recognition
----------------
:doc:`datasets/tr_chars`
:doc:`datasets/tr_svt`

@ -0,0 +1,29 @@
HMDB: A Large Human Motion Database
===================================
.. ocv:class:: AR_hmdb
Implements loading dataset:
_`"HMDB: A Large Human Motion Database"`: http://serre-lab.clps.brown.edu/resource/hmdb-a-large-human-motion-database/
.. note:: Usage
1. From link above download dataset files: hmdb51_org.rar & test_train_splits.rar.
2. Unpack them.
3. To load data run: ./opencv/build/bin/example_datasets_ar_hmdb -p=/home/user/path_to_unpacked_folders/
Benchmark
"""""""""
For this dataset was implemented benchmark, which gives accuracy: 0.107407 (using precomputed HOG/HOF "STIP" features from site, averaging for 3 splits)
To run this benchmark execute:
.. code-block:: bash
./opencv/build/bin/example_datasets_ar_hmdb_benchmark -p=/home/user/path_to_unpacked_folders/
(precomputed features should be unpacked in the same folder: /home/user/path_to_unpacked_folders/hmdb51_org_stips/)

@ -0,0 +1,14 @@
Sports-1M Dataset
=================
.. ocv:class:: AR_sports
Implements loading dataset:
_`"Sports-1M Dataset"`: http://cs.stanford.edu/people/karpathy/deepvideo/
.. note:: Usage
1. From link above download dataset files (git clone https://code.google.com/p/sports-1m-dataset/).
2. To load data run: ./opencv/build/bin/example_datasets_ar_sports -p=/home/user/path_to_downloaded_folders/

@ -0,0 +1,27 @@
Labeled Faces in the Wild
=========================
.. ocv:class:: FR_lfw
Implements loading dataset:
_`"Labeled Faces in the Wild"`: http://vis-www.cs.umass.edu/lfw/
.. note:: Usage
1. From link above download any dataset file: lfw.tgz\lfwa.tar.gz\lfw-deepfunneled.tgz\lfw-funneled.tgz and files with pairs: 10 test splits: pairs.txt and developer train split: pairsDevTrain.txt.
2. Unpack dataset file and place pairs.txt and pairsDevTrain.txt in created folder.
3. To load data run: ./opencv/build/bin/example_datasets_fr_lfw -p=/home/user/path_to_unpacked_folder/lfw2/
Benchmark
"""""""""
For this dataset was implemented benchmark, which gives accuracy: 0.623833 +- 0.005223 (train split: pairsDevTrain.txt, dataset: lfwa)
To run this benchmark execute:
.. code-block:: bash
./opencv/build/bin/example_datasets_fr_lfw_benchmark -p=/home/user/path_to_unpacked_folder/lfw2/

@ -0,0 +1,18 @@
ChaLearn Looking at People
==========================
.. ocv:class:: GR_chalearn
Implements loading dataset:
_`"ChaLearn Looking at People"`: http://gesture.chalearn.org/
.. note:: Usage
1. Follow instruction from site above, download files for dataset "Track 3: Gesture Recognition": Train1.zip-Train5.zip, Validation1.zip-Validation3.zip (Register on site: www.codalab.org and accept the terms and conditions of competition: https://www.codalab.org/competitions/991#learn_the_details There are three mirrors for downloading dataset files. When I downloaded data only mirror: "Universitat Oberta de Catalunya" works).
2. Unpack train archives Train1.zip-Train5.zip to folder Train/, validation archives Validation1.zip-Validation3.zip to folder Validation/
3. Unpack all archives in Train/ & Validation/ in the folders with the same names, for example: Sample0001.zip to Sample0001/
4. To load data run: ./opencv/build/bin/example_datasets_gr_chalearn -p=/home/user/path_to_unpacked_folders/

@ -0,0 +1,16 @@
Sheffield Kinect Gesture Dataset
================================
.. ocv:class:: GR_skig
Implements loading dataset:
_`"Sheffield Kinect Gesture Dataset"`: http://lshao.staff.shef.ac.uk/data/SheffieldKinectGesture.htm
.. note:: Usage
1. From link above download dataset files: subject1_dep.7z-subject6_dep.7z, subject1_rgb.7z-subject6_rgb.7z.
2. Unpack them.
3. To load data run: ./opencv/build/bin/example_datasets_gr_skig -p=/home/user/path_to_unpacked_folders/

@ -0,0 +1,16 @@
PARSE Dataset
=============
.. ocv:class:: HPE_parse
Implements loading dataset:
_`"PARSE Dataset"`: http://www.ics.uci.edu/~dramanan/papers/parse/
.. note:: Usage
1. From link above download dataset file: people.zip.
2. Unpack it.
3. To load data run: ./opencv/build/bin/example_datasets_hpe_parse -p=/home/user/path_to_unpacked_folder/people_all/

@ -0,0 +1,16 @@
Affine Covariant Regions Datasets
=================================
.. ocv:class:: IR_affine
Implements loading dataset:
_`"Affine Covariant Regions Datasets"`: http://www.robots.ox.ac.uk/~vgg/data/data-aff.html
.. note:: Usage
1. From link above download dataset files: bark\\bikes\\boat\\graf\\leuven\\trees\\ubc\\wall.tar.gz.
2. Unpack them.
3. To load data, for example, for "bark", run: ./opencv/build/bin/example_datasets_ir_affine -p=/home/user/path_to_unpacked_folder/bark/

@ -0,0 +1,15 @@
Robot Data Set
==============
.. ocv:class:: IR_robot
Implements loading dataset:
_`"Robot Data Set"`: http://roboimagedata.compute.dtu.dk/?page_id=24
.. note:: Usage
1. From link above download files for dataset "Point Feature Data Set – 2010": SET001_6.tar.gz-SET055_60.tar.gz (there are two data sets: - Full resolution images (1200×1600), ~500 Gb and - Half size image (600×800), ~115 Gb.)
2. Unpack them to one folder.
3. To load data run: ./opencv/build/bin/example_datasets_ir_robot -p=/home/user/path_to_unpacked_folder/

@ -0,0 +1,16 @@
The Berkeley Segmentation Dataset and Benchmark
===============================================
.. ocv:class:: IS_bsds
Implements loading dataset:
_`"The Berkeley Segmentation Dataset and Benchmark"`: https://www.eecs.berkeley.edu/Research/Projects/CS/vision/bsds/
.. note:: Usage
1. From link above download dataset files: BSDS300-human.tgz & BSDS300-images.tgz.
2. Unpack them.
3. To load data run: ./opencv/build/bin/example_datasets_is_bsds -p=/home/user/path_to_unpacked_folder/BSDS300/

@ -0,0 +1,16 @@
Weizmann Segmentation Evaluation Database
=========================================
.. ocv:class:: IS_weizmann
Implements loading dataset:
_`"Weizmann Segmentation Evaluation Database"`: http://www.wisdom.weizmann.ac.il/~vision/Seg_Evaluation_DB/
.. note:: Usage
1. From link above download dataset files: Weizmann_Seg_DB_1obj.ZIP & Weizmann_Seg_DB_2obj.ZIP.
2. Unpack them.
3. To load data, for example, for 1 object dataset, run: ./opencv/build/bin/example_datasets_is_weizmann -p=/home/user/path_to_unpacked_folder/1obj/

@ -0,0 +1,16 @@
EPFL Multi-View Stereo
======================
.. ocv:class:: MSM_epfl
Implements loading dataset:
_`"EPFL Multi-View Stereo"`: http://cvlabwww.epfl.ch/~strecha/multiview/denseMVS.html
.. note:: Usage
1. From link above download dataset files: castle_dense\\castle_dense_large\\castle_entry\\fountain\\herzjesu_dense\\herzjesu_dense_large_bounding\\cameras\\images\\p.tar.gz.
2. Unpack them in separate folder for each object. For example, for "fountain", in folder fountain/ : fountain_dense_bounding.tar.gz -> bounding/, fountain_dense_cameras.tar.gz -> camera/, fountain_dense_images.tar.gz -> png/, fountain_dense_p.tar.gz -> P/
3. To load data, for example, for "fountain", run: ./opencv/build/bin/example_datasets_msm_epfl -p=/home/user/path_to_unpacked_folder/fountain/

@ -0,0 +1,16 @@
Stereo – Middlebury Computer Vision
===================================
.. ocv:class:: MSM_middlebury
Implements loading dataset:
_`"Stereo – Middlebury Computer Vision"`: http://vision.middlebury.edu/mview/
.. note:: Usage
1. From link above download dataset files: dino\\dinoRing\\dinoSparseRing\\temple\\templeRing\\templeSparseRing.zip
2. Unpack them.
3. To load data, for example "temple" dataset, run: ./opencv/build/bin/example_datasets_msm_middlebury -p=/home/user/path_to_unpacked_folder/temple/

@ -0,0 +1,18 @@
ImageNet
========
.. ocv:class:: OR_imagenet
Implements loading dataset:
_`"ImageNet"`: http://www.image-net.org/
Currently implemented loading full list with urls. Planned to implement dataset from ILSVRC challenge.
.. note:: Usage
1. From link above download dataset file: imagenet_fall11_urls.tgz
2. Unpack it.
3. To load data run: ./opencv/build/bin/example_datasets_or_imagenet -p=/home/user/path_to_unpacked_file/

@ -0,0 +1,16 @@
MNIST
=====
.. ocv:class:: OR_mnist
Implements loading dataset:
_`"MNIST"`: http://yann.lecun.com/exdb/mnist/
.. note:: Usage
1. From link above download dataset files: t10k-images-idx3-ubyte.gz, t10k-labels-idx1-ubyte.gz, train-images-idx3-ubyte.gz, train-labels-idx1-ubyte.gz.
2. Unpack them.
3. To load data run: ./opencv/build/bin/example_datasets_or_mnist -p=/home/user/path_to_unpacked_files/

@ -0,0 +1,18 @@
SUN Database
============
.. ocv:class:: OR_sun
Implements loading dataset:
_`"SUN Database"`: http://sundatabase.mit.edu/
Currently implemented loading "Scene Recognition Benchmark. SUN397". Planned to implement also "Object Detection Benchmark. SUN2012".
.. note:: Usage
1. From link above download dataset file: SUN397.tar
2. Unpack it.
3. To load data run: ./opencv/build/bin/example_datasets_or_sun -p=/home/user/path_to_unpacked_folder/SUN397/

@ -0,0 +1,23 @@
Caltech Pedestrian Detection Benchmark
======================================
.. ocv:class:: PD_caltech
Implements loading dataset:
_`"Caltech Pedestrian Detection Benchmark"`: http://www.vision.caltech.edu/Image_Datasets/CaltechPedestrians/
.. note:: First version of Caltech Pedestrian dataset loading.
Code to unpack all frames from seq files commented as their number is huge!
So currently load only meta information without data.
Also ground truth isn't processed, as need to convert it from mat files first.
.. note:: Usage
1. From link above download dataset files: set00.tar-set10.tar.
2. Unpack them to separate folder.
3. To load data run: ./opencv/build/bin/example_datasets_pd_caltech -p=/home/user/path_to_unpacked_folders/

@ -0,0 +1,16 @@
KITTI Vision Benchmark
======================
.. ocv:class:: SLAM_kitti
Implements loading dataset:
_`"KITTI Vision Benchmark"`: http://www.cvlibs.net/datasets/kitti/eval_odometry.php
.. note:: Usage
1. From link above download "Odometry" dataset files: data_odometry_gray\\data_odometry_color\\data_odometry_velodyne\\data_odometry_poses\\data_odometry_calib.zip.
2. Unpack data_odometry_poses.zip, it creates folder dataset/poses/. After that unpack data_odometry_gray.zip, data_odometry_color.zip, data_odometry_velodyne.zip. Folder dataset/sequences/ will be created with folders 00/..21/. Each of these folders will contain: image_0/, image_1/, image_2/, image_3/, velodyne/ and files calib.txt & times.txt. These two last files will be replaced after unpacking data_odometry_calib.zip at the end.
3. To load data run: ./opencv/build/bin/example_datasets_slam_kitti -p=/home/user/path_to_unpacked_folder/dataset/

@ -0,0 +1,16 @@
TUMindoor Dataset
=================
.. ocv:class:: SLAM_tumindoor
Implements loading dataset:
_`"TUMindoor Dataset"`: http://www.navvis.lmt.ei.tum.de/dataset/
.. note:: Usage
1. From link above download dataset files: dslr\\info\\ladybug\\pointcloud.tar.bz2 for each dataset: 11-11-28 (1st floor)\\11-12-13 (1st floor N1)\\11-12-17a (4th floor)\\11-12-17b (3rd floor)\\11-12-17c (Ground I)\\11-12-18a (Ground II)\\11-12-18b (2nd floor)
2. Unpack them in separate folder for each dataset. dslr.tar.bz2 -> dslr/, info.tar.bz2 -> info/, ladybug.tar.bz2 -> ladybug/, pointcloud.tar.bz2 -> pointcloud/.
3. To load each dataset run: ./opencv/build/bin/example_datasets_slam_tumindoor -p=/home/user/path_to_unpacked_folders/

@ -0,0 +1,18 @@
The Chars74K Dataset
====================
.. ocv:class:: TR_chars
Implements loading dataset:
_`"The Chars74K Dataset"`: http://www.ee.surrey.ac.uk/CVSSP/demos/chars74k/
.. note:: Usage
1. From link above download dataset files: EnglishFnt\\EnglishHnd\\EnglishImg\\KannadaHnd\\KannadaImg.tgz, ListsTXT.tgz.
2. Unpack them.
3. Move .m files from folder ListsTXT/ to appropriate folder. For example, English/list_English_Img.m for EnglishImg.tgz.
4. To load data, for example "EnglishImg", run: ./opencv/build/bin/example_datasets_tr_chars -p=/home/user/path_to_unpacked_folder/English/

@ -0,0 +1,16 @@
The Street View Text Dataset
============================
.. ocv:class:: TR_svt
Implements loading dataset:
_`"The Street View Text Dataset"`: http://vision.ucsd.edu/~kai/svt/
.. note:: Usage
1. From link above download dataset file: svt.zip.
2. Unpack it.
3. To load data run: ./opencv/build/bin/example_datasets_tr_svt -p=/home/user/path_to_unpacked_folder/svt/svt1/

@ -39,19 +39,19 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_AR_HMDB_HPP
#define OPENCV_DATASETSTOOLS_AR_HMDB_HPP
#ifndef OPENCV_DATASETS_AR_HMDB_HPP
#define OPENCV_DATASETS_AR_HMDB_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
struct AR_hmdbObj : public Object

@ -39,19 +39,19 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_AR_SPORTS_HPP
#define OPENCV_DATASETSTOOLS_AR_SPORTS_HPP
#ifndef OPENCV_DATASETS_AR_SPORTS_HPP
#define OPENCV_DATASETS_AR_SPORTS_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
struct AR_sportsObj : public Object

@ -39,8 +39,8 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_DATASET_HPP
#define OPENCV_DATASETSTOOLS_DATASET_HPP
#ifndef OPENCV_DATASETS_DATASET_HPP
#define OPENCV_DATASETS_DATASET_HPP
#include <string>
#include <vector>
@ -49,7 +49,7 @@
namespace cv
{
namespace datasetstools
namespace datasets
{
struct Object

@ -39,19 +39,19 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_FR_LFW_HPP
#define OPENCV_DATASETSTOOLS_FR_LFW_HPP
#ifndef OPENCV_DATASETS_FR_LFW_HPP
#define OPENCV_DATASETS_FR_LFW_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
struct FR_lfwObj : public Object

@ -39,19 +39,19 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_GR_CHALEARN_HPP
#define OPENCV_DATASETSTOOLS_GR_CHALEARN_HPP
#ifndef OPENCV_DATASETS_GR_CHALEARN_HPP
#define OPENCV_DATASETS_GR_CHALEARN_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
struct groundTruth

@ -39,19 +39,19 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_GR_SKIG_HPP
#define OPENCV_DATASETSTOOLS_GR_SKIG_HPP
#ifndef OPENCV_DATASETS_GR_SKIG_HPP
#define OPENCV_DATASETS_GR_SKIG_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
enum actionType

@ -39,19 +39,19 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_HPE_PARSE_HPP
#define OPENCV_DATASETSTOOLS_HPE_PARSE_HPP
#ifndef OPENCV_DATASETS_HPE_PARSE_HPP
#define OPENCV_DATASETS_HPE_PARSE_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
struct HPE_parseObj : public Object

@ -39,20 +39,20 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_IR_AFFINE_HPP
#define OPENCV_DATASETSTOOLS_IR_AFFINE_HPP
#ifndef OPENCV_DATASETS_IR_AFFINE_HPP
#define OPENCV_DATASETS_IR_AFFINE_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
#include <opencv2/core/matx.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
struct IR_affineObj : public Object

@ -39,19 +39,19 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_IR_ROBOT_HPP
#define OPENCV_DATASETSTOOLS_IR_ROBOT_HPP
#ifndef OPENCV_DATASETS_IR_ROBOT_HPP
#define OPENCV_DATASETS_IR_ROBOT_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
// calibration matrix from calibrationFile.mat

@ -39,19 +39,19 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_IS_BSDS_HPP
#define OPENCV_DATASETSTOOLS_IS_BSDS_HPP
#ifndef OPENCV_DATASETS_IS_BSDS_HPP
#define OPENCV_DATASETS_IS_BSDS_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
struct IS_bsdsObj : public Object

@ -39,19 +39,19 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_IS_WEIZMANN_HPP
#define OPENCV_DATASETSTOOLS_IS_WEIZMANN_HPP
#ifndef OPENCV_DATASETS_IS_WEIZMANN_HPP
#define OPENCV_DATASETS_IS_WEIZMANN_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
struct IS_weizmannObj : public Object

@ -39,19 +39,19 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_MSM_EPFL_HPP
#define OPENCV_DATASETSTOOLS_MSM_EPFL_HPP
#ifndef OPENCV_DATASETS_MSM_EPFL_HPP
#define OPENCV_DATASETS_MSM_EPFL_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
struct cameraParam

@ -39,19 +39,19 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_MSM_MIDDLEBURY_HPP
#define OPENCV_DATASETSTOOLS_MSM_MIDDLEBURY_HPP
#ifndef OPENCV_DATASETS_MSM_MIDDLEBURY_HPP
#define OPENCV_DATASETS_MSM_MIDDLEBURY_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
struct MSM_middleburyObj : public Object

@ -39,19 +39,19 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_OR_IMAGENET_HPP
#define OPENCV_DATASETSTOOLS_OR_IMAGENET_HPP
#ifndef OPENCV_DATASETS_OR_IMAGENET_HPP
#define OPENCV_DATASETS_OR_IMAGENET_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
struct OR_imagenetObj : public Object

@ -39,19 +39,19 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_OR_MNIST_HPP
#define OPENCV_DATASETSTOOLS_OR_MNIST_HPP
#ifndef OPENCV_DATASETS_OR_MNIST_HPP
#define OPENCV_DATASETS_OR_MNIST_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
struct OR_mnistObj : public Object

@ -39,19 +39,19 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_OR_SUN_HPP
#define OPENCV_DATASETSTOOLS_OR_SUN_HPP
#ifndef OPENCV_DATASETS_OR_SUN_HPP
#define OPENCV_DATASETS_OR_SUN_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
struct OR_sunObj : public Object

@ -0,0 +1,84 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2014, Itseez Inc, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Itseez Inc or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#ifndef OPENCV_DATASETS_PD_CALTECH_HPP
#define OPENCV_DATASETS_PD_CALTECH_HPP
#include <string>
#include <vector>
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasets
{
struct PD_caltechObj : public Object
{
//double groundTrue[][];
//Mat image;
std::string name;
std::vector< std::string > imageNames;
};
//
// first version of Caltech Pedestrian dataset loading
// code to unpack all frames from seq files commented as their number is huge
// so currently load only meta information without data
//
// also ground truth isn't processed, as need to convert it from mat files first
//
class CV_EXPORTS PD_caltech : public Dataset
{
public:
virtual void load(const std::string &path) = 0;
static Ptr<PD_caltech> create();
};
}
}
#endif

@ -39,19 +39,19 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_SLAM_KITTI_HPP
#define OPENCV_DATASETSTOOLS_SLAM_KITTI_HPP
#ifndef OPENCV_DATASETS_SLAM_KITTI_HPP
#define OPENCV_DATASETS_SLAM_KITTI_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
struct pose

@ -39,19 +39,19 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_SLAM_TUMINDOOR_HPP
#define OPENCV_DATASETSTOOLS_SLAM_TUMINDOOR_HPP
#ifndef OPENCV_DATASETS_SLAM_TUMINDOOR_HPP
#define OPENCV_DATASETS_SLAM_TUMINDOOR_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
enum imageType

@ -39,19 +39,19 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_TR_CHARS_HPP
#define OPENCV_DATASETSTOOLS_TR_CHARS_HPP
#ifndef OPENCV_DATASETS_TR_CHARS_HPP
#define OPENCV_DATASETS_TR_CHARS_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
struct TR_charsObj : public Object

@ -39,19 +39,19 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_TR_SVT_HPP
#define OPENCV_DATASETSTOOLS_TR_SVT_HPP
#ifndef OPENCV_DATASETS_TR_SVT_HPP
#define OPENCV_DATASETS_TR_SVT_HPP
#include <string>
#include <vector>
#include "opencv2/datasetstools/dataset.hpp"
#include "opencv2/datasets/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
namespace datasets
{
struct tag

@ -39,8 +39,8 @@
//
//M*/
#ifndef OPENCV_DATASETSTOOLS_UTIL_HPP
#define OPENCV_DATASETSTOOLS_UTIL_HPP
#ifndef OPENCV_DATASETS_UTIL_HPP
#define OPENCV_DATASETS_UTIL_HPP
#include <string>
#include <vector>
@ -49,12 +49,14 @@
namespace cv
{
namespace datasetstools
namespace datasets
{
void split(const std::string &s, std::vector<std::string> &elems, char delim);
void CV_EXPORTS split(const std::string &s, std::vector<std::string> &elems, char delim);
void getDirList(const std::string &dirName, std::vector<std::string> &fileNames);
void CV_EXPORTS createDirectory(const std::string &path);
void CV_EXPORTS getDirList(const std::string &dirName, std::vector<std::string> &fileNames);
}
}

@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/datasetstools/ar_hmdb.hpp"
#include "opencv2/datasets/ar_hmdb.hpp"
#include <opencv2/core.hpp>
@ -50,7 +50,7 @@
using namespace std;
using namespace cv;
using namespace cv::datasetstools;
using namespace cv::datasets;
int main(int argc, char *argv[])
{

@ -0,0 +1,276 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2014, Itseez Inc, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Itseez Inc or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include "opencv2/datasets/ar_hmdb.hpp"
#include "opencv2/datasets/util.hpp"
#include <opencv2/core.hpp>
#include <opencv2/flann.hpp>
#include <opencv2/ml.hpp>
#include <cstdio>
#include <string>
#include <vector>
#include <fstream>
using namespace std;
using namespace cv;
using namespace cv::datasets;
using namespace cv::flann;
using namespace cv::ml;
unsigned int getNumFiles(vector< Ptr<Object> > &curr);
unsigned int getNumFiles(vector< Ptr<Object> > &curr)
{
unsigned int numFiles = 0;
for (unsigned int i=0; i<curr.size(); ++i)
{
AR_hmdbObj *example = static_cast<AR_hmdbObj *>(curr[i].get());
vector<string> &videoNames = example->videoNames;
for (vector<string>::iterator it=videoNames.begin(); it!=videoNames.end(); ++it)
{
numFiles++;
}
}
return numFiles;
}
void fillData(const string &path, vector< Ptr<Object> > &curr, Index &flann_index, Mat1f &data, Mat1i &labels);
void fillData(const string &path, vector< Ptr<Object> > &curr, Index &flann_index, Mat1f &data, Mat1i &labels)
{
const unsigned int descriptorNum = 162;
Mat1f sample(1, descriptorNum);
Mat1i nresps(1, 1);
Mat1f dists(1, 1);
unsigned int numFiles = 0;
for (unsigned int i=0; i<curr.size(); ++i)
{
AR_hmdbObj *example = static_cast<AR_hmdbObj *>(curr[i].get());
vector<string> &videoNames = example->videoNames;
for (vector<string>::iterator it=videoNames.begin(); it!=videoNames.end(); ++it)
{
string featuresFile = *it + ".txt";
string featuresFullPath = path + "hmdb51_org_stips/" + example->name + "/" + featuresFile;
ifstream infile(featuresFullPath.c_str());
string line;
// skip header
for (unsigned int j=0; j<3; ++j)
{
getline(infile, line);
}
while (getline(infile, line))
{
// 7 skip, hog+hof: 72+90 read
vector<string> elems;
split(line, elems, '\t');
for (unsigned int j=0; j<descriptorNum; ++j)
{
sample(0, j) = (float)atof(elems[j+7].c_str());
}
flann_index.knnSearch(sample, nresps, dists, 1, SearchParams());
data(numFiles, nresps(0, 0)) ++;
}
labels(numFiles, 0) = i;
numFiles++;
}
}
}
int main(int argc, char *argv[])
{
const char *keys =
"{ help h usage ? | | show this message }"
"{ path p |true| path to dataset }";
CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path"));
if (parser.has("help") || path=="true")
{
parser.printMessage();
return -1;
}
// loading dataset
Ptr<AR_hmdb> dataset = AR_hmdb::create();
dataset->load(path);
int numSplits = dataset->getNumSplits();
printf("splits number: %u\n", numSplits);
const unsigned int descriptorNum = 162;
const unsigned int clusterNum = 4000;
const unsigned int sampleNum = 5613856; // max for all 3 splits
vector<double> res;
for (int currSplit=0; currSplit<numSplits; ++currSplit)
{
Mat1f samples(sampleNum, descriptorNum);
unsigned int currSample = 0;
vector< Ptr<Object> > &curr = dataset->getTrain(currSplit);
unsigned int numTrainFiles = getNumFiles(curr);
unsigned int numFeatures = 0;
for (unsigned int i=0; i<curr.size(); ++i)
{
AR_hmdbObj *example = static_cast<AR_hmdbObj *>(curr[i].get());
vector<string> &videoNames = example->videoNames;
for (vector<string>::iterator it=videoNames.begin(); it!=videoNames.end(); ++it)
{
string featuresFile = *it + ".txt";
string featuresFullPath = path + "hmdb51_org_stips/" + example->name + "/" + featuresFile;
ifstream infile(featuresFullPath.c_str());
string line;
// skip header
for (unsigned int j=0; j<3; ++j)
{
getline(infile, line);
}
while (getline(infile, line))
{
numFeatures++;
if (currSample < sampleNum)
{
// 7 skip, hog+hof: 72+90 read
vector<string> elems;
split(line, elems, '\t');
for (unsigned int j=0; j<descriptorNum; ++j)
{
samples(currSample, j) = (float)atof(elems[j+7].c_str());
}
currSample++;
}
}
}
}
printf("split %u, train features number: %u, samples number: %u\n", currSplit, numFeatures, currSample);
// clustering
Mat1f centers(clusterNum, descriptorNum);
::cvflann::KMeansIndexParams kmean_params;
unsigned int resultClusters = hierarchicalClustering< L2<float> >(samples, centers, kmean_params);
if (resultClusters < clusterNum)
{
centers = centers.rowRange(Range(0, resultClusters));
}
Index flann_index(centers, KDTreeIndexParams());
printf("resulted clusters number: %u\n", resultClusters);
Mat1f trainData(numTrainFiles, resultClusters);
Mat1i trainLabels(numTrainFiles, 1);
for (unsigned int i=0; i<numTrainFiles; ++i)
{
for (unsigned int j=0; j<resultClusters; ++j)
{
trainData(i, j) = 0;
}
}
printf("calculating train histograms\n");
fillData(path, curr, flann_index, trainData, trainLabels);
printf("train svm\n");
SVM::Params params;
params.svmType = SVM::C_SVC;
params.kernelType = SVM::POLY; //SVM::RBF;
params.degree = 0.5;
params.gamma = 1;
params.coef0 = 1;
params.C = 1;
params.nu = 0.5;
params.p = 0;
params.termCrit = TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS, 1000, 0.01);
Ptr<SVM> svm = SVM::create(params);
svm->train(trainData, ROW_SAMPLE, trainLabels);
// prepare to predict
curr = dataset->getTest(currSplit);
unsigned int numTestFiles = getNumFiles(curr);
Mat1f testData(numTestFiles, resultClusters);
Mat1i testLabels(numTestFiles, 1); // ground true
for (unsigned int i=0; i<numTestFiles; ++i)
{
for (unsigned int j=0; j<resultClusters; ++j)
{
testData(i, j) = 0;
}
}
printf("calculating test histograms\n");
fillData(path, curr, flann_index, testData, testLabels);
printf("predicting\n");
Mat1f testPredicted(numTestFiles, 1);
svm->predict(testData, testPredicted);
unsigned int correct = 0;
for (unsigned int i=0; i<numTestFiles; ++i)
{
if ((int)testPredicted(i, 0) == testLabels(i, 0))
{
correct++;
}
}
double accuracy = 1.0*correct/numTestFiles;
printf("correctly recognized actions: %f\n", accuracy);
res.push_back(accuracy);
}
double accuracy = 0.0;
for (unsigned int i=0; i<res.size(); ++i)
{
accuracy += res[i];
}
printf("average: %f\n", accuracy/res.size());
return 0;
}

@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/datasetstools/ar_sports.hpp"
#include "opencv2/datasets/ar_sports.hpp"
#include <opencv2/core.hpp>
@ -51,7 +51,7 @@
using namespace std;
using namespace cv;
using namespace cv::datasetstools;
using namespace cv::datasets;
int main(int argc, char *argv[])
{

@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/datasetstools/fr_lfw.hpp"
#include "opencv2/datasets/fr_lfw.hpp"
#include <opencv2/core.hpp>
@ -50,7 +50,7 @@
using namespace std;
using namespace cv;
using namespace cv::datasetstools;
using namespace cv::datasets;
int main(int argc, char *argv[])
{

@ -0,0 +1,175 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2014, Itseez Inc, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Itseez Inc or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#include "opencv2/core.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/face.hpp"
#include "opencv2/datasets/fr_lfw.hpp"
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <map>
using namespace std;
using namespace cv;
using namespace cv::datasets;
using namespace cv::face;
map<string, int> people;
int getLabel(const string &imagePath);
int getLabel(const string &imagePath)
{
size_t pos = imagePath.find('/');
string curr = imagePath.substr(0, pos);
map<string, int>::iterator it = people.find(curr);
if (people.end() == it)
{
people.insert(make_pair(curr, (int)people.size()));
it = people.find(curr);
}
return (*it).second;
}
int main(int argc, const char *argv[])
{
const char *keys =
"{ help h usage ? | | show this message }"
"{ path p |true| path to dataset (lfw2 folder) }";
CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path"));
if (parser.has("help") || path=="true")
{
parser.printMessage();
return -1;
}
// These vectors hold the images and corresponding labels.
vector<Mat> images;
vector<int> labels;
// load dataset
Ptr<FR_lfw> dataset = FR_lfw::create();
dataset->load(path);
unsigned int numSplits = dataset->getNumSplits();
printf("splits number: %u\n", numSplits);
printf("train size: %u\n", (unsigned int)dataset->getTrain().size());
printf("test size: %u\n", (unsigned int)dataset->getTest().size());
for (unsigned int i=0; i<dataset->getTrain().size(); ++i)
{
FR_lfwObj *example = static_cast<FR_lfwObj *>(dataset->getTrain()[i].get());
int currNum = getLabel(example->image1);
Mat img = imread(path+example->image1, IMREAD_GRAYSCALE);
images.push_back(img);
labels.push_back(currNum);
currNum = getLabel(example->image2);
img = imread(path+example->image2, IMREAD_GRAYSCALE);
images.push_back(img);
labels.push_back(currNum);
}
// 2200 pairsDevTrain, first split: correct: 373, from: 600 -> 62.1667%
Ptr<FaceRecognizer> model = createLBPHFaceRecognizer();
// 2200 pairsDevTrain, first split: correct: correct: 369, from: 600 -> 61.5%
//Ptr<FaceRecognizer> model = createEigenFaceRecognizer();
// 2200 pairsDevTrain, first split: correct: 372, from: 600 -> 62%
//Ptr<FaceRecognizer> model = createFisherFaceRecognizer();
model->train(images, labels);
//string saveModelPath = "face-rec-model.txt";
//cout << "Saving the trained model to " << saveModelPath << endl;
//model->save(saveModelPath);
vector<double> p;
for (unsigned int j=0; j<numSplits; ++j)
{
unsigned int incorrect = 0, correct = 0;
vector < Ptr<Object> > &curr = dataset->getTest(j);
for (unsigned int i=0; i<curr.size(); ++i)
{
FR_lfwObj *example = static_cast<FR_lfwObj *>(curr[i].get());
//int currNum = getLabel(example->image1);
Mat img = imread(path+example->image1, IMREAD_GRAYSCALE);
int predictedLabel1 = model->predict(img);
//currNum = getLabel(example->image2);
img = imread(path+example->image2, IMREAD_GRAYSCALE);
int predictedLabel2 = model->predict(img);
if ((predictedLabel1 == predictedLabel2 && example->same) ||
(predictedLabel1 != predictedLabel2 && !example->same))
{
correct++;
} else
{
incorrect++;
}
}
p.push_back(1.0*correct/(correct+incorrect));
printf("correct: %u, from: %u -> %f\n", correct, correct+incorrect, p.back());
}
double mu = 0.0;
for (vector<double>::iterator it=p.begin(); it!=p.end(); ++it)
{
mu += *it;
}
mu /= p.size();
double sigma = 0.0;
for (vector<double>::iterator it=p.begin(); it!=p.end(); ++it)
{
sigma += (*it - mu)*(*it - mu);
}
sigma = sqrt(sigma/p.size());
double se = sigma/sqrt(p.size());
printf("estimated mean accuracy: %f and the standard error of the mean: %f\n", mu, se);
return 0;
}

@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/datasetstools/gr_chalearn.hpp"
#include "opencv2/datasets/gr_chalearn.hpp"
#include <opencv2/core.hpp>
@ -50,7 +50,7 @@
using namespace std;
using namespace cv;
using namespace cv::datasetstools;
using namespace cv::datasets;
int main(int argc, char *argv[])
{

@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/datasetstools/gr_skig.hpp"
#include "opencv2/datasets/gr_skig.hpp"
#include <opencv2/core.hpp>
@ -51,7 +51,7 @@
using namespace std;
using namespace cv;
using namespace cv::datasetstools;
using namespace cv::datasets;
int main(int argc, char *argv[])
{

@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/datasetstools/hpe_parse.hpp"
#include "opencv2/datasets/hpe_parse.hpp"
#include <opencv2/core.hpp>
@ -50,7 +50,7 @@
using namespace std;
using namespace cv;
using namespace cv::datasetstools;
using namespace cv::datasets;
int main(int argc, char *argv[])
{

@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/datasetstools/ir_affine.hpp"
#include "opencv2/datasets/ir_affine.hpp"
#include <opencv2/core.hpp>
@ -51,7 +51,7 @@
using namespace std;
using namespace cv;
using namespace cv::datasetstools;
using namespace cv::datasets;
int main(int argc, char *argv[])
{

@ -39,7 +39,7 @@
//
//M*/
#include "opencv2/datasetstools/ir_robot.hpp"
#include "opencv2/datasets/ir_robot.hpp"
#include <opencv2/core.hpp>
@ -50,7 +50,7 @@
using namespace std;
using namespace cv;
using namespace cv::datasetstools;
using namespace cv::datasets;
int main(int argc, char *argv[])
{

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save