Skip to main content

A GUI tool to apply perspective transformations to images.

Project description

Image Perspective Transformer

This project provides a PyQt-based GUI application for marking four points on an image to apply a perspective transformation. Users can preview the transformed image and reselect points if the result is unsatisfactory.


Features

  • Load and Display Image: Load an image and scale it to fit the screen while maintaining its aspect ratio.
  • Mark Points: Click on the image to select four points for transformation.
  • Clear Points: Reset the marked points and start over without restarting the application.
  • Preview Transformation: Display the transformed image and check its quality before saving.
  • Iterative Workflow: If the transformation is not satisfactory, reselect the points and apply the transformation again.
  • Save Image: Save the transformed image to a file.
  • Exit Application: Close the application. (Ctrl+Q / Command+Q)

Ensure the following are installed on your system:

  • Python 3.7+

Install Steps

  1. Clone the repository:
git clone https://github.com/zangjiucheng/Perspective-Transformer.git
  1. Install the required packages:
pip install -r requirements.txt
  1. Run the application:
python perspective.py <image_path> [output_path]

How to Use

  1. Run the Application:

    • Replace image.jpg in the code with the path to your image or place your image in the same directory as the script.

    • Start the application:

      python perspective.py <image_path> [output_path]
      
  2. Mark Points:

    Click on the image to select four points in any order. These points define the region for perspective transformation.

  3. Confirm Points:

    After selecting four points, click "Confirm Points" to apply the transformation.

  4. Preview Transformed Image:

    Click "Preview Transformed Image" to see the transformed result in the same window. If the result is unsatisfactory, click "Clear Points" to reset and reselect points.

  5. Save Transformed Image:

    When satisfied, the application automatically saves the transformed image as transformed_image.jpg or the specified output path.


License

This project is open-source and can be modified and used for personal or educational purposes. Attribution to the original creator is appreciated. (MIT License)

Enjoy transforming your images! 🚀

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

perspective_transformer-1.0.3.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

perspective_transformer-1.0.3-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file perspective_transformer-1.0.3.tar.gz.

File metadata

File hashes

Hashes for perspective_transformer-1.0.3.tar.gz
Algorithm Hash digest
SHA256 81c58cf3c557ade3bd4bfba383018a1ae6f7efe958b8a3257a03007ea59ea22a
MD5 c2e3fce139bb1e700f047fc018a40726
BLAKE2b-256 53dd50d11e3d486c200ec83bcf6c4f3568d37e901bbd437f3bbeca318e290552

See more details on using hashes here.

Provenance

The following attestation bundles were made for perspective_transformer-1.0.3.tar.gz:

Publisher: publish-to-pypi.yml on zangjiucheng/Perspective-Transformer

Attestations:

File details

Details for the file perspective_transformer-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for perspective_transformer-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 53ee84afe8ac591a7d985c8ae27213608825383c02fef525dcb41e69cf46ec07
MD5 a99c3f0f4d0d9852dfca7a64f030e11a
BLAKE2b-256 6cb38532530b8d5c7e4d988f87480f91801fff2bf122daefd93ac30de872abd5

See more details on using hashes here.

Provenance

The following attestation bundles were made for perspective_transformer-1.0.3-py3-none-any.whl:

Publisher: publish-to-pypi.yml on zangjiucheng/Perspective-Transformer

Attestations:

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