Forum

Author Topic: Exporting a layerstack of aligned bands for a single image  (Read 1702 times)

UAV_project

  • Newbie
  • *
  • Posts: 25
    • View Profile
Hey guys,

I am using Metashape for orthomosaics, but I was wondering if it could perhaps be used for another task in my project.
I have a set of MicaSense images where the bands are unaligned. What I want is to align all bands for a given image. I have tried to play around with it myself, using a 3x3 subset of the chunk.camera[0].transform as a homography matrix, but it doesn't seem to be working.

Is it possible for Metashape to help me with this task? Or shall I look elsewhere? I have also tried CV2 but they seem to have poor support for 16bit imagery (which MicaSense is), and my warped images are being given back as 8bit.

Thanks!

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14816
    • View Profile
Re: Exporting a layerstack of aligned bands for a single image
« Reply #1 on: May 12, 2020, 07:58:04 PM »
Hello UAV_project,

Can you please elaborate the task?

Do you mean that in the large project you have several not aligned cameras or whether you want to align the bands of the single camera only?
Best regards,
Alexey Pasumansky,
Agisoft LLC

UAV_project

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Exporting a layerstack of aligned bands for a single image
« Reply #2 on: May 13, 2020, 10:02:58 AM »
Hey Alexey,

The second option is what I am looking for. Essentially, what I have is a mask image which I have created to overlap with the MicaSense band 4. But since the other bands are not aligned with band 4, the mask is inaccurate for the other bands. So I want to transform the other MicaSense bands for this capture so that my mask lines up with all bands instead of having the make a new mask for each other MicaSense band.

Yesterday I was trying to get a set of tiepoints by loading just the 5 band images into Metashape and deriving the point cloud in hopes that the coordinates of the tiepoint projections could help me to get a homography matrix using something like OpenCV, but if there is a way to perform this alignment task using only Metashape then I would prefer this method.

Thanks.

UAV_project

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Exporting a layerstack of aligned bands for a single image
« Reply #3 on: May 13, 2020, 06:30:18 PM »
Well I have been having pretty good results now by using the coordinates of the point cloud tie points and feeding them into cv2 to find the homography and then warping. The only issue is that when I do get a good resulting homography matrix, I can't seem to obtain the same results when I repeat the process. I guess this is due to some randomness in the camera parameter optimization?

UAV_project

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: Exporting a layerstack of aligned bands for a single image
« Reply #4 on: May 14, 2020, 02:39:35 PM »
After another day of working on this band alignment task, I am wondering if there is any way that I could ensure more consistent results from the camera optimization parameters?

In the end I would like to have it automated such that I don't need to go checking the result manually each time in order to see if the result was accurate or not. Because right now I am running the exact same code over and over, but sometimes it will align perfectly, while other times the results are a somewhat offset.