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 4595610
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:59:42+00:00 2026-05-21T22:59:42+00:00

I have installed OpenCV 2.2 and when I try to use drawContours I get

  • 0

I have installed OpenCV 2.2 and when I try to use drawContours I get the following error:

cv.drawContours(frame, contours, 0, cv.RGB(255, 0, 0))
TypeError: <unknown> is not a numpy array

The code related to this error is the following:

storage = cv.CreateMemStorage(0)
contours = cv.FindContours (color_mask, storage, method = cv.CV_CHAIN_APPROX_SIMPLE)
cv.drawContours(frame, contours, 0, cv.RGB(255, 0, 0))

The python documentation does not correspond with the correct order of parameters (I know the correct order thank to IDLE) and the C++ documentation for this function does not help me very much

Here is the full code (relevant code):

    cv.NamedWindow("MyWindow", 1)
    capture = cv.CaptureFromCAM(0)

    while 1:
        frame = cv.QueryFrame(capture)

        color_mask = cv.CreateImage(cv.GetSize(frame), 8, 1)

        cv.InRangeS(frame, cv.Scalar(*min_color), cv.Scalar(*max_color), color_mask)

        cv.CvtColor(frame, frame, cv.CV_BGR2HSV)

        storage = cv.CreateMemStorage(0)
        contours = cv.FindContours (color_mask, storage, method = cv.CV_CHAIN_APPROX_SIMPLE)
        cv.drawContours(image = frame, contours = contours, contourIdx = 0, color = cv.RGB(255, 0, 0))

        cv.ShowImage("MyWindow", frame)

Thanks in advance

  • 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-05-21T22:59:42+00:00Added an answer on May 21, 2026 at 10:59 pm

    You should be aware that drawContours and DrawContours are two different functions. They actually do the same thing, but they accept different parameters. I believe the first one only accepts numpy arrays instead of CvMat or other arrays from openCV.

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

Sidebar

Related Questions

I have installed Eclipse+CDT and OpenCV with: $ sudo apt-get install libcv1 libcv-dev libcvaux1
I have just installed the OpenCV 2.2 library with VS 2010 following the willowgarage
I have installed CherryPy 3.1.0,. Here is what happens when I try to run
I have opencv installed and working on my iphone (big thanks to this community).
I have tried to install ruby-opencv and I can't get it to work. I
I have just installed OpenCV on my Windows 7 machine. As a result, I
I have checked out the OpenCV SVN repo, installed all necessary libraries, compiled it
I have installed OpenCV C libraries from package management into my Kubuntu 9.10. I
I have a strange problem with opencv running on an Ubuntu. I installed OpenCV
I need to install OpenCV on Win32. I do not have it installed currently.

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.