Forum

Author Topic: How to project feature pixel-annotation to orthomosaic  (Read 2495 times)

salmon

  • Newbie
  • *
  • Posts: 7
    • View Profile
How to project feature pixel-annotation to orthomosaic
« on: June 22, 2020, 07:11:12 PM »
Hi,
the raw images that were input to Metashape have corresponding pixel-wise feature annotations to classify regions of the image. The raw images were processed to orthophotos.

Is it somehow possible to project the annotations using the same projection as the original images use such that the pixels align?

Furthermore, is it possible to do it the other way around i.e. the orthophoto is annotated and then project to the original image?

JMR

  • Hero Member
  • *****
  • Posts: 502
    • View Profile
Re: How to project feature pixel-annotation to orthomosaic
« Reply #1 on: June 23, 2020, 09:28:46 AM »
How were the annotations written on raw images?

Jordan Pierce

  • Newbie
  • *
  • Posts: 23
    • View Profile
Re: How to project feature pixel-annotation to orthomosaic
« Reply #2 on: June 24, 2020, 03:57:03 AM »
I think he means that each image has a corresponding pixel-wise annotation in the form of an image with the same dimensions. I'd be very interested to see if you could go from an annotated ortho to each image used to create it. What classified ortho are you working on?

salmon

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: How to project feature pixel-annotation to orthomosaic
« Reply #3 on: July 24, 2020, 01:07:34 PM »
Yes, JamesPatrick is right. The pixel-wise annotations consist of a second image with the same dimensions. The pixel values are used to encode information e.g. which type of land is this pixel? building, water, road,...

I'm working on the classification of areas in grasslands.

One use case i can think of is the validation of annotations on orthomosaic. The shape of the annotated area is what i want to validate. I would be able to annotate images taken on the ground align the images and project them on the orthoplan. Then i can layer the ground image annotation with the annotation from the orthomosaic to see where errors were made.
« Last Edit: July 29, 2020, 11:30:07 AM by salmon »

vics

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: How to project feature pixel-annotation to orthomosaic
« Reply #4 on: January 19, 2021, 12:47:10 PM »
Hi there,
did you manage solving this issue? I am also interested in projecting back information from the orthomosaic to the 2D photos

salmon

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: How to project feature pixel-annotation to orthomosaic
« Reply #5 on: January 19, 2021, 04:12:31 PM »
Hi,
nope i think it is not possible with Metashape. However mathematically speaking it should be possible.

For the calculation you will need the estimated pose of the camera and the DEM that was used for orthomosaic creation.  Then for each pixel-feature you need to perform the inverse operation of orthorectification. That will involve raycasting from the pixels of the image you want to project to the DEM and based on that select pixel-features on the orthomosaic.

As an approximation you could use gdalwarp which just does reprojection no raycasting if you have flat terrain.


Paulo

  • Hero Member
  • *****
  • Posts: 1301
    • View Profile
Re: How to project feature pixel-annotation to orthomosaic
« Reply #6 on: January 19, 2021, 04:48:13 PM »
Yes as Salmon says in Metashape, it is not possible to access the individual pixels from Ortho to do reprojection into each photo where it appears. But if you have a shape polygon (3D) for each colored area of interest from your Ortho, then just use Filter Photos by Shapes context menu for selected shape and then you can review each image where selected shape is present and eventually print out or file the image coordinates for such shape. As in attached example, where polygon projection of selected shape is printed out for 4 images...(image size is 4608 pix by 3456 pix)
« Last Edit: January 19, 2021, 06:39:14 PM by Paulo »
Best Regards,
Paul Pelletier,
Surveyor