Shortcuts

mmpose.apis.webcam.utils.copy_and_paste

mmpose.apis.webcam.utils.copy_and_paste(img: numpy.ndarray, background_img: numpy.ndarray, mask: numpy.ndarray, bbox: Optional[List] = None, effect_region: Tuple = (0.2, 0.2, 0.8, 0.8), min_size: Tuple = (20, 20))numpy.ndarray[源代码]

Copy the image region and paste to the background.

参数
  • img (np.ndarray) – Image data.

  • background_img (np.ndarray) – Background image data.

  • mask (ndarray) – instance segmentation result.

  • bbox (list, optional) – instance bbox in (x1, y1, x2, y2). If not given, the bbox will be obtained by _find_bbox(). Default: None

  • effect_region (tuple) – The region to apply mask, the coordinates are normalized (x1, y1, x2, y2). Default: (0.2, 0.2, 0.8, 0.8)

  • min_size (tuple) – The minimum region size (w, h) in pixels. Default: (20, 20)

返回

The background with pasted image region.

返回类型

np.ndarray

Read the Docs v: latest
Versions
latest
1.x
v1.0.0rc0
v0.29.0
v0.28.0
v0.27.0
dev-1.x
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.