Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9181641
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:21:56+00:00 2026-06-17T18:21:56+00:00

So, this is what I am trying: import cv2 import cv2.cv as cv cv2.namedWindow(threeDWinName,

  • 0

So, this is what I am trying:

    import cv2
    import cv2.cv as cv
    cv2.namedWindow(threeDWinName, cv2.CV_WINDOW_AUTOSIZE)
    img2 = cv.CreateImage((320, 240), 32, 1)
    cv2.imshow(threeDWinName,img2)

Does anybody know what is going wrong with this? I get TypeError: <unknown> is not a numpy array

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T18:21:58+00:00Added an answer on June 17, 2026 at 6:21 pm

    The more recent version of OpenCV, cv2 uses numpy arrays for images, the preceding version cv used opencv’s special Mat’s. In your code you’ve created an image as a Mat using the old cv function CreateImage, and then tried to view it using the newer cv2.imshow function, but cv2.imshow expects a numpy array…

    …so all you need to do is import numpy, and then change you CreateImage line to:

    img2 = np.zeros((320,240),np.float32)
    

    And then it should be fine 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying this import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; import java.io.OutputStream;
I'm trying to import our SVN repository into Git. When I run either this
I'm trying to import IIS logs into SQL Server 2008. I get this error
I'm trying to run this script: import re, os def build_pool(cwd): global xtn_pool, file_pool
This code shows the structure of what I am trying to do. import multiprocessing
Currently I'm trying to run this powershell script: Param ( $websiteName, $physicalPath ) import-module
I'm trying to make a new CLLocation subclass. This is the skeleton: #import <UIKit/UIKit.h>
I'm using Python 2.5. I'm trying to use this 'with' statement. from __future__ import
I've been trying to import shape xml to customized View. like this, <shape xmlns:android=http://schemas.android.com/apk/res/android
i have faced this problem couple of days ago, while trying to import an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.