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.
- 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.
This script requires the following Python libraries:
- OpenCV (
opencv-python) - Matplotlib
You can install them using pip:
pip install opencv-python matplotlib-
Clone this repository or download the script.
-
Place the image you want to analyze in the same directory or provide the full path to it.
-
Run the script from your terminal:
python your_script_name.py "path/to/your/image.jpg" -
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.
This project is licensed under the MIT License.