Skip to content

Laudeires/pixel-distance-measurer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Interactive Pixel Distance Measurer

A simple Python script that allows a user to load an image and measure the Euclidean distance in pixels between any two points by clicking on them.

Features

  • Loads an image from a local file.
  • Displays the image in a plot window.
  • Captures two mouse clicks to define points.
  • Calculates and prints the pixel distance between the points.
  • Draws a line and markers on the image to visualize the measurement.

Requirements

This script requires the following Python libraries:

  • OpenCV (opencv-python)
  • Matplotlib

You can install them using pip:

pip install opencv-python matplotlib

Usage

  1. Clone this repository or download the script.

  2. Place the image you want to analyze in the same directory or provide the full path to it.

  3. Run the script from your terminal:

    python your_script_name.py "path/to/your/image.jpg"
  4. The image will appear in a window. Click on two points to measure the distance. The coordinates and the final distance will be printed in the terminal.

License

This project is licensed under the MIT License.

About

A Python script to interactively measure pixel distance on an image.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages