Skip to main content

Generate sequences of random speckle patterns and defining optical flow fields.

Project description

Speckle Dataset Generation

Dataset Generation

We generate multi-frame synthetic speckle pattern image sequences and ground-truth flows that represent the underlying deformation of the sequence. Each sequence has a unique reference pattern and contains between 9,000 and 11,000 randomly generated ellipses of varying sizes, with major and minor axes ranging from 7 to 30 pixels. These ellipses are fully filled with random gray scale intensity gradients ranging from 0 to 255. We then backward warp each unique pattern with smooth and randomly generated spatial random deformation fields to generate deforming sequences. The random deformation fields are generated using GSTools, a library which uses covariance model to generate spatial random fields.

Sample Demo

Speckle Pattern Flow Visualization

Run Speckle Generator

There are four arguments to be specified by the user. --output_path defines the directory where generated image sequences, ground-truth flows and flow visualizations will be saved. --seq_number and --seq_length represent the number of random speckle pattern sequences to generate and the number of frames per each sequence, respectively. Lastly, the --dimensions argument specifies the height and width of the output speckle patterns. Optionally, a user can specify --scales an argument that defines the max u and v flow magnitudes, default value is (10 10).

PyPI installation

This speckle dataset generator can be installed and used as follows:

Installation

conda create -n specklegen_env python=3.8
pip install specklegen==0.1.7

Usage

from specklegen.synthetic_data_generator import data_generator

# Define arguments
output_path = "./output" #output path
seq_number = 10 #number of sequences 
seq_length = 3 #number of frames per sequence
dimensions = (512, 512)  #output flow and sequence dimensions 
scales = (5, 7)  #max flow magnitudes of u and v fields, respectively

# Call function
data_generator(output_path, seq_number, seq_length, dimensions, scales)

Output Format

The output files include synthetic speckle pattern image sequences, .flo ground truth deformation fields containing the u and v components of the deformation, as well as flow visualization files (heatmaps of the u and v flows).

├── <output_path>/
│   ├── Sequences├──Seq1├──frame0001.png
│   │            │              .
│   │            │      ├──frame000n.png     
│   │            │ 
│   ├── Flow     ├──Seq1├──flow0001.flo
│   │            │              .
│   │            │      ├──frame000n-1.flo
│   │            │     
│   ├── Flow_vis ├──Seq1├──flow0001.png
│   │            │              .
│   │            │      ├──frame000n-1.png

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

specklegen-0.1.7.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

specklegen-0.1.7-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file specklegen-0.1.7.tar.gz.

File metadata

  • Download URL: specklegen-0.1.7.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for specklegen-0.1.7.tar.gz
Algorithm Hash digest
SHA256 8302beb64e6ab23ec1fb128b73a50e3f282ac3f6c0209b79ffc80c6c603b3da4
MD5 3192e16a7b306fb4da5df278681f405a
BLAKE2b-256 f4e38f56473771bc8d9e1d7a667b10fce50515e5657603732164d8f54433a67c

See more details on using hashes here.

File details

Details for the file specklegen-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: specklegen-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for specklegen-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 22e90ace9b088adf4f139c7d2425d4eee5de550c3f5f1fc84703ed0a8452de43
MD5 14eccb6b79cae779d54a9b9bb893b384
BLAKE2b-256 9c6a28a808814d9815fbec9241d757ad033b446c3bb772616a135ac601082954

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