Generic utilities for scene generation example. More...
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <iostream>
#include <boost/filesystem.hpp>
#include <random>
#include "debug.hh"
Go to the source code of this file.
Macros | |
#define | ARG_SCENES_DEFAULT 10 |
Default number of scenes. More... | |
#define | ARG_START_DEFAULT 0 |
Default index of the first scene. More... | |
#define | ARG_IMGS_DIR_DEFAULT "imgs" |
Default image directory. More... | |
#define | ARG_DATASET_DIR_DEFAULT "dataset" |
Default dataset directory. More... | |
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... | |
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... | |
Generic utilities for scene generation example.
#define ARG_DATASET_DIR_DEFAULT "dataset" |
Default dataset directory.
#define ARG_IMGS_DIR_DEFAULT "imgs" |
Default image directory.
#define ARG_SCENES_DEFAULT 10 |
Default number of scenes.
#define ARG_START_DEFAULT 0 |
Default index of the first scene.
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.
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.