aws.osml.image_processing.sidd_updater module

class aws.osml.image_processing.sidd_updater.SIDDUpdater(xml_str: str)[source]

Bases: object

update_image_data_for_chip(chip_bounds: List[int], output_size: Tuple[int, int] | None) None[source]

This adds or updates the SIDD GeometricChip structure so that the ChipSize and original corner coordinates are recorded. A sample of this XML structure is shown below:

<GeometricChip>
<ChipSize>

<Row xmlns:ns1=”urn:SICommon:1.0”>512</Row> <Col xmlns:ns1=”urn:SICommon:1.0”>512</Col>

</ChipSize> <OriginalUpperLeftCoordinate>

<Row xmlns:ns1=”urn:SICommon:1.0”>7408</Row> <Col xmlns:ns1=”urn:SICommon:1.0”>7407</Col>

</OriginalUpperLeftCoordinate> <OriginalUpperRightCoordinate>

<Row xmlns:ns1=”urn:SICommon:1.0”>7408</Row> <Col xmlns:ns1=”urn:SICommon:1.0”>7919</Col>

</OriginalUpperRightCoordinate> <OriginalLowerLeftCoordinate>

<Row xmlns:ns1=”urn:SICommon:1.0”>7920</Row> <Col xmlns:ns1=”urn:SICommon:1.0”>7407</Col>

</OriginalLowerLeftCoordinate> <OriginalLowerRightCoordinate>

<Row xmlns:ns1=”urn:SICommon:1.0”>7920</Row> <Col xmlns:ns1=”urn:SICommon:1.0”>7919</Col>

</OriginalLowerRightCoordinate>

</GeometricChip>

Parameters:
  • chip_bounds – the [col, row, width, height] of the chip boundary

  • output_size – the [width, height] of the output chip if different from the chip boundary

encode_current_xml() str[source]

Returns a copy of the current SIDD metadata encoded in XML.

Returns:

xml encoded SIDD metadata

static chipped_coordinate_to_full(chip_coordinate: Tuple[float, float], chip_size: Tuple[int, int], original_corner_coordinates: List[Tuple[float, float]]) Tuple[float, float][source]

This function converts pixel locations in a chip to the pixel locations in a full image using a bi-linear interpolation method described in section 5.1.1 of the Sensor Independent Derived Data (SIDD) specification v3.0 Volume 1.

Parameters:
  • chip_coordinate – the [x, y] coordinate of the pixel in the chip

  • chip_size – the size of the chip [width, height]

  • original_corner_coordinates – the [x, y] location of the UL, UR, LR, LL corners in the original image

Returns:

the [x, y] coordinate of the pixel in the original image