This repository holds a set of tools to help us analyze the data set obtained from the Microsoft Hololens. The aim is to be able to create a shared coordinates systems to optimize data processing and network bandwidth.
You can find an example of a data set at data/process_log. The process to analyze the data set is as follows;
- Run
process_data_set.pyto obtain augmented images, marker-based coordinates data, and detection coordinates data. - Run
process_log.pyto obtain raycast-based coordinates data. - Run
separate_by_position.pyto separate images and data from the different positions into different directories. - Run
calc_stats.pyto calculate the statistics of the previously obtained coordinates.
python create_marker.py [-i <id>] [-v] [-s] [-o <output_image>] [-m <size-in-pixels>]
-i: ID of the marker to be created-v: Verbose mode-s: Show window with original image augmented with marker coordinates system axis-o: Path to where the marker image will be written-m: Size of the marker image in pixels
A data set of picture for testing this is provided at data/original.
python get_shared_coord.py -i <input_image> -c <camera_config_file> [-v] [-s] [-o <output_image>] [-p <params_file>] [-m <size-in-meters>]
-i: Path to the input image-c: Path to the camera calibration file-v: Verbose mode-s: Show window with original image augmented with marker coordinates system axis-o: Path to where the augmented image will be written-p: Path to where the JSON file containing the following information will be written;- ID of each of the detected marker
- Pixel location of the center point of each of the detected marker
- 3D location of the center point of each of the detected marker
- Normal vector with respect to each detected marker
-m: Size of the printed marker in meters
def get_coordinates(in_path,
camera,
out_path,
parameters_path=None,
show_window=False,
marker_size=0.071):
in_path: Path to the input imagecamera: Path to the camera calibration fileshow_window: Show window with original image augmented with marker coordinates system axisout_path: Path to where the augmented image will be writtenparameters_path: Path to where the JSON file containing the following information will be written;- ID of each of the detected marker
- Pixel location of the center point of each of the detected marker
- 3D location of the center point of each of the detected marker
- Normal vector with respect to each detected marker
marker_size: Size of the printed marker in meters
A data set of picture for testing this is provided at data/circles_distance.
python circles_distance.py -i <input_image> -c <camera_config_file> [-v] [-s] [-o <output_image>] [-m <size-in-meters>]
-i: Path to the input image-c: Path to the camera calibration file-v: Verbose mode-s: Show window with original image augmented with marker coordinates system axis-o: Path to where the augmented image will be written-m: Size of the printed marker in meters
def circles_distance(in_path,
out_path,
camera,
show_window=False,
marker_size=0.071):
in_path: Path to the input imagecamera: Path to the camera calibration fileshow_window: Show window with original image augmented with marker coordinates system axisout_path: Path to where the augmented image will be writtenmarker_size: Size of the printed marker in meters
This command assumes that the data set contains multiple images stored in a folder (input path) and with the following files;
- .jpg : Image file
- .json : Server data response
- _answer.json : Detected objects and their center position
- _detection.txt : Bounding box information returned by the Deep Learning algorithm
You can find an example of this data set at data/process_data.
python process_data_set.py -i <input_path> -c <camera_config_file> [-l <level>] [-m <marker-size-in-meters>]
-i: Path to the input data set-c: Path to the camera calibration file. For the data set atdata/process_data,data/calibration/hololens/hololens.ymlcan be used.-l: Logging level possible values are;info,debug,warninganderror.-m: Size of the printed marker in meters
This script processes a log as the one at data/process_data/data.log.
python process_log.py -i <input_log> [-v] -o <output-path>
-i: Path to the input log file-v: Verbose mode-o: Output path to where the obtained information will be placed
This script separates the images and their corresponding data into different folders. Useful for further analysis. For example, to use the calc_stats.py script.
python separate_by_position.py -i <input_path> [-v] -s <path-to-sep-file> -o <output-path>
-i: Path to the input data set-v: Verbose mode-o: Output path to where the separated data will be placed-s: Path to separation file
This scripts calculates statistics from the coordinates of a data set.
python calc_stats.py -i <input_path> [-v] -o <output-path>
-i: Path to the input data set-v: Verbose mode-o: Output path to where the statistics output files will be placed