Skip to main content

Align a source image file with a reference image

Project description

IMage ALIGN

Align source image with a reference image using OpenCV SIFT algorithm.

Motivation

The task of aligning an image obtained by digitising a negative or slide with a direct digital capture of the same scene is often encountered in hybrid film/digital photography workflow. The applications include calibration of negative inversion algorithms or characterising film materials. Generally, the reference and source images have different resolution, aspect ratios, angle of view and can have a slight tilt. A script was needed that can perform this aligning task automatically.

Installation

The imalign package is available from PyPI and can be installed by pip:

pip install imalign

Usage

Once installed, the imalign script should be available in your terminal. Run

imalign --help

to see the list of command line arguments.

Examples

Sample images are included in the source repository. They include a processed laboratory scan of a film negative and a DSLR capture of the same frame on the light table.

Laboratory Scan

DSLR Capture

The DSLR image is a horizontally flipped negative that includes frame borders, parts of the film holder and fragments of adjacent frames.

Running the command:

imalign --reference=tests/samples/lab.jpg
--source=tests/samples/dslr.jpg
--output=tests/samples/aligned.jpg
--trimmed=tests/samples/trimmed.jpg
--border=0.05
--invert-source
--flip

Produces these two images:

Trimmed Laboratory Scan

Aligned Image

Note, that the aligned image is flipped but not converted to positive.

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

imalign-0.0.1.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

imalign-0.0.1-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file imalign-0.0.1.tar.gz.

File metadata

  • Download URL: imalign-0.0.1.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.7

File hashes

Hashes for imalign-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1814d1a311e5ef0652b99b4ed3c1f5be8f14789c5a8589013c24ef3d1550e762
MD5 989702ddc2d1b30276ebe457ab09b3f4
BLAKE2b-256 28c6eb0a5e21eeb913ff44aa7b661c1eb842b1f44aeee5443fe63df1b5cfe4b4

See more details on using hashes here.

File details

Details for the file imalign-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: imalign-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.7

File hashes

Hashes for imalign-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 046f2a4d66785c5646c15705d02230b3502ff1333eba5886b197bc17c876b5b2
MD5 bd99f032cbb0d78568701199bad91901
BLAKE2b-256 e07ba5d999a45642e4b2e5ffd5678a9a9619c1255c20f9729b5b89926a410443

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