DemoGetImageSegment.php 581 B

1234567891011121314151617181920212223242526
  1. <?php
  2. require('../../vendor/autoload.php');
  3. use Volc\Service\ImageX;
  4. $client = ImageX::getInstance();
  5. // call below method if you dont set ak and sk in ~/.volc/config
  6. $client->setAccessKey("xx");
  7. $client->setSecretKey("xx");
  8. $Contour = array(
  9. 'Color' => 'color',
  10. 'Size' => 0,
  11. );
  12. $params = array(
  13. "Contour" => $Contour,
  14. );
  15. $params["ServiceId"] = "xx";
  16. $params["Class"] = "class";
  17. $params["Refine"] = true;
  18. $params["StoreUri"] = "xx";
  19. $params["OutFormat"] = "out format";
  20. $params["TransBg"] = true;
  21. $response = $client->getSegmentImage($params);
  22. print_r($response);