Posts Tagged ‘photosynth’

PhotoSynthToolkit 11

May 23rd, 2012

I’ve for some reason extra time to kill so I’ve updated PhotoSynthToolkit (SFMToolkit will follow soon). I’ve been only focusing on PMVS2 for this release: I’ve integrated Nghiaho optimization, fixed white-space folder handling in PMVS2 using boost::filesystem and fixed the timing output in the console. Thus there is no need for the ugly temporary z drive anymore :-) .

Nghiaho optimizations are disabled by default as I’ve found that it generates a point cloud less dense. You can enable the optimization by adding:

--optimize

as last PMVS2.exe parameter in your command prompt or just activate the optimization by modifying the following files:

  • 3 – Prepare for PMVS2.wsf line 49 -> var USE_OPTIMIZED_PMVS = true;
  • 4 – Prepare for CMVS.wsf line 46 -> var USE_OPTIMIZED_PMVS = true;

You can download PhotoSynthToolkit11.zip.

Share

PhotoSynthToolkit 10

May 1st, 2012

What do you think of this concept: a new PhotoSynthToolkit version almost everyday? :-) .

This version introduce a new feature that will allow you to process a PhotoSynth without needing to wait for the end of the upload. In fact you can even cancel your synth as soon as the computation is complete. But be aware that all pictures uploaded in the meantime will stay on photosynth server (AFAIK).

How to proceed:
- wait for synth to be processed (but not fully uploaded).
- copy the 2 following files from %temp%\Photosynther to another folder (d:\my_synth for example)

  • collection.dzcz
  • collection.synth.bin

- then you can launch the step 1 of the PhotoSynthToolkit by providing your folder (d:\my_synth).
- you’ll need then to copy your original jpegs to the distort folder and you’re done!

You can download PhotoSynthToolkit10.zip.

Share

PhotoSynthToolkit 8

April 14th, 2012

I’ve finally decided to release the new version of my PhotoSynthToolkit. This new version has bundle.out output support: this was indeed easy to add as I’ve already implemented it in my WebGL chrome extension. I’ve also rewritten the network part of the downloader by using libcurl. PhotoSynthDownloader is now replaced by my new tool PhotoSynthGrabber. BTW thumbnail/HD pictures downloading should be really much faster ;-) .

New feature coming:

  • CMVS support (coming very soon)
  • White space handling in the toolkit scripting (PhotoSynthGrabber is already ready)
  • Expose HTTP Proxy parameters for the downloader

You can download the new version: PhotoSynthToolkit8.zip or keep the previous one in case you miss some advanced feature (vis.dat generation, SoftImage XSI / 3DS Max scripting for example): PhotoSynthToolkit7.zip.

Share

WebGL Photosynth extension updated

March 25th, 2012

I’ve updated my PhotoSynth extension for Google Chrome. I’ve included all optimization described in my previous post: point cloud loading is 4x faster and ply file generation could be 17x faster in some cases ;-) . As you can see in the screenshot below, I’ve also added a new checkbox to let you choose if you want to load thumbnails or not in the WebGL context (which could take a while for synth with more than 200 pictures).

 

There is still room for improvements: I’ve discovered lot of interesting stuff that I’ve to try in Lilli Thompson speech at the GDC. In particular I’d like to improve:

  • memory usage: track V8 garbage collection
  • thumbnails loading: could be speed-up by using a web workers too
  • Three.js rendering: I still need to switch to r48 and use BufferGeometry
  • bundle.out generation: still very slow for big synth

To accelerate bundle.out file generation I’ve found a solution working pretty well for very large ascii file (80mo+). I’m generating the ascii file by writing directly in binary in a Uint8Array (by chunk of 1mo). The resulting code is more complex but is as fast as regular string concatenation and in comparison as a memory footprint very limited. It’s not integrated in the extension yet as my test case is working well (ascii ply generation) but bundle.out is slow (I need to track V8 bailout/deopt to understand why it’s slow).

Share

Improving PhotoSynth extension performance

March 19th, 2012

I’ve recently discover the new transferable object feature in Google chrome. BTW transferable objects are really great! Furthermore you really should use them as I’ve found that structure cloning is leaking (you can try this leaking demo with chrome 17). Thus I’ve started to update my extension and done a benchmark of various solution with a big synth of 20mo (1200k vertices and 1000 pictures).

I’ve also improved a lot my binary parsing by using only native binary parsing (DataView). One thing about DataView: did they realize that if you forgot the endianness parameter it will use BigEndian? (littleEndian = x86, bigEndian = Motora 68k).

Thanks to both optimization the new version is 4x faster! (loading time: 24s > 6s)

solution 1



  • cross-orign was forbidden in contentscript (fixed now since chrome 13)
  • lack of TypedArray copy/transfert -> JS array replacement
  • Loading time: 13600ms (24400ms with the previous version without optimized binary parsing)

solution 2



  • Issue: the UI is frozen during parsing (lack of threading)
  • Loading time: 6500ms

solution 3



  • I’m using transferable objects to both send the xhr.response (ArrayBuffer) and receive the parsed Float32Array (vertex positions) and Uint8Array (vertex colors).
  • Issue: I didn’t manage to spawn a worker from my extension directly (SECURITY_ERR: DOM Exception 18): I’ve been forced to inline the worker as a workaround.
  • Loading time: 6000ms

solution 4



  • Issue: because of this bug workers can not do cross-orign xhr.
  • Loading time: N/A

I’ve also optimized the PLY file generation by generating binary file on the client side instead of ascii.

  • Ascii: 74mo in 9000ms
  • Binary: 17mo in 530ms (~17x faster!)

Sadly I didn’t manage to find a way to accelerate “bundle.out” ascii file generation yet (involving lot of string concatenation and numbers formatting).

I didn’t have updated the extension on the chrome web store yet as I’m working on using the new BufferGeometry of Three.js that should be more efficient. Building BufferGeometry directly from Float32Array (vertex positions array) and Uint8Array (vertex colors array) seems a really better solution IMO.

Mesh compression

I’ve also discover the webgl-loader mesh compression solution recently. I’ve compiled my own version of objcompress.cc and fixed the JSON export. Then I’ve created my own format allowing to pack in one file all the utf8 files (thus reducing the number of http request needed). I will post about it soon: stay tuned!

Firefox extension?


On a side note I’ve also been playing with the new mozilla add-on builder SDK… well IMO Firefox isn’t the best browser for extension anymore. I’ve been very disappointed by the restriction applied to code running in the contentscript (for example prototype.js is not working: I had to use a clone that I’ve built long time ago). And I’m also very concerned about their security strategy: they don’t have a cross-orign xhr permissions field in the manifest. Thus extensions can do cross-orign request to all domains by default! Nevertheless I’ve managed to port the binary parsing of the point cloud but Three.js is not working either :-( .

Share