Google\Cloud\Vision\VisionClient::image PHP Method

image() public method

This method should be used to configure a single image, or when a set of images requires different settings for each member of the set. If you have a set of images which all will use the same settings, {@see \Google\Cloud\Vision\VisionClient::images()} may be quicker and simpler to use. This method will not perform any service requests, and is meant to be used to configure a request prior to calling {@see \Google\Cloud\Vision\VisionClient::annotate()}. For more information, including best practices and examples detailing other usage such as $imageContext, see {@see \Google\Cloud\Vision\Image::__construct()}. Example: $imageResource = fopen(__DIR__ .'/assets/family-photo.jpg', 'r'); $image = $vision->image($imageResource, [ 'FACE_DETECTION' ]); Setting maxResults for a feature $imageResource = fopen(__DIR__ .'/assets/family-photo.jpg', 'r'); $image = $vision->image($imageResource, [ 'FACE_DETECTION' ], [ 'maxResults' => [ 'FACE_DETECTION' => 1 ] ]);
public image ( resource | string | StorageObject $image, array $features, array $options = [] ) : Image
$image resource | string | StorageObject An image to configure with the given settings. This parameter will accept a resource, a string of bytes, or an instance of {@see \Google\Cloud\Storage\StorageObject}.
$features array A list of cloud vision [features](https://cloud.google.com/vision/reference/rest/v1/images/annotate#type) to apply to the image.
$options array See {@see \Google\Cloud\Vision\Image::__construct()} for configuration details.
return Image
    public function image($image, array $features, array $options = [])
    {
        return new Image($image, $features, $options);
    }