Forum

Author Topic: When to merge and align chunks?  (Read 28499 times)

Captbyrne

  • Newbie
  • *
  • Posts: 19
    • View Profile
When to merge and align chunks?
« on: July 20, 2014, 02:05:28 AM »
Greetings all,

I am in the middle of a large ortho project that has about 14,000 images for a GIS dataset. I am doing it in 14 chunks with about 1,000 images per chunk.

My question is, when should I add the ground control? Should I do it in each individual chunk prior to aligning and merging the chunks? Or should I align and merge the chunks first, then add the ground control?

I would appreciate any input from users that have done similar projects.

Thanks,

Dave

Captbyrne

  • Newbie
  • *
  • Posts: 19
    • View Profile
Re: When to merge and align chunks?
« Reply #1 on: July 20, 2014, 04:28:09 AM »
I should add that when I said ground control, I meant markers. The photo alignment was done with GPS positions in the EXIF data and i have a set of ground control points that I will use to refine the accuracy.

Dave

kforbes

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: When to merge and align chunks?
« Reply #2 on: July 20, 2014, 05:26:25 AM »
Similar to this question, what exactly does align chunks do?  I tried a test and had very confusing results. 

I took images of the same place with two cameras.  I put the images from both cameras into separate chunks.  I ran the workflow on each chunk, then aligned the chunks and exported orthophotos from each chunk.  The orthophotos don't overlay very closely when loaded into an image editor.

Next, I loaded all images into a single chunk and aligned the photos.  Then I exported two orthophotos for each group of images.  The output orthophotos exactly overlay.

So exactly what is the intended benefit of align chunks if the resulting images don't actually overlay properly?   The ideal scenario for me is that I load images from different cameras into different chunks, align chunks, and then the exported orthophotos perfectly overlay so that I can do image processing on them.

mobilexcopter

  • Newbie
  • *
  • Posts: 48
    • View Profile
    • mobileXcopter
Re: When to merge and align chunks?
« Reply #3 on: July 20, 2014, 07:15:56 PM »
You can use chunks for larger projects where there are too many pictures to process them ( because of limited computer resources, etc... ) and then align them or if you use batch process tool on several chunks, where different project reperesents one chunk.

Best regards,

Alex


David Cockey

  • Full Member
  • ***
  • Posts: 209
    • View Profile
Re: When to merge and align chunks?
« Reply #4 on: July 21, 2014, 12:00:25 AM »
Similar to this question, what exactly does align chunks do?  I tried a test and had very confusing results. 

I took images of the same place with two cameras.  I put the images from both cameras into separate chunks.  I ran the workflow on each chunk, then aligned the chunks and exported orthophotos from each chunk.  The orthophotos don't overlay very closely when loaded into an image editor.

Next, I loaded all images into a single chunk and aligned the photos.  Then I exported two orthophotos for each group of images.  The output orthophotos exactly overlay.

So exactly what is the intended benefit of align chunks if the resulting images don't actually overlay properly?   The ideal scenario for me is that I load images from different cameras into different chunks, align chunks, and then the exported orthophotos perfectly overlay so that I can do image processing on them.

How many photos? How much overlap?

What settings were used for "Align Photos"? What is the "Effective Overlap" and "Reprojection Error" for "Show Info" for each chunk.

What settings used for "Align Chunks"?

Mikeman

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: When to merge and align chunks?
« Reply #5 on: August 05, 2014, 07:35:46 AM »
My question is, when should I add the ground control? Should I do it in each individual chunk prior to aligning and merging the chunks? Or should I align and merge the chunks first, then add the ground control?

This was the main question and I am also keen to get the answer/s

Limpopo_River

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: When to merge and align chunks?
« Reply #6 on: August 09, 2014, 08:08:03 PM »
I have a similar situation and am interested in the responses.  I have four+ image sets of the same object (rock face) taken with different camera settings (but no changes in camera focus or aperture within each of the four image sets).  The reasons for multiple image sets of the same object were primarily the limited memory card available for the camera (8 Gb), which ran out before finishing one of the sets, so we repeated the capture.  Also, we captured the scale in two image sets on an adjacent part of the wall, at two distances and camera settings. 

Because it was a vertical wall, we had >60 percent vertical overlap of images in portrait orientation within each image set, and we also rotated the camera 180-degrees and horizontally in overlapping rows of images for calibration purposes.  The total image data set was 800+ images, with 2 chunks each having about 400 images and 2 chunks for scale each having ~20-40 images.

My workflow, which didn't produce as good a result as I had hoped, was as follows:

1.  I loaded each of four image sets into a chunk within the project.  I masked and aligned photos in each chunk independently, producing a single camera calibration for that chunk.

2.  I aligned the chunks (point-based, high accuracy, constrain features by mask, generic preselection, 80,000 point limit).

