动物识别接口
该请求用于识别一张图片。即对于输入的一张图片（可正常解码，且长宽比适宜），输出动物识别结果

@param image - 二进制图像数据
@param options - 可选参数对象，key: value都为string类型
options - options列表:
top_num 返回预测得分top结果数，默认为6
baike_num 返回百科信息的结果数，默认不返回
@return JSONObject
350151
public JSONObject animalDetect(byte[] image, HashMap<String, String> options) {
        AipRequest request = new AipRequest();
        preOperation(request);
        
        String base64Content = Base64Util.encode(image);
        request.addBody("image", base64Content);
        if (options != null) {
            request.addBody(options);
        }
        request.setUri(ImageClassifyConsts.ANIMAL_DETECT);
        postOperation(request);
        return requestServer(request);
    }
634584
public JSONObject dehaze(byte[] image, HashMap<String, String> options) {
        AipRequest request = new AipRequest();
        preOperation(request);
        
        String base64Content = Base64Util.encode(image);
        request.addBody("image", base64Content);
        if (options != null) {
            request.addBody(options);
        }
        request.setUri(ImageProcessConsts.DEHAZE);
        postOperation(request);
        return requestServer(request);
    }
671285
private ImageView getImageView(final int position) {
        if (position < mImageViewList.size()) {
            return mImageViewList.get(position);

        } else {
            if (mAdapter != null) {
                ImageView imageView = mAdapter.generateImageView(getContext());
                mImageViewList.add(imageView);
                return imageView;
            } else {
                Log.e("9GridImageView", "你必须为LQRNineGridImageView设置LQRNineGridImageViewAdapter");
                return null;
            }
        }
    }
580897
public void setImage(java.lang.String image) {
        getStateHelper().put(PropertyKeys.image, image);
    }
942142
public static ByteBuffer getImageByteBuffer(RenderedImage image) {
        ColorModel cm = image.getColorModel();
        WritableRaster wr = image.getData().createCompatibleWritableRaster(image.getWidth(), image.getHeight());
        image.copyData(wr);
        BufferedImage bi = new BufferedImage(cm, wr, cm.isAlphaPremultiplied(), null);
        return convertImageData(bi);
    }
428108
public Object getData() 
    {
        Object objValue = super.getData();
        ImageIcon image = this.convertValueToImage(objValue);
        return image;
    }
1176951
protected Graphics2D getGraphics(BufferedImage image) {
		Graphics2D graphics = image.createGraphics();
		graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
				RenderingHints.VALUE_ANTIALIAS_ON);
		return graphics;
	}
36345
public static void printAvailableImage(final Image image) {
        final Subscription subscription = image.subscription();
        System.out.println(String.format("Available image on %s streamId=%d sessionId=%d from %s",
                        subscription.channel(), subscription.streamId(), image.sessionId(), image.sourceIdentity()));
    }
428807
public static ns_image[] get(nitro_service client) throws Exception
	{
		ns_image resource = new ns_image();
		resource.validate("get");
		return (ns_image[]) resource.get_resources(client);
	}
890352
function json (options) {
  var opts = options || {}

  var limit = typeof opts.limit !== 'number'
    ? bytes.parse(opts.limit || '100kb')
    : opts.limit
  var inflate = opts.inflate !== false
  var reviver = opts.reviver
  var strict = opts.strict !== false
  var type = opts.type || 'application/json'
  var verify = opts.verify || false

  if (verify !== false && typeof verify !== 'function') {
    throw new TypeError('option verify must be function')
  }

  // create the appropriate type checking function
  var shouldParse = typeof type !== 'function'
    ? typeChecker(type)
    : type

  function parse (body) {
    if (body.length === 0) {
      // special-case empty json body, as it's a common client-side mistake
      // TODO: maybe make this configurable or part of "strict" option
      return {}
    }

    if (strict) {
      var first = firstchar(body)

      if (first !== '{' && first !== '[') {
        debug('strict violation')
        throw new SyntaxError('Unexpected token ' + first)
      }
    }

    debug('parse json')
    return JSON.parse(body, reviver)
  }

  return function jsonParser (req, res, next) {
    if (req._body) {
      debug('body already parsed')
      next()
      return
    }

    req.body = req.body || {}

    // skip requests without bodies
    if (!typeis.hasBody(req)) {
      debug('skip empty body')
      next()
      return
    }

    debug('content-type %j', req.headers['content-type'])

    // determine if request should be parsed
    if (!shouldParse(req)) {
      debug('skip parsing')
      next()
      return
    }

    // assert charset per RFC 7159 sec 8.1
    var charset = getCharset(req) || 'utf-8'
    if (charset.substr(0, 4) !== 'utf-') {
      debug('invalid charset')
      next(createError(415, 'unsupported charset "' + charset.toUpperCase() + '"', {
        charset: charset
      }))
      return
    }

    // read
    read(req, res, next, parse, debug, {
      encoding: charset,
      inflate: inflate,
      limit: limit,
      verify: verify
    })
  }
}
597496
public static function getImageThumbTag( $image, $options = [] ) {

		// Use Image from DB
		if( isset( $image ) ) {

			$thumbUrl = $image->getThumbUrl();

			if( isset( $options[ 'class' ] ) ) {

				$class = $options[ 'class' ];

				return "<img class='$class' src='$thumbUrl'>";
			}
			else {

				return "<img src='$thumbUrl'>";
			}
		}
		else {

			// Use Image from web root directory
			if( isset( $options[ 'image' ] ) ) {

				$images = Yii::getAlias( '@images' );
				$img	= $options[ 'image' ];

				if( isset( $options[ 'class' ] ) ) {

					$class	= $options[ 'class' ];

					return "<img class='$class' src='$images/$img'>";
				}
				else {

					return "<img src='$images/$img'>";
				}
			}
			// Use icon
			else if( isset( $options[ 'icon' ] ) ) {

				$icon = $options[ 'icon' ];

				return "<span class='$icon'></span>";
			}
		}
	}
831556
def image(id, options={})
      params = options
      get(surl('image') + id, params).body
    end
984603
public function tableRecognitionAsync($image, $options=array()){

        $data = array();
        
        $data['image'] = base64_encode($image);

        $data = array_merge($data, $options);

        return $this->request($this->tableRecognizeUrl, $data);
    }
943931
private static function encode($image)
    {
        // 网址 ?

        // 本地路径 ? is_file file_exists()

        // base64 编码 ? not support

        // 文件内容 ?

        // 资源 ? is_resource

        // SplFileInfo ? instanceof SplFileInfo

        $content = Is::is_image($image, null, true);

        if ($content) {
            return $content;
        } else {
            throw new TencentAIException(90301);
        }
    }
1103832
private JSONObject tableRecSyncHelper(byte[] imgData, long timeout, String resultType) {
        JSONObject res = tableRecognitionAsync(imgData, null);
        if (res.has("error_code")) {
            return res;
        }
        String reqId = res.getJSONArray("result").getJSONObject(0).getString("request_id");
        long start = Calendar.getInstance().getTimeInMillis();
        long sleepInterval = 2000;
        JSONObject result;
        while (true) {
            long now = Calendar.getInstance().getTimeInMillis();
            if (now - start > timeout) {
                // 超时
                return AipError.ASYNC_TIMEOUT_ERROR.toJsonResult();
            }
            result = getTableResultHelper(reqId, resultType);
            if (result.has("error_code")) {
                // 返回错误
                return result;
            }
            int retCode = result.getJSONObject("result").getInt("ret_code");
            if (retCode == OcrConsts.ASYNC_TASK_STATUS_FINISHED) {
                return result;
            }
            else {
                try {
                    Thread.sleep(sleepInterval);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        }
    }
1005705
public function saveFromString($image, $options = array())
    {
        if (isset($options['file'])) {
            if (false === @file_put_contents($options['file'], $image)) {
                throw new Exception\RuntimeException('could not save image');
            }
            return $options['file'];
        }
        return $image;
    }
464421
public static JComponent generateComponent(Image image) {

        if (image == null) {
            return new LabelUIResource("Image is null");
        }

        return SwingUtils.generateComponent(new ImageIcon(image));
    }