Skip to main content

Diffeomorphic transformations for image and video morphing in psychological experiments

Project description

Diffeomorphic

A Python package for creating diffeomorphically transformed images and videos for psychological experiments.

Overview

Diffeomorphic implements diffeomorphic transformations for image and video morphing, as described in:

Stojanoski, B., & Cusack, R. (2014). Time to wave good-bye to phase scrambling: Creating controlled scrambled images using diffeomorphic transformations. Journal of Vision, 14(12), 6. doi:10.1167/14.12.6

This Python package was developed by Mohammad Ahsan Khodami, based on the original algorithms described in the paper by Stojanoski & Cusack.

Installation

pip install diffeomorphic

Usage

As a command-line tool

# Transform a single image
diffeomorphic-image --input image.jpg --output output_dir --maxdistortion 80 --nsteps 20

# Transform a video
diffeomorphic-movie --input video.mp4 --output output_dir --maxdistortion 60 --nsteps 20

# Transform with warpshift
diffeomorphic-warpshift --input image.jpg --output output_dir --maxdistortion 60 --nsteps 20 --phasedrift 0.39

As a Python library

import diffeomorphic

# Transform a single image
diffeomorphic.transform_image(
    input_path="image.jpg", 
    output_path="output_dir",
    max_distortion=80,
    n_steps=20
)

# Transform a video
diffeomorphic.transform_movie(
    input_path="video.mp4", 
    output_path="output_dir",
    max_distortion=60,    n_steps=20
)

# Transform with warpshift
diffeomorphic.transform_warpshift(
    input_path="image.jpg", 
    output_path="output_dir",
    max_distortion=60,
    n_steps=20,
    phase_drift=0.39
)

License

MIT License

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 Distribution

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

diffeomorphic-0.1.0-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file diffeomorphic-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: diffeomorphic-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.12

File hashes

Hashes for diffeomorphic-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a4cdc67ce18943a6c4fa76f5872fc48cc8177a520fee440e939b98db0ba0ae4b
MD5 cd0affe2b1e69a1d58a16aa40bd16ce4
BLAKE2b-256 c02ecd9066abd37e6bd103855e294eb91c23608b22b04d913ca6f988df9baf12

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