다음을 통해 공유


ImageBoundingBox Class

  • java.lang.Object
    • com.azure.ai.vision.imageanalysis.models.ImageBoundingBox

Implements

public final class ImageBoundingBox
implements JsonSerializable<ImageBoundingBox>

A basic rectangle specifying a sub-region of the image.

Method Summary

Modifier and Type Method and Description
static ImageBoundingBox fromJson(JsonReader jsonReader)

Reads an instance of ImageBoundingBox from the JsonReader.

int getHeight()

Get the height property: Height of the area, in pixels.

int getWidth()

Get the width property: Width of the area, in pixels.

int getX()

Get the x property: X-coordinate of the top left point of the area, in pixels.

int getY()

Get the y property: Y-coordinate of the top left point of the area, in pixels.

JsonWriter toJson(JsonWriter jsonWriter)
String toString()

Returns a compact string containing the bounding box values in a style suitable for printing.

Methods inherited from java.lang.Object

Method Details

fromJson

public static ImageBoundingBox fromJson(JsonReader jsonReader)

Reads an instance of ImageBoundingBox from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of ImageBoundingBox if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getHeight

public int getHeight()

Get the height property: Height of the area, in pixels.

Returns:

the height value.

getWidth

public int getWidth()

Get the width property: Width of the area, in pixels.

Returns:

the width value.

getX

public int getX()

Get the x property: X-coordinate of the top left point of the area, in pixels.

Returns:

the x value.

getY

public int getY()

Get the y property: Y-coordinate of the top left point of the area, in pixels.

Returns:

the y value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

toString

public String toString()

Returns a compact string containing the bounding box values in a style suitable for printing.

Overrides:

ImageBoundingBox.toString()

Returns:

a string containing the bounding box values.

Applies to