3.  Merged chunks.  I didn't add scale bars to the ground control pane yet; I just marked the points on my scale in the photos.  I'd suggest not merging the markers if you have markers in more than one chunk, because Marker 1 in one chunk will get confused with Marker 1 in a different chunk--generating many gray marker flags that are mislocated.

4.  I optimized the alignment on the merged chunks.  I prefer to use gradual selection very lightly (only removing about 40K points from a sparse point cloud starting with >9M points) at each optimization step.  Once I got reprojection error to about 0.35 pixel and reconstruction uncertainty of less than about 30, I added scale bars and continued the optimization until RE < 0.3 (about 2.6) and RU <10.

5.  I generated the dense point cloud at low quality to check the optimization. 

I was disappointed to find that the dense point cloud is in layers with many discontinuities, rather than converging on a single continuous surface.  It appears that the slight differences in camera calibration leads to depth maps that differ, even though the calibration for each chunk produces a single, continuous surface.

I had learned (I thought) that using multiple cameras of the same object can help to improve the reconstruction uncertainty, but apparently not in this case.  I'm wondering how I can get the different chunks to agree better and converge on a single surface?  I spent many hours optimizing these data sets, but the results are not what I had hoped.

Limpopo_River

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: When to merge and align chunks?
« Reply #7 on: September 09, 2014, 12:47:02 AM »
I thought it would be worth mentioning a change in my workflow that seems to have produced better results than my last post on this topic.  I've gotten better results by loading all 4 image sets into a single chunk, and aligning them with pair preselection disabled.  This meant the alignment step took 29 hours for 823 images vs. about 2 hours with generic pair preselection.  The benefit, however, was that the alignment produced tie points between all the overlapping images in all the image sets, whereas pair preselection previously only produced tie points between the nearest overlapping images in a single set of images.  Now, using disabled pair preselection, when I optimized the sparse point cloud as a single chunk, the camera calibration converged to produce a single, continuous surface from all the images.

I'd like to build the mesh using the dense point cloud I processed on high quality (about 400 million points), but my machine doesn't have enough memory (only 32 Gb).  Others have suggested making copies of the complete chunk and making a smaller, slightly overlapping bounding box volume for each copy of the chunk.  Then one could generate a mesh for each smaller bounding box and merge the chunks and models together at the end.  I have concerns about this approach, however:  when I tried this on another project, I found that the merge chunks step doesn't produce a continuous mesh, but instead creates a confusing double mesh (in some cases I had four overlapping meshes at the intersection of multiple chunks).  Unless there's a way to merge the meshes from each chunk to eliminate the redundant polygons where the meshes overlap (using Meshlab or CloudCompare, perhaps?), I think I need a better solution.

igor73

  • Full Member
  • ***
  • Posts: 228
    • View Profile
Re: When to merge and align chunks?
« Reply #8 on: September 30, 2014, 11:47:33 PM »
I have also noticed that the chunks does not become welded when you align the chunks. I used camera based alignment.  Maybe point based works  better for welding the meshes together? Anyone know?

The reason i work in chunks is RAM limit though and i have feeling i will run out of RAM if i use point based chunk align.  Also the processing time is very slow. Camera based is instant.  The alignment in all cases i have tried it was perfect though, except that the chunks are not welded.  This should not be a problem unless you plan to print the model though which i do.  Also if you want to UV map in external software you need to make a low poly version and the un welded chunks create problems in many apps.

I have overcome this problem by editing the mesh i zbrush though.   First i decimate the mesh to 200k ploys or so then i convert to Dynamesh and after that run Zremesher to get the poly count down to about 150K. Converting the mesh to Dynamesh will merge the mesh and give you good topology.    Reason i use Zremesher is  to get perfect topology for UV mapping.  The UV map generated by Agisoft is very bad and inefficient. It is broken up in thousand of pieces making it impossible to edit.  Also it uses the UV space poorly giving you low resolution.  After UV mapping i project detail back to the mesh from a copy of the high poly original mesh.  I subdivide and project, subdivide and project again.  In the end i will get back all the details of the original mesh.  Some artifacts may appear but can be fixed.   

igor73

  • Full Member
  • ***
  • Posts: 228
    • View Profile
Re: When to merge and align chunks?
« Reply #9 on: September 30, 2014, 11:53:26 PM »
And yes i have also noted MUCH better results when you place all images in the same chunk for alignment.  Align images is not very RAM intensive. I have 64GB of RAM and excpect to be able to process over 10.000 images on high with out a problem.  Dens cloud i am limited to around 50-70 36mpix images on high though and here the chunks are very necessary for a large project.

 I use the same workflow as you.  Dublicate the sparse cloud to lets say 5 chunks and then resize the box so each one overlaps a bit.  Having the overlap does not get rid of the unwelded seams though so not sure i will bother with this in the future. Seems like a waste of processing time as i get a perfect aligned mesh with out overlap anyway.