Skip to content

This takes a 2D photo as it's input and does some imagining and gives you a LR stereo pair. This is very simple, uses a nice simple tool for most of the underpinnings and works great with my CPU only system

Notifications You must be signed in to change notification settings

matthewkleinmann/3d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

🖼️ Stereo Image Inpainting Pipeline This script wraps the Simple-Lama-Inpainting library into a stereo-aware image processing pipeline. It pads input images, generates inpaint masks, fills missing regions, and outputs left/right stereo pairs with optional gutter spacing.

🚀 Quick Start

  1. Create a Python 3.10 environment python -m venv lama_env source lama_env/bin/activate # or lama_env\Scripts\activate on Windows

  2. Install dependencies pip install simple-lama-inpainting pillow numpy

  3. Run the script python stereo_inpaint.py path/to/image.jpg --pad_percent 10 --gutter 50

🧠 What It Does Given an input image:

  • Pads the image by a percentage of its largest dimension
  • Creates a binary mask for the padded region
  • Uses Simple-Lama to inpaint the masked area
  • Crops the padded result to simulate a "right-eye" view
  • Outputs:
  • Left-eye image (*_L.jpg)
  • Right-eye image (*_R.jpg)
  • Stereo pair with gutter (*_lr.jpg)

⚙️ CLI Options

img_path [--pad_percent] [--gutter] [--l_and_r] [--debug] [--visual_debug]

--pad_percent is the offset between the two images. Note that the offset is imagened, not real. This defaults to 10%

--gutter is the space between the left and right image in the composit. It is specified in pixles. This defaults to 50 pixles.

--debug turns on text messages about the sizes of the images and how it is slicing them.

--l_and_r makes the program save individual l and r jpg images. Default is off.

--visual_debug makes the program save the intermediate steps so you get a jpg of the padded file with the space added to it, you get a jpg of the mask file, you get a jpg of the new file with the padded space imagined.

About

This takes a 2D photo as it's input and does some imagining and gives you a LR stereo pair. This is very simple, uses a nice simple tool for most of the underpinnings and works great with my CPU only system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages