Forum

Author Topic: Trouble with UAV & Local Coordinate System Workflow  (Read 3833 times)

Super_Saffer

  • Newbie
  • *
  • Posts: 36
    • View Profile
Trouble with UAV & Local Coordinate System Workflow
« on: July 19, 2021, 02:46:18 AM »
I'm having a ton of trouble with 2 data sets given to me by a client. It's been quite a while since I've done work like this, and the client has had issues with the data collection. 

The 2 data sets are of the same area, but at different times this year. There was an issue with the 1st data set in that some images did not save properly, so there is a gap in the data. The client want to use the data from the 2nd set to plug the hole in the 1st set. However, the 2nd set was completed with a different drone at a much lower resolution and lower overlap.  The 1st data set is almost 3 x the size of the fist in terms of photos and size. 1500 vs 3000 pics and 8GB vs 22GB.  The data was collected with 2 different model DJI drone.  There are also 15 GCP, which the client laid out and are triangles that 'point' to the mark. These are recorded in a local (m) coordinate system.  It's very time-consuming to find these because Metashape can't find them for me.

Before I can even think of plugging up the hole in the first data set, I need to be able to properly process them both...I think. Here is my workflow.  I cannot get the GCP to line up, after I mark them and update the transform.

1. Import images
2. Align images, remove any images that don't align properly, align again
3. Import reference: Local (m) .... now the client says' its meters anyhow.
4. Metashape creates the markers, and I spend the next 2 hours finding and marking the GCP with the 15 markers given to me.
5. Then the update transform function in the reference window. If I select Local (m) the markers are way above the 'ground' and not in the correct shape.  If I try with USft then it lines up almost fine, but the markers are now off by a few feet horizontally but below the surface vertically. 

How do I get the markers to line up with the GCP that are given in the local (m) datum?

This is where I'm stuck so far.  I know there is some kind of issue with how DJI records X axis/altitude data but I'm not sure how it apples with the scripts given by Agisoft. The data quality is poor, and I can't talk to the data collectors directly, or the people who laid out the GCP.

Any insight would be greatly appreciated.

Paulo

  • Hero Member
  • *****
  • Posts: 1178
    • View Profile
Re: Trouble with UAV & Local Coordinate System Workflow
« Reply #1 on: July 19, 2021, 06:04:57 AM »
Hi Super Saffer,

I think what you need to do after importing the GCPs in local coodinate system, is open the Reference settings (with tools button) and define the coordinate system as local, uncheck the camera reference option and set marker reference as Local CS as in attached screen copy.
Then deselect all your cameras, clear all reference camera locations (with right click context menu) and mark the GCPS in each photo, Update Transform and you will now have the model referenced in local system.

In example shown, my original project was referenced from cameras in WGS84. I imported 3 GCPS in local CS and defined the various CSs in reference settings. After marking the GCPS in at leat 2 photos each, i update my transform and now the model is referenced in local CS (X, Y in 100 s instead of lat, long....)

Hope this makes sense,

PS. it seems definitely that the GCPs local z is in feet as it is 3 times larger than camera reference altitude....
« Last Edit: July 19, 2021, 09:29:42 AM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

Super_Saffer

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Trouble with UAV & Local Coordinate System Workflow
« Reply #2 on: July 20, 2021, 05:35:43 AM »
Thank you Paul!

If there is not a GCP in every photo do I still want to remove the camera references? It is a very large area, and over 1000 photos, but only very few with GCP.


Hi Super Saffer,

I think what you need to do after importing the GCPs in local coodinate system, is open the Reference settings (with tools button) and define the coordinate system as local, uncheck the camera reference option and set marker reference as Local CS as in attached screen copy.
Then deselect all your cameras, clear all reference camera locations (with right click context menu) and mark the GCPS in each photo, Update Transform and you will now have the model referenced in local system.

In example shown, my original project was referenced from cameras in WGS84. I imported 3 GCPS in local CS and defined the various CSs in reference settings. After marking the GCPS in at leat 2 photos each, i update my transform and now the model is referenced in local CS (X, Y in 100 s instead of lat, long....)

Hope this makes sense,

PS. it seems definitely that the GCPs local z is in feet as it is 3 times larger than camera reference altitude....
« Last Edit: July 20, 2021, 05:41:23 AM by Super_Saffer »

Paulo

  • Hero Member
  • *****
  • Posts: 1178
    • View Profile
Re: Trouble with UAV & Local Coordinate System Workflow
« Reply #3 on: July 20, 2021, 06:30:53 AM »
Hey Super,

