Generic utilities for scene generation example implementation. More...
#include "utils.hh"Functions | |
| const std::string | getUsage (const char *argv_0) |
| Returns string with program usage information. More... | |
| void | parseArgs (int argc, char **argv, unsigned int &scenes, unsigned int &start, std::string &imgs_dir, std::string &dataset_dir) |
| Parses command-line arguments. More... | |
| bool | createDirectory (std::string &path) |
| Creates the directory given its path. More... | |
| std::mt19937 | mt_rng (rng()) |
| int | getRandomInt (int min, int max) |
| Get a random integer in a given interval. More... | |
| double | getRandomDouble (double min, double max) |
| Get a random double in a given interval. More... | |
| void | shuffleIntVector (std::vector< int > &vector) |
| Randomly shuffles an integer vector. More... | |
Variables | |
| std::random_device | rng |
| std::uniform_int_distribution< int > | uniform_dist |
Generic utilities for scene generation example implementation.
| bool createDirectory | ( | std::string & | path | ) |
Creates the directory given its path.
| path | The path string |
| double getRandomDouble | ( | double | min, |
| double | max | ||
| ) |
Get a random double in a given interval.
Value is sampled from uniform distribution
| min | Interval lower bound |
| max | Interval upper bound |
| int getRandomInt | ( | int | min, |
| int | max | ||
| ) |
Get a random integer in a given interval.
Value is sampled from uniform distribution
| min | Interval lower bound |
| max | Interval upper bound |
| const std::string getUsage | ( | const char * | argv_0 | ) |
Returns string with program usage information.
| std::mt19937 mt_rng | ( | rng() | ) |
| void parseArgs | ( | int | argc, |
| char ** | argv, | ||
| unsigned int & | scenes, | ||
| unsigned int & | start, | ||
| std::string & | imgs_dir, | ||
| std::string & | dataset_dir | ||
| ) |
Parses command-line arguments.
| argc | Argument count |
| argv | Argument values |
| scenes | Number of scenes to generate |
| start | Index of the first scene |
| imgs_dir | Image output directory |
| dataset_dir | Dataset annotations output directory |
| void shuffleIntVector | ( | std::vector< int > & | vector | ) |
Randomly shuffles an integer vector.
| std::random_device rng |
| std::uniform_int_distribution<int> uniform_dist |