9
« on: November 15, 2024, 05:29:01 AM »
Hi All,
I have spent alot of time trying to work this specific requirement out, so thought I would share in case it may help others. I'm sure alot of MS users reading this will think this is obvious or have a better way. I would be very happy to hear from those users.
Problem - how do you shift a MS job from assumed coordinates (XYZ) to a either somewhere else in space or to a published coordinate system (E,N,ALT or lat,long,heigh). This solution is for when you have markers in your job that you can calculate the shift (XYZ and rotation) required to move them to required new coordinates.
By Assumed Coordinates, I mean where you have no exif location data and have just nominated a point in your MS job at any coordinate e.g. Point 1 has XYZ of 1000.000,2000.000,50.000. This example of "Assumed" coordinates could also be called "Local Coordinates" in metashape.
I have a project where I have captured the underside of a bridge with a handheld camera. These photos have no exif location data. This is a visual inspection job so actual true location and true dimensions are not critical but it would be handy if the job was roughly in a known CRS so I need to move it.
I did have a survey staff (3metres long) in some of the photos to act as a scale bar. That scaled the project to roughly actually size.
After aligning the photos, the sparse cloud is created. I rotated the sparse cloud using "rotate object" to put the z axis roughly "up" and also roughly rotated the sparse cloud alignment to match the real world bridge direction. I only did this so it visually looked close to the real world bridge look, making it easier to work on the data. During the photo alignment I had needed to create some markers to help it align. In the reference pane I gave one marker an assumed "source" coordinate ( x=40 y =25, z=10) by writing in the Reference / "View Source" / marker XYZ . After ticking one marker running the "optimize cameras" that meant all my other markers now had "estimated" x,y,z values - These are shown after clicking the Reference / "View Estimated" button. I copied (via click,drag,hightlight,copy) all the marker's "estimated" XYZ values and pasted those values into a Excel spreadsheet and saved as a csv file. I then imported them into MS using the "Import Reference" function. So now a have a project on "Local Co-ordinates" with all markers having "Source" values. I created two additional markers at each end of my bridge. I exported all the marker values to a csv.
I then used a external website that has a map viewer and shows location values for the cursor when over the map. The web site allows the user to extract location values in many different Coordinate Systems e.g. WGS 84, MGA2020 etc. From this I could get two very rough MGA2020 coordinates for either end of my bridge (at similar locations to the additional points I created in Metashape). I used some survey software to rotate and shift all my markers from assumed coordinate to MGA2020 based on these two common points. I exported out the MGA2020 coordinates of all markers from the survey software to a csv.
I then -
10. Using the "Import Reference" command - Re-imported markers (using the new csv - When the "Import csv" dialogue box opens, if needed, change the "Coordinate System" from Local Coordinates to the defined CRS you need. In the example I have attached I am going from Local Coordinates to MGA 2020 (EPSG 7856), click OK and import the data. This updated all my source marker values to MGA2020 values
11. Under the Reference Settings the "Coordinate System" should now be showing the CRS you want (not Local Coordinates)
12. Tick all your markers on and click " Update Transform"
13. In the Reference Tab / "View Source" list - your markers should have the correct coords and labels (e.g. E,N,Altitude or Lat,Long not XYZ)
14. The data should have moved. Also click View Menu/ Reset View to see your data.
15. If you get the error message" Error- vertical datum outside tolerance" you have a marker or markers that did not update and still on their original coords. Either delete or update these.
Notes
20. For Step 10 - if you are just moving your data from a "Assumed" CS to another "Assumed" CS to can just leave the "Coordinate System" as "Local Coordinates"
21. Obviously this method could be adopted if you have "accurate" marker values in both local and CRS. You would not have to use external software and resources.
I hope this may help someone with the same need.
Kind Regards,
Ben