-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from eweidaw/master
Handle files from Lytro V2 format, by eweidaw, r=nrpatel
- Loading branch information
Showing
4 changed files
with
118 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
In December 2012 Lytro released a software upgrade that supports | ||
perspective shift viewing and "living filters". This entailed a | ||
change to the contents of .lfp files as described below. | ||
================================================================ | ||
|
||
The Lytro Version 2 software generates three .lfp files instead of two | ||
as in Version 1. These files are: | ||
|
||
1. IMG_nnnn.lfp | ||
|
||
This file seems to be pretty much the same as Version 1. I have | ||
not done a full analysis, however. | ||
|
||
2. IMG_nnnn-dm.lfp | ||
|
||
This file is new in Version 2. It contains an expanded depth | ||
map (330 x 330) as well as a confidence map of the same | ||
dimensions. I will wait for someone else to explain what | ||
the confidence map is used for. The depth map represents | ||
lambda values, as in Version 1, but at a much finer | ||
granularity than in Version 1. | ||
|
||
3. IMG_nnnn-stk.lfp | ||
|
||
A file with this name was also generated by Lytro Version 1 software, | ||
but with the Version 2 format the contents have changed. The most | ||
significant difference is that the image stacks are encoded as H264 frame | ||
sequences. The -stk.lfp file may contain one or two image stacks (H264 | ||
frame sequences), depending on whether the user has performed | ||
additional processing for shift perspective viewing using the | ||
option provided in the Lytro processing software. | ||
|
||
An example of running the new lfpsplitter on Lytro files generated | ||
with Lytro's version 2 software is shown below. | ||
|
||
$ ./lfpsplitter IMG_0008.lfp | ||
Saved IMG_0008_table.json | ||
Saved IMG_0008_imageRef0.raw | ||
Saved IMG_0008_metadataRef0.json | ||
Saved IMG_0008_privateMetadataRef1.json | ||
|
||
$ ./lfpsplitter IMG_0008-dm.lfp | ||
Saved IMG_0008-dm_table.json | ||
Saved IMG_0008-dm_lut_depth.txt | ||
Saved IMG_0008-dm_lut_confidence.txt | ||
|
||
$ ./lfpsplitter IMG_0008-stk.lfp | ||
Saved IMG_0008-stk_table.json | ||
Saved IMG_0008-stk_blockOfImagesRef_00.h264 | ||
Saved IMG_0008-stk_lut_depth.txt | ||
Saved IMG_0008-stk_blockOfImagesRef_01.h264 | ||
|
||
The example shown above was run on an image where | ||
perspective shift processing had been performed. If it | ||
had not been performed, only one .h264 file would | ||
have been output for IMG_0008-stk.lfp. | ||
|
||
Note tha lfpsplitter does NOT decode the H264 blocks into individual | ||
images. There are legal issues swirling around H264 decoding, so you | ||
will need to find another utility to accomplish this. You might | ||
try ffmpeg (ffmpeg.org). Using that utility, you could try the | ||
following command line to generate JPEGs: | ||
|
||
ffmpeg -format h265 -i IMG_0008-stk_blockOfImagesRef_00.h264 | ||
-an -qscale 1 IMG_0008-stk_blockOfImagesRef_00_%04d.jpg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters