code: def test_crop_image(self):
      img = self.data_info["img"]
      offset = [0, 0]
      target = [6, 6]
      trans = TextDetRandomCrop(target_size=(3, 3))
      crop, _ = trans._crop_img(img, offset, target)
      self.assertEqual(img.shape, crop.shape)
  
      target = [3, 2]
      crop = trans._crop_img(img, offset, target)
      self.assertTrue(
          np.allclose(
              np.array([[[1, 2, 3], [1, 2, 3]]]).transpose(1, 2, 0),
              crop[0],
          )
      )
      self.assertTrue(np.allclose(crop[1], np.array([0, 0, 3, 2])))
  
imports: import copy
  import unittest
  import unittest.mock
  import numpy
  from mmcv.transforms import Pad, RandomResize
  from mmocr.datasets.transforms import BoundedScaleAspectJitter, RandomCrop, RandomFlip, Resize, ShortScaleAspectJitter, SourceImagePad, TextDetRandomCrop, TextDetRandomCropFlip
  from mmocr.utils import bbox2poly, poly2shapely
label_desc: Use image node_id 3 for calling the TestTextDetRandomCrop obj's underlying member method code with example usage: obj.test_crop_image() without return types