Forum

Author Topic: batch aligning chunks  (Read 10621 times)

monsterchrist

  • Newbie
  • *
  • Posts: 8
    • View Profile
batch aligning chunks
« on: October 31, 2018, 06:43:38 PM »
I searched around for this and couldn't find a solution right a way. 

I want to automate a bunch of tasks using batch and walk away. One of things I want to do is align all other chunks based on the first chunk. It seems Align chunks works with points differently in batch vs running it as the command in the gui. Ran through batch, it does the 2nd chunk based on the 1st and all subsequent chunks are all over the place.

I've set the reference chunk to be the first chunk. Is there something I'm missing?

thanks!
Brad

monsterchrist

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: batch aligning chunks
« Reply #1 on: November 08, 2018, 01:08:02 AM »
Anyone?

Infinite

  • Sr. Member
  • ****
  • Posts: 366
    • View Profile
Re: batch aligning chunks
« Reply #2 on: November 23, 2018, 06:58:05 PM »
Presuming you're using a fixed camera system and that your image names match each other in each chunk, you can use Workflow Align Chunk... and use Method: Camera Based. You can run that on batch by selecting all the chunks you want to align to your selected chunk.

Hope that helps.
_______________________________________________
I N F I N I T E
www.ir-ltd.net

monsterchrist

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: batch aligning chunks
« Reply #3 on: December 03, 2018, 05:35:52 AM »
Thanks for the reply Infinite, I'd almost given up on this post.

I have a fixed camera system and all of my camera names are the same and I use "align chunk" in camera mode to propagate scale and relative position to all other chunks. This seems to work in batch though agisoft could be switching the reference chunk to the one just completed and I'd never know. That's fine though.

I want to use point based alignment in this specific case. I want to get a decent rigid alignment based on my neutral front. It works as expected on the first chunk, but I suspect that Agisoft is changing my reference chunk when align chunk works in batch because every chunk after are rotated and moved into a completely different space than the reference chunk. 

I have a script that loops though the doc.chunks aligning each to the the selected chunk but it would be better if it worked in batch process so I could select and exclude some chunks.  I can disable chunks but that isn't ideal because I have other scripts I use that need and scripts work on the .doc.

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14846
    • View Profile
Re: batch aligning chunks
« Reply #4 on: December 07, 2018, 01:02:19 PM »
Hello Brad,

Are you using "align chunks" in Batch process several times (for each chunk) or only once? And do you select the reference chunk there?
Best regards,
Alexey Pasumansky,
Agisoft LLC

monsterchrist

  • Newbie
  • *
  • Posts: 8
    • View Profile
Re: batch aligning chunks
« Reply #5 on: May 02, 2019, 08:25:07 AM »
Hi Alexey,
I had forgotten about this post until looking up another problem tonight. In the batch, I am using the job only once, and I select the reference in the batch. I have since written a for loop in python that works. This fixes the issue by always using my first chunk to align all of my other chunks to it, but now I'm running into other issues.

To give you further context, I am hoping to use point based align chunks to get a first pass rigid alignment on my facs shapes. I use my neutral as my reference chunk and I am masking off bony landmarks on the neutral photos and setting the align chunks to use masks. I'm using this paper to help with the landmarks

http://studios.disneyresearch.com/publication/rigid-stabilization/

This seemed to work perfectly, and was going to save us tons of time until I realized that the align chunks is scaling the my meshes. I confirmed that this is a problem, by:
    solving a a chunk up to the mesh phase
    propagating scale (we use a measuring device that is set up in ground control)
    duplicating that chunk
    aligning the duplicate
    exporting both meshes and doing a 3 point alignment in Maya


I've set "fix scale" (only available through script?)  in my script and it doesn't seem to respect scaling either. As you can imagine the scaling issue is less than ideal since I am using this for facial expressions, not aligning chunks to merge them.

I don't think align chunks was intended to be used this way, but I was hoping that it could fill this need by setting specific options. Am I using this function incorrectly? is there any way to get the results I'm after? 
« Last Edit: May 02, 2019, 05:28:43 PM by monsterchrist »