Commit 17d73988 authored by dmitriy.anisimov's avatar dmitriy.anisimov

finished conversion project to module

parent 3787bf99
...@@ -24,7 +24,7 @@ _`"HMDB: A Large Human Motion Database"`: http://serre-lab.clps.brown.edu/resour ...@@ -24,7 +24,7 @@ _`"HMDB: A Large Human Motion Database"`: http://serre-lab.clps.brown.edu/resour
2. Unpack them. 2. Unpack them.
3. To load data run: ./ar_hmdb -p=/home/user/path_to_unpacked_folders/ 3. To load data run: ./opencv/build/bin/example_datasetstools_ar_hmdb -p=/home/user/path_to_unpacked_folders/
ar_sports ar_sports
========= =========
...@@ -37,7 +37,7 @@ _`"Sports-1M Dataset"`: http://cs.stanford.edu/people/karpathy/deepvideo/ ...@@ -37,7 +37,7 @@ _`"Sports-1M Dataset"`: http://cs.stanford.edu/people/karpathy/deepvideo/
1. From link above download dataset files (git clone https://code.google.com/p/sports-1m-dataset/). 1. From link above download dataset files (git clone https://code.google.com/p/sports-1m-dataset/).
2. To load data run: ./ar_sports -p=/home/user/path_to_downloaded_folders/ 2. To load data run: ./opencv/build/bin/example_datasetstools_ar_sports -p=/home/user/path_to_downloaded_folders/
Face Recognition Face Recognition
---------------- ----------------
...@@ -55,7 +55,7 @@ _`"Labeled Faces in the Wild-a"`: http://www.openu.ac.il/home/hassner/data/lfwa/ ...@@ -55,7 +55,7 @@ _`"Labeled Faces in the Wild-a"`: http://www.openu.ac.il/home/hassner/data/lfwa/
2. Unpack it. 2. Unpack it.
3. To load data run: ./fr_lfw -p=/home/user/path_to_unpacked_folder/lfw2/ 3. To load data run: ./opencv/build/bin/example_datasetstools_fr_lfw -p=/home/user/path_to_unpacked_folder/lfw2/
Gesture Recognition Gesture Recognition
------------------- -------------------
...@@ -73,7 +73,7 @@ _`"ChaLearn Looking at People"`: http://gesture.chalearn.org/ ...@@ -73,7 +73,7 @@ _`"ChaLearn Looking at People"`: http://gesture.chalearn.org/
2. Unpack train archives Train1.zip-Train5.zip to one folder (currently loading validation files wasn't implemented) 2. Unpack train archives Train1.zip-Train5.zip to one folder (currently loading validation files wasn't implemented)
3. To load data run: ./gr_chalearn -p=/home/user/path_to_unpacked_folder/ 3. To load data run: ./opencv/build/bin/example_datasetstools_gr_chalearn -p=/home/user/path_to_unpacked_folder/
gr_skig gr_skig
======= =======
...@@ -88,7 +88,7 @@ _`"Sheffield Kinect Gesture Dataset"`: http://lshao.staff.shef.ac.uk/data/Sheffi ...@@ -88,7 +88,7 @@ _`"Sheffield Kinect Gesture Dataset"`: http://lshao.staff.shef.ac.uk/data/Sheffi
2. Unpack them. 2. Unpack them.
3. To load data run: ./gr_skig -p=/home/user/path_to_unpacked_folders/ 3. To load data run: ./opencv/build/bin/example_datasetstools_gr_skig -p=/home/user/path_to_unpacked_folders/
Human Pose Estimation Human Pose Estimation
--------------------- ---------------------
...@@ -106,7 +106,7 @@ _`"PARSE Dataset"`: http://www.ics.uci.edu/~dramanan/papers/parse/ ...@@ -106,7 +106,7 @@ _`"PARSE Dataset"`: http://www.ics.uci.edu/~dramanan/papers/parse/
2. Unpack it. 2. Unpack it.
3. To load data run: ./hpe_parse -p=/home/user/path_to_unpacked_folder/people_all/ 3. To load data run: ./opencv/build/bin/example_datasetstools_hpe_parse -p=/home/user/path_to_unpacked_folder/people_all/
Image Registration Image Registration
------------------ ------------------
...@@ -124,7 +124,7 @@ _`"Affine Covariant Regions Datasets"`: http://www.robots.ox.ac.uk/~vgg/data/dat ...@@ -124,7 +124,7 @@ _`"Affine Covariant Regions Datasets"`: http://www.robots.ox.ac.uk/~vgg/data/dat
2. Unpack them. 2. Unpack them.
3. To load data, for example, for "bark", run: ./ir_affine -p=/home/user/path_to_unpacked_folder/bark/ 3. To load data, for example, for "bark", run: ./opencv/build/bin/example_datasetstools_ir_affine -p=/home/user/path_to_unpacked_folder/bark/
ir_robot ir_robot
======== ========
...@@ -138,7 +138,7 @@ _`"Robot Data Set"`: http://roboimagedata.compute.dtu.dk/?page_id=24 ...@@ -138,7 +138,7 @@ _`"Robot Data Set"`: http://roboimagedata.compute.dtu.dk/?page_id=24
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.) 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. 2. Unpack them to one folder.
3. To load data run: ./ir_robot -p=/home/user/path_to_unpacked_folder/ 3. To load data run: ./opencv/build/bin/example_datasetstools_ir_robot -p=/home/user/path_to_unpacked_folder/
Image Segmentation Image Segmentation
------------------ ------------------
...@@ -156,7 +156,7 @@ _`"The Berkeley Segmentation Dataset and Benchmark"`: https://www.eecs.berkeley. ...@@ -156,7 +156,7 @@ _`"The Berkeley Segmentation Dataset and Benchmark"`: https://www.eecs.berkeley.
2. Unpack them. 2. Unpack them.
3. To load data run: ./is_bsds -p=/home/user/path_to_unpacked_folder/BSDS300/ 3. To load data run: ./opencv/build/bin/example_datasetstools_is_bsds -p=/home/user/path_to_unpacked_folder/BSDS300/
is_weizmann is_weizmann
=========== ===========
...@@ -171,7 +171,7 @@ _`"Weizmann Segmentation Evaluation Database"`: http://www.wisdom.weizmann.ac.il ...@@ -171,7 +171,7 @@ _`"Weizmann Segmentation Evaluation Database"`: http://www.wisdom.weizmann.ac.il
2. Unpack them. 2. Unpack them.
3. To load data, for example, for 1 object dataset, run: ./is_weizmann -p=/home/user/path_to_unpacked_folder/1obj/ 3. To load data, for example, for 1 object dataset, run: ./opencv/build/bin/example_datasetstools_is_weizmann -p=/home/user/path_to_unpacked_folder/1obj/
Multiview Stereo Matching Multiview Stereo Matching
------------------------- -------------------------
...@@ -189,7 +189,7 @@ _`"EPFL Multi-View Stereo"`: http://cvlabwww.epfl.ch/~strecha/multiview/denseMVS ...@@ -189,7 +189,7 @@ _`"EPFL Multi-View Stereo"`: http://cvlabwww.epfl.ch/~strecha/multiview/denseMVS
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/ 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: ./msm_epfl -p=/home/user/path_to_unpacked_folder/fountain/ 3. To load data, for example, for "fountain", run: ./opencv/build/bin/example_datasetstools_msm_epfl -p=/home/user/path_to_unpacked_folder/fountain/
msm_middlebury msm_middlebury
============== ==============
...@@ -204,7 +204,7 @@ _`"Stereo – Middlebury Computer Vision"`: http://vision.middlebury.edu/mview/ ...@@ -204,7 +204,7 @@ _`"Stereo – Middlebury Computer Vision"`: http://vision.middlebury.edu/mview/
2. Unpack them. 2. Unpack them.
3. To load data, for example "temple" dataset, run: ./msm_middlebury -p=/home/user/path_to_unpacked_folder/temple/ 3. To load data, for example "temple" dataset, run: ./opencv/build/bin/example_datasetstools_msm_middlebury -p=/home/user/path_to_unpacked_folder/temple/
Object Recognition Object Recognition
------------------ ------------------
...@@ -224,7 +224,7 @@ Currently implemented loading full list with urls. Planned to implement dataset ...@@ -224,7 +224,7 @@ Currently implemented loading full list with urls. Planned to implement dataset
2. Unpack it. 2. Unpack it.
3. To load data run: ./or_imagenet -p=/home/user/path_to_unpacked_file/ 3. To load data run: ./opencv/build/bin/example_datasetstools_or_imagenet -p=/home/user/path_to_unpacked_file/
or_sun or_sun
====== ======
...@@ -241,7 +241,7 @@ Currently implemented loading "Scene Recognition Benchmark. SUN397". Planned to ...@@ -241,7 +241,7 @@ Currently implemented loading "Scene Recognition Benchmark. SUN397". Planned to
2. Unpack it. 2. Unpack it.
3. To load data run: ./or_sun -p=/home/user/path_to_unpacked_folder/SUN397/ 3. To load data run: ./opencv/build/bin/example_datasetstools_or_sun -p=/home/user/path_to_unpacked_folder/SUN397/
SLAM SLAM
---- ----
...@@ -259,7 +259,7 @@ _`"KITTI Vision Benchmark"`: http://www.cvlibs.net/datasets/kitti/eval_odometry. ...@@ -259,7 +259,7 @@ _`"KITTI Vision Benchmark"`: http://www.cvlibs.net/datasets/kitti/eval_odometry.
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. 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: ./slam_kitti -p=/home/user/path_to_unpacked_folder/dataset/ 3. To load data run: ./opencv/build/bin/example_datasetstools_slam_kitti -p=/home/user/path_to_unpacked_folder/dataset/
slam_tumindoor slam_tumindoor
============== ==============
...@@ -274,7 +274,7 @@ _`"TUMindoor Dataset"`: http://www.navvis.lmt.ei.tum.de/dataset/ ...@@ -274,7 +274,7 @@ _`"TUMindoor Dataset"`: http://www.navvis.lmt.ei.tum.de/dataset/
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/. 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: ./slam_tumindoor -p=/home/user/path_to_unpacked_folders/ 3. To load each dataset run: ./opencv/build/bin/example_datasetstools_slam_tumindoor -p=/home/user/path_to_unpacked_folders/
Text Recognition Text Recognition
---------------- ----------------
...@@ -294,7 +294,7 @@ _`"The Chars74K Dataset"`: http://www.ee.surrey.ac.uk/CVSSP/demos/chars74k/ ...@@ -294,7 +294,7 @@ _`"The Chars74K Dataset"`: http://www.ee.surrey.ac.uk/CVSSP/demos/chars74k/
3. Move *.m files from folder ListsTXT/ to appropriate folder. For example, English/list_English_Img.m for EnglishImg.tgz. 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: ./tr_chars -p=/home/user/path_to_unpacked_folder/English/ 4. To load data, for example "EnglishImg", run: ./opencv/build/bin/example_datasetstools_tr_chars -p=/home/user/path_to_unpacked_folder/English/
tr_svt tr_svt
====== ======
...@@ -309,5 +309,5 @@ _`"The Street View Text Dataset"`: http://vision.ucsd.edu/~kai/svt/ ...@@ -309,5 +309,5 @@ _`"The Street View Text Dataset"`: http://vision.ucsd.edu/~kai/svt/
2. Unpack it. 2. Unpack it.
3. To load data run: ./tr_svt -p=/home/user/path_to_unpacked_folder/svt/svt1/ 3. To load data run: ./opencv/build/bin/example_datasetstools_tr_svt -p=/home/user/path_to_unpacked_folder/svt/svt1/
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
<ol class="last arabic simple"> <ol class="last arabic simple">
<li>From link above download dataset files: hmdb51_org.rar &amp; test_train_splits.rar.</li> <li>From link above download dataset files: hmdb51_org.rar &amp; test_train_splits.rar.</li>
<li>Unpack them.</li> <li>Unpack them.</li>
<li>To load data run: ./ar_hmdb -p=/home/user/path_to_unpacked_folders/</li> <li>To load data run: ./opencv/build/bin/example_datasetstools_ar_hmdb -p=/home/user/path_to_unpacked_folders/</li>
</ol> </ol>
</div> </div>
</div> </div>
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<p>Usage</p> <p>Usage</p>
<ol class="last arabic simple"> <ol class="last arabic simple">
<li>From link above download dataset files (git clone <a class="reference external" href="https://code.google.com/p/sports-1m-dataset/">https://code.google.com/p/sports-1m-dataset/</a>).</li> <li>From link above download dataset files (git clone <a class="reference external" href="https://code.google.com/p/sports-1m-dataset/">https://code.google.com/p/sports-1m-dataset/</a>).</li>
<li>To load data run: ./ar_sports -p=/home/user/path_to_downloaded_folders/</li> <li>To load data run: ./opencv/build/bin/example_datasetstools_ar_sports -p=/home/user/path_to_downloaded_folders/</li>
</ol> </ol>
</div> </div>
</div> </div>
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
<ol class="last arabic simple"> <ol class="last arabic simple">
<li>From link above download dataset file: lfwa.tar.gz.</li> <li>From link above download dataset file: lfwa.tar.gz.</li>
<li>Unpack it.</li> <li>Unpack it.</li>
<li>To load data run: ./fr_lfw -p=/home/user/path_to_unpacked_folder/lfw2/</li> <li>To load data run: ./opencv/build/bin/example_datasetstools_fr_lfw -p=/home/user/path_to_unpacked_folder/lfw2/</li>
</ol> </ol>
</div> </div>
</div> </div>
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
<ol class="last arabic simple"> <ol class="last arabic simple">
<li>Follow instruction from site above, download files for dataset &#8220;Track 3: Gesture Recognition&#8221;: Train1.zip-Train5.zip, Validation1.zip-Validation3.zip (Register on site: www.codalab.org and accept the terms and conditions of competition: <a class="reference external" href="https://www.codalab.org/competitions/991#learn_the_details">https://www.codalab.org/competitions/991#learn_the_details</a> There are three mirrors for downloading dataset files. When I downloaded data only mirror: &#8220;Universitat Oberta de Catalunya&#8221; works).</li> <li>Follow instruction from site above, download files for dataset &#8220;Track 3: Gesture Recognition&#8221;: Train1.zip-Train5.zip, Validation1.zip-Validation3.zip (Register on site: www.codalab.org and accept the terms and conditions of competition: <a class="reference external" href="https://www.codalab.org/competitions/991#learn_the_details">https://www.codalab.org/competitions/991#learn_the_details</a> There are three mirrors for downloading dataset files. When I downloaded data only mirror: &#8220;Universitat Oberta de Catalunya&#8221; works).</li>
<li>Unpack train archives Train1.zip-Train5.zip to one folder (currently loading validation files wasn&#8217;t implemented)</li> <li>Unpack train archives Train1.zip-Train5.zip to one folder (currently loading validation files wasn&#8217;t implemented)</li>
<li>To load data run: ./gr_chalearn -p=/home/user/path_to_unpacked_folder/</li> <li>To load data run: ./opencv/build/bin/example_datasetstools_gr_chalearn -p=/home/user/path_to_unpacked_folder/</li>
</ol> </ol>
</div> </div>
</div> </div>
...@@ -118,7 +118,7 @@ ...@@ -118,7 +118,7 @@
<ol class="last arabic simple"> <ol class="last arabic simple">
<li>From link above download dataset files: subject1_dep.7z-subject6_dep.7z, subject1_rgb.7z-subject6_rgb.7z.</li> <li>From link above download dataset files: subject1_dep.7z-subject6_dep.7z, subject1_rgb.7z-subject6_rgb.7z.</li>
<li>Unpack them.</li> <li>Unpack them.</li>
<li>To load data run: ./gr_skig -p=/home/user/path_to_unpacked_folders/</li> <li>To load data run: ./opencv/build/bin/example_datasetstools_gr_skig -p=/home/user/path_to_unpacked_folders/</li>
</ol> </ol>
</div> </div>
</div> </div>
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
<ol class="last arabic simple"> <ol class="last arabic simple">
<li>From link above download dataset file: people.zip.</li> <li>From link above download dataset file: people.zip.</li>
<li>Unpack it.</li> <li>Unpack it.</li>
<li>To load data run: ./hpe_parse -p=/home/user/path_to_unpacked_folder/people_all/</li> <li>To load data run: ./opencv/build/bin/example_datasetstools_hpe_parse -p=/home/user/path_to_unpacked_folder/people_all/</li>
</ol> </ol>
</div> </div>
</div> </div>
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
<ol class="last arabic simple"> <ol class="last arabic simple">
<li>From link above download dataset files: bark\bikes\boat\graf\leuven\trees\ubc\wall.tar.gz.</li> <li>From link above download dataset files: bark\bikes\boat\graf\leuven\trees\ubc\wall.tar.gz.</li>
<li>Unpack them.</li> <li>Unpack them.</li>
<li>To load data, for example, for &#8220;bark&#8221;, run: ./ir_affine -p=/home/user/path_to_unpacked_folder/bark/</li> <li>To load data, for example, for &#8220;bark&#8221;, run: ./opencv/build/bin/example_datasetstools_ir_affine -p=/home/user/path_to_unpacked_folder/bark/</li>
</ol> </ol>
</div> </div>
</div> </div>
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
<ol class="last arabic simple"> <ol class="last arabic simple">
<li>From link above download files for dataset &#8220;Point Feature Data Set – 2010&#8221;: 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.)</li> <li>From link above download files for dataset &#8220;Point Feature Data Set – 2010&#8221;: 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.)</li>
<li>Unpack them to one folder.</li> <li>Unpack them to one folder.</li>
<li>To load data run: ./ir_robot -p=/home/user/path_to_unpacked_folder/</li> <li>To load data run: ./opencv/build/bin/example_datasetstools_ir_robot -p=/home/user/path_to_unpacked_folder/</li>
</ol> </ol>
</div> </div>
</div> </div>
...@@ -183,7 +183,7 @@ ...@@ -183,7 +183,7 @@
<ol class="last arabic simple"> <ol class="last arabic simple">
<li>From link above download dataset files: BSDS300-human.tgz &amp; BSDS300-images.tgz.</li> <li>From link above download dataset files: BSDS300-human.tgz &amp; BSDS300-images.tgz.</li>
<li>Unpack them.</li> <li>Unpack them.</li>
<li>To load data run: ./is_bsds -p=/home/user/path_to_unpacked_folder/BSDS300/</li> <li>To load data run: ./opencv/build/bin/example_datasetstools_is_bsds -p=/home/user/path_to_unpacked_folder/BSDS300/</li>
</ol> </ol>
</div> </div>
</div> </div>
...@@ -197,7 +197,7 @@ ...@@ -197,7 +197,7 @@
<ol class="last arabic simple"> <ol class="last arabic simple">
<li>From link above download dataset files: Weizmann_Seg_DB_1obj.ZIP &amp; Weizmann_Seg_DB_2obj.ZIP.</li> <li>From link above download dataset files: Weizmann_Seg_DB_1obj.ZIP &amp; Weizmann_Seg_DB_2obj.ZIP.</li>
<li>Unpack them.</li> <li>Unpack them.</li>
<li>To load data, for example, for 1 object dataset, run: ./is_weizmann -p=/home/user/path_to_unpacked_folder/1obj/</li> <li>To load data, for example, for 1 object dataset, run: ./opencv/build/bin/example_datasetstools_is_weizmann -p=/home/user/path_to_unpacked_folder/1obj/</li>
</ol> </ol>
</div> </div>
</div> </div>
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
<ol class="last arabic simple"> <ol class="last arabic simple">
<li>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.</li> <li>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.</li>
<li>Unpack them in separate folder for each object. For example, for &#8220;fountain&#8221;, in folder fountain/ : fountain_dense_bounding.tar.gz -&gt; bounding/, fountain_dense_cameras.tar.gz -&gt; camera/, fountain_dense_images.tar.gz -&gt; png/, fountain_dense_p.tar.gz -&gt; P/</li> <li>Unpack them in separate folder for each object. For example, for &#8220;fountain&#8221;, in folder fountain/ : fountain_dense_bounding.tar.gz -&gt; bounding/, fountain_dense_cameras.tar.gz -&gt; camera/, fountain_dense_images.tar.gz -&gt; png/, fountain_dense_p.tar.gz -&gt; P/</li>
<li>To load data, for example, for &#8220;fountain&#8221;, run: ./msm_epfl -p=/home/user/path_to_unpacked_folder/fountain/</li> <li>To load data, for example, for &#8220;fountain&#8221;, run: ./opencv/build/bin/example_datasetstools_msm_epfl -p=/home/user/path_to_unpacked_folder/fountain/</li>
</ol> </ol>
</div> </div>
</div> </div>
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
<ol class="last arabic simple"> <ol class="last arabic simple">
<li>From link above download dataset files: dino\dinoRing\dinoSparseRing\temple\templeRing\templeSparseRing.zip</li> <li>From link above download dataset files: dino\dinoRing\dinoSparseRing\temple\templeRing\templeSparseRing.zip</li>
<li>Unpack them.</li> <li>Unpack them.</li>
<li>To load data, for example &#8220;temple&#8221; dataset, run: ./msm_middlebury -p=/home/user/path_to_unpacked_folder/temple/</li> <li>To load data, for example &#8220;temple&#8221; dataset, run: ./opencv/build/bin/example_datasetstools_msm_middlebury -p=/home/user/path_to_unpacked_folder/temple/</li>
</ol> </ol>
</div> </div>
</div> </div>
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
<ol class="last arabic simple"> <ol class="last arabic simple">
<li>From link above download dataset file: imagenet_fall11_urls.tgz</li> <li>From link above download dataset file: imagenet_fall11_urls.tgz</li>
<li>Unpack it.</li> <li>Unpack it.</li>
<li>To load data run: ./or_imagenet -p=/home/user/path_to_unpacked_file/</li> <li>To load data run: ./opencv/build/bin/example_datasetstools_or_imagenet -p=/home/user/path_to_unpacked_file/</li>
</ol> </ol>
</div> </div>
</div> </div>
...@@ -261,7 +261,7 @@ ...@@ -261,7 +261,7 @@
<ol class="last arabic simple"> <ol class="last arabic simple">
<li>From link above download dataset file: SUN397.tar</li> <li>From link above download dataset file: SUN397.tar</li>
<li>Unpack it.</li> <li>Unpack it.</li>
<li>To load data run: ./or_sun -p=/home/user/path_to_unpacked_folder/SUN397/</li> <li>To load data run: ./opencv/build/bin/example_datasetstools_or_sun -p=/home/user/path_to_unpacked_folder/SUN397/</li>
</ol> </ol>
</div> </div>
</div> </div>
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
<ol class="last arabic simple"> <ol class="last arabic simple">
<li>From link above download &#8220;Odometry&#8221; dataset files: data_odometry_gray\data_odometry_color\data_odometry_velodyne\data_odometry_poses\data_odometry_calib.zip.</li> <li>From link above download &#8220;Odometry&#8221; dataset files: data_odometry_gray\data_odometry_color\data_odometry_velodyne\data_odometry_poses\data_odometry_calib.zip.</li>
<li>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 &amp; times.txt. These two last files will be replaced after unpacking data_odometry_calib.zip at the end.</li> <li>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 &amp; times.txt. These two last files will be replaced after unpacking data_odometry_calib.zip at the end.</li>
<li>To load data run: ./slam_kitti -p=/home/user/path_to_unpacked_folder/dataset/</li> <li>To load data run: ./opencv/build/bin/example_datasetstools_slam_kitti -p=/home/user/path_to_unpacked_folder/dataset/</li>
</ol> </ol>
</div> </div>
</div> </div>
...@@ -292,7 +292,7 @@ ...@@ -292,7 +292,7 @@
<ol class="last arabic simple"> <ol class="last arabic simple">
<li>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)</li> <li>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)</li>
<li>Unpack them in separate folder for each dataset. dslr.tar.bz2 -&gt; dslr/, info.tar.bz2 -&gt; info/, ladybug.tar.bz2 -&gt; ladybug/, pointcloud.tar.bz2 -&gt; pointcloud/.</li> <li>Unpack them in separate folder for each dataset. dslr.tar.bz2 -&gt; dslr/, info.tar.bz2 -&gt; info/, ladybug.tar.bz2 -&gt; ladybug/, pointcloud.tar.bz2 -&gt; pointcloud/.</li>
<li>To load each dataset run: ./slam_tumindoor -p=/home/user/path_to_unpacked_folders/</li> <li>To load each dataset run: ./opencv/build/bin/example_datasetstools_slam_tumindoor -p=/home/user/path_to_unpacked_folders/</li>
</ol> </ol>
</div> </div>
</div> </div>
...@@ -310,7 +310,7 @@ ...@@ -310,7 +310,7 @@
<li>From link above download dataset files: EnglishFnt\EnglishHnd\EnglishImg\KannadaHnd\KannadaImg.tgz, ListsTXT.tgz.</li> <li>From link above download dataset files: EnglishFnt\EnglishHnd\EnglishImg\KannadaHnd\KannadaImg.tgz, ListsTXT.tgz.</li>
<li>Unpack them.</li> <li>Unpack them.</li>
<li>Move <a href="#id1"><span class="problematic" id="id2">*</span></a>.m files from folder ListsTXT/ to appropriate folder. For example, English/list_English_Img.m for EnglishImg.tgz.</li> <li>Move <a href="#id1"><span class="problematic" id="id2">*</span></a>.m files from folder ListsTXT/ to appropriate folder. For example, English/list_English_Img.m for EnglishImg.tgz.</li>
<li>To load data, for example &#8220;EnglishImg&#8221;, run: ./tr_chars -p=/home/user/path_to_unpacked_folder/English/</li> <li>To load data, for example &#8220;EnglishImg&#8221;, run: ./opencv/build/bin/example_datasetstools_tr_chars -p=/home/user/path_to_unpacked_folder/English/</li>
</ol> </ol>
</div> </div>
</div> </div>
...@@ -324,7 +324,7 @@ ...@@ -324,7 +324,7 @@
<ol class="last arabic simple"> <ol class="last arabic simple">
<li>From link above download dataset file: svt.zip.</li> <li>From link above download dataset file: svt.zip.</li>
<li>Unpack it.</li> <li>Unpack it.</li>
<li>To load data run: ./tr_svt -p=/home/user/path_to_unpacked_folder/svt/svt1/</li> <li>To load data run: ./opencv/build/bin/example_datasetstools_tr_svt -p=/home/user/path_to_unpacked_folder/svt/svt1/</li>
</ol> </ol>
</div> </div>
</div> </div>
......
...@@ -45,7 +45,14 @@ ...@@ -45,7 +45,14 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "dataset.h" #include "opencv2/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
struct action struct action
{ {
...@@ -53,7 +60,7 @@ struct action ...@@ -53,7 +60,7 @@ struct action
std::vector<std::string> videoNames; std::vector<std::string> videoNames;
}; };
class ar_hmdb : public dataset class CV_EXPORTS ar_hmdb : public dataset
{ {
public: public:
ar_hmdb() {} ar_hmdb() {}
...@@ -67,6 +74,11 @@ public: ...@@ -67,6 +74,11 @@ public:
private: private:
void loadDataset(std::string &path, unsigned int number = 0); void loadDataset(std::string &path, unsigned int number = 0);
void loadAction(std::string &fileName, std::vector<std::string> &train_, std::vector<std::string> &test_);
}; };
}
}
#endif #endif
...@@ -45,7 +45,14 @@ ...@@ -45,7 +45,14 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "dataset.h" #include "opencv2/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
struct element struct element
{ {
...@@ -53,7 +60,7 @@ struct element ...@@ -53,7 +60,7 @@ struct element
std::vector<unsigned int> labels; std::vector<unsigned int> labels;
}; };
class ar_sports : public dataset class CV_EXPORTS ar_sports : public dataset
{ {
public: public:
ar_sports() {} ar_sports() {}
...@@ -67,6 +74,11 @@ public: ...@@ -67,6 +74,11 @@ public:
private: private:
void loadDataset(std::string &path); void loadDataset(std::string &path);
void loadDatasetPart(std::string &fileName, std::vector<element> &dataset_);
}; };
}
}
#endif #endif
...@@ -44,7 +44,14 @@ ...@@ -44,7 +44,14 @@
#include <string> #include <string>
class dataset #include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
class CV_EXPORTS dataset
{ {
public: public:
dataset() {} dataset() {}
...@@ -53,4 +60,7 @@ public: ...@@ -53,4 +60,7 @@ public:
virtual void load(std::string &path, unsigned int number = 0) = 0; virtual void load(std::string &path, unsigned int number = 0) = 0;
}; };
}
}
#endif #endif
...@@ -45,7 +45,14 @@ ...@@ -45,7 +45,14 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "dataset.h" #include "opencv2/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
struct face struct face
{ {
...@@ -53,7 +60,7 @@ struct face ...@@ -53,7 +60,7 @@ struct face
std::vector<std::string> images; std::vector<std::string> images;
}; };
class fr_lfw : public dataset class CV_EXPORTS fr_lfw : public dataset
{ {
public: public:
fr_lfw() {} fr_lfw() {}
...@@ -68,4 +75,7 @@ private: ...@@ -68,4 +75,7 @@ private:
void loadDataset(std::string &path); void loadDataset(std::string &path);
}; };
}
}
#endif #endif
...@@ -45,7 +45,14 @@ ...@@ -45,7 +45,14 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "dataset.h" #include "opencv2/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
struct groundTruth struct groundTruth
{ {
...@@ -70,7 +77,7 @@ struct gesture ...@@ -70,7 +77,7 @@ struct gesture
std::vector<skeleton> skeletons; std::vector<skeleton> skeletons;
}; };
class gr_chalearn : public dataset class CV_EXPORTS gr_chalearn : public dataset
{ {
public: public:
gr_chalearn() {} gr_chalearn() {}
...@@ -85,4 +92,7 @@ private: ...@@ -85,4 +92,7 @@ private:
void loadDataset(std::string &path); void loadDataset(std::string &path);
}; };
}
}
#endif #endif
...@@ -45,16 +45,23 @@ ...@@ -45,16 +45,23 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "dataset.h" #include "opencv2/dataset.hpp"
struct gesture #include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
struct gestureSkig
{ {
std::string rgb; std::string rgb;
std::string dep; std::string dep;
unsigned char person, background, illumination, pose, actionType; unsigned char person, background, illumination, pose, actionType;
}; };
class gr_skig : public dataset class CV_EXPORTS gr_skig : public dataset
{ {
public: public:
gr_skig() {} gr_skig() {}
...@@ -63,10 +70,13 @@ public: ...@@ -63,10 +70,13 @@ public:
virtual void load(std::string &path, unsigned int number = 0); virtual void load(std::string &path, unsigned int number = 0);
std::vector<gesture> train; std::vector<gestureSkig> train;
private: private:
void loadDataset(std::string &path); void loadDataset(std::string &path);
}; };
}
}
#endif #endif
...@@ -45,9 +45,16 @@ ...@@ -45,9 +45,16 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "dataset.h" #include "opencv2/dataset.hpp"
class hpe_parse : public dataset #include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
class CV_EXPORTS hpe_parse : public dataset
{ {
public: public:
hpe_parse() {} hpe_parse() {}
...@@ -63,4 +70,7 @@ private: ...@@ -63,4 +70,7 @@ private:
void loadDataset(std::string &path); void loadDataset(std::string &path);
}; };
}
}
#endif #endif
...@@ -45,7 +45,14 @@ ...@@ -45,7 +45,14 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "dataset.h" #include "opencv2/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
struct imageParams struct imageParams
{ {
...@@ -53,7 +60,7 @@ struct imageParams ...@@ -53,7 +60,7 @@ struct imageParams
double mat[3][3]; double mat[3][3];
}; };
class ir_affine : public dataset class CV_EXPORTS ir_affine : public dataset
{ {
public: public:
ir_affine() {} ir_affine() {}
...@@ -68,4 +75,7 @@ private: ...@@ -68,4 +75,7 @@ private:
void loadDataset(std::string &path); void loadDataset(std::string &path);
}; };
}
}
#endif #endif
...@@ -45,7 +45,14 @@ ...@@ -45,7 +45,14 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "dataset.h" #include "opencv2/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
// calibration matrix from calibrationFile.mat // calibration matrix from calibrationFile.mat
// 2.8290e+03 0.0000e+00 8.0279e+02 // 2.8290e+03 0.0000e+00 8.0279e+02
...@@ -58,7 +65,7 @@ struct scene ...@@ -58,7 +65,7 @@ struct scene
std::vector<std::string> images; // TODO: implement more complex structure std::vector<std::string> images; // TODO: implement more complex structure
}; };
class ir_robot : public dataset class CV_EXPORTS ir_robot : public dataset
{ {
public: public:
ir_robot() {} ir_robot() {}
...@@ -73,4 +80,7 @@ private: ...@@ -73,4 +80,7 @@ private:
void loadDataset(std::string &path); void loadDataset(std::string &path);
}; };
}
}
#endif #endif
...@@ -45,9 +45,16 @@ ...@@ -45,9 +45,16 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "dataset.h" #include "opencv2/dataset.hpp"
class is_bsds : public dataset #include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
class CV_EXPORTS is_bsds : public dataset
{ {
public: public:
is_bsds() {} is_bsds() {}
...@@ -61,6 +68,11 @@ public: ...@@ -61,6 +68,11 @@ public:
private: private:
void loadDataset(std::string &path); void loadDataset(std::string &path);
void loadDatasetPart(std::string &fileName, std::vector<std::string> &dataset_);
}; };
}
}
#endif #endif
...@@ -45,7 +45,14 @@ ...@@ -45,7 +45,14 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "dataset.h" #include "opencv2/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
struct object struct object
{ {
...@@ -55,7 +62,7 @@ struct object ...@@ -55,7 +62,7 @@ struct object
std::string humanSeg; // TODO: read human segmented std::string humanSeg; // TODO: read human segmented
}; };
class is_weizmann : public dataset class CV_EXPORTS is_weizmann : public dataset
{ {
public: public:
is_weizmann() {} is_weizmann() {}
...@@ -70,4 +77,7 @@ private: ...@@ -70,4 +77,7 @@ private:
void loadDataset(std::string &path); void loadDataset(std::string &path);
}; };
}
}
#endif #endif
...@@ -45,15 +45,22 @@ ...@@ -45,15 +45,22 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "dataset.h" #include "opencv2/dataset.hpp"
struct object #include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
struct objectEpfl
{ {
std::string imageName; std::string imageName;
std::vector<double> bounding, camera, p; // TODO: implement better structures std::vector<double> bounding, camera, p; // TODO: implement better structures
}; };
class msm_epfl : public dataset class CV_EXPORTS msm_epfl : public dataset
{ {
public: public:
msm_epfl() {} msm_epfl() {}
...@@ -62,10 +69,15 @@ public: ...@@ -62,10 +69,15 @@ public:
virtual void load(std::string &path, unsigned int number = 0); virtual void load(std::string &path, unsigned int number = 0);
std::vector<object> train; std::vector<objectEpfl> train;
private: private:
void loadDataset(std::string &path); void loadDataset(std::string &path);
void readFileDouble(std::string fileName, std::vector<double> &out);
}; };
}
}
#endif #endif
...@@ -45,7 +45,14 @@ ...@@ -45,7 +45,14 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "dataset.h" #include "opencv2/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
struct cameraParam struct cameraParam
{ {
...@@ -55,7 +62,7 @@ struct cameraParam ...@@ -55,7 +62,7 @@ struct cameraParam
double t[3]; double t[3];
}; };
class msm_middlebury : public dataset class CV_EXPORTS msm_middlebury : public dataset
{ {
public: public:
msm_middlebury() {} msm_middlebury() {}
...@@ -70,4 +77,7 @@ private: ...@@ -70,4 +77,7 @@ private:
void loadDataset(std::string &path); void loadDataset(std::string &path);
}; };
}
}
#endif #endif
...@@ -46,16 +46,23 @@ ...@@ -46,16 +46,23 @@
#include <vector> #include <vector>
#include <set> #include <set>
#include "dataset.h" #include "opencv2/dataset.hpp"
struct object #include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
struct objectImagenet
{ {
std::string wnid; // TODO: string -> unsigned int std::string wnid; // TODO: string -> unsigned int
unsigned int id2; unsigned int id2;
std::string imageUrl; std::string imageUrl;
}; };
class or_imagenet : public dataset class CV_EXPORTS or_imagenet : public dataset
{ {
public: public:
or_imagenet() {} or_imagenet() {}
...@@ -64,11 +71,14 @@ public: ...@@ -64,11 +71,14 @@ public:
virtual void load(std::string &path, unsigned int number = 0); virtual void load(std::string &path, unsigned int number = 0);
std::vector<object> train; std::vector<objectImagenet> train;
std::set<std::string> wnids; std::set<std::string> wnids;
private: private:
void loadDataset(std::string &path); void loadDataset(std::string &path);
}; };
}
}
#endif #endif
...@@ -45,15 +45,22 @@ ...@@ -45,15 +45,22 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "dataset.h" #include "opencv2/dataset.hpp"
struct object #include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
struct objectSun
{ {
std::string name; std::string name;
std::vector<std::string> imageNames; std::vector<std::string> imageNames;
}; };
class or_sun : public dataset class CV_EXPORTS or_sun : public dataset
{ {
public: public:
or_sun() {} or_sun() {}
...@@ -62,10 +69,13 @@ public: ...@@ -62,10 +69,13 @@ public:
virtual void load(std::string &path, unsigned int number = 0); virtual void load(std::string &path, unsigned int number = 0);
std::vector<object> train; std::vector<objectSun> train;
private: private:
void loadDataset(std::string &path); void loadDataset(std::string &path);
}; };
}
}
#endif #endif
...@@ -45,7 +45,14 @@ ...@@ -45,7 +45,14 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "dataset.h" #include "opencv2/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
struct pose struct pose
{ {
...@@ -61,7 +68,7 @@ struct sequence ...@@ -61,7 +68,7 @@ struct sequence
std::vector<pose> posesArray; std::vector<pose> posesArray;
}; };
class slam_kitti : public dataset class CV_EXPORTS slam_kitti : public dataset
{ {
public: public:
slam_kitti() {} slam_kitti() {}
...@@ -76,4 +83,7 @@ private: ...@@ -76,4 +83,7 @@ private:
void loadDataset(std::string &path); void loadDataset(std::string &path);
}; };
}
}
#endif #endif
...@@ -45,7 +45,14 @@ ...@@ -45,7 +45,14 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "dataset.h" #include "opencv2/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
enum imageType enum imageType
{ {
...@@ -61,7 +68,7 @@ struct imageInfo ...@@ -61,7 +68,7 @@ struct imageInfo
imageType type; imageType type;
}; };
class slam_tumindoor : public dataset class CV_EXPORTS slam_tumindoor : public dataset
{ {
public: public:
slam_tumindoor() {} slam_tumindoor() {}
...@@ -76,4 +83,7 @@ private: ...@@ -76,4 +83,7 @@ private:
void loadDataset(std::string &path); void loadDataset(std::string &path);
}; };
}
}
#endif #endif
...@@ -45,7 +45,14 @@ ...@@ -45,7 +45,14 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "dataset.h" #include "opencv2/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
struct character struct character
{ {
...@@ -53,7 +60,7 @@ struct character ...@@ -53,7 +60,7 @@ struct character
unsigned int label; unsigned int label;
}; };
class tr_chars : public dataset class CV_EXPORTS tr_chars : public dataset
{ {
public: public:
tr_chars() {} tr_chars() {}
...@@ -67,6 +74,11 @@ public: ...@@ -67,6 +74,11 @@ public:
private: private:
void loadDataset(std::string &path, unsigned int number = 0); void loadDataset(std::string &path, unsigned int number = 0);
void parseLine(std::string &line, std::vector<int> &currSet, unsigned int number);
}; };
}
}
#endif #endif
...@@ -45,7 +45,14 @@ ...@@ -45,7 +45,14 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "dataset.h" #include "opencv2/dataset.hpp"
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
struct tag struct tag
{ {
...@@ -60,7 +67,7 @@ struct image ...@@ -60,7 +67,7 @@ struct image
std::vector<tag> tags; std::vector<tag> tags;
}; };
class tr_svt : public dataset class CV_EXPORTS tr_svt : public dataset
{ {
public: public:
tr_svt() {} tr_svt() {}
...@@ -74,6 +81,11 @@ public: ...@@ -74,6 +81,11 @@ public:
private: private:
void loadDataset(std::string &path); void loadDataset(std::string &path);
void xmlParse(std::string &set, std::vector<image> &out);
}; };
}
}
#endif #endif
...@@ -45,8 +45,18 @@ ...@@ -45,8 +45,18 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include <opencv2/core.hpp>
namespace cv
{
namespace datasetstools
{
void split(std::string s, std::vector<std::string> &elems, char delim); void split(std::string s, std::vector<std::string> &elems, char delim);
void getDirList(std::string &dirName, std::vector<std::string> &fileNames); void getDirList(std::string &dirName, std::vector<std::string> &fileNames);
}
}
#endif #endif
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
// //
//M*/ //M*/
#include "opencv2/ar_hmdb.h" #include "opencv2/ar_hmdb.hpp"
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#include <cstdio> #include <cstdio>
...@@ -48,13 +49,15 @@ ...@@ -48,13 +49,15 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
using namespace cv;
using namespace cv::datasetstools;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to dataset }"; "{ path p |true| path to dataset }";
cv::CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
if (parser.has("help") || path=="true") if (parser.has("help") || path=="true")
{ {
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
// //
//M*/ //M*/
#include "opencv2/ar_sports.h" #include "opencv2/ar_sports.hpp"
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#include <cstdio> #include <cstdio>
...@@ -49,13 +50,15 @@ ...@@ -49,13 +50,15 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
using namespace cv;
using namespace cv::datasetstools;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to dataset description }"; "{ path p |true| path to dataset description }";
cv::CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
if (parser.has("help") || path=="true") if (parser.has("help") || path=="true")
{ {
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
// //
//M*/ //M*/
#include "opencv2/fr_lfw.h" #include "opencv2/fr_lfw.hpp"
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#include <cstdio> #include <cstdio>
...@@ -48,13 +49,15 @@ ...@@ -48,13 +49,15 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
using namespace cv;
using namespace cv::datasetstools;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to dataset (lfw2 folder) }"; "{ path p |true| path to dataset (lfw2 folder) }";
cv::CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
if (parser.has("help") || path=="true") if (parser.has("help") || path=="true")
{ {
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
// //
//M*/ //M*/
#include "opencv2/gr_chalearn.h" #include "opencv2/gr_chalearn.hpp"
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#include <cstdio> #include <cstdio>
...@@ -48,13 +49,15 @@ ...@@ -48,13 +49,15 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
using namespace cv;
using namespace cv::datasetstools;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to dataset folder }"; "{ path p |true| path to dataset folder }";
cv::CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
if (parser.has("help") || path=="true") if (parser.has("help") || path=="true")
{ {
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
// //
//M*/ //M*/
#include "opencv2/gr_skig.h" #include "opencv2/gr_skig.hpp"
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#include <cstdio> #include <cstdio>
...@@ -49,13 +50,15 @@ ...@@ -49,13 +50,15 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
using namespace cv;
using namespace cv::datasetstools;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to dataset (subject* folders) }"; "{ path p |true| path to dataset (subject* folders) }";
cv::CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
if (parser.has("help") || path=="true") if (parser.has("help") || path=="true")
{ {
...@@ -68,7 +71,7 @@ int main(int argc, char *argv[]) ...@@ -68,7 +71,7 @@ int main(int argc, char *argv[])
// *************** // ***************
// dataset contains pair of rgb\dep images // dataset contains pair of rgb\dep images
// For example, let output train size and first element. // For example, let output train size and first element.
gesture &example = dataset.train[0]; gestureSkig &example = dataset.train[0];
printf("train size: %u\n", (unsigned int)dataset.train.size()); printf("train size: %u\n", (unsigned int)dataset.train.size());
printf("first train image:\nrgb: %s\ndep: %s\n", example.rgb.c_str(), example.dep.c_str()); printf("first train image:\nrgb: %s\ndep: %s\n", example.rgb.c_str(), example.dep.c_str());
printf("person: %u, backgroud: %u, illumination: %u, pose: %u, actionType: %u\n", printf("person: %u, backgroud: %u, illumination: %u, pose: %u, actionType: %u\n",
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
// //
//M*/ //M*/
#include "opencv2/hpe_parse.h" #include "opencv2/hpe_parse.hpp"
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#include <cstdio> #include <cstdio>
...@@ -48,13 +49,15 @@ ...@@ -48,13 +49,15 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
using namespace cv;
using namespace cv::datasetstools;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to dataset (people_all folder) }"; "{ path p |true| path to dataset (people_all folder) }";
cv::CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
if (parser.has("help") || path=="true") if (parser.has("help") || path=="true")
{ {
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
// //
//M*/ //M*/
#include "opencv2/ir_affine.h" #include "opencv2/ir_affine.hpp"
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#include <cstdio> #include <cstdio>
...@@ -49,13 +50,15 @@ ...@@ -49,13 +50,15 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
using namespace cv;
using namespace cv::datasetstools;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to dataset folder }"; "{ path p |true| path to dataset folder }";
cv::CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
if (parser.has("help") || path=="true") if (parser.has("help") || path=="true")
{ {
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
// //
//M*/ //M*/
#include "opencv2/ir_robot.h" #include "opencv2/ir_robot.hpp"
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#include <cstdio> #include <cstdio>
...@@ -48,13 +49,15 @@ ...@@ -48,13 +49,15 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
using namespace cv;
using namespace cv::datasetstools;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to dataset folders }"; "{ path p |true| path to dataset folders }";
cv::CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
if (parser.has("help") || path=="true") if (parser.has("help") || path=="true")
{ {
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
// //
//M*/ //M*/
#include "opencv2/is_bsds.h" #include "opencv2/is_bsds.hpp"
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#include <cstdio> #include <cstdio>
...@@ -48,13 +49,15 @@ ...@@ -48,13 +49,15 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
using namespace cv;
using namespace cv::datasetstools;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to dataset (images, iids_train.txt, iids_test.txt) }"; "{ path p |true| path to dataset (images, iids_train.txt, iids_test.txt) }";
cv::CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
if (parser.has("help") || path=="true") if (parser.has("help") || path=="true")
{ {
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
// //
//M*/ //M*/
#include "opencv2/is_weizmann.h" #include "opencv2/is_weizmann.hpp"
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#include <cstdio> #include <cstdio>
...@@ -48,13 +49,15 @@ ...@@ -48,13 +49,15 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
using namespace cv;
using namespace cv::datasetstools;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to dataset (1obj/2obj folders) }"; "{ path p |true| path to dataset (1obj/2obj folders) }";
cv::CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
if (parser.has("help") || path=="true") if (parser.has("help") || path=="true")
{ {
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
// //
//M*/ //M*/
#include "opencv2/msm_epfl.h" #include "opencv2/msm_epfl.hpp"
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#include <cstdio> #include <cstdio>
...@@ -48,13 +49,15 @@ ...@@ -48,13 +49,15 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
using namespace cv;
using namespace cv::datasetstools;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to dataset (bounding/, camera/, P/, png/ folders) }"; "{ path p |true| path to dataset (bounding/, camera/, P/, png/ folders) }";
cv::CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
if (parser.has("help") || path=="true") if (parser.has("help") || path=="true")
{ {
...@@ -68,7 +71,7 @@ int main(int argc, char *argv[]) ...@@ -68,7 +71,7 @@ int main(int argc, char *argv[])
// dataset contains all information for each image. // dataset contains all information for each image.
// For example, let output dataset size and first object. // For example, let output dataset size and first object.
printf("dataset size: %u\n", (unsigned int)dataset.train.size()); printf("dataset size: %u\n", (unsigned int)dataset.train.size());
object &example = dataset.train[0]; objectEpfl &example = dataset.train[0];
printf("first image:\nname: %s\n", example.imageName.c_str()); printf("first image:\nname: %s\n", example.imageName.c_str());
printf("bounding:\n"); printf("bounding:\n");
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
// //
//M*/ //M*/
#include "opencv2/msm_middlebury.h" #include "opencv2/msm_middlebury.hpp"
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#include <cstdio> #include <cstdio>
...@@ -48,13 +49,15 @@ ...@@ -48,13 +49,15 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
using namespace cv;
using namespace cv::datasetstools;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to dataset description }"; "{ path p |true| path to dataset description }";
cv::CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
if (parser.has("help") || path=="true") if (parser.has("help") || path=="true")
{ {
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
// //
//M*/ //M*/
#include "opencv2/or_imagenet.h" #include "opencv2/or_imagenet.hpp"
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#include <cstdio> #include <cstdio>
...@@ -50,13 +51,15 @@ ...@@ -50,13 +51,15 @@
#include <set> #include <set>
using namespace std; using namespace std;
using namespace cv;
using namespace cv::datasetstools;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to file with urls: fall11_urls.txt }"; "{ path p |true| path to file with urls: fall11_urls.txt }";
cv::CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
if (parser.has("help") || path=="true") if (parser.has("help") || path=="true")
{ {
...@@ -71,7 +74,7 @@ int main(int argc, char *argv[]) ...@@ -71,7 +74,7 @@ int main(int argc, char *argv[])
// For example, let output dataset size and first object. // For example, let output dataset size and first object.
printf("dataset size: %u\n", (unsigned int)dataset.train.size()); printf("dataset size: %u\n", (unsigned int)dataset.train.size());
printf("wnids number: %u\n", (unsigned int)dataset.wnids.size()); printf("wnids number: %u\n", (unsigned int)dataset.wnids.size());
object &example = dataset.train[0]; objectImagenet &example = dataset.train[0];
printf("first object url: %s\n", example.imageUrl.c_str()); printf("first object url: %s\n", example.imageUrl.c_str());
printf("first object wnid: %s\n", example.wnid.c_str()); printf("first object wnid: %s\n", example.wnid.c_str());
printf("first object id2: %u\n", example.id2); printf("first object id2: %u\n", example.id2);
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
// //
//M*/ //M*/
#include "opencv2/or_sun.h" #include "opencv2/or_sun.hpp"
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#include <cstdio> #include <cstdio>
...@@ -48,13 +49,15 @@ ...@@ -48,13 +49,15 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
using namespace cv;
using namespace cv::datasetstools;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to dataset (SUN397 folder) }"; "{ path p |true| path to dataset (SUN397 folder) }";
cv::CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
if (parser.has("help") || path=="true") if (parser.has("help") || path=="true")
{ {
...@@ -68,7 +71,7 @@ int main(int argc, char *argv[]) ...@@ -68,7 +71,7 @@ int main(int argc, char *argv[])
// dataset contains for each object its images. // dataset contains for each object its images.
// For example, let output dataset size and last object. // For example, let output dataset size and last object.
printf("dataset size: %u\n", (unsigned int)dataset.train.size()); printf("dataset size: %u\n", (unsigned int)dataset.train.size());
object &example = dataset.train.back(); objectSun &example = dataset.train.back();
printf("last object name: %s\n", example.name.c_str()); printf("last object name: %s\n", example.name.c_str());
printf("last object images number: %u\n", (unsigned int)example.imageNames.size()); printf("last object images number: %u\n", (unsigned int)example.imageNames.size());
vector<string> &imageNames = example.imageNames; vector<string> &imageNames = example.imageNames;
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
// //
//M*/ //M*/
#include "opencv2/slam_kitti.h" #include "opencv2/slam_kitti.hpp"
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#include <cstdio> #include <cstdio>
...@@ -48,13 +49,15 @@ ...@@ -48,13 +49,15 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
using namespace cv;
using namespace cv::datasetstools;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to dataset folders }"; "{ path p |true| path to dataset folders }";
cv::CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
if (parser.has("help") || path=="true") if (parser.has("help") || path=="true")
{ {
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
// //
//M*/ //M*/
#include "opencv2/slam_tumindoor.h" #include "opencv2/slam_tumindoor.hpp"
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#include <cstdio> #include <cstdio>
...@@ -48,13 +49,15 @@ ...@@ -48,13 +49,15 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
using namespace cv;
using namespace cv::datasetstools;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to dataset folders }"; "{ path p |true| path to dataset folders }";
cv::CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
if (parser.has("help") || path=="true") if (parser.has("help") || path=="true")
{ {
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
// //
//M*/ //M*/
#include "opencv2/tr_chars.h" #include "opencv2/tr_chars.hpp"
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#include <cstdio> #include <cstdio>
...@@ -49,13 +50,15 @@ ...@@ -49,13 +50,15 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
using namespace cv;
using namespace cv::datasetstools;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to dataset description file: list_English_Img.m }"; "{ path p |true| path to dataset description file: list_English_Img.m }";
cv::CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
if (parser.has("help") || path=="true") if (parser.has("help") || path=="true")
{ {
......
...@@ -39,7 +39,8 @@ ...@@ -39,7 +39,8 @@
// //
//M*/ //M*/
#include "opencv2/tr_svt.h" #include "opencv2/tr_svt.hpp"
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#include <cstdio> #include <cstdio>
...@@ -49,13 +50,15 @@ ...@@ -49,13 +50,15 @@
#include <vector> #include <vector>
using namespace std; using namespace std;
using namespace cv;
using namespace cv::datasetstools;
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
"{ help h usage ? | | show this message }" "{ help h usage ? | | show this message }"
"{ path p |true| path to dataset xml files }"; "{ path p |true| path to dataset xml files }";
cv::CommandLineParser parser(argc, argv, keys); CommandLineParser parser(argc, argv, keys);
string path(parser.get<string>("path")); string path(parser.get<string>("path"));
if (parser.has("help") || path=="true") if (parser.has("help") || path=="true")
{ {
......
...@@ -39,16 +39,21 @@ ...@@ -39,16 +39,21 @@
// //
//M*/ //M*/
#include <opencv2/util.h> #include "opencv2/util.hpp"
#include <opencv2/ar_hmdb.h> #include "opencv2/ar_hmdb.hpp"
#include <cstdio> #include <cstdio>
#include <fstream> #include <fstream>
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
void loadAction(string &fileName, vector<string> &train, vector<string> &test) void ar_hmdb::loadAction(string &fileName, vector<string> &train_, vector<string> &test_)
{ {
ifstream infile(fileName.c_str()); ifstream infile(fileName.c_str());
string video, label; string video, label;
...@@ -56,11 +61,11 @@ void loadAction(string &fileName, vector<string> &train, vector<string> &test) ...@@ -56,11 +61,11 @@ void loadAction(string &fileName, vector<string> &train, vector<string> &test)
{ {
if ("1"==label) if ("1"==label)
{ {
train.push_back(video); train_.push_back(video);
} else } else
if ("2"==label) if ("2"==label)
{ {
test.push_back(video); test_.push_back(video);
} }
} }
} }
...@@ -102,3 +107,6 @@ void ar_hmdb::loadDataset(string &path, unsigned int number) ...@@ -102,3 +107,6 @@ void ar_hmdb::loadDataset(string &path, unsigned int number)
loadAction(fileName, train.back().videoNames, test.back().videoNames); loadAction(fileName, train.back().videoNames, test.back().videoNames);
} }
} }
}
}
...@@ -39,17 +39,22 @@ ...@@ -39,17 +39,22 @@
// //
//M*/ //M*/
#include <opencv2/util.h> #include "opencv2/util.hpp"
#include <opencv2/ar_sports.h> #include "opencv2/ar_sports.hpp"
#include <cstdio> #include <cstdio>
#include <cstdlib> // atoi #include <cstdlib> // atoi
#include <fstream> #include <fstream>
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
void loadDatasetPart(string &fileName, vector<element> &dataset) void ar_sports::loadDatasetPart(string &fileName, vector<element> &dataset_)
{ {
ifstream infile(fileName.c_str()); ifstream infile(fileName.c_str());
string videoUrl, labels; string videoUrl, labels;
...@@ -65,7 +70,7 @@ void loadDatasetPart(string &fileName, vector<element> &dataset) ...@@ -65,7 +70,7 @@ void loadDatasetPart(string &fileName, vector<element> &dataset)
curr.labels.push_back(atoi((*it).c_str())); curr.labels.push_back(atoi((*it).c_str()));
} }
dataset.push_back(curr); dataset_.push_back(curr);
} }
} }
...@@ -76,6 +81,11 @@ ar_sports::ar_sports(string &path) ...@@ -76,6 +81,11 @@ ar_sports::ar_sports(string &path)
void ar_sports::load(string &path, unsigned int number) void ar_sports::load(string &path, unsigned int number)
{ {
if (number!=0)
{
return;
}
loadDataset(path); loadDataset(path);
} }
...@@ -90,3 +100,6 @@ void ar_sports::loadDataset(string &path) ...@@ -90,3 +100,6 @@ void ar_sports::loadDataset(string &path)
// loading test video urls & labels // loading test video urls & labels
loadDatasetPart(testPath, test); loadDatasetPart(testPath, test);
} }
}
}
...@@ -39,13 +39,18 @@ ...@@ -39,13 +39,18 @@
// //
//M*/ //M*/
#include <opencv2/util.h> #include "opencv2/util.hpp"
#include <opencv2/fr_lfw.h> #include "opencv2/fr_lfw.hpp"
#include <cstdio> #include <cstdio>
#include <fstream> #include <fstream>
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
fr_lfw::fr_lfw(std::string &path) fr_lfw::fr_lfw(std::string &path)
...@@ -55,6 +60,11 @@ fr_lfw::fr_lfw(std::string &path) ...@@ -55,6 +60,11 @@ fr_lfw::fr_lfw(std::string &path)
void fr_lfw::load(string &path, unsigned int number) void fr_lfw::load(string &path, unsigned int number)
{ {
if (number!=0)
{
return;
}
loadDataset(path); loadDataset(path);
} }
...@@ -78,3 +88,6 @@ void fr_lfw::loadDataset(string &path) ...@@ -78,3 +88,6 @@ void fr_lfw::loadDataset(string &path)
train.push_back(curr); train.push_back(curr);
} }
} }
}
}
...@@ -39,14 +39,19 @@ ...@@ -39,14 +39,19 @@
// //
//M*/ //M*/
#include <opencv2/util.h> #include "opencv2/util.hpp"
#include <opencv2/gr_chalearn.h> #include "opencv2/gr_chalearn.hpp"
#include <cstdio> #include <cstdio>
#include <cstdlib> // atoi #include <cstdlib> // atoi
#include <fstream> #include <fstream>
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
gr_chalearn::gr_chalearn(std::string &path) gr_chalearn::gr_chalearn(std::string &path)
...@@ -56,6 +61,11 @@ gr_chalearn::gr_chalearn(std::string &path) ...@@ -56,6 +61,11 @@ gr_chalearn::gr_chalearn(std::string &path)
void gr_chalearn::load(string &path, unsigned int number) void gr_chalearn::load(string &path, unsigned int number)
{ {
if (number!=0)
{
return;
}
loadDataset(path); loadDataset(path);
} }
...@@ -87,13 +97,13 @@ void gr_chalearn::loadDataset(string &path) ...@@ -87,13 +97,13 @@ void gr_chalearn::loadDataset(string &path)
ifstream infileGroundTruth(fileGroundTruth.c_str()); ifstream infileGroundTruth(fileGroundTruth.c_str());
while (getline(infileGroundTruth, line)) while (getline(infileGroundTruth, line))
{ {
vector<string> elems; vector<string> elems2;
split(line, elems, ','); split(line, elems2, ',');
groundTruth currGroundTruth; groundTruth currGroundTruth;
currGroundTruth.gestureID = atoi(elems[0].c_str()); currGroundTruth.gestureID = atoi(elems2[0].c_str());
currGroundTruth.initialFrame = atoi(elems[1].c_str()); currGroundTruth.initialFrame = atoi(elems2[1].c_str());
currGroundTruth.lastFrame = atoi(elems[2].c_str()); currGroundTruth.lastFrame = atoi(elems2[2].c_str());
curr.groundTruths.push_back(currGroundTruth); curr.groundTruths.push_back(currGroundTruth);
} }
...@@ -105,20 +115,20 @@ void gr_chalearn::loadDataset(string &path) ...@@ -105,20 +115,20 @@ void gr_chalearn::loadDataset(string &path)
{ {
skeleton currSkeleton; skeleton currSkeleton;
vector<string> elems; vector<string> elems2;
split(line, elems, ','); split(line, elems2, ',');
for (unsigned int i=0, numJoin=0; i<elems.size(); i+=9, ++numJoin) for (unsigned int i=0, numJoin=0; i<elems2.size(); i+=9, ++numJoin)
{ {
currSkeleton.s[numJoin].Wx = atof(elems[i+0].c_str()); currSkeleton.s[numJoin].Wx = atof(elems2[i+0].c_str());
currSkeleton.s[numJoin].Wy = atof(elems[i+1].c_str()); currSkeleton.s[numJoin].Wy = atof(elems2[i+1].c_str());
currSkeleton.s[numJoin].Wz = atof(elems[i+2].c_str()); currSkeleton.s[numJoin].Wz = atof(elems2[i+2].c_str());
currSkeleton.s[numJoin].Rx = atof(elems[i+3].c_str()); currSkeleton.s[numJoin].Rx = atof(elems2[i+3].c_str());
currSkeleton.s[numJoin].Ry = atof(elems[i+4].c_str()); currSkeleton.s[numJoin].Ry = atof(elems2[i+4].c_str());
currSkeleton.s[numJoin].Rz = atof(elems[i+5].c_str()); currSkeleton.s[numJoin].Rz = atof(elems2[i+5].c_str());
currSkeleton.s[numJoin].Rw = atof(elems[i+6].c_str()); currSkeleton.s[numJoin].Rw = atof(elems2[i+6].c_str());
currSkeleton.s[numJoin].Px = atof(elems[i+7].c_str()); currSkeleton.s[numJoin].Px = atof(elems2[i+7].c_str());
currSkeleton.s[numJoin].Py = atof(elems[i+8].c_str()); currSkeleton.s[numJoin].Py = atof(elems2[i+8].c_str());
} }
curr.skeletons.push_back(currSkeleton); curr.skeletons.push_back(currSkeleton);
...@@ -127,3 +137,6 @@ void gr_chalearn::loadDataset(string &path) ...@@ -127,3 +137,6 @@ void gr_chalearn::loadDataset(string &path)
train.push_back(curr); train.push_back(curr);
} }
} }
}
}
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
// //
//M*/ //M*/
#include <opencv2/util.h> #include "opencv2/util.hpp"
#include <opencv2/gr_skig.h> #include "opencv2/gr_skig.hpp"
#include <cstdio> #include <cstdio>
#include <cstdlib> // atoi #include <cstdlib> // atoi
...@@ -48,6 +48,11 @@ ...@@ -48,6 +48,11 @@
#include <fstream> #include <fstream>
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
gr_skig::gr_skig(std::string &path) gr_skig::gr_skig(std::string &path)
...@@ -57,6 +62,11 @@ gr_skig::gr_skig(std::string &path) ...@@ -57,6 +62,11 @@ gr_skig::gr_skig(std::string &path)
void gr_skig::load(string &path, unsigned int number) void gr_skig::load(string &path, unsigned int number)
{ {
if (number!=0)
{
return;
}
loadDataset(path); loadDataset(path);
} }
...@@ -75,7 +85,7 @@ void gr_skig::loadDataset(string &path) ...@@ -75,7 +85,7 @@ void gr_skig::loadDataset(string &path)
{ {
string &file = *it; string &file = *it;
gesture curr; gestureSkig curr;
curr.rgb = pathDatasetRgb + file; curr.rgb = pathDatasetRgb + file;
curr.dep = file; curr.dep = file;
curr.dep[0] = 'K'; curr.dep[0] = 'K';
...@@ -96,3 +106,6 @@ void gr_skig::loadDataset(string &path) ...@@ -96,3 +106,6 @@ void gr_skig::loadDataset(string &path)
} }
} }
} }
}
}
...@@ -39,13 +39,18 @@ ...@@ -39,13 +39,18 @@
// //
//M*/ //M*/
#include <opencv2/util.h> #include "opencv2/util.hpp"
#include <opencv2/hpe_parse.h> #include "opencv2/hpe_parse.hpp"
#include <cstdio> #include <cstdio>
#include <fstream> #include <fstream>
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
hpe_parse::hpe_parse(std::string &path) hpe_parse::hpe_parse(std::string &path)
...@@ -55,6 +60,11 @@ hpe_parse::hpe_parse(std::string &path) ...@@ -55,6 +60,11 @@ hpe_parse::hpe_parse(std::string &path)
void hpe_parse::load(string &path, unsigned int number) void hpe_parse::load(string &path, unsigned int number)
{ {
if (number!=0)
{
return;
}
loadDataset(path); loadDataset(path);
} }
...@@ -84,3 +94,6 @@ void hpe_parse::loadDataset(string &path) ...@@ -84,3 +94,6 @@ void hpe_parse::loadDataset(string &path)
} }
} }
} }
}
}
...@@ -39,13 +39,18 @@ ...@@ -39,13 +39,18 @@
// //
//M*/ //M*/
#include <opencv2/ir_affine.h> #include "opencv2/ir_affine.hpp"
#include <cstdio> #include <cstdio>
#include <cstdlib> // atoi #include <cstdlib> // atoi
#include <fstream> #include <fstream>
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
ir_affine::ir_affine(std::string &path) ir_affine::ir_affine(std::string &path)
...@@ -55,6 +60,11 @@ ir_affine::ir_affine(std::string &path) ...@@ -55,6 +60,11 @@ ir_affine::ir_affine(std::string &path)
void ir_affine::load(string &path, unsigned int number) void ir_affine::load(string &path, unsigned int number)
{ {
if (number!=0)
{
return;
}
loadDataset(path); loadDataset(path);
} }
...@@ -72,11 +82,11 @@ void ir_affine::loadDataset(string &path) ...@@ -72,11 +82,11 @@ void ir_affine::loadDataset(string &path)
{ {
string matName(path + "H1to" + tmp + "p"); string matName(path + "H1to" + tmp + "p");
ifstream infile(matName.c_str()); ifstream infile(matName.c_str());
for (int i=0; i<3; ++i) for (int k=0; k<3; ++k)
{ {
for (int j=0; j<3; ++j) for (int j=0; j<3; ++j)
{ {
infile >> curr.mat[i][j]; infile >> curr.mat[k][j];
} }
} }
} }
...@@ -84,3 +94,6 @@ void ir_affine::loadDataset(string &path) ...@@ -84,3 +94,6 @@ void ir_affine::loadDataset(string &path)
train.push_back(curr); train.push_back(curr);
} }
} }
}
}
...@@ -39,13 +39,18 @@ ...@@ -39,13 +39,18 @@
// //
//M*/ //M*/
#include <opencv2/util.h> #include "opencv2/util.hpp"
#include <opencv2/ir_robot.h> #include "opencv2/ir_robot.hpp"
#include <cstdio> #include <cstdio>
#include <fstream> #include <fstream>
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
ir_robot::ir_robot(std::string &path) ir_robot::ir_robot(std::string &path)
...@@ -55,6 +60,11 @@ ir_robot::ir_robot(std::string &path) ...@@ -55,6 +60,11 @@ ir_robot::ir_robot(std::string &path)
void ir_robot::load(string &path, unsigned int number) void ir_robot::load(string &path, unsigned int number)
{ {
if (number!=0)
{
return;
}
loadDataset(path); loadDataset(path);
} }
...@@ -78,3 +88,6 @@ void ir_robot::loadDataset(string &path) ...@@ -78,3 +88,6 @@ void ir_robot::loadDataset(string &path)
train.push_back(curr); train.push_back(curr);
} }
} }
}
}
...@@ -39,21 +39,26 @@ ...@@ -39,21 +39,26 @@
// //
//M*/ //M*/
#include <opencv2/is_bsds.h> #include "opencv2/is_bsds.hpp"
#include <cstdio> #include <cstdio>
#include <fstream> #include <fstream>
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
void loadDatasetPart(string &fileName, vector<string> &dataset) void is_bsds::loadDatasetPart(string &fileName, vector<string> &dataset_)
{ {
ifstream infile(fileName.c_str()); ifstream infile(fileName.c_str());
string imageName; string imageName;
while (infile >> imageName) while (infile >> imageName)
{ {
dataset.push_back(imageName); dataset_.push_back(imageName);
} }
} }
...@@ -64,6 +69,11 @@ is_bsds::is_bsds(std::string &path) ...@@ -64,6 +69,11 @@ is_bsds::is_bsds(std::string &path)
void is_bsds::load(string &path, unsigned int number) void is_bsds::load(string &path, unsigned int number)
{ {
if (number!=0)
{
return;
}
loadDataset(path); loadDataset(path);
} }
...@@ -78,3 +88,6 @@ void is_bsds::loadDataset(string &path) ...@@ -78,3 +88,6 @@ void is_bsds::loadDataset(string &path)
// loading test // loading test
loadDatasetPart(testName, test); loadDatasetPart(testName, test);
} }
}
}
...@@ -39,13 +39,18 @@ ...@@ -39,13 +39,18 @@
// //
//M*/ //M*/
#include <opencv2/util.h> #include "opencv2/util.hpp"
#include <opencv2/is_weizmann.h> #include "opencv2/is_weizmann.hpp"
#include <cstdio> #include <cstdio>
#include <fstream> #include <fstream>
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
is_weizmann::is_weizmann(std::string &path) is_weizmann::is_weizmann(std::string &path)
...@@ -55,6 +60,11 @@ is_weizmann::is_weizmann(std::string &path) ...@@ -55,6 +60,11 @@ is_weizmann::is_weizmann(std::string &path)
void is_weizmann::load(string &path, unsigned int number) void is_weizmann::load(string &path, unsigned int number)
{ {
if (number!=0)
{
return;
}
loadDataset(path); loadDataset(path);
} }
...@@ -78,3 +88,6 @@ void is_weizmann::loadDataset(string &path) ...@@ -78,3 +88,6 @@ void is_weizmann::loadDataset(string &path)
} }
} }
} }
}
}
...@@ -39,16 +39,21 @@ ...@@ -39,16 +39,21 @@
// //
//M*/ //M*/
#include <opencv2/util.h> #include "opencv2/util.hpp"
#include <opencv2/msm_epfl.h> #include "opencv2/msm_epfl.hpp"
#include <cstdio> #include <cstdio>
#include <fstream> #include <fstream>
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
void readFileDouble(string fileName, vector<double>& out) void msm_epfl::readFileDouble(string fileName, vector<double> &out)
{ {
ifstream infile(fileName.c_str()); ifstream infile(fileName.c_str());
double val; double val;
...@@ -65,6 +70,11 @@ msm_epfl::msm_epfl(std::string &path) ...@@ -65,6 +70,11 @@ msm_epfl::msm_epfl(std::string &path)
void msm_epfl::load(string &path, unsigned int number) void msm_epfl::load(string &path, unsigned int number)
{ {
if (number!=0)
{
return;
}
loadDataset(path); loadDataset(path);
} }
...@@ -79,7 +89,7 @@ void msm_epfl::loadDataset(string &path) ...@@ -79,7 +89,7 @@ void msm_epfl::loadDataset(string &path)
getDirList(pathPng, fileNames); getDirList(pathPng, fileNames);
for (vector<string>::iterator it=fileNames.begin(); it!=fileNames.end(); ++it) for (vector<string>::iterator it=fileNames.begin(); it!=fileNames.end(); ++it)
{ {
object curr; objectEpfl curr;
curr.imageName = *it; curr.imageName = *it;
readFileDouble(pathBounding + curr.imageName + ".bounding", curr.bounding); readFileDouble(pathBounding + curr.imageName + ".bounding", curr.bounding);
...@@ -89,3 +99,6 @@ void msm_epfl::loadDataset(string &path) ...@@ -89,3 +99,6 @@ void msm_epfl::loadDataset(string &path)
train.push_back(curr); train.push_back(curr);
} }
} }
}
}
...@@ -39,12 +39,17 @@ ...@@ -39,12 +39,17 @@
// //
//M*/ //M*/
#include <opencv2/msm_middlebury.h> #include "opencv2/msm_middlebury.hpp"
#include <cstdio> #include <cstdio>
#include <fstream> #include <fstream>
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
msm_middlebury::msm_middlebury(std::string &path) msm_middlebury::msm_middlebury(std::string &path)
...@@ -54,6 +59,11 @@ msm_middlebury::msm_middlebury(std::string &path) ...@@ -54,6 +59,11 @@ msm_middlebury::msm_middlebury(std::string &path)
void msm_middlebury::load(string &path, unsigned int number) void msm_middlebury::load(string &path, unsigned int number)
{ {
if (number!=0)
{
return;
}
loadDataset(path); loadDataset(path);
} }
...@@ -96,3 +106,6 @@ void msm_middlebury::loadDataset(string &path) ...@@ -96,3 +106,6 @@ void msm_middlebury::loadDataset(string &path)
train.push_back(curr); train.push_back(curr);
} }
} }
}
}
...@@ -39,14 +39,19 @@ ...@@ -39,14 +39,19 @@
// //
//M*/ //M*/
#include <opencv2/util.h> #include "opencv2/util.hpp"
#include <opencv2/or_imagenet.h> #include "opencv2/or_imagenet.hpp"
#include <cstdio> #include <cstdio>
#include <cstdlib> // atoi #include <cstdlib> // atoi
#include <fstream> #include <fstream>
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
or_imagenet::or_imagenet(std::string &path) or_imagenet::or_imagenet(std::string &path)
...@@ -56,6 +61,11 @@ or_imagenet::or_imagenet(std::string &path) ...@@ -56,6 +61,11 @@ or_imagenet::or_imagenet(std::string &path)
void or_imagenet::load(string &path, unsigned int number) void or_imagenet::load(string &path, unsigned int number)
{ {
if (number!=0)
{
return;
}
loadDataset(path); loadDataset(path);
} }
...@@ -68,7 +78,7 @@ void or_imagenet::loadDataset(string &path) ...@@ -68,7 +78,7 @@ void or_imagenet::loadDataset(string &path)
vector<string> elems; vector<string> elems;
split(line, elems, '\t'); split(line, elems, '\t');
object curr; objectImagenet curr;
curr.imageUrl = elems[1]; curr.imageUrl = elems[1];
string id(elems[0]); string id(elems[0]);
...@@ -83,3 +93,6 @@ void or_imagenet::loadDataset(string &path) ...@@ -83,3 +93,6 @@ void or_imagenet::loadDataset(string &path)
train.push_back(curr); train.push_back(curr);
} }
} }
}
}
...@@ -39,13 +39,18 @@ ...@@ -39,13 +39,18 @@
// //
//M*/ //M*/
#include <opencv2/util.h> #include "opencv2/util.hpp"
#include <opencv2/or_sun.h> #include "opencv2/or_sun.hpp"
#include <cstdio> #include <cstdio>
#include <fstream> #include <fstream>
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
or_sun::or_sun(std::string &path) or_sun::or_sun(std::string &path)
...@@ -55,6 +60,11 @@ or_sun::or_sun(std::string &path) ...@@ -55,6 +60,11 @@ or_sun::or_sun(std::string &path)
void or_sun::load(string &path, unsigned int number) void or_sun::load(string &path, unsigned int number)
{ {
if (number!=0)
{
return;
}
loadDataset(path); loadDataset(path);
} }
...@@ -65,7 +75,7 @@ void or_sun::loadDataset(string &path) ...@@ -65,7 +75,7 @@ void or_sun::loadDataset(string &path)
string line; string line;
while (getline(infile, line)) while (getline(infile, line))
{ {
object curr; objectSun curr;
curr.name = line; curr.name = line;
string currPath(path + curr.name); string currPath(path + curr.name);
...@@ -79,3 +89,6 @@ void or_sun::loadDataset(string &path) ...@@ -79,3 +89,6 @@ void or_sun::loadDataset(string &path)
train.push_back(curr); train.push_back(curr);
} }
} }
}
}
...@@ -39,14 +39,19 @@ ...@@ -39,14 +39,19 @@
// //
//M*/ //M*/
#include <opencv2/util.h> #include "opencv2/util.hpp"
#include <opencv2/slam_kitti.h> #include "opencv2/slam_kitti.hpp"
#include <cstdio> #include <cstdio>
#include <cstdlib> // atof #include <cstdlib> // atof
#include <fstream> #include <fstream>
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
slam_kitti::slam_kitti(std::string &path) slam_kitti::slam_kitti(std::string &path)
...@@ -56,6 +61,11 @@ slam_kitti::slam_kitti(std::string &path) ...@@ -56,6 +61,11 @@ slam_kitti::slam_kitti(std::string &path)
void slam_kitti::load(string &path, unsigned int number) void slam_kitti::load(string &path, unsigned int number)
{ {
if (number!=0)
{
return;
}
loadDataset(path); loadDataset(path);
} }
...@@ -72,12 +82,12 @@ void slam_kitti::loadDataset(string &path) ...@@ -72,12 +82,12 @@ void slam_kitti::loadDataset(string &path)
string currPath(pathSequence + curr.name); string currPath(pathSequence + curr.name);
// loading velodyne // loading velodyne
string pathSequence(currPath + "/velodyne/"); string pathVelodyne(currPath + "/velodyne/");
vector<string> sequenceNames; vector<string> velodyneNames;
getDirList(pathSequence, sequenceNames); getDirList(pathVelodyne, velodyneNames);
for (vector<string>::iterator itSequence=sequenceNames.begin(); itSequence!=sequenceNames.end(); ++itSequence) for (vector<string>::iterator itV=velodyneNames.begin(); itV!=velodyneNames.end(); ++itV)
{ {
curr.velodyne.push_back(*itSequence); curr.velodyne.push_back(*itV);
} }
// loading gray & color images // loading gray & color images
...@@ -109,10 +119,10 @@ void slam_kitti::loadDataset(string &path) ...@@ -109,10 +119,10 @@ void slam_kitti::loadDataset(string &path)
getline(infile2, line); getline(infile2, line);
vector<string> elems; vector<string> elems;
split(line, elems, ' '); split(line, elems, ' ');
vector<string>::iterator it=elems.begin(); vector<string>::iterator itE=elems.begin();
for (++it; it!=elems.end(); ++it) for (++itE; itE!=elems.end(); ++itE)
{ {
curr.p[i].push_back(atof((*it).c_str())); curr.p[i].push_back(atof((*itE).c_str()));
} }
} }
...@@ -125,13 +135,13 @@ void slam_kitti::loadDataset(string &path) ...@@ -125,13 +135,13 @@ void slam_kitti::loadDataset(string &path)
unsigned int i=0; unsigned int i=0;
vector<string> elems; vector<string> elems;
split(line, elems, ' '); split(line, elems, ' ');
for (vector<string>::iterator it=elems.begin(); it!=elems.end(); ++it, ++i) for (vector<string>::iterator itE=elems.begin(); itE!=elems.end(); ++itE, ++i)
{ {
if (i>11) if (i>11)
{ {
break; break;
} }
p.elem[i] = atof((*it).c_str()); p.elem[i] = atof((*itE).c_str());
} }
curr.posesArray.push_back(p); curr.posesArray.push_back(p);
...@@ -140,3 +150,6 @@ void slam_kitti::loadDataset(string &path) ...@@ -140,3 +150,6 @@ void slam_kitti::loadDataset(string &path)
train.push_back(curr); train.push_back(curr);
} }
} }
}
}
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
// //
//M*/ //M*/
#include <opencv2/util.h> #include "opencv2/util.hpp"
#include <opencv2/slam_tumindoor.h> #include "opencv2/slam_tumindoor.hpp"
#include <cstdio> #include <cstdio>
#include <cstdlib> // atof #include <cstdlib> // atof
...@@ -48,6 +48,11 @@ ...@@ -48,6 +48,11 @@
#include <fstream> #include <fstream>
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
slam_tumindoor::slam_tumindoor(std::string &path) slam_tumindoor::slam_tumindoor(std::string &path)
...@@ -57,6 +62,11 @@ slam_tumindoor::slam_tumindoor(std::string &path) ...@@ -57,6 +62,11 @@ slam_tumindoor::slam_tumindoor(std::string &path)
void slam_tumindoor::load(string &path, unsigned int number) void slam_tumindoor::load(string &path, unsigned int number)
{ {
if (number!=0)
{
return;
}
loadDataset(path); loadDataset(path);
} }
...@@ -96,3 +106,6 @@ void slam_tumindoor::loadDataset(string &path) ...@@ -96,3 +106,6 @@ void slam_tumindoor::loadDataset(string &path)
train.push_back(curr); train.push_back(curr);
} }
} }
}
}
...@@ -39,17 +39,22 @@ ...@@ -39,17 +39,22 @@
// //
//M*/ //M*/
#include <opencv2/util.h> #include "opencv2/util.hpp"
#include <opencv2/tr_chars.h> #include "opencv2/tr_chars.hpp"
#include <cstdio> #include <cstdio>
#include <cstdlib> // atoi #include <cstdlib> // atoi
#include <fstream> #include <fstream>
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
void parseLine(string &line, vector<int> &currSet, unsigned int number) void tr_chars::parseLine(string &line, vector<int> &currSet, unsigned int number)
{ {
vector<string> elems; vector<string> elems;
split(line, elems, ' '); split(line, elems, ' ');
...@@ -157,7 +162,7 @@ void tr_chars::loadDataset(string &path, unsigned int number) ...@@ -157,7 +162,7 @@ void tr_chars::loadDataset(string &path, unsigned int number)
for (vector<int>::iterator it=trainSet.begin(); it!=trainSet.end(); ++it) for (vector<int>::iterator it=trainSet.begin(); it!=trainSet.end(); ++it)
{ {
if (*it>=allNames.size() || *it>=allLabels.size()) if (*it>=(int)allNames.size() || *it>=(int)allLabels.size())
{ {
printf("incorrect train index: %u\n", *it); printf("incorrect train index: %u\n", *it);
continue; continue;
...@@ -171,7 +176,7 @@ void tr_chars::loadDataset(string &path, unsigned int number) ...@@ -171,7 +176,7 @@ void tr_chars::loadDataset(string &path, unsigned int number)
for (vector<int>::iterator it=testSet.begin(); it!=testSet.end(); ++it) for (vector<int>::iterator it=testSet.begin(); it!=testSet.end(); ++it)
{ {
if (*it>=allNames.size() || *it>=allLabels.size()) if (*it>=(int)allNames.size() || *it>=(int)allLabels.size())
{ {
printf("incorrect test index: %u\n", *it); printf("incorrect test index: %u\n", *it);
continue; continue;
...@@ -183,3 +188,6 @@ void tr_chars::loadDataset(string &path, unsigned int number) ...@@ -183,3 +188,6 @@ void tr_chars::loadDataset(string &path, unsigned int number)
test.push_back(curr); test.push_back(curr);
} }
} }
}
}
...@@ -39,8 +39,8 @@ ...@@ -39,8 +39,8 @@
// //
//M*/ //M*/
#include <opencv2/util.h> #include "opencv2/util.hpp"
#include <opencv2/tr_svt.h> #include "opencv2/tr_svt.hpp"
#include <tinyxml2/tinyxml2.h> #include <tinyxml2/tinyxml2.h>
...@@ -49,10 +49,15 @@ ...@@ -49,10 +49,15 @@
#include <fstream> #include <fstream>
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
using namespace tinyxml2; using namespace tinyxml2;
void xmlParse(string &set, vector<image> &out) void tr_svt::xmlParse(string &set, vector<image> &out)
{ {
XMLDocument doc; XMLDocument doc;
doc.LoadFile(set.c_str()); doc.LoadFile(set.c_str());
...@@ -104,6 +109,11 @@ tr_svt::tr_svt(std::string &path) ...@@ -104,6 +109,11 @@ tr_svt::tr_svt(std::string &path)
void tr_svt::load(string &path, unsigned int number) void tr_svt::load(string &path, unsigned int number)
{ {
if (number!=0)
{
return;
}
loadDataset(path); loadDataset(path);
} }
...@@ -118,3 +128,6 @@ void tr_svt::loadDataset(string &path) ...@@ -118,3 +128,6 @@ void tr_svt::loadDataset(string &path)
// loading test images description // loading test images description
xmlParse(testXml, test); xmlParse(testXml, test);
} }
}
}
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
// //
//M*/ //M*/
#include <opencv2/util.h> #include "opencv2/util.hpp"
#include <cstdlib> #include <cstdlib>
...@@ -53,6 +53,11 @@ ...@@ -53,6 +53,11 @@
#include <direct.h> #include <direct.h>
#endif #endif
namespace cv
{
namespace datasetstools
{
using namespace std; using namespace std;
void split(string s, vector<string> &elems, char delim) void split(string s, vector<string> &elems, char delim)
...@@ -70,7 +75,7 @@ void getDirList(string &dirName, vector<string> &fileNames) ...@@ -70,7 +75,7 @@ void getDirList(string &dirName, vector<string> &fileNames)
#ifdef __GNUC__ #ifdef __GNUC__
struct dirent **namelist; struct dirent **namelist;
int n = scandir(dirName.c_str(), &namelist, NULL, alphasort); int n = scandir(dirName.c_str(), &namelist, NULL, alphasort);
for (unsigned int i=0; i<n; ++i) for (int i=0; i<n; ++i)
{ {
string fileName(namelist[i]->d_name); string fileName(namelist[i]->d_name);
if ('.' != fileName[0]) if ('.' != fileName[0])
...@@ -100,3 +105,6 @@ void getDirList(string &dirName, vector<string> &fileNames) ...@@ -100,3 +105,6 @@ void getDirList(string &dirName, vector<string> &fileNames)
_findclose(hFile); _findclose(hFile);
#endif #endif
} }
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment