Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Problem in copying part of image to another

img=cv2.imread("d:\OCR Readers\CPU images\50190025579077\AO_Form_1.jpeg") img.shape (1000, 800, 3) part=img[400:440, 1080:1515] img2=cv2.imread("d:\OCR Readers\white1.png") img2.shape (2338, 1651, 3) img2[15:55, 130:565]=part

ValueError: could not broadcast input array from shape (40,0,3) into shape (40,435,3)

How to resolve this problem

click to hide/show revision 2
None

updated 2019-08-12 14:33:50 -0500

berak gravatar image

Problem in copying part of image to another

How to resolve this problem

img=cv2.imread("d:\OCR Readers\CPU images\50190025579077\AO_Form_1.jpeg")

>>> img=cv2.imread("d:\\OCR Readers\\CPU images\\50190025579077\\AO_Form_1.jpeg")
>>> img.shape
 (1000, 800, 3)
 >>> part=img[400:440, 1080:1515]
      img2=cv2.imread("d:\OCR Readers\white1.png")
      >>> img2=cv2.imread("d:\\OCR Readers\\white1.png")
>>> img2.shape
 (2338, 1651, 3)
 >>> img2[15:55, 130:565]=part

130:565]=part

ValueError: could not broadcast input array from shape (40,0,3) into shape (40,435,3)

How to resolve this problem

(40,435,3)