Cloud Vision V1 Client - Class ColorInfo (1.8.0)

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
NameDescription
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
TypeDescription
Google\Type\Color|null

hasColor

clearColor

setColor

RGB components of the color.

Parameter
NameDescription
var Google\Type\Color
Returns
TypeDescription
$this

getScore

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

Returns
TypeDescription
float

setScore

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

Parameter
NameDescription
var float
Returns
TypeDescription
$this

getPixelFraction

The fraction of pixels the color occupies in the image.

Value in range [0, 1].

Returns
TypeDescription
float

setPixelFraction

The fraction of pixels the color occupies in the image.

Value in range [0, 1].

Parameter
NameDescription
var float
Returns
TypeDescription
$this