Automatic GCP points using ArUco markers

Hi,

I’m working on automatic GCP points using ArUco markers. The opendronemap website explains how to use it.

  1. Install Python3, OpenCV and OpenCV contrib on your machine
  2. Download the source code from GitHub
  3. Generate ArUco markers
  4. Put the markers on the field
  5. Make the flight
  6. Collect the GCP’s 3D coordinates in a TXT file
  7. Run gcp_find.py
  8. Add the generated gcp_list.txt to your ODM project and start ODM processing

All steps are clear to me except one.

I have installed the software, but don’t know how to use it further? At point 7 it says Run gcp_find.py but how do i open it? And how does gcp_find.py know where my drone images are? Hopefully someone can provide some additional information on the above? Thanks

1 Like

First of all thank you for pointing at this blog post : https://www.opendronemap.org/2021/04/automatize-gcp-image-coordinate-collection/
It was exactly what I was looking for.

Based on my understanding here is how it works.

You need to run :

python \path\to\gcp_find.py path\to\image.png -t ODM -i .\path\to\gcp_coord.txt --epsg gcp_epsg_code -o \path\to\gcp_list.txt

Where gcp_coord.txt is a file containing the coordinates of the various gcp used like “id_gcp lat long alt” :

1 4.482 4.201 0.370
2 5.758 3.859 -0.557
3 2.822 4.201 0.359
4 2.173 4.202 -0.153
5 4.119 3.764 -0.518
6 1.041 3.712 -0.560

and gcp_epsg_code is the EPSG code corresponding to the coordinates in this gcp_coord.txt file.

It will then ouput a gcp_list.txt file where you ask it corresponding to the ODM format. Do not forget to check the -d option and make sure it match the ArUco you have generated.

Perhaps there is a way to run it on several images but for now I just run it for each image and then concatenate the result. I will keep you up to date if I find anything else.

For now all this is pure theory, I have juste read the code and doc of the command. I will generate, capture and try it on real data as soon as possible.

1 Like

Welcome, barryV!

Looks like bernarde gave you an excellent summary of how to use the tool!

Bernarde, you should be able to loop through the folder, right? I’m really bad with Python, though.

Thanks for giving such great instructions!

From the examples on github should be possible of running it on multiple images if the name is a regex :

samples/DJI_017[234].JPG

But on my machine I have an error

processing samples\DJI_017[234].JPG
error reading image: samples\DJI_017[234].JPG

Not sure if it is because I am running it on Windows and the method use is not cross-platform or because of a bug. Will investigate later.

Let me know if the regex naming work for you.

1 Like

Hi Bernard, thank you so much for your explanation! I’m on vacation right now so I can’t test it yet. I am curious about your results when you start working with real data! greetings, Barry

1 Like

After discussion with zsiki from the Find-GCP project I can add that :

  • To be clear they are note regex but jokers
  • As I guessed it was already natively working on linux but not on windows
  • It is now working on Windows
  • you can anyways precise multiple input files to the input command like this for instace :
    python \path\to\gcp_find.py -t ODM -i .\path\to\gcp_coord.txt --epsg gcp_epsg_code -o \path\to\gcp_list.txt path\to\image1.png path\to\image2.png path\to\image3.png

Concerning the real data, capture is in progress. I should be able to retrieve the data at the end of the day and work on it the next days.

1 Like

Good to hear Bernard! I am also curious whether the flight height still determines the quality. good luck with the implementation!:v:

1 Like

OK first tests were à disaster so I Will not share thé datasets but thé markers were badly designed.
(misunderstanding with a collaborator lead To too small markers dim 4x4 where I wanted 3x3 and flight was realized at 70m instead of 50m)

I just made New bigger markers in 3x3 and they should be used on a fly on tuesday.

4 Likes

Planning to make some this weekend. Will hopefully post a dataset.

3 Likes

Hi, I also tried to use markers last Tuesday. The markers had a size of 50x50 cm and the flight height was 35 m with a GSD of approx. 1.0. Unfortunately, the size of the marker also turned out not to be sufficient for a reliable dataset. Next time I’ll try again with an even bigger one!

2 Likes

image

2 Likes

Hi all,

I can not post the dataset of last flight because of private installations on some pictures but here is an extract :

Targets are 50x50 cm and flight altitude is between 40m and 60m so I do not think issue is the size of your marker @barryV, in fact your image seems really “burned”. You can calculate max flight altitude depending on you marker size and camera here : http://www.agt.bme.hu/on_line/gsd_calc/gsd_calc.html
Furthermore your markers seems to be 4x4 or perhaps 5x5 if I am right, you should try with 3x3 with the same size (50x50cm).

The find GCP worked like a charm on my dataset.

  • 0 false positive and no detection error
  • 1 false negative. 108 detection for 109 occurences on images

I am trying to use the output results in reconstruction. Will keep you up to date as usual and post a complete dataset when I can.

1 Like

hi Bernarde, your markers sure look good! thank you for explaining. I look forward to your dataset!

1 Like

Okay here is the dataset in the images folder :
https://drive.google.com/drive/folders/1o2j7UEccEFvWee4OH3ryLPa7gcXHObuN?usp=sharing
Alongwith it you will find the detected_gcp.txt file which is the output of find-gcp on the dataset.
I have review the pictures and the detected_gcp.txt file but did not make such a detail count of false postive and negative but rouglhy I will say there 2 false negatives.
Positions in pixels and marker detected seems correct for each detection.

I have successfully rebuild the corresponding pointcloud and orhtophoto using the RTK data embedded in the pictures but whenever I try supplying the gcp file it fails.
In the same folder you will find the err.log and msg.log corresponding to the stderr and stdout log respectively.

Any help would be greatly appreciated.

1 Like

Ok, I made a mistake in the GCP coords. With the correct one the generation can complete.

I add two corresponding files “corrected_gcp.txt” and “corrected_detected_gcp.txt”.

I also add 3 pointclouds inside a folder.

  • The RTK one is compute only with xmp tag (metadata) from the pictures
  • 2 GCP is computing using only two markers
  • 3 GCP is computing using the 3 markers

There is a significant displacement between the three pointclouds as you can see (there should be only one line of rocks):

------------------------- Edit ------------------------------

After discussion with the field team it seems that for one GCP the GPS accuracy signal was very low. To compensate I decided to cheat a little. I have picked the center of the GCP on the cloud generated with RTK. With this new accurate coordinates both the RTK and GCP generated clouds are aligned so this is a nice addition to the pipeline. Just need to work on the process with my team to reduce human error and make it work flowlessly.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.