{"id":356,"date":"2022-08-30T14:59:59","date_gmt":"2022-08-30T14:59:59","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/06\/opencv-python-is-not-a-numpy-array-collection-of-common-programming-errors\/"},"modified":"2022-08-30T14:59:59","modified_gmt":"2022-08-30T14:59:59","slug":"opencv-python-is-not-a-numpy-array-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/opencv-python-is-not-a-numpy-array-collection-of-common-programming-errors\/","title":{"rendered":"opencv-python: is not a numpy array-Collection of common programming errors"},"content":{"rendered":"<p>I want to use the current array to be the output array of the blur operation made in the frame image and im getting this error:<\/p>\n<pre><code>TypeError:  is not a numpy array\n<\/code><\/pre>\n<p>I already checked and both are arrays of the same size and type, I dont understand why this is happening.<\/p>\n<p>Part of the code:<\/p>\n<pre><code>previous = np.zeros((frameHeight,frameWidth,3),np.uint8) #blank image with 640x480 and 3 channels\ndifference = np.zeros((frameHeight,frameWidth,3),np.uint8)\ncurrent = np.zeros((frameHeight,frameWidth,3),np.uint8)\n\nwhile True:\n    # Capture a frame\n    flag,frame = capture.read()\n    cv2.flip(frame, flipCode=1)\n\n    # Difference between frames\n    cv2.blur(frame, current, (15,15))\n<\/code><\/pre>\n<ol>\n<li>\n<p>The arguments to <code>cv2.blur<\/code>, as described in the documentation, are the following:<\/p>\n<pre><code>cv2.blur(src, ksize[, dst[, anchor[, borderType]]]) \u2192 dst\n<\/code><\/pre>\n<p>So, I think you meant<\/p>\n<pre><code>current= cv2.blur(frame, (15,15))\n<\/code><\/pre>\n<\/li>\n<\/ol>\n<p id=\"rop\"><small>Originally posted 2013-11-06 03:16:11. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I want to use the current array to be the output array of the blur operation made in the frame image and im getting this error: TypeError: is not a numpy array I already checked and both are arrays of the same size and type, I dont understand why this is happening. Part of the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-356","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=356"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/356\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}