Forum

Author Topic: Georeferenced planar orthomosaic (fasade)  (Read 3959 times)

flogs

  • Newbie
  • *
  • Posts: 37
    • View Profile
Georeferenced planar orthomosaic (fasade)
« on: January 25, 2022, 04:59:01 PM »
Hi,

I can achieve somehow what I want but only in a too complicated way. My goal is a georeferenced orthomosaic of a fasade of a building. I have read an Agisoft tutorial https://agisoft.freshdesk.com/support/solutions/articles/31000154049-orthomosaic-generation-planar-projection-. But not much usefull concerning this issue. Also note that there do not have to be orthogonal fasade structures enabling for such a process.

I want an orthophoto of a fasade based on georeferenced model coordinates. Now I obtain relative coordinates which needs a quite lot of steps and time to get it back - where Z coordinate is right again.

I use "Markers" projekction plane (Planar projection). I define 3 markers on the fasade (e.g. on the tiled model). Afterwards I remove those projection on the model and edit height (Z) of the two horizontal points to be the same. In order to have georeferenced model, I tried to mark my 3 markers on some photos (without changing there positions). Now I am getting hopefully right output with  good rotation and relative coordinates but not absolute. Center point of my local coordinate system (defined by my 3 markers) is set to 0 on the final orthophoto. It is the same even if I do not remove projections of my 3 markers on the model. Not sure why. And I have to move the picture in the CAD program to the absolute position in Z coordinate to match the whole model.

I think there should much simpler way. Is there any already and am I missing something? I just want a georeferenced orthomosaic which shloud be quite a very common requested output. Why not to give to the point [0,0] of a mosaic a real coordinates from a georefereced model? Many steps I have to do now are not necessessary and even sources of errors.

Thanks
Filip

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Georeferenced planar orthomosaic (fasade)
« Reply #1 on: January 25, 2022, 05:39:59 PM »
Hello Filip,

Can you please elaborate, what do you mean by georeferenced orthomosaic of the facade? Do you have an example of such file that you can share?
Best regards,
Alexey Pasumansky,
Agisoft LLC

flogs

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Georeferenced planar orthomosaic (fasade)
« Reply #2 on: January 25, 2022, 06:36:23 PM »
Hello Filip,

Can you please elaborate, what do you mean by georeferenced orthomosaic of the facade? Do you have an example of such file that you can share?

Of course I can. My models are georeferenced in czech national reference systems (S-JTSK for XY plane, Bpv for Z of height plane). I am a surveyor. If I want to create an orthophotomosaic of a fasade from such a model, I want to have it in the same coordinates. If I create standard top view ortohomosaic (Geogpraphic projection), it is georeferenced correctly. But if I do a Planar projection (based on markers) of a side of a building (fasade), I am loosing the absolute coordinate informations from the model. One of my marker (center of the local system) is assigned to be [0,0] on the final orthomosaic. I want this point and all the rest to be in congruence with the model - czech national reference systems. Metashape has that information.

It is a reasonable requirement from a architect (my customer) to have CAD 2D drawings of a fasade georeferenced. At least in the Z plane - meters about sea level.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Georeferenced planar orthomosaic (fasade)
« Reply #3 on: January 25, 2022, 08:14:41 PM »
Hello Filip,

If possible, please send an example of such orthomosaic to support@agisoft.com, so that we could check, how the coordinate system is defined in meta data. I thought that georeferencing means that X and Y coordinates of the image correspond to Lat/Long (Easting/Northing).
Best regards,
Alexey Pasumansky,
Agisoft LLC

Paulo

  • Hero Member
  • *****
  • Posts: 1301
    • View Profile
Re: Georeferenced planar orthomosaic (fasade)
« Reply #4 on: January 25, 2022, 11:06:54 PM »
Hello all,

I've been working with planar orthomosaic also and I think that wanting Z axis of such projection to represent height MSL is not possible. In the planar ortho the local xy axii correspond to a plane parallel to façade which is almost vertical so local Z can never represent H amsl as it is orthogonal to plane represented by façade. Of course you can always give origin marker a Z corresponding to its height amsl but tthen all points on façade will have about the same Z which does not correspond to reality. I hope that this makes some sense.

For example in attached example, I have a planar projection ortho of a side of a roof. The planar projection was defined using 3 markers where point 1 is the origin of local coordinates (0,0,0), point 1 to point 2 > local x.
I clicked on Point 1 and Point 3 in ortho to get their chunk CRS coordinates and of course their Z amsl is quite different though in the local sustem they are on same plane (side roof) and thus have local z =0...

PS. in case of vertical façade, then the planar ortho can be shifted so that local y corresponds to Z amsl. In 2nd example, I have a a façade done by planar projection with 3 markers (1, 2, 3). In origina ortho (right half of screen), the local coordinates of marker 1 are (0,0). But in shifted ortho (left side), the marker 1 local coordinates are (0,13.4) where the y corresponds to Z amsl...
« Last Edit: January 26, 2022, 10:48:13 AM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

flogs

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Georeferenced planar orthomosaic (fasade)
« Reply #5 on: January 26, 2022, 11:37:45 AM »
Hallo Paulo, thanks, I think you understand this quite well.

But how do you shift the orthofoto from 2nd example? Somehow manually afterwards inside Metashape?

Secondly, I wonder when I am creating that 3 markers on the fasade. Does ortogonality between markers makes any difference? Of course it matters in X axis but for the third vertical marker, it shloud be not important if it is ortogonaly above the origin or not. It should be sufficient to know if it is above or below in order to determine the right view of the orthofoto (front or back). Am I right?


Paulo

  • Hero Member
  • *****
  • Posts: 1301
    • View Profile
Re: Georeferenced planar orthomosaic (fasade)
« Reply #6 on: January 26, 2022, 11:47:42 AM »
Hello flogs,

to produce a shifted ortho of vertical façade, a script would have to be developped ...

As for 2nd question, it is important that first 2 markers (defining x or horizontal axis) be well placed on horizontal plane. 3rd marker does not need to be orthogonal to markers 1 and 2. It defines the projection plane (but should be on same vertical plane than 1 and 2 for a trule vertical p;ane projection) and its position relative to 1 and 2 (above or below) will define orientation of resulting ortho (up or down)...

Hope this can be useful in your endeavours,
« Last Edit: January 26, 2022, 04:32:28 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

flogs

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Georeferenced planar orthomosaic (fasade)
« Reply #7 on: January 26, 2022, 04:44:02 PM »
Hello Filip,

If possible, please send an example of such orthomosaic to support@agisoft.com, so that we could check, how the coordinate system is defined in meta data. I thought that georeferencing means that X and Y coordinates of the image correspond to Lat/Long (Easting/Northing).

Hello Alexey,

please, see Paulo's answers. He pretty well understood what I wanted. If his assumtions are in congruence with you and Agisoft, there is not much else to solve. It is not possibile to achive what I want directly in Metashape. Or at least not without additional script. All generated planar orthomosaics are only in a local coordinate subsystem which has its origin in one of the markers used for this purpose. Trasnformation (move) in case of vertical fasades can be done outside metashape - which I know how to do it.

Filip

Paulo

  • Hero Member
  • *****
  • Posts: 1301
    • View Profile
Re: Georeferenced planar orthomosaic (fasade)
« Reply #8 on: January 27, 2022, 07:42:41 PM »
Filip,

another possibility is exporting your planar ortho vertical façade with a world file such that it is placed corectly in chunk crs. Example shows a planar ortho vertcal façade of a colonial house in Hanoi created from a ladybug panomaric street suvey. With the world file the ortho is correctly placed in the project UTM CS...

PS. In this case only markers 1 and 2 (defining vertical planar projection x axis) are placed correctly in project CRS. Point 3 position which is on vertical façade of course is not placed correctly on project CRs.

« Last Edit: January 28, 2022, 10:14:11 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

flogs

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Georeferenced planar orthomosaic (fasade)
« Reply #9 on: January 28, 2022, 07:02:51 PM »
Filip,

another possibility is exporting your planar ortho vertical façade with a world file such that it is placed corectly in chunk crs. Example shows a planar ortho vertcal façade of a colonial house in Hanoi created from a ladybug panomaric street suvey. With the world file the ortho is correctly placed in the project UTM CS...

Hi, now I am not sure what should be the trick. :) I am already using world file to place the mosaic in CAD. But the world file corresponds only to a local cs, not the model crs (or chunk crs as you said). F.
« Last Edit: January 28, 2022, 10:44:56 PM by flogs »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: Georeferenced planar orthomosaic (fasade)
« Reply #10 on: January 28, 2022, 07:30:13 PM »
Hello Filip,

Would it be sufficient for your needs, if the orthomosaic is exported to TIFF format is a way similar to Paul's example with World file, when facade orthomosaic bottom corners have real geographic XY coordinates assigned and the orthomosaic itself if put from vertical plane to horizontal (geographic XY)?
Best regards,
Alexey Pasumansky,
Agisoft LLC

flogs

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Georeferenced planar orthomosaic (fasade)
« Reply #11 on: January 28, 2022, 11:17:55 PM »
Hello Filip,

Would it be sufficient for your needs, if the orthomosaic is exported to TIFF format is a way similar to Paul's example with World file, when facade orthomosaic bottom corners have real geographic XY coordinates assigned and the orthomosaic itself if put from vertical plane to horizontal (geographic XY)?

Yes, we are getting very close to what is needed. :) And sorry, Pauls pictures are so wide I did not see the right part last time. Thas why I did not understand.

To be clear, let's repeat my goal once again. (Firstly without mixing Metashape to it.) I have a referenced 3D model of a house. Coordinates XY are in horizontal plane, Z is in vertical plane. I want to make orthomosaic e.g. of every side of the house. I need the exiting Z axis of the 3D model (even absolute values - heigth above sea) to be preserved in all orthophotos. I do not care so much about XY (geographic). Let's say I need to look to the fasade like I would be exactly paralel to the model Z axis. What if a house is little bit oblique? I don't care. I need to stick to absolute heigths so I need always the same angle looking to different fasades. Because at the end, I want e.g. the top spot of the house to be in the same heiht on all orthophotos. It is a very common goedetic requirement, I think.

Even playing with Markers, I mention some significant differences (many centimeters) between rooftops which should be the same on all my fasades. Not sure why. If there were a little difference in planar angle or it is an inaccuracy when Metashape generates mosaics. I tried jgw world file and it did no preserve original heights from the model. I did not try tiff and corresponding world file recently. I manually moved positions of orthomosaics in CAD in order to corresponds to absolute model heights.

So with this phillosophy, the three markers has to be in the same plane but not exactly on the side of the building. Only two horizontal markers have to be on the fasade but the third has to be straight above the first two but not neccessarily on the fasade if it is not absolutely vertical.
« Last Edit: January 29, 2022, 01:05:24 AM by flogs »

Paulo

  • Hero Member
  • *****
  • Posts: 1301
    • View Profile
Re: Georeferenced planar orthomosaic (fasade)
« Reply #12 on: January 29, 2022, 04:05:45 AM »
Heelo flogs,

Thanks for the explanation, now I  better understand your needs .. Yes a script could be developped so that for each 2 markers set at base of a building façade, a vertical planar projection is done with the local y set to absolute Z amsl so that each side willl have same height reference... in example a building is shown and for 2 façades (defined each by 2 markers( a relevant planar vertical projection is built. Note each planar ortho has same Z reference as seen by picking top of house and getting Z aMSL (Local Y in ortho CS) equal to 656.4 m...The model is not great so excuse he imperfections, but I think it gives you an idea,

So if you need more explanatio, please PM me,
« Last Edit: January 29, 2022, 08:39:58 AM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor

flogs

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: Georeferenced planar orthomosaic (fasade)
« Reply #13 on: January 29, 2022, 07:29:50 PM »
Heelo flogs,

Thanks for the explanation, now I  better understand your needs .. Yes a script could be developped so that for each 2 markers set at base of a building façade, a vertical planar projection is done with the local y set to absolute Z amsl so that each side willl have same height reference... in example a building is shown and for 2 façades (defined each by 2 markers( a relevant planar vertical projection is built. Note each planar ortho has same Z reference as seen by picking top of house and getting Z aMSL (Local Y in ortho CS) equal to 656.4 m...The model is not great so excuse he imperfections, but I think it gives you an idea,

So if you need more explanatio, please PM me,

Yes, that's it. Very common surveying task. I don't need more explation. I know what I want. And now you know what I want. :) The only question remains if it is worth for me to go for python script or maybe there can be some utilization of the software as Alexey sort of suggested (if I felt it right). I will PM you not to bother others here. Thanks very much!

UPDATE: Paulo suggested to create a paid script for this. I am not interested in that. I originally looked for an already existing solution in Metashape. It seems the software has not any right now. So I continue with tweaking it differently or I will find time to solve it myself. Thanks.

In short, for everyone who wants what I want. You have to remove markers projections and edit coordinates of 3 markers in order to create an orthomosaic. Horizontal markers has to be strictly horizontal and verical markers strictly vertical (strictly right angle between markers not required). Aftewards it works pretty well. And then in CAD you have to move the picture to desired absolute height. Not so complicated but maybe still not easy to figure out rigth away for most surveyors.
« Last Edit: February 01, 2022, 04:20:57 PM by flogs »

L_A

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Georeferenced planar orthomosaic (fasade)
« Reply #14 on: January 31, 2022, 04:48:21 PM »
If the facade is vertical and you have 3d coordinates of two points on the facade (e.g. A and B) in the desired reference system,  it is not necessary that the two points have the same height.
I create three imaginary points:
O has Long and Lat equal to A and arbitrary Alt
X has Long and Lat equal to B and Alt like O
Y has Long and Lat equal to O and Alt greater than O
So the three points are orthogonal to each other.
Having the real coordinates of O, it is easy to give the right shift to the orthophoto, but it would be better if this was inserted directly in Metashape