yes you must clear camera  references  `cause they refer to WGS84 datum and your GCPs are referenced in some local CS with unknown datum transformation to WGS84. So if you keep the camera references you will get some error message as
Quote
Unsupported datum transformation
.....

15 GCPs is sufficient to reference your projects. Maybe use 10 as GCP and 5 as Check points (unchecked during optimization).
« Last Edit: July 20, 2021, 09:12:20 AM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

Super_Saffer

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Trouble with UAV & Local Coordinate System Workflow
« Reply #4 on: July 20, 2021, 06:52:13 AM »
Do you mean "reset camera alignment"? I don't see an option to remove the camera reference from a right click menu, but rather the reset camera alignment option.

I learned this evening that the overlap was only 65%, so I'm not sure how much of an issue that it.

Paulo

  • Hero Member
  • *****
  • Posts: 1178
    • View Profile
Re: Trouble with UAV & Local Coordinate System Workflow
« Reply #5 on: July 20, 2021, 08:14:58 AM »
In the reference pane, select all your images or cameras and in right click context menu, you will find Clear... which will open Clear Reference menu where you select Location option to clear all cameras reference locations....

Is 65% the forward or side overlap? It is best to have at least 60% side lap and 75% front lap but less can also be dealt with if there is good texture in imagery which seems to be your case as from camera coordinates you are on a mining site, right?
« Last Edit: July 20, 2021, 08:16:30 AM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

Paulo

  • Hero Member
  • *****
  • Posts: 1178
    • View Profile
Re: Trouble with UAV & Local Coordinate System Workflow
« Reply #6 on: July 20, 2021, 01:53:00 PM »
Hello again Super,

I have some thought on a different way to tackle your problem. If your client does not require the outputs to be in their local CS, you coud process the 2 datasets in 2 different chunks with Coordinate system defined as WGS84. After marking the GCPs in the 2 datasets (with no need to import the Local GCP coordinates), check all cameras and uncheck all markers and do Update Transform.

You will get the GCPS in 2 datasets with estimated coordinates in WGS84. Next align the 2 chunks using marker based method and voila you will get the 2 chunks aligned in same datum and you can fill gap...
of course, this way your products will have a relative high WGS84 datum accuracy but absolute accuracy will be a few meters because of low accuracy of camera GPS coordinates...

Additionally you will now have the the GCPs coordinates in the local CS and WGS84 which could help you define a datum transformation between the 2...

Hope this makes some sense,
« Last Edit: July 20, 2021, 02:29:43 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

Super_Saffer

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Trouble with UAV & Local Coordinate System Workflow
« Reply #7 on: July 21, 2021, 07:16:02 AM »
Well, I now know why I couldn't get the GCP to line up no matter what I tried. The client now says that some of the GCP may have been moved by site workers.   >:(

I was able to use the older data, and the "fill hole" feature when exporting DEM. I'm not sure how my client will move the project forward, but I was able to give them a result. I guess the lesson here is to always be skeptical of every piece of information, if you are not the person who collected the data.

Thank you very much, Paul! The silver lining here for me is that you taught me a few new things, which I really appreciate.

In the reference pane, select all your images or cameras and in right click context menu, you will find Clear... which will open Clear Reference menu where you select Location option to clear all cameras reference locations....

Is 65% the forward or side overlap? It is best to have at least 60% side lap and 75% front lap but less can also be dealt with if there is good texture in imagery which seems to be your case as from camera coordinates you are on a mining site, right?

Paulo

  • Hero Member
  • *****
  • Posts: 1178
    • View Profile
Re: Trouble with UAV & Local Coordinate System Workflow
« Reply #8 on: July 21, 2021, 11:40:59 AM »
No problem,

anotherway to get a complete result is to align the 2 datasets in WGS84 in 2 different chunks. In older data set (1st) draw a polygon around gap and export the shape. Import this shape into second dataset (newer without gap) and select all images that touch this shape. Now create a new chunk with all images from 1st dataset + images that concern gap from 2nd dataset.
Align this new chunk and you should get a gapless result referenced to WGS84 (of course with an absolute accuracy of some 3-5 m because of consumer grade GPS onboard drnes)....

This could get you a better representation of the gap....of course if some natural features have changed between 2 surveys (like salt ponds limits due to evaporation) then it could present some issues...

PS. this supposes that the GSD is not too differents between the 2 sets.... if they are very different then matches between older and newer images could be very low and lead to a final chunk with 2 independant alignments or 2 components (older and newer)...In such case you could use markers to align the 2 components as in following tutorial https://agisoft.freshdesk.com/support/solutions/articles/31000158896-connected-components-in-camera-alignment-procedure
« Last Edit: July 21, 2021, 12:08:05 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

Super_Saffer

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Trouble with UAV & Local Coordinate System Workflow
« Reply #9 on: July 27, 2021, 06:15:21 PM »
Thanks again Paul. Yup, the GSP was very different for all attempts. It's just a real mess, and I', coordinating with the client to recollect the data. They can't even get straight which units the GCP are in. Now they tell me it's International Survey feet, after telling me it was first meters and then US Survey ft. Oh well...

Paulo

  • Hero Member
  • *****
  • Posts: 1178
    • View Profile
Re: Trouble with UAV & Local Coordinate System Workflow
« Reply #10 on: July 27, 2021, 07:29:10 PM »
Hey Super,

the coordinates supplied for the GCPs are definitely in feet. I referenced the image of your dense cloud to existing world imagery in Global Mapper. To reference the list of GCPs from your screen capture, I had to define the coordinates to be in orthographic projection with international feet as unit and then move them so they fit within your referenced dense cloud. Also the altitude from the GCPs text file must be transformed to meter (multiply by 0.3048) to fit the downloaded DEM from NRCanada....
see following attachments...

PS. if you want to play around with the workspace here is a zip file containing Global mapper workspace, Densecloud.jpg, gcps.txt, gcps.prj and DEM.tif....
« Last Edit: August 01, 2021, 01:54:02 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

Super_Saffer

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Trouble with UAV & Local Coordinate System Workflow
« Reply #11 on: August 06, 2021, 04:20:06 AM »
Hi again Paul, well I managed to get a new GCP list from the client. Several of them were either the wrong GCP completely, or the GCP had moved.  The 'old' data I'm processing in 2 chunks as it was collected at 2 different heights.  There is a 50m difference in capture height between the 2 "old" sets.  The 'new' data I'm processing as a 3rd chunk.  There is an 80m difference between this set and the lowest 'old' set, and a 30m difference between it and the highest 'old' set.

I can get the 3 chunks to align individually, but now when I try to import the updated reference it doesn't create markers automatically like it used to. Nor can I create markers myself. What could it be now?

Hey Super,

the coordinates supplied for the GCPs are definitely in feet. I referenced the image of your dense cloud to existing world imagery in Global Mapper. To reference the list of GCPs from your screen capture, I had to define the coordinates to be in orthographic projection with international feet as unit and then move them so they fit within your referenced dense cloud. Also the altitude from the GCPs text file must be transformed to meter (multiply by 0.3048) to fit the downloaded DEM from NRCanada....
see following attachments...

PS. if you want to play around with the workspace here is a zip file containing Global mapper workspace, Densecloud.jpg, gcps.txt, gcps.prj and DEM.tif....
« Last Edit: August 06, 2021, 05:43:28 AM by Super_Saffer »

Paulo

  • Hero Member
  • *****
  • Posts: 1178
    • View Profile
Re: Trouble with UAV & Local Coordinate System Workflow
« Reply #12 on: August 06, 2021, 02:58:22 PM »
Hello Super,

maybe you can show the updated reference list to see what could be the problem?
Best Regards,
Paul Pelletier,
Surveyor

Super_Saffer

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Trouble with UAV & Local Coordinate System Workflow
« Reply #13 on: August 06, 2021, 05:16:02 PM »
Attached here. I also sent you a message via the forums, if you're interested?

Coordinates on only 1 (GCP7) spot have been updated, yet when I try to import it it doesn't show up.  The client has multiple GCP set out, and some are close together, so they gave me a picture list of the correct GCP. The KMZ showing the GCP they originally gave me was pretty inaccurate, so I selected the wrong GCP in several cases. GCP 2 "may have blown away and not be visible on the images".



Hello Super,

maybe you can show the updated reference list to see what could be the problem?
« Last Edit: August 06, 2021, 05:54:46 PM by Super_Saffer »

Paulo

  • Hero Member
  • *****
  • Posts: 1178
    • View Profile
Re: Trouble with UAV & Local Coordinate System Workflow
« Reply #14 on: August 06, 2021, 06:31:14 PM »
Yes,

these updated gcps are clearly again in  some local CS with units in feet as seen in attachment where I have to simulate an ortho projection with Planar units in Feet International to fit the gcps with the georeferenced WGS84 project,

So now you have the 3 chunks georeferenced in WGS84 from drone airborne GPS. Now to import the gcps, you need:

- select all cameras in source reference Pane and clear the location coordinates;
- import the gcps to chunk defined as Local CS (ft);
- mark them on each photo where they appear;
- update transformation and now each chunk will be referenced in same local CS (ft)

I suggest you do these operations on duplicates to keep orginal WGS84 referenced chunks as backup....

The 3rd attachment shows Import Reference CSV after clearing cameras Reference Location coordinates....
« Last Edit: August 06, 2021, 06:55:44 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor