doda42/LFToolbox

opt: LFLytroDecodeImage.m

Closed this issue · 4 comments

old version(v0.4) of LFLytroDecodeImage.m has the note in Line72

% DecodeOptions = LFDefaultField( 'DecodeOptions', 'WhiteImageDatabasePath', fullfile('Cameras',LFMetadata.SerialData.camera.serialNumber,'WhiteImageDatabase.mat'));

which can get different kinds of camera's whiteImageDatabase in different folder

But the new version delete it(Line 70), which means that "Camera" folder can only contain one kind of camera's configuration files

The toolbox does work with multiple cameras, no need to modify the code, no need to uncomment that line. Put each camera's white images into a sub-folder of "Cameras". I do this by naming each folder with the serial number of the corresponding camera, as has been done in the LFToolbox0.5 Sample Pack 1 here:
http://www-personal.acfr.usyd.edu.au/ddan1654/LFToolbox0.5_Samples.zip

I'm going to close this, if I've misunderstood the problem you're trying to solve please reopen it.

Thanks to your reply. But, the sample may not contain WhiteImageDatabase.mat. And the new version of code dose not support for including the serial number in the path of WhiteImageDatabase.mat. So when you put different WhiteImageDatabase.mat into different cameras, for example:

├─Cameras
│  ├─A000424242
│  │  ├─CalZoomedOutFixedFoc
│  │  ├─WhiteImages
│  │  └─WhiteImageDatabase.mat
│  └─B5143300780
│      ├─WhiteImages
│      └─WhiteImageDatabase.mat

It will fail to load WhiteImageDatabase.mat.

Have I misunderstood the WhiteImageDatabase.mat? I think different serial of cameras should use different WhiteImageDatabase.mat

There should be one WhiteImageDatabase. If you run LFUtilProcessWhiteImages from the top of your folder structure, as in the demo in the documentation, it will crawl through all of your cameras and keep track of them via serial number. Then you get one WhiteImageDatabase at the top of your Cameras folder.

In future toolboxes the WhiteImageDatabase will be a .json file making it human-readable and a bit more transparent. For now you can use matlab's load() command to look in this file, and you'll see that every entry has an associated camera serial number.

Bottom line: run LFUtilProcessWhiteImages on the top-level camera folder, so you should only ever need one WhiteImageDatabase.