Interactive GUI tool to record clicked pixel coordinates on images
Project description
Installation: how to install PyCorec
pip install pycorec
Update
pip install --upgrade pycorec
How to use
Naming of image data🖼️
When using sequential images in a time series, please add a sequential number to the end of the file name of the image data.
This is not necessary when loading a video file.
It is recommended that the images to be analyzed be placed under a single directory to be loaded at a time.
Supports .jpg, .png, .tiff, .bmp image extensions.
If the file name contains “Bkg” and “Sub”, the image will not be loaded.
For time-series images, prepare files with the same file name followed by a number, so that the images with the lowest number are read in order.
Example:
picture_001.jpg, picture_002.jpg, …
pic-1.jpg, pic-2.jpg, …
syashin1.jpg, syashin2.jpg, …
mov_202308231159.jpg, mov_202308231201.jpg, …
e 43.jpg, e 47.jpg, …
Shashin (1).jpg, Shashin (2).jpg, …
Launch the application💻
pycorec or python -m pycorec in a terminal in a python environment where pycorec is installed.pycorec
python -m pycorec
Loading data📥
Select one of the modes from the buttons on the right
Video capture (reads frames in the video)
Directory Selection (reads all images in a directory)
Bounded Selection (selects a range of images to load)
Click Selection (selectively load images)
In the above three modes, a dialog box for setting the frame interval appears.
1 for sequential loading, 2 for skipping one.
Optional settings
Entering “fps” (frames per second, the reciprocal of the frame interval) creates a column of relative time (s).
If you enter cm/px (value at 100% image size), which indicates how many centimeters one px on the image corresponds to in reality, a value converted to the coordinate cm will be output.
If there is an object of known size on the image, it can be calculated by first reading only one image, taking a point, and dividing the distance between the two points (cm) by the difference in coordinates (px) for each x and y.
Change the screen display size📺
By default, the image is displayed at the largest size that fits the screen.
🔍 Zoom
Mouse wheel up: zoom in
Mouse wheel down: zoom out
Zoom centers on the mouse cursor
🖱️ Pan
Hold Space + drag: pan the image
Cursor changes to a fleur during panning
Press “Reset to Window Size” to return to the initial size and position.
Press “Fit image to Actual size” to display the image at 100% of its original size.
Press “Toggle Fullscreen” to switch between fullscreen and windowed mode.
The zoomed state is maintained and the image is moved to the next image.
Image coordinates are converted to the value at 100% image size no matter what size the image is displayed.
Record the coordinates 🖱️
Left-click to record coordinates.
Right-click to cancel the previous record in the same image.
When you press Shift + Left-click, NaN coordinates are recorded as missing values, and the next point in the same image can be recorded.
The point where the coordinates were acquired is displayed as a red dot.
The number of points recorded in the image is displayed as “Record Points” in the bar at the bottom.
When the recording of coordinates in an image is finished, press the right arrow key (→) to move to the next image.
Press the left arrow key (←) to go back to the previous image.
The title bar at the top displays the image number / total number of images and the name of the image file currently being displayed.
The coordinates of the mouse position and other information are displayed at any time at the bottom of the screen.
Save the coordinate data 💾
When recording is finished with the last image, press → again to open the file save screen.
Or press “Save as…” in the lower right corner to save the data up to that point.
To interrupt coordinate recording, press “Save as…” to output the coordinate recording file, and when resuming, press “Resume Recording” to read the file you have just output.
If the path to the image file changes, it cannot be loaded. In the case of video, the output image file is referenced. Please correct the Filepath column in the coordinate record file using the Replace function, etc., and then read the file again.
Output file can be selected from xlsx or csv.
Image coordinate px is the origin at the upper left of the image, x-axis is positive rightward, and y-axis is positive downward as per the standard.
When outputting in physical coordinates cm, the origin is the upper left corner of the image, the x-axis is positive rightward, and the y-axis is positive upward.
For the position on the image, x: positive value (cm), y: negative value (cm).
Release
See the full changelog here: https://github.com/tnku10/pycorec/blob/main/CHANGELOG.md
Future update
(Planned features will be documented here in future releases.)
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pycorec-2.1.0.tar.gz.
File metadata
- Download URL: pycorec-2.1.0.tar.gz
- Upload date:
- Size: 15.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
908c9f6030191e490f79a142c946fa460fd12ebd2004aaedbefb373e5310f326
|
|
| MD5 |
d07cc443615117ffe52fae25dce6bcbf
|
|
| BLAKE2b-256 |
51dd2be28ecd3a542c075ffdc5eebdb9e905201592262fbe317bce96c1774b70
|
File details
Details for the file pycorec-2.1.0-py2.py3-none-any.whl.
File metadata
- Download URL: pycorec-2.1.0-py2.py3-none-any.whl
- Upload date:
- Size: 13.4 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da55a5b05edec994ecfed332968fe3a23ec8ffdcca0d085de52b1a5c55a4ef49
|
|
| MD5 |
9b7d62bd11cb459bde173f8ec0a6ad27
|
|
| BLAKE2b-256 |
4414fb2e121c9d8c4c53f03cf4869ac58d77def60b363d056281d04b4303009a
|