Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1st Gen Lytro Camera Support #13

Open
mavhc opened this issue Oct 23, 2020 · 12 comments
Open

1st Gen Lytro Camera Support #13

mavhc opened this issue Oct 23, 2020 · 12 comments

Comments

@mavhc
Copy link

mavhc commented Oct 23, 2020

Does anyone know if this software works with the original Lytro Camera? The cuboid one.

@hahnec
Copy link
Owner

hahnec commented Oct 25, 2020

There is only limited support for the first generation Lytro cameras. Before going to details, were you able to retrieve the calibration data files (e.g. data.C.3) from your device?

@koenkooi
Copy link

koenkooi commented Jan 5, 2021

The first gen cameras don't have a real menu, is there another way to generate calibration data, like taking pictures of a known object?

@hahnec
Copy link
Owner

hahnec commented Jan 6, 2021

From a theoretical standpoint, it is an interesting thought to use a known geometric scene to calibrate a plenoptic camera. AFAIK, this would require information about the relative position of the camera with respect to the environment.

From experience, the probably most straightforward calibration approach is to use a so-called white image. In case of Lytro's cameras, white images are stored on the camera's internal memory (e.g. as data.C.3) for a variety of optical settings. Since it appears to be quite cumbersome to retrieve these images from Lytro's 1st generation cameras, one may generate such a white image him- or herself. We can hold the camera into sufficiently bright white light source, take a photo and then pass that file to PlenoptiCam as a calibration image. So, yes: There might be a feasible workaround. Thanks @koenkooi !

Note that each change in optical parameters (e.g. focal length and focal position) would require a corresponding white image and a re-calibration.

@lonetech
Copy link

lonetech commented Feb 7, 2021

I'm pretty sure I have some ancient test code lying around that could read calibration data from the original Lytro. I'll spend a little time trying to revive it.

@hahnec
Copy link
Owner

hahnec commented Feb 8, 2021

@lonetech that‘s great news! let me know if i can assist you with the integration, once you get things running on your side.

@lonetech
Copy link

lonetech commented Feb 9, 2021

Well, just because I can read it out doesn't mean I understand it! Part of it is JSON, and a bunch of chunks are clearly for varied parameters, but they're not the raw images one might have expected. The entire calibration data is only 84K, while containing something like 30 reference sets. With some luck perhaps it's arrays with information like centers and sizes of the lenslets.

This doesn't really mean this is the only calibration data. We might well be able to find white images too.

As for the code revival, I have basic communication over Linux SG, libusb and Wifi TCP working now, and my Lytro is functioning (though I'll want to find the set date function).

The thumbnails are 4:2:2 YCbCr, not 16-bit grayscale as guessed at https://ljirkovsky.wordpress.com/2015/03/16/lytro-protocol/

I do believe the lyli project has some code that uses parts of this calibration data.

By the way, it appears this original model calls itself "F01", if we want another identifier than "that original cuboid one".

lytro.zip

@hahnec
Copy link
Owner

hahnec commented Feb 9, 2021

Sounds all reasonable to me. I got familiar with Lytro's JSON schema once I wrote decoders for the binary image files for both generations of Lytro cameras (see lfp_decoder.py). I just didn't find a quick way for data transfer of the F01 so far. So, by integration I was rather referring to the calibration image retrieval and some required early data preparation. The calibration itself can be covered by PlenoptiCam's generic micro image processing.

Can you share some insights on your sg commands, libusb and Wifi TCP usage? If your procedure is lengthy or involves different tools and languages, it might be worth to open a separate repo at this stage?

This thread proves that there will be developers like me appreciating a way to use the raw data of the first generation camera. Until then, I use mine as a paper weight.

@lonetech
Copy link

lonetech commented Feb 9, 2021

The F01 doesn't know about LFPs or calibration images, AFAICT. It does provide access to raws, thumbnails, and a calibration set. The protocol is a few custom SCSI commands, wrapped in either USB bulk mass storage or TCP. I put up a repo at https://github.com/lonetech/pyly but it may well be less useful than lyli, though it has fewer strict dependencies.

It's just proof of concept test code at the moment. Needs a little bit of restructuring to become a usable package, and some more features like directory parsing.

lyli: https://github.com/martin-pr/lyli

More protocol information, including stuff I haven't implemented: http://optics.miloush.net/lytro/Default.aspx

@hahnec
Copy link
Owner

hahnec commented Feb 14, 2021

Thank you! That might be exactly what's needed. I currently have limited time, but will look into it asap.

@hahnec
Copy link
Owner

hahnec commented May 19, 2021

For the time being, I recommend to use Lyli in conjunction with plenopticam.

@hahnec hahnec changed the title Original Lytro Camera 1st Gen Lytro Camera Support Sep 4, 2021
@hahnec hahnec added wontfix This will not be worked on and removed wontfix This will not be worked on not implemented labels Apr 9, 2022
@asking1125
Copy link

I found that the Lytro 1 generation (The cuboid one) isn't conneting the Lytro desktop. Fail to get calibration data.

@asking1125
Copy link

Hi,
I found that the Lytro 1 generation (The cuboid one) isn't conneting the Lytro desktop. Fail to get calibration data.
So my question is following:

  1. How to obtain the calibration data of Lytro 1 generation.
    2)How to perform Pairing Process in Lytro desktop software.
    Looking forward to your reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants