-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MVP for database querying works. The test needs some work though.
- Loading branch information
1 parent
56ea351
commit f526d2d
Showing
4 changed files
with
74 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 52 additions & 3 deletions
55
experimental/learn_descriptors/symphony_lake_parser_test.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,56 @@ | ||
#include "experimental/learn_descriptors/symphony_lake_parser.hh" | ||
|
||
#include <iostream> | ||
#include <sstream> | ||
#include <string> | ||
#include <vector> | ||
|
||
#include "gtest/gtest.h" | ||
#include "opencv2/opencv.hpp" | ||
|
||
namespace robot::experimental::learn_descriptors::symphony_lake_parser { | ||
TEST(SymphonyLakeParserTest, hello_world) { | ||
hello_world("hello from symphony lake dataset. includes working well."); | ||
} | ||
|
||
TEST(SymphonyLakeParserTest, database_query) { | ||
std::string image_root_dir = "/home/pizzaroll04/Documents/datasets/symphony_lake_full"; | ||
std::string surveys = "140106"; | ||
std::vector<std::string> survey_list; | ||
std::cout << "\nEnter root image directory: "; | ||
// std::cin >> image_root_dir; | ||
std::cout << "\nEnter surveys separated by spaces: "; | ||
// std::getline(std::cin, surveys); | ||
|
||
std::string token; | ||
std::stringstream ss(surveys); | ||
while (std::getline(ss, token, ' ')) { | ||
survey_list.push_back(token); | ||
} | ||
|
||
DataParser data_parser = DataParser(image_root_dir, survey_list); | ||
|
||
const symphony_lake_dataset::SurveyVector &survey_vector = data_parser.getSurveys(); | ||
|
||
namespace robot::experimental::learn_descriptors::symphony_lake_dataset { | ||
TEST(SymphonyLakeParserTest, hello_world) { hello_world("womp womp"); } | ||
} // namespace robot::experimental::learn_descriptors::symphony_lake_dataset | ||
cv::Mat image; | ||
cv::namedWindow("Symphony Dataset Image", cv::WINDOW_AUTOSIZE); | ||
printf("Press 'q' in graphic window to quit\n"); | ||
for (int i = 0; i < static_cast<int>(survey_vector.getNumSurveys()); i++) { | ||
const symphony_lake_dataset::Survey &survey = survey_vector.get(i); | ||
for (int j = 0; j < static_cast<int>(survey.getNumImages()); j++) { | ||
int key = cv::waitKey(1) & 0xFF; | ||
switch (key) { | ||
case 'q': | ||
case 'Q': | ||
case 0x27: | ||
return; | ||
break; | ||
default: | ||
break; | ||
} | ||
image = survey.loadImageByImageIndex(j); | ||
cv::imshow("Symphony Dataset Image", image); | ||
} | ||
} | ||
} | ||
} // namespace robot::experimental::learn_descriptors::symphony_lake_parser |