Skip to content

Commit

Permalink
Merge pull request #1 from csgt/master
Browse files Browse the repository at this point in the history
Fix to TextDetection documentation
  • Loading branch information
icweb committed Apr 18, 2019
2 parents 04f4333 + 9bb5a3b commit cf17c6e
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions README.md
Expand Up @@ -63,7 +63,7 @@ $client = new RekognitionClient([
'version' => 'latest'
]);
```

#### __Preparing the Image__

Convert the uploaded file into base64-encoded image bytes.
Expand All @@ -81,29 +81,28 @@ __Detect Nudity__

```php
$results = $client->detectModerationLabels([
'Image' => ['Bytes' => $bytes],
'Image' => ['Bytes' => $bytes],
'MinConfidence' => 50
])['ModerationLabels'];

# Check to see if nudity labels were returned
$containsNudity = array_search('Explicit Nudity', array_column($results, 'Name'));
```


__Detect Text in Photo__

```php
$results = $client->detectText([
'Image' => ['Bytes' => $bytes],
'MinConfidence' => 50
])['ModerationLabels'];

'Image' => ['Bytes' => $bytes],
])['TextDetections'];

# Create single string of all words detected
foreach($results as $item)
{
if($item['Type'] === 'WORD')
if($item['Type'] === 'WORD')
{
$string .= $item['DetectedText'] . ' ';
}
}
```
```

0 comments on commit cf17c6e

Please sign in to comment.