0

I have a patch with size 32x32 and I have the center coordinate and the x1,y1,x2,y2 coordinates of the patch in the image. I do not know how to add this patch to its position in an image with 256x256?

fireant
  • 12,032
  • 4
  • 34
  • 47
sc241
  • 149
  • 13

1 Answers1

1

You can simply use slicing in Python. Remember that opencv images are numpy arrays in Python.

See a sample code in this answer.

fireant
  • 12,032
  • 4
  • 34
  • 47
  • I really appreciate your help, what if the patches are overlapping? how to determine the value of overlapping patches. my patches have 3 values (0:background, 1:obj1, and 2: obj2), and some of the patches are overlapping, once we overlay them into an empty image(a numpy array with zero value), the values of objects are changing in the overlapped areas. what can I do in this case? – sc241 Jun 16 '18 at 05:57