[SOLVED] Bug 11580: Orthoprojection Memory Issue (latest build RC)

Dear developers and community, 

There appears to be an issue with the latest build of RealityCapture where it is using ridiculous amounts of memory (and then virtual memory) to build orthophotos. I will try to keep this post brief. 

When I build an orthoprojection (no matter the pixel dimensions I set) the following happens: 

  • RAM spikes to ca 90%, then plateaus for a little bit, then spikes to ca 98%, plateaus for a little bit, then fills up to the entirety of the 64GB of RAM. 
  • After RAM is full the computer interface slows down drastically, and the pagefile on my C drive is filled. Once its capacity is reached (after about 5 minutes), the ortho rendering fails. 

By comparison, when I render a view, even at 16K (which is larger than some of the orthos I tried to render) the following happens: 

  • RAM spikes to ca 90%, then stays there. 
  • After about 3 minutes my render is complete. Comparison between render and ortho results shows about the same quality result, making me assume that the two essentially function in the same way, only the orthoprojection algorithm has a bug causing huge memory leak. 

Project details: 

  • CLI License v 1.0.3.3939
  • 6423 images
  • Original model 1.5B tris decimated to 40M
  • Unwrap at fixed texel size unit 0.001 (ca 60% of optimal size) 
  • Textured to 392 textures of 4096 pix²

Computer details:

  • i7-6800K CPU
  • GTX 1080 GPU
  • 64GB RAM
  • Windows 10 Home 64 bit 

User Jakub GeoContext posted the same issue on the Facebook group Capturing Reality Arena just shortly before I wanted to post it, so I assume it doesn’t have much to do with my project, and more to do with the latest build of RC. 

Just for info: the only “workaround” that works is in control panel increasing my pagefile capacity to about 750GB (on both C and D drive) and then waiting about 3 hours for a single ortho to render (during which time my computer is completely bricked since RAM is full and both C and D drive are 100% in use). Even with 392 textures of 4096 pixels all loaded at once this should only require 25GB of memory, so I really don’t know why it’s using so much more. After building that one ortho, I then have to reset my pagefile, restart computer to clear it, and then I can resume to the next ortho. Batch processing orthos fails. Given that the client needs about 20 orthos this is an unworkable workflow for this project. 

I really hope there is a solution soon because we bought the CLI license specifically for this project. The client already has laser scans of the scene, all they really wanted photogrammetry for was… orthophotos (of course it’s nice that RC’s 3D photogrammetry model will be about 10x more detailed than the laser scans ;)) Any input or help is very much appreciated. 

Sincerely, 

Thomas

Edit: perhaps it would be possible to download an older version of RC somewhere, so I can see if orthoprojection issue is ‘solved’ in older version? 

As a test I’ve gone back to an old project where I had previously successfully built an ortho with RC, and tried to build a new ortho. The same issue described above occurs, and orthoprojection now fails, indicating that it is indeed a bug in the current version. 

Hello Thomas,

does this error occur in all projects? Would it be possible to share the sample dataset (the samllest possible) and project file and folder with us so that we will be able to reproduce the problem?

Thanks for your reply, I’m uploading the project file to Dropbox now. 

After orthoprojection failed on the project I was working on I tried one more dataset (which I had already produced orthos for in the past) and this one also failed. However because you asked I trialed one more large dataset I worked on in the past, and interestingly this one did manage to run through the entire ortho process, but then when I tried to view the orthophoto it produced an unknown error and then RC closed. 

Oh dear, that does not bode well!

Any news on this yet, Zuzana?

Hello, 

we were able to reproduce the problem. Seems like bug on our side, our developers will look into it. Thank you for reporting this issue. 

Hi Zuzana,

thanks for replying.

Are all orthophotos showing this behavior or is it caused by certain circumstances?

I am asking because I need to be able to create orthophotos and would rather not update if it is a major problem…

Hello everyone,

we found out that this behavior is caused because in the project, there is one singleton model and over 300 textures for this model. This means that RC is loading all the textures when creating ortho projection at once and therefore consumes too much RAM. We need to fix this and will let you know once the issue is fixed.

In the meantime, you need to either import the model and change in the RECONSTRUCTION - Settings - Model import the ‘Maximal vertices count per part’ to a smaller number so that model will be divided into parts and unwrap and texture the model again. Or if the model was created by simplification, there is a need to change Preserve parts to ‘True’ in the Simplify tool settings and again unwrap and texture.

Thanks again for reporting this problem and we are sorry for the inconvenience caused.

Ah, so it is a problem of a very specific combination of circumstances?

Then I assume, that in my (more normal) cases everything will work as usual…

So a little update: as suggested by Zuzana, decimating the high res model with Preserve parts set to “True”, retexturing it and then building orthos helped. I can now once again produce an ortho in ± 5 minutes as opposed to hours or days per ortho (using virtual memory) described above. 

However: 

  • Building texture for the model with parts preserved (40M) took 3 full days, as opposed to a single day for the 40M singleton, using the same texel size settings. The resulting model has 439 x 4096pix² textures as opposed to the singleton with 392 textures, but this isn’t in proportion to the three-fold calculation time increase? 

  • I am now running into the same issue described on the RC Facebook group by user Jakub GeoContext, namely that after generating a single ortho, I have to save, close and re-open the project in order to build a second orthophoto. Batch processing doesn’t work and building a second ortho after the first (manually) likewise gives an “operation failed” message. This is highly annoying and makes producing 30+ orthophotos very tedious work. 

Hi all,

Is this issue fixed as yet? I am having the exact same symptoms when creating an ortho. I have tried the simplify preserve parts work around, however this made no difference.

Any other suggestions?

Cheers

 

Dear jarradmounser,

the issue is fixed but will be released in the upcoming version. In the meantime, I will contact you via email to resolve this individually. Thank you for your understanding.

 

How soon is this fix going to be released?

Hi Zuzana,

 

Do you have a release date for the fix? We are evaluating RC for elevations of heritage site but don’t want to invest in something with some issues, especially since I am trying to learn this software as I go and there is a steep learning curve.

 

Kind regards, Daire.

is this solved? I keep having this issue. 

Hello,

Isn’t this is issue resolved?

I have a model with 585M Polygons in 320 parts and 312 8k textures.

When I try to make an orthoprojection I’m getting Program Memoery Error.

Hi Menandros,
are you creating the ortho from full model? What are your ortho creation settings? Is this also happening for smaller models?
Can you show there your error?

After clearing cache and restarting the app it seems that it is able to create ortho without any error.