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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:57:43+00:00 2026-06-09T15:57:43+00:00

While attempting to do real time planar object tracking with opencv I came across

  • 0

While attempting to do real time planar object tracking with opencv I came across the “find object” demo for pyopencv. This script does what I want with the exception that it compares one static image against another whereas I’m trying to compare a static image against the current frame grabbed from a webcam. To this end I replaced this line

scene_filename = "box_in_scene.png"

with this

capture = cv.VideoCapture(0)
frame = Mat()
capture >> frame
imwrite("box_in_scene.png",frame)

This works as it should but when I then try to add a simple loop to make it do this continuously, it goes through one cycle then stops. When I exit the script I get the following error:

 OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupport
 ed array type) in cvGetMat, file M:\programming\packages\opencv\workspace\2.1\Op
 enCV-2.1.0\src\cxcore\cxarray.cpp, line 2476
 Traceback (most recent call last):
  File "find_obj.py", line 114, in <module>
    imageDescriptors = surf(image, mask, imageKeypoints)
 RuntimeError: M:\programming\packages\opencv\workspace\2.1\OpenCV-2.1.0\src\cxco
 re\cxarray.cpp:2476: error: (-206) Unrecognized or unsupported array type in fun
 ction cvGetMat

Anyone have a clue what might be causing this?

The loop I’m using is

myloop = 1
while myloop == 1 :

This link is the code in it’s entirety.

  • 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-09T15:57:44+00:00Added an answer on June 9, 2026 at 3:57 pm

    A few things come to mind immediately upon perusing your code. Firstly, you are declaring a new Mat(), and two new namedWindow objects EVERY time you loop. While this could cause a memory error after a few thousand loops (depending on your computer and OS), it likely isn’t your main problem. It is, however, a terrible way of doing things and a bad habit to get into.

    My second issue with your code is that you scan an image from your video camera, save it to file, and then re-load the file back into memory so you can use the image! I understand the want to save off a copy of the image in memory from the camera, but you already have it in memory, so why reload it? If you are on windows, this could be the source of your bad matrix, since the VC++10 libs are known to have some issues with imwrite and imread. [EDIT] I know you’re using python, but your program reports the error from a .cpp file, meaning the python imports are in fact linked to the c++ libs somewhere [/EDIT]

    Try removing the imwrite and imread calls in your loop, and using the image directly from the camera. If your code works after this, then you’ll know where your issues are. Let us know how it goes.

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

Sidebar

Related Questions

Usually one comes across this problem in python3.0 while attempting a split() method on
While attempting to debug a job submission script, I ended up narrowing down the
While attempting to link with QT 4.5 release, I run into this error message
I'm working through 'Dive Into Python' on Google App Engine and came across this
While attempting to provide an implimentation to this question , I got stuck on
While attempting to render a 3D object using OpenGL (and the GLFW library), the
I'm having some problems while attempting to serialize a libxml2 object in python. In
While attempting to find a way to merge existing PDF files and forms, I
While attempting my first sub-class in Objective-C I have come across the following warning
While attempting to port the extension from manifest version 1 to version 2, this

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.