class_docstr: Random crop and resize.
  A crop of random size (default: of 0.08 to 1.0) of the original size and a random
  aspect ratio (default: of 3/4 to 4/3) of the original aspect ratio is made. This crop
  is finally resized to given size.
  This is popularly used to train the Inception networks.
  
  Parameters
  ----------
  size : tuple of int
      Expected output size of each edge
  scale : tuple of float
      Range of size of the origin size cropped
  ratio : tuple of float
      Range of aspect ratio of the origin aspect ratio cropped
  
  Inputs:
      - **data**: a list of frames with shape [H x W x C]
  
  Outputs:
      - **out**: a list of cropped and resized frames with shape [size x size x C]
class_docstr_tok: ["Random","crop","and","resize",".","A","crop","of","random","size","(","default",":","of","0.08","to","1.0",")","of","the","original","size","and","a","random","aspect","ratio","(","default",":","of","3\/4","to","4\/3",")","of","the","original","aspect","ratio","is","made",".","This","crop","is","finally","resized","to","given","size",".","This","is","popularly","used","to","train","the","Inception","networks",".","Parameters","--","--","--","--","--","size",":","tuple","of","int","Expected","output","size","of","each","edge","scale",":","tuple","of","float","Range","of","size","of","the","origin","size","cropped","ratio",":","tuple","of","float","Range","of","aspect","ratio","of","the","origin","aspect","ratio","cropped","Inputs",":","-","*","*","data","*","*",":","a","list","of","frames","with","shape","[","H","x","W","x","C","]","Outputs",":","-","*","*","out","*","*",":","a","list","of","cropped","and","resized","frames","with","shape","[","size","x","size","x","C","]"]
docstr: Get parameters for ``crop`` for a random sized crop.
  
  Parameters:
      img (cv2 Image): Image to be cropped.
      scale (tuple): range of size of the origin size cropped
      ratio (tuple): range of aspect ratio of the origin aspect ratio cropped
  Returns:
      tuple: params (i, j, h, w) to be passed to ``crop`` for a random
          sized crop.
docstr_tok: ["Get","parameters","for","``","crop","``","for","a","random","sized","crop",".","Parameters",":","img","(","cv2","Image",")",":","Image","to","be","cropped",".","scale","(","tuple",")",":","range","of","size","of","the","origin","size","cropped","ratio","(","tuple",")",":","range","of","aspect","ratio","of","the","origin","aspect","ratio","cropped","Returns",":","tuple",":","params","(","i",",","j",",","h",",","w",")","to","be","passed","to","``","crop","``","for","a","random","sized","crop","."]
code: def get_params(self, img, scale, ratio):
      """Get parameters for ``crop`` for a random sized crop.
  
      Parameters:
          img (cv2 Image): Image to be cropped.
          scale (tuple): range of size of the origin size cropped
          ratio (tuple): range of aspect ratio of the origin aspect ratio cropped
      Returns:
          tuple: params (i, j, h, w) to be passed to ``crop`` for a random
              sized crop.
      """
      height, width, _ = img.shape
      area = height * width
  
      for _ in range(10):
          target_area = random.uniform(*scale) * area
          aspect_ratio = random.uniform(*ratio)
  
          w = int(round(math.sqrt(target_area * aspect_ratio)))
          h = int(round(math.sqrt(target_area / aspect_ratio)))
  
          if random.random() < 0.5:
              w, h = h, w
  
          if 0 < w <= width and 0 < h <= height:
              i = random.randint(0, height - h)
              j = random.randint(0, width - w)
              return i, j, h, w
  
      # Fallback to center crop
      in_ratio = float(width) / float(height)
      if in_ratio < min(ratio):
          w = width
          h = int(round(w / min(ratio)))
      elif in_ratio > max(ratio):
          h = height
          w = int(round(h * max(ratio)))
      else:  # whole image
          w = width
          h = height
  
      i = (height - h) // 2
      j = (width - w) // 2
      return i, j, h, w
  
imports: from __future__ import division
  import random
  import math
  import numbers
  import numpy
  from mxnet.gluon import Block
label_desc: Use image node_id 2 for calling the RandomResizedCrop obj's underlying member method code with example usage: obj.get_params(img, scale, ratio) and returns: i,  j,  h,  w, i,  j,  h,  w