The images should be structured in the following directory format. Each subdirectory must have two or more images.
/path/to/root/folder
|--> /sub_directory_1
|--> repeat1.jpg
|--> repeat2.jpg
|--> /sub_directory_2
|--> repeat1.jpg
|--> repeat2.jpg
|--> /sub_directory_3
|--> repeat1.jpg
|--> repeat2.jpg
|--> repeat3.jpg
...
Pull the docker file from the docker hub with the following command.
docker pull enigmaoffline/armmsThen run the container with the shell file provided, modify the variables to point the directories and files that you need to processing.
./docker_run.shIn the project directory, run the following command to build the docker image.
docker build -t armms .Then run the container with the shell file as above.
./docker_run.shOR
- Create a python environment using Conda
conda env create -f env/environment.ymlThis command will create a python3.11 environment and install all the relevant dependencies.
Once activating the conda environment, use the following command to run the main.py file using the dummy data provided.
python main.py -j jobs/job_local.jsonYou can refer to the jobs/job_local.json file to learn more about the arguments available for the script. Alternatively, you can pass in the arguments directly to the main.py on execution as such.
python main.py -r data/data_small_groups -o out/OR
Open the ipynb notebook and run each cell, the inference process is identical.
DICT_TYPE: ArUCo marker dictionaryMARKER_SIZE: Marker size (can be in any unit)VALID_MARKER_IDS: Detection will only match the IDs provided below, leave the list empty if you want possible markers to be detected, highly advised to be used ifUSE_ADV_THRESHis enabledROOT_DIR: Root directory of the images, see below for file structureOUT_DIR: Output directory for the results, log file, and generated images, however, the output directory can't be inside theROOT_DIRDETECTION_ONLY: Boolean flag for disabling comparison and calculationsUSE_ADV_THRESH: Boolean flag for enabling advanced thresholding. Sweeps for a multitude of thresholding settings, aids in detecting markers that are less visibleCOMPARISON_MODE: Comparison mode, "all" or "series"GEN_RESULTS: Boolean flag for generating result imagesGEN_OVERLAYS: Boolean flag for generating an overlaid result of all the result images of the subdirectoryVERBOSE: Boolean flag for enabling command line output
Initialisation Step
- Verifying that each subdirectory of the root has two or more images
- Create leaf directories in the output folder
Detection Step
- Go through each subdirectory and each image in the subdirectories
- Detect all markers present in the images
- Generate results images
- Saves the intermediate results (coordinates of detected markers) to JSON and CSV file in the output directory
Calculation and Comparison Step
- Recover edge length of each maker
- Calculate the distances of markers in the same group with the same ID
- Save result dictionary as JSON
- Convert dictionary to rows of data and save as CSV
Edge length recovery calculation demo video created with Manim.
demo.mp4
Image Overlays Generation Step
- Go through each subdirectory in the output folder and overlay images with equal alpha