class_docstr: An example image iterator using opencv plugin
class_docstr_tok: ["An","example","image","iterator","using","opencv","plugin"]
docstr: Move iterator position forward
docstr_tok: ["Move","iterator","position","forward"]
code: def next(self):
      """Move iterator position forward"""
      batch = mx.nd.zeros(
          (self.batch_size, self.size[1], self.size[0], 3)
      )
      i = self.cur
      for i in range(
          self.cur, min(len(self.list), self.cur + self.batch_size)
      ):
          str_img = open(self.root + self.list[i] + ".jpg").read()
          img = imdecode(str_img, 1)
          img, _ = random_crop(img, self.size)
          batch[i - self.cur] = img
      batch = mx.nd.transpose(batch, axes=(0, 3, 1, 2))
      ret = mx.io.DataBatch(
          data=[batch],
          label=[],
          pad=self.batch_size - (i - self.cur),
          index=None,
      )
      self.cur = i
      return ret
  
file_path: mxnet/plugin/opencv/opencv.py
imports: import random
  import ctypes
  import cv2
  import mxnet
  from mxnet.base import _LIB
  from mxnet.base import mx_uint, NDArrayHandle, check_call
label_desc: Use image node_id 3 for calling the ImageListIter obj's underlying member method code with example usage: obj.next() and returns: ret