Package boofcv.io.image
Class LabeledImagePolygonCodec
java.lang.Object
boofcv.io.image.LabeledImagePolygonCodec
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
decode
(InputStream reader, ImageDimension shape, DogArray<PolygonRegion> regions) Decodes the stream and reads the labeled imagestatic void
encode
(List<PolygonRegion> regions, int width, int height, OutputStream writer, String... comments) Saves polygon regions which have been used to label an image.
-
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 imagewidth
- (Input) Image widthheight
- (Input) Image heightwriter
- (Output) Where the image is written tocomments
- (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
-