annotate.py contains two functions that you call from the python console.
Set up for a single image:
-
- img_path - name and location of the image, example "B.jpg"
- size1 - size of the 1st brush circle, in px
- size2 - size of the 2nd brush circle, in px
- initials - First name and last name initials of the person doing the labelling. Recorded next to every PMT feature ID line in the text file.
-
- {image_name}.png - A map of all the features in binary - features labelled in blue are recorded as RGB (1,1,1), and features in red are recorded as RGB (2,2,2).
- {image_name}.txt - A text file. Each line contains a PMT feature ID and its pixel coordinates on the image. The text file has the same name as the image.
Set up for directory of images with file structure for image segmentation. This function calls annotate_img() for every image in the specified directory, and then saves the output texts and masks in separate folders.
-
- img_dir - image directory. Images are contained inside this folder.
- initials - First name and last name initials of the person doing the labelling. Recorded next to every PMT feature ID line in the text file.
- size1 - size of the 1st brush circle, in px.
- size2 - size of the 2nd brush circle, in px.
-
- {image_name}.png - A map of all the features in binary - features labelled in blue are recorded as RGB (1,1,1), and features in red are recorded as RGB (2,2,2).
- {image_name}.txt - A text file. Each line contains a PMT feature ID and its pixel coordinates on the image. The text file has the same name as the image.
-
- {img_dir}
- Source images are stored here.
- {img_dir}_texts
- Output text files are stored here.
- {img_dir}_masks
- Output mask files are stored here.
- {img_dir}
- click on image to grab pixel coordinates:
- Left-click to label with red
- middle-click to label with blue
- s to close image and exit program
- r to write coordinates (you will be prompted for the PMT feature ID if a PMT has not been selected yet)
- f to select new PMT
- n to increment the featureID number
- b to decrement the featureID number