PRO TIP:
While the script does a job of pre-selecting images, it's recommended taking a moment to
visually inspect the chosen images. This ensures that markers are clearly visible and that the annotations with ArUco ID align with the correct pattern. A brief manual check can help enhance the accuracy and reliability of your dataset.
Automation aids efficiency, but a human touch ensures precision!
@@ -812,11 +812,10 @@ The output `representatives` should contain the representative image for each ma
2993 2141 R0036789.JPG 10
3120 2112 R0037136.JPG 11
```
-You can visually inspect the selected images to ensure they indeed showcase the distinct pattern of the detected ArUco marker ID and confirm that each image contains only one marker. *In my case, all detected markers match the pattern of a suggested ArUco ID.*
-
+4. You can visually inspect the selected images to ensure they indeed showcase the distinct pattern of the detected ArUco marker ID and confirm that each image contains only one marker. *In my case, all detected markers match the pattern of a suggested ArUco ID.*
![](../assets/images/aruco_detected.png)
-Create a subdirectory and copy in or soft link the representative images:
+5. Create a subdirectory and copy in or soft link the representative images:
```
mkdir representative
awk '{print $3}' < representatives > list
@@ -841,44 +840,44 @@ for i in `cat list`; do k=`echo $i | awk -F"." '{print $1}'`; n=`cat representat
```
3. Run the `gcp_to_aruco_mapper.py` script to match the GCP coordinates with the representative images:
+```
+python3 gcp_to_aruco_mapper.py -g gcp_list.txt -i "./" -z 11 -o matching_results -d 50 > out_distances
+grep "Match" < matching results | sort -nk4 > ID_matches
+cat ID_matches
+```
+```
+Match found: GCP 131 (d=16.84m) is likely in image R0036737_0.JPG with ArUco marker 0.
+Match found: GCP 132 (d=12.69m) is likely in image R0037136_11.JPG with ArUco marker 11.
+Match found: GCP 133 (d=1.64m) is likely in image R0036914_3.JPG with ArUco marker 3.
+Match found: GCP 134 (d=1.00m) is likely in image R0036909_1.JPG with ArUco marker 1.
+Match found: GCP 135 (d=3.09m) is likely in image R0036789_10.JPG with ArUco marker 10.
+Match found: GCP 136 (d=18.49m) is likely in image R0036401_2.JPG with ArUco marker 2.
+Match found: GCP 137 (d=25.80m) is likely in image R0036140_6.JPG with ArUco marker 6.
+Match found: GCP 138 (d=15.18m) is likely in image R0036953_5.JPG with ArUco marker 5.
+Match found: GCP 139 (d=4.29m) is likely in image R0036927_8.JPG with ArUco marker 8.
+Match found: GCP 141 (d=5.95m) is likely in image R0036704_4.JPG with ArUco marker 4.
+Match found: GCP 143 (d=7.09m) is likely in image R0036933_7.JPG with ArUco marker 7.
+```
-
- WARNING:
-
Note that you should have activated a specific conda environment related to this project. See the STEP 0 in this section.
-
-
- ```
- python3 gcp_to_aruco_mapper.py -g gcp_list.txt -i "./" -z 11 -o matching_results -d 50 > out_distances
- grep "Match" < matching results | sort -nk4 > ID_matches
- cat ID_matches
- ```
+
+WARNING:
+
Note that you should have activated a specific conda environment related to this project. See the STEP 0 in this section.
+
- ```
- Match found: GCP 131 (d=16.84m) is likely in image R0036737_0.JPG with ArUco marker 0.
- Match found: GCP 132 (d=12.69m) is likely in image R0037136_11.JPG with ArUco marker 11.
- Match found: GCP 133 (d=1.64m) is likely in image R0036914_3.JPG with ArUco marker 3.
- Match found: GCP 134 (d=1.00m) is likely in image R0036909_1.JPG with ArUco marker 1.
- Match found: GCP 135 (d=3.09m) is likely in image R0036789_10.JPG with ArUco marker 10.
- Match found: GCP 136 (d=18.49m) is likely in image R0036401_2.JPG with ArUco marker 2.
- Match found: GCP 137 (d=25.80m) is likely in image R0036140_6.JPG with ArUco marker 6.
- Match found: GCP 138 (d=15.18m) is likely in image R0036953_5.JPG with ArUco marker 5.
- Match found: GCP 139 (d=4.29m) is likely in image R0036927_8.JPG with ArUco marker 8.
- Match found: GCP 141 (d=5.95m) is likely in image R0036704_4.JPG with ArUco marker 4.
- Match found: GCP 143 (d=7.09m) is likely in image R0036933_7.JPG with ArUco marker 7.
- ```
**STEP 3.** Once the matches are made, create a **new** `GCP_reference.txt` file replacing the custom IDs with ArUco IDs.
-1. Create a 2-column `GCP_reference_aruco.txt` file with matching IDs: `GCP` `ArUco`
- ```
- awk '{print $4"_"$14}' < ID_matches > ../tmp
- cd ../ # navigate to the IMAGES dir with the GCP_reference.file
- for i in `cat tmp`
- do
- old=`echo $i | awk -F"_" '{print $1}'`
- new=`echo $i | awk -F"_" '{print $2}'`
- awk -v A=$old -v B=$new '{if ($1==A) print B,$2,$3,$4}' < GCP_reference.txt >> GCP_reference_aruco.txt
- done
+Create a 2-column `GCP_reference_aruco.txt` file with matching IDs: `GCP` `ArUco`
+```
+awk '{print $4"_"$14}' < ID_matches > ../tmp
+cd ../ # navigate to the IMAGES dir with the GCP_reference.file
+
+for i in `cat tmp`
+do
+ old=`echo $i | awk -F"_" '{print $1}'`
+ new=`echo $i | awk -F"_" '{print $2}'`
+ awk -v A=$old -v B=$new '{if ($1==A) print B,$2,$3,$4}' < GCP_reference.txt >> GCP_reference_aruco.txt
+done
```
**STEP 4.** The `gcp_find.py` tool is then utilized again as in [SCENARIO 1: GCP file with known ArUco IDs](#scenario-1-gcp-file-with-known-aruco-ids). The end output, `gcp_list.txt`, is compatible with ODM software, but it should be used cautiously due to limited precision of GCP matching in this approach.