Class LabeledImagePolygonCodec

java.lang.Object
boofcv.io.image.LabeledImagePolygonCodec

public class LabeledImagePolygonCodec extends Object
For reading and writing images which have been labeled with polygon regions. The image size and location of each polygon in pixels is saved in a text format. The format does provide the potential for a binary format to be used in the future. This is a BoofCV specific file format.
  • Constructor Details

    • LabeledImagePolygonCodec

      public LabeledImagePolygonCodec()
  • Method Details

    • encode

      public static void encode(List<PolygonRegion> regions, int width, int height, OutputStream writer, String... comments) throws IOException
      Saves polygon regions which have been used to label an image.
      Parameters:
      regions - (Input) Regions which have been denoted inside the image
      width - (Input) Image width
      height - (Input) Image height
      writer - (Output) Where the image is written to
      comments - (Input) Optional comments to be added to the image
      Throws:
      IOException - Thrown if anything goes wrong
    • decode

      public static void decode(InputStream reader, ImageDimension shape, DogArray<PolygonRegion> regions) throws IOException
      Decodes the stream and reads the labeled image
      Parameters:
      reader - Stream containing RLE encoded image
      Throws:
      IOException - Thrown if anything goes wrong