Skip to content

A python based script for combining 8 separate photos taken by the Vuze 4K 3D 360 camera into a stereo 360 image.

License

Notifications You must be signed in to change notification settings

e-regular-games/vuze-3d-stitcher

Repository files navigation

vuze-3d-stitcher

A python based script for combining 8 separate photos taken by the Vuze 4K 3D 360 camera into a stereo 360 image. The goal is to provide a unix based alternative to the Vuze VR Studio which is only available on Windows and MAC. In the process, it may be possible to improve upon the overall stitch and output image quality. A set of sample images with their merged output is provided below.

Left-eye, facing forward. Left-eye, facing right. Left-eye, facing backwards. Left-eye, facing left.
Right-eye, facing forward. Right-eye, facing right. Right-eye, facing backwards. Right-eye, facing left.

The following image uses a resolution of 4320x4320 (resized for display here) along with the exposure merge of HET_0011, HET_0012, HET_0014, and HET_0015. The image is also suitable for lens position and size determination. A series of sample depth images (indepent of this one) were used to determine the optimal positioning of the left and right eye images. Using the merged image additional outputs are produced for use in Google Photos and for use with Red-Cyan Anaglyph glasses. Note: the Google Photos image stores the right eye in special EXIF metadata fields which only display with Google Cardboard image viewer or Google Photos. The final image of the 4 is a wiggle gif which switches between the left and right eye images quickly at times providing an almost 3d effect with the need for special glasses.

Generated Images
Over-Under 3D Image
Over-under 3D
Google Photos 3D Image (When Viewed in Google Cardboard)
Google Photos compatible 3D and 2D.
Red-Cyan Anaglyph
Red-Cyan Anaglyph
Wiggle 3D GIF
Wiggle 3D Gif

This is the command used to generate the full resolution versions of the above images.

src/vuze_merge.py -a coeffs_v6.json -I test/HET_0014 -O test/HET_0014_demo \
  -f over-under,anaglyph:90:0:0:1112:955,stereo:90:0:0:1112:955 \
  --config-option exposure_fuse,test/HET_0011 \
  --config-option exposure_fuse,test/HET_0012 \
  --config-option exposure_fuse,test/HET_0015
mogrify -resize 25% test/HET_0014_demo.JPG
convert -delay 8 -loop 0 test/HET_0014_demo_stereo*.JPG test/HET_0014_demo_stereo.gif
src/vuze_merge.py -a coeffs_v6.json -l test/HET_0014_demo.JPG -f gpano

Requirements

The test system had the following specification.

Hardware Spec
CPU AMD Ryzen 7 5800U with Radeon Graphics
Cores 16x @ 2.3Ghz
Memory + Swap 16GB + 16GB

The following python models will need to be installed. The installation requires pip.

pip install numpy
pip install opencv-python
pip install -U scikit-learn
python -m pip install -U scikit-image
python -m pip install -U pyexiftool

Installation and Usage

Clone this repository and ensure all of the requirements above are met. Assuming your Vuze Camera is similar to the one used for this project, copy a series of 8 images (_1.JPG -> _8.JPG) and their CSV from the camera to the root directory of this repo. Also copy the VUZ*.yml file from the root of the memory card. The following commands are run from the root directory of the repo.

Update the position of the sensors within the lens using your cameras configuration. Note: the images to merge in this command are HET_0014_1.JPG -> HET_0014_8.JPG.

echo '{"yamlConfig": "<VUZ_FILE_NAME_HERE>.yml"}' > vuz_config.json
src/vuze_merge.py -a coeffs_v6.json --setup vuz_config.json

Merge the images into an over-under 3d equirectangular image and save the transform and seam coefficients for future images. Note: the write-coeffs option should be use only on images with a large number of details throughout.

src/vuze_merge.py -a coeffs_v6.json -i HET_0014 --write-coeffs

To further configure the merge process examine the additional options provided by vuze_merge.py by running the script without any arguments. A more advanced camera calibration process can be used following the example camera_setup.json. See the Depth Calibration development log for details.

src/vuze_merge.py

Contribute

There is currently no formal contribution process. And there are no unit tests or regression tests. So good luck! Having said that code contributions of features and fixes are welcome.

If you wish to support this project please buy me a coffee.

Buy Me A Coffee

Website

E-Regular Games

Development Log

This directory contains documentation on useful processes and tests. It also documents attempts which failed, to avoid repeating them in the future. This is an on-going development log.

Depth At Seams (March 28th, 2023)

Color Table (March 18th, 2023)

Matches and Seams (March 17th, 2023)

World Seams (March 5th, 2023)

Depth Calibration (January 8th, 2023)

Sensor Rotation and Feature Depth (December 27, 2022)

Camera Constants (December 23, 2022)

Lens Alignment (November 16, 2022)

Horizon Leveling (October 31, 2022)

Super Resolution (October 21, 2022)

Color Matching Seams (October 14, 2022)

Seam Blending (August 12, 2022)

Color Matching with Regression (August 11, 2022)

Handling Outliers & Better Seam Lines (August 7, 2022)

All at Once Alignment (August 4, 2022)

Code Modules (August 2, 2022)

Alignment in 3 Steps (July 30, 2022)

Alignment with a Cubic (July 27, 2022)

Color Histogram Matching (July 24, 2022)

Seam Alignment (July 24, 2022)

Using Feature Detection (July 23, 2022)

Python Splice (July 21, 2022)

Exposure Fusion (July 19, 2022)

Bash Splice (July 15, 2022)

Make VR (July 10, 2022)

Source Code

The working source code. The current implementation is in python and requires several added libraries such as Numpy, OpenCV and MatPlotLib.

Main Function

Tests

A collection of test images, configuration files, and result images.

Test Images

About

A python based script for combining 8 separate photos taken by the Vuze 4K 3D 360 camera into a stereo 360 image.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published