Cloud Vision V1 Client - Class ColorInfo (1.9.3)

Reference documentation and code samples for the Cloud Vision V1 Client class ColorInfo.

Color information consists of RGB channels, score, and the fraction of the image that the color occupies in the image.

Generated from protobuf message google.cloud.vision.v1.ColorInfo

Namespace

Google \ Cloud \ Vision \ V1

Methods

__construct

Constructor.

Parameters
Name Description
data array

Optional. Data for populating the Message object.

↳ color Google\Type\Color

RGB components of the color.

↳ score float

Image-specific score for this color. Value in range [0, 1].

↳ pixel_fraction float

The fraction of pixels the color occupies in the image. Value in range [0, 1].

getColor

RGB components of the color.

Returns
Type Description
Google\Type\Color|null

hasColor

clearColor

setColor

RGB components of the color.

Parameter
Name Description
var Google\Type\Color
Returns
Type Description
$this

getScore

Image-specific score for this color. Value in range [0, 1].

Returns
Type Description
float

setScore

Image-specific score for this color. Value in range [0, 1].

Parameter
Name Description
var float
Returns
Type Description
$this

getPixelFraction

The fraction of pixels the color occupies in the image.

Value in range [0, 1].

Returns
Type Description
float

setPixelFraction

The fraction of pixels the color occupies in the image.

Value in range [0, 1].

Parameter
Name Description
var float
Returns
Type Description
$this