Bump version to 1.1.0
|2 months ago|
|docs||2 months ago|
|image_marker||2 months ago|
|.gitignore||3 years ago|
|LICENSE||3 years ago|
|MANIFEST.in||3 years ago|
|Makefile||2 months ago|
|NOTICE||2 months ago|
|README.md||2 months ago|
|image-marker||2 months ago|
|setup.cfg||2 months ago|
|setup.py||2 months ago|
|tox.ini||2 months ago|
A graphical program to mark rectangular areas in a batch of images and save their coordinates as a CSV. Optionally, add a text note to each of the images. Optimized for a fast workflow.
Output CSV format:
<image path> <left px> <top px> <width px> <height px>
./test_images/building.jpg 350 237 909 547 ./test_images/canal.jpg 530 533 1075 252
This is all Image Marker does. You can do whatever you want with the output CSV. One obvious option is to crop the images according to the marks. You can use image-crop for that.
pip install --user --upgrade .
Put all the images you want to mark in a single directory.
Run Image Marker:
image-marker ./my_directory --marks my_marks.csv --output my_output.csv --box-ratio 1.33 --box-padding 0.1
The positional argument specifies the directory to load the images from.
--marks specifies the CSV file path, where the coordinates of
the marked rectangles will be saved.
--output specifies the CSV file path, where the post-processed
coordinates will be saved. More on that later.
A window will appear with the first image in the directory. Use the mouse to draw a rectangular mark. The output CSV files are saved immediately.
If you're not happy with the mark position or size, draw it again. The previously drawn rectangle will disappear.
Use the right arrow key to advance to the next image.
You can also go back using the left arrow key.
Type any characters on your keyboard to add a text note to an image. It will appear in blue by the bottom edge of the window. You can delete what you've typed using the backspace key.
Quit the program by pressing the esc key.
By default the values stored in the
--output CSV files are the
However, it is possible to make some automatic adjustments to your marks. In
this case, the original marks will be stored in the
--marks CSV file and the
post-processed marks in the
--output CSV file.
There is currently one post-processing option:
If you want to create a set of marks that all have the same aspect ratio, you
can use the option
--box-ratio to automatically draw a box around each mark
with a specified aspect ratio. The box will be drawn symmetrically around the
marked area as a green rectangle. If the box doesn't fit in the image, it will
be moved in the image.
You can also add padding to the box using the option
--box-padding. It is
defined as a fraction of the marked rectangle width. For instance
--box-padding 0.15 will result in a 30 px padding for a 200 px wide mark.