Vision Image Properties#
Image Properties Annotation#
Image properties class representation derived from Vision API response.
-
class
google.cloud.vision.color.Color(red, green, blue, alpha)[source]# Bases:
objectRepresentation of RGBA color information.
Parameters: - red (int) – The amount of red in the color as a value in the interval [0, 255].
- green (int) – The amount of green in the color as a value in the interval [0, 255].
- blue (int) – The amount of blue in the color as a value in the interval [0, 255].
- alpha (float) – The fraction of this color that should be applied to the pixel.
-
class
google.cloud.vision.color.ColorInformation(color, score, pixel_fraction)[source]# Bases:
objectRepresentation of color information from API response.
Parameters: -
color# RGB components of the color.
Return type: ColorReturns: Instance of Color.
-
classmethod
from_api_repr(response)[source]# Factory: construct
ColorInformationfor a color found.Parameters: response (dict) – Color data with extra meta information. Return type: ColorInformationReturns: Instance of ColorInformation.
-
-
class
google.cloud.vision.color.ImagePropertiesAnnotation(colors)[source]# Bases:
objectRepresentation of image properties
Parameters: colors (list) – List of ColorInformation.-
colors# Colors in an image.
Return type: list of ColorInformationReturns: Populated list of ColorInformation.
-
classmethod
from_api_repr(response)[source]# Factory: construct
ImagePropertiesAnnotationfrom a response.Parameters: response (dict) – Dictionary response from Vision API with image properties data. Return type: ImagePropertiesAnnotation.Returns: Populated instance of ImagePropertiesAnnotation.
-