|Jakub Valenta cf1c3dce78 README: Major update||2 months ago|
|docs||2 months ago|
|image_marker||2 months ago|
|tests||3 months ago|
|.gitignore||3 months ago|
|LICENSE||3 months ago|
|MANIFEST.in||3 months ago|
|NOTICE||3 months ago|
|README.md||2 months ago|
|image-marker||3 months ago|
|setup.py||3 months ago|
|tox.ini||3 months ago|
Graphical program to quickly mark rectangular areas in a batch of images and save the output as a CSV, optionally adding a text note to each of the marks.
The output CSV file (space-separated) contains on each row an image path with the coordinates of the marked rectangle. Example:
./test_images/building.jpg 350 237 909 547 ./test_images/canal.jpg 530 533 1075 252
The general format is:
<image path> <left px> <top px> <width px> <height px>
This is all Image Marker does. It's completely up to you how to use this CSV output.
pip install --user --upgrade .
Image Marker operates on a directory of images.
It displays one image at a time. You can change the displayed image using your keyboard arrow keys.
The images are always scaled to fit in the window of the program. There is no zoom option.
On each image you can select with your mouse a rectangular area. This is what we call a mark. The mark will appear on the screen as a red rectangle.
Use the option
--marks to specify a CSV file path, in which the coordinates of the marked rectangles will be saved.
Use the option
--output to specify a CSV file path, in which the post-processed coordinates will be saved.
By default the values stored in the
--output CSV files are the same.
However, it is possible to make some automatic adjustments to your marked rectangles. There is currently one such scenario:
If you want to automatically draw a box around your marked rectangles with a specific aspect ratio, use the option
--box-ratio. This way, you can just mark the part of the image that contains the subject that you are interested
in, but all your marks will become rectangles of the same aspect ratio, thus forming a nicely unified collection.
The box will be rendered symmetrically around the marked area as a green rectangle and always have the specified aspect ratio (unless it wouldn't fit in the image).
You can also specify a box padding with the option
--box-padding to make the box a little further from the
original marked rectangle. The padding is specified as a fraction of marked area width. Example: option
--box-padding 0.15 will result in a 30 px padding for a 200 px wide selection.
You can add text to each image. Just start typing any characters, the text will appear in blue by the bottom of the image. You can delete what you've typed with the backspace key.
Put the images that you want to mark in one directory, let say
image-marker ./my_directory/ --marks my_marks.csv --output my_output.csv --box-ratio 1.33 --box-padding 0.1
A window will appear with the first image in the directory.
Draw the first rectangle with the mouse on the image.
If you're not happy with it, draw it again. The previously drawn rectangle will disappear.
Press left arrow key to advance to the next image.
You can go back to the previous image by pression the left arrow key. The rectangle that you've drawn before will still be there.
The marks and output CSV are written immediately. You can quit the program any time by pressing the escape key.