Copied
Docs

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

EMPLOYEE LOGIN
  • Home
  • Getting Started
  • Annotate
  • Tasks
  • API
  • Recipes
  • Tutorials
  • Integrations

Raster Annotation

Updated at January 22nd, 2025

Raster annotation is a process used to assign a category to each pixel in an image. This technique is commonly employed in various fields, such as computer vision, remote sensing, and medical imaging, to create precise and structured datasets for training machine learning models.

What Is Raster Annotation?

Raster annotation involves labeling each pixel in an image with a specific category. Initially, all pixels are assigned a “no label” category. The annotation process consists of systematically assigning categories to the pixels corresponding to different objects or regions in the image. The result is a labeled mask that represents the categorization of every pixel in the image.

Tools for Raster Annotation

There are three different raster tools, each with different options in the secondary toolbar in the workspace. Depending on how the project has been set up, your workspace may only contain some of these tools. Since not all projects need every kind of tool, it's up to the project manager to choose which ones to provide.

💡  You can use all the annotation tools with the no-label mask, which acts like an eraser — it will remove any mask that was previously applied.

Paintbrush

The Paintbrush tool is used to paint a mask over numerous pixels, using your mouse as a brush. This tool is useful for fine-tuning annotations, such as cleaning up edges and filling in small areas.

To paint pixels:

  1. In the mask panel, click on the mask that you want to paint with.
  2. With the Paintbrush tool selected, click on the Width slider and adjust the size of the brush to the desired number of pixels.
  3. Click on the image where you would like to start painting, and then drag to paint.

Lock All

Using Lock all, each applied layer will be locked, preventing color overlap when many objects are being masked.

 
 

Fill

The Fill tool uses color and contrasts to quickly fill in groups of similar pixels. This tool is a great way to quickly fill in large areas that have little detail, and works particularly well with high-contrast images.

Tip

You can use the Paintbrush tool to paint along the contour of an object and create a boundary for the Fill tool to fill to.

 

To fill in pixels:

  1. In the mask panel, click on the mask that you want to fill with.
  2. Click on the image where you intend to start filling in pixels, and then drag outward from the starting point until you are satisfied with the number of pixels that have been filled. If you go too far, just drag inward again.

If you later would like to change the mask type, you can just select a new mask and use the Fill tool to re-fill the area.

 
 

Superpixel

The Superpixel tool is used to break the image up into larger sections of similarly colored pixels. Three different algorithms are available to determine how the image should best be divided into sections. This tool is particularly effective for images that have large areas of similarly colored pixels.

To divide an image into superpixels:

  1. With the Superpixel tool selected, choose an algorithm from the drop-down menu above the image.
  2. Click on the Width slider and drag it to the left to make the superpixels smaller, or to the right to make them larger.
  3. In the mask panel, click on the mask that you want to fill the superpixels with.
  4. Click on each superpixel one at a time to fill it.
 
 

Raster Mask

The output of this type of annotation takes the form of a greyscale PNG mask for each image, where the value of a pixel represents the category to which it has been assigned.

The location of the raster mask image is listed in the output JSON file under the mask_url key:

Review the recipe to see the full JSON

...
"layers":{
           "raster_coding":{
              "mask_url":"https://mask-image.png"}
...
}

Download the mask

If you have been provided with the right credentials, you can download the mask using the AWS CLI.

aws s3api get-object --bucket samahub3 --key "clients/23/external/projects/8616/tasks/6125acb53928ed00e6fc55fa/outputs/Image Raster/d1bdde4b-3d01-47d3-8536-4952eb871969.png" raster-mask.png
        
             
The linked Colab notebook contains Python code that shows you how to get your latest deliveries, get temporary AWS credentials, and download the raster masks. 
             
tagging tools labeling tools marking notation annotation semantic segmentation

Was this article helpful?

Yes
No
Give feedback about this article
Tools for Raster Annotation Tip Raster Mask Download the mask

The first B Corp-certified AI company

  • Security
  • Terms
  • Privacy
  • Quality & Information

Copyright © 2023 Samasource Impact Sourcing, Inc. All rights reserved.


Knowledge Base Software powered by Helpjuice

Expand