Skip to main content

disparity npy file viewer

Project description

disparity-view

viewer for disparity data in npy file format

checked environment

  • NVIDIA Jetson AGX orin
  • Ubuntu 20
  • python3.8
  • Optional:
    • ZED SDK 4.1 (StereoLabs)

Install in docker environment

pip install is executed in Dockerfile.

docker_build.sh
docker_run.sh

# now you can  execute inside docker environment
zed_capture -h
disparity_viewer -h

Install without docker

python3 -m pip install .[dev]

tools

$ view_npy -h
usage: view_npy [-h] [--vmax VMAX] [--vmin VMIN] [--disp3d] [--outdir OUTDIR] [--gray] [--jet] [--inferno] [--normal] npy_file

np file viewer

positional arguments:
  npy_file         npy_file to view

optional arguments:
  -h, --help       show this help message and exit
  --vmax VMAX      max disparity [pixel]
  --vmin VMIN      min disparity [pixel]
  --disp3d         display 3D
  --outdir OUTDIR  save colored or ply

colormap:
  --gray           gray colormap
  --jet            jet colormap
  --inferno        inferno colormap
  --normal         normal mapping

left_motorcycle.png left_motorcycle.png normal_left_motorcycle.png overlay_left_motorcycle.png

reproject_left_motorcycle.gif

view_npy --normal  --outdir normal test/test-imgs/disparity-IGEV/left_motorcycle.npy
view_npy --jet  --outdir jet test/test-imgs/disparity-IGEV/left_motorcycle.npy

script version

python3 scripts/view_npy.py -h

reproject to 2D

$ python3 project.py -h
usage: project.py [-h] [--axis AXIS] [--gif] [--outdir OUTDIR] disparity left json

reprojector

positional arguments:
  disparity        disparity npy file
  left             left image file
  json             json file for camera parameter

optional arguments:
  -h, --help       show this help message and exit
  --axis AXIS      axis to shift(0: to right, 1: to upper, 2: to far)
  --gif            git animation
  --outdir OUTDIR  output folder

depth_to_normal

  • Depth image is not easy to recognize fine structure.
  • Ported depth_to_normal from following github.
python3 scripts/depth_to_normal_map.py -h
usage: depth_to_normal_map.py [-h] [--outdir OUTDIR] input

Convert depth map to normal map

positional arguments:
  input            Path to depth map gray image

optional arguments:
  -h, --help       show this help message and exit
  --outdir OUTDIR  Output directory for normal map image (default: output)
$ python3 depth_overlay.py -h
usage: depth_overlay.py [-h] [--outdir OUTDIR] [--jet] [--inferno] disparity left

overlay depth image to left image

positional arguments:
  disparity        disparity npy file
  left             left image file

optional arguments:
  -h, --help       show this help message and exit
  --outdir OUTDIR  output folder

colormap:
  --jet            jet colormap
  --inferno        inferno colormap

generate ply file

$ python3 gen_ply.py -h
usage: gen_ply.py [-h] [--outdir OUTDIR] disparity left json

generate ply file

positional arguments:
  disparity        disparity npy file
  left             left image file
  json             json file for camera parameter

optional arguments:
  -h, --help       show this help message and exit
  --outdir OUTDIR  output folder

optional tool (with ZED SDK)

If you have ZED2i or ZED_X by StereoLabs, You can use following command to capture stereo images and disparity npy files. Access here for more information. https://www.stereolabs.com/en-jp

$ zed_capture -h
usage: zed_capture [-h] [--input_svo_file INPUT_SVO_FILE] [--ip_address IP_ADDRESS] [--resolution RESOLUTION] [--confidence_threshold CONFIDENCE_THRESHOLD] [--outdir OUTDIR]

capture stereo pairs

optional arguments:
  -h, --help            show this help message and exit
  --input_svo_file INPUT_SVO_FILE
                        Path to an .svo file, if you want to replay it
  --ip_address IP_ADDRESS
                        IP Adress, in format a.b.c.d:port or a.b.c.d, if you have a streaming setup
  --resolution RESOLUTION
                        Resolution, can be either HD2K, HD1080, HD720, SVGA or VGA
  --confidence_threshold CONFIDENCE_THRESHOLD
                        depth confidence_threshold(0 ~ 100)
  --outdir OUTDIR       image pair output

After zed_capture execution, you will have following folders.

./outdir
./outdir/left
./outdir/right
./outdir/zed-disparity

Note on StereoLabs ZED2i Camera

  • You can get stereo rectified left, right image pairs with timestamp.
  • You can retrieve depth data and point cloud by zed sdk.

how to make whl file

inside docker environment if you are using docker

make whl

will generate

dist/disparity_view-0.0.1-py3-none-any.whl
dist/disparity_view-0.0.1.tar.gz

THANKS

https://github.com/cobanov/depth2normal.git

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

disparity_view-0.0.17.tar.gz (56.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

disparity_view-0.0.17-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file disparity_view-0.0.17.tar.gz.

File metadata

  • Download URL: disparity_view-0.0.17.tar.gz
  • Upload date:
  • Size: 56.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for disparity_view-0.0.17.tar.gz
Algorithm Hash digest
SHA256 94a1134c4c6892bf3018d9cd2969d677c73f5523ac7d28ff31d7f227fe9a085c
MD5 57fbe31516d2398205d6f1d2dfffa783
BLAKE2b-256 e3a6359c802f34c152b1d98d94e96f0aaa5f03902af4fe58bae3838ee32b0e9c

See more details on using hashes here.

File details

Details for the file disparity_view-0.0.17-py3-none-any.whl.

File metadata

File hashes

Hashes for disparity_view-0.0.17-py3-none-any.whl
Algorithm Hash digest
SHA256 916c4c6754d13f9fdadfb5c89c71238016dcf8ea919d88586cd7cf8e01bffcca
MD5 d5b6e62b83381f1fbbd38c0d2271624e
BLAKE2b-256 59a6475eb019b35e3fcf727c61749eaac8d677731b8f1a8f7a574f666a320787

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page