Skip to main content

Nearest neighbor interpolation for disparity images with missing parts.

Project description

Python 3.7 Python 3.8 Python 3.9 License: MIT Linux CI

Fast nearest-neighbor interpolation of disparity maps using Cython

Some stereo matching methods such as Semi-Global Matching (SGM) might provide sparse disparity maps, meaning that some pixels will not have valid disparity values. In those cases, an interpolation of the predicted disparity map might be needed for evaluation against semi-dense ground-truth, as in the KITTI Stereo 2015 benchmark.

Usage example:

import disparity_interpolation


def interpolate_disparity(disparity_map: np.array) -> np.array:
    """Intepolate disparity image to inpaint holes.
       The expected run time for a stereo image with 2056 × 2464 pixels is ~50 ms.
    """
    # Set the invalid disparity values defined as "0" to -1.
    disparity_map[disparity_map == 0] = -1
    disparity_map_interp = disparity_interpolation.disparity_interpolator(disparity_map)

    return disparity_map_interp

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

disparity_interpolation-1.0.5-cp39-cp39-win_amd64.whl (70.9 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

disparity_interpolation-1.0.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

disparity_interpolation-1.0.5-cp39-cp39-macosx_10_9_x86_64.whl (67.3 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

disparity_interpolation-1.0.5-cp38-cp38-win_amd64.whl (71.6 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

disparity_interpolation-1.0.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

disparity_interpolation-1.0.5-cp38-cp38-macosx_10_9_x86_64.whl (69.3 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

disparity_interpolation-1.0.5-cp37-cp37m-win_amd64.whl (69.9 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

disparity_interpolation-1.0.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

disparity_interpolation-1.0.5-cp37-cp37m-macosx_10_9_x86_64.whl (69.4 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

Supported by

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