generate_11x11_ppm_for_lenslets
Author: Ismael Seidel Affiliation: Embedded Computing Lab (ECL), Federal University of Santa Catarina (UFSC)
- Description:
This module renames PPM files to select a subset of the views and starts counting from view 000_000. This implementation is for JPEG Pleno CE 14.
- get_lenslet_lf(name)[source]
Create a LightField object for a lenslet configuration (11x11 views).
- Parameters:
name (str) – Light field name
- Returns:
Light field object with lenslet specifications
- Return type:
- get_raw_lenslet_lf_ppm(name, raw_ppm_path)[source]
Create a raw light field data object for lenslet PPM files.
- Parameters:
name (str) – Light field name
raw_ppm_path (str) – Path to the raw PPM files
- Returns:
Raw light field data object
- Return type:
- load_paths_from_json(cfg_file)[source]
Load paths configuration from a JSON file.
Loads the raw_ppm_path, selected_ppm_path, and other paths from a JSON configuration file.
- Parameters:
cfg_file (str) – Path to the JSON configuration file
- Returns:
Dictionary containing paths from the JSON file
- Return type:
dict
- copy_and_rename_files(raw_ppm_path, selected_ppm_path, xxx, yyy, limit_xxx, limit_yyy)[source]
Copy and rename PPM files from source to destination with view indexing.
Copies files from raw_ppm_path to selected_ppm_path, renaming them from xxx_yyy.ppm to 000_000.ppm format, within the specified view limits.
- Parameters:
raw_ppm_path (str) – Path to the raw source files
selected_ppm_path (str) – Path to the output folder
xxx (int) – Offset for the first view index dimension
yyy (int) – Offset for the second view index dimension
limit_xxx (int) – Maximum value for first dimension before stopping
limit_yyy (int) – Maximum value for second dimension before resetting
- Returns:
None
- Return type:
None
- main()[source]
Generate 11x11 PPM files for lenslet light fields.
Processes lenslet light fields to extract and rename views into 11x11 grid format, starting from view 000_000. Performs validation by converting to YUV and comparing with previously generated YUV files.
Usage: python generate_11x11_ppm_for_lenslets.py <configuration.json>
- Returns:
None
- Return type:
None