title: Array shape error while resizing and pasting transparent PNG on live web cam video using cv2
body: <pre><code>ValueError: could not broadcast input array from shape (392,400,4) into shape (392,400,3)
  </code></pre>
  <p>The following error occurs in my python code while pasting a transparent png which has been loaded using this
  <code>cv2.imread(&quot;shirt.png&quot;, cv2.IMREAD_UNCHANGED)</code> on to the live web cam video through cv2. The error doesn't occurif i load jpg or png with black background using <code>cv2.imread(&quot;shirt.png&quot;)</code>.</p>
  <p>Here are some snippets of the code:</p>
  <p><img src="https://i.stack.imgur.com/NkH7g.png" alt="enter image description here" /></p>
  <p><img src="https://i.stack.imgur.com/o66Dg.png" alt="enter image description here" /></p>
  <p>some one has already asked related question <a href="https://stackoverflow.com/questions/54139308/opencv-image-shape-error-could-not-broadcast-input-array-from-shape-585-828">OpenCV Image Shape Error - : could not broadcast input array from shape (585,828,3) into shape (585,828,4)</a></p>