Skip to main content

LIC plotting algorithm.

Project description

Line Integral Convolution

Demo

The Line Integral Convolution (LIC) is an algorithm used to image a vector field. Its main advantage is to show in intricate detail the fine structure of the vector field. It does not display the direction or magnitude of the vectors, although this information can be color coded in a postprocessing step.

The result of course depends on the shape of the kernel and the length
of the streamline. If it is too small, the texture is not sufficiently filtered and the motion is not clear. If it is too large, the image is smoothed and details of the motion are lost. For an image of size (256, 256), a value of 20 provides acceptable results.

Install

If you want to install LIC you can clone the repo and run.

    pip install -e .

or install from pypi

    pip install lic

Usage

The basic usage is shown in and a runnable example can be found under examples/lic_demo.py

    from lic import lic_internal
    import numpy as np
    import matplotlib.pyplot as plt
    # create vector field and kernel
    size = 500
    u = np.zeros((size, size), dtype=np.float32)
    v = np.zeros((size, size), dtype=np.float32)
    texture = np.random.rand(size, size).astype(np.float32)

    # create a kernel
    kernel_length = 31
    kernel = np.sin(np.arange(kernel_length) * np.pi / kernel_length).astype(np.float32)

    # compute the lic
    image = lic_internal.line_integral_convolution(u, v, texture, kernel)

    plt.imshow(image, cmap="hot")
    plt.show()

Forked from https://github.com/aarchiba/scikits-vectorplot

by Anne Archibald

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

licplot-1.0.0.tar.gz (46.0 kB view details)

Uploaded Source

File details

Details for the file licplot-1.0.0.tar.gz.

File metadata

  • Download URL: licplot-1.0.0.tar.gz
  • Upload date:
  • Size: 46.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.0.0.post20201207 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5

File hashes

Hashes for licplot-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9db68a9947c7888800c18445635ea33e34e9aa144d82002ba8df0375164effa1
MD5 8aa1eb53d35472e134798a1f988df09a
BLAKE2b-256 d9e54a271ddba8bc3dbd651cf8ebe7184fbabd8e30fe1188c8a4674a9289beed

See more details on using hashes here.

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