cloudmersive/cloudmersive_imagerecognition_api_client

3.0.1 2023-07-02 02:18 UTC

README

Image Recognition and Processing APIs let you use Machine Learning to recognize and process images, and also perform useful image modification operations.

Cloudmersive Image Recognition and Computer Vision API provides advanced computer vision and image recognition capabilities.

  • API version: v1
  • Package version: 3.0.1

Requirements

PHP 5.5 and later

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:

{
  "repositories": [
    {
      "type": "git",
      "url": "https://github.com/cloudmersive/cloudmersive_imagerecognition_api_client.git"
    }
  ],
  "require": {
    "cloudmersive/cloudmersive_imagerecognition_api_client": "*@dev"
  }
}

Then run composer install

Manual Installation

Download the files and include autoload.php:

    require_once('/path/to/cloudmersive_imagerecognition_api_client/vendor/autoload.php');

Tests

To run the unit tests:

composer install
./vendor/bin/phpunit

Getting Started

Please follow the installation procedure and then run the following:

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure API key authorization: Apikey
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Apikey', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Apikey', 'Bearer');

$apiInstance = new Swagger\Client\Api\ArtisticApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$style = "style_example"; // string | The style of the painting to apply.  To start, try \"udnie\" a painting style.  Possible values are: \"udnie\", \"wave\", \"la_muse\", \"rain_princess\".
$image_file = "/path/to/file.txt"; // \SplFileObject | Image file to perform the operation on.  Common file formats such as PNG, JPEG are supported.

try {
    $result = $apiInstance->artisticPainting($style, $image_file);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ArtisticApi->artisticPainting: ', $e->getMessage(), PHP_EOL;
}

?>

Documentation for API Endpoints

All URIs are relative to https://api.cloudmersive.com

Class Method HTTP request Description
ArtisticApi artisticPainting POST /image/artistic/painting/{style} Transform an image into an artistic painting automatically
ConvertApi convertToBmp POST /image/convert/to/bmp Convert input image to Bitmap BMP format
ConvertApi convertToGif POST /image/convert/to/gif Convert input image to GIF format
ConvertApi convertToJpg POST /image/convert/to/jpg/{quality} Convert input image to JPG, JPEG format
ConvertApi convertToPhotoshop POST /image/convert/to/psd Convert input image to Photoshop PSD format
ConvertApi convertToPng POST /image/convert/to/png Convert input image to PNG format
ConvertApi convertToTiff POST /image/convert/to/tiff Convert input image to TIFF format
ConvertApi convertToWebP POST /image/convert/to/webp Convert input image to WebP format
EditApi editAutoOrient POST /image/edit/auto-orient/remove-exif Normalizes image rotation and removes EXIF rotation data
EditApi editCompositeBasic POST /image/edit/composite/{location} Composite two images together
EditApi editCompositePrecise POST /image/edit/composite/precise Composite two images together precisely
EditApi editContrastAdaptive POST /image/edit/contrast/{gamma}/adaptive Adaptively adjust the contrast of the image to be more appealing and easy to see
EditApi editCropCircle POST /image/edit/crop/circle/{left}/{top}/{radius} Crop an image to an circular area
EditApi editCropRectangle POST /image/edit/crop/rectangle/{left}/{top}/{width}/{height} Crop an image to a rectangular area
EditApi editDrawPolygon POST /image/edit/draw/polygon Draw a polygon onto an image
EditApi editDrawRectangle POST /image/edit/draw/rectangle Draw a rectangle onto an image
EditApi editDrawText POST /image/edit/draw/text Draw text onto an image
EditApi editDropShadow POST /image/edit/drop-shadow/{X}/{Y}/{sigma}/{opacity} Add a customizeable drop shadow to an image
EditApi editInvert POST /image/edit/invert Invert, negate the colors in the image
EditApi editRemoveExifData POST /image/edit/remove-exif Remove EXIF data from the image
EditApi editRemoveTransparency POST /image/edit/remove-transparency Remove transparency from the image
EditApi editRotate POST /image/edit/rotate/{degrees}/angle Rotate an image any number of degrees
FaceApi faceCompare POST /image/face/compare-and-match Compare and match faces
FaceApi faceCropFirst POST /image/face/crop/first Crop image to face with square crop
FaceApi faceCropFirstRound POST /image/face/crop/first/round Crop image to face with round crop
FaceApi faceDetectAge POST /image/face/detect-age Detect the age of people in an image
FaceApi faceDetectGender POST /image/face/detect-gender Detect the gender of people in an image
FaceApi faceLocate POST /image/face/locate Detect and find faces in an image
FaceApi faceLocateWithLandmarks POST /image/face/locate-with-landmarks Detect and find faces and landmarks eyes and nose and mouth in image
FilterApi filterBlackAndWhite POST /image/filter/black-and-white Convert image to black-and-white grayscale
FilterApi filterDespeckle POST /image/filter/despeckle Despeckle to remove point noise from the image
FilterApi filterEdgeDetect POST /image/filter/edge-detect/{radius} Detect and highlight edges in an image
FilterApi filterEmboss POST /image/filter/emboss/{radius}/{sigma} Emboss an image
FilterApi filterGaussianBlur POST /image/filter/blur/guassian/{radius}/{sigma} Perform a guassian blur on the input image
FilterApi filterMotionBlur POST /image/filter/blur/motion/{radius}/{sigma}/{angle} Perform a motion blur on the input image
FilterApi filterPosterize POST /image/filter/posterize Posterize the image by reducing distinct colors
FilterApi filterSwirl POST /image/filter/swirl Swirl distort the image
InfoApi infoGetDominantColor POST /image/get-info/dominant-color Returns the dominant colors of the image
InfoApi infoGetMetadata POST /image/get-info/metadata Returns the image metadata including EXIF and resolution
NsfwApi nsfwClassify POST /image/nsfw/classify Not safe for work NSFW racy content classification
RecognizeApi recognizeDescribe POST /image/recognize/describe Describe an image in natural language
RecognizeApi recognizeDetectAndUnskewDocument POST /image/recognize/detect-document/unskew Detect and unskew a photo of a document
RecognizeApi recognizeDetectObjects POST /image/recognize/detect-objects Detect objects including types and locations in an image
RecognizeApi recognizeDetectPeople POST /image/recognize/detect-people Detect people including locations in an image
RecognizeApi recognizeDetectTextFine POST /image/recognize/detect-text/fine Detect fine text in a photo of a document
RecognizeApi recognizeDetectTextLarge POST /image/recognize/detect-text/large Detect large text in a photo
RecognizeApi recognizeDetectVehicleLicensePlates POST /image/recognize/detect-vehicle-license-plates Detect vehicle license plates in an image
RecognizeApi recognizeFindSymbol POST /image/recognize/find/symbol Find the location of a symbol in an image
RecognizeApi recognizeSimilarityCompare POST /image/recognize/similarity/compare Compare two images for similarity
RecognizeApi recognizeSimilarityHash POST /image/recognize/similarity/hash Generate a perceptual image hash
RecognizeApi recognizeSimilarityHashDistance POST /image/recognize/similarity/hash/distance Calculates the similarity between two perceptual image hashes
ResizeApi resizePost POST /image/resize/preserveAspectRatio/{maxWidth}/{maxHeight} Resize an image while preserving aspect ratio
ResizeApi resizeResizeSimple POST /image/resize/target/{width}/{height} Resize an image
TextGenerationApi textGenerationCreateHandwritingPng POST /image/text/create/handwriting/png Create an image of handwriting in PNG format

Documentation For Models

Documentation For Authorization

Apikey

  • Type: API key
  • API key parameter name: Apikey
  • Location: HTTP header

Author