473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

trouble calling OpenCV cvFitLine

1
I am trying to use the OpenCV cvFitLine() function using the Python SWIG interface to OpenCV. My problem has to do with the fact that the last argument is a pointer to an array of four floats (to return the fitted line parameters). My first mindless attempt looked like this:

Expand|Select|Wrap|Line Numbers
  1. line = []
  2. cv.cvFitLine(img, cv.CV_DIST_L2, 0, 0.01, 0.01, line)
This produced the error:

TypeError: in method 'cvFitLine', argument 6 of type 'float *'
After googling around bit, I decided that ctypes would give me the array pointer that I needed, so I modified my code as follows:

Expand|Select|Wrap|Line Numbers
  1. FourFloats = ctypes.c_float * 4
  2. line = FourFloats()
  3. cv.cvFitLine(img, cv.CV_DIST_L2, 0, 0.01, 0.01, ctypes.byref(line))
But this produced the same error. I'm stuck. Can someone please point me in the right direction?


Thanks...
Dec 23 '08 #1
0 2045

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Claudio Grondi | last post by:
What is the current status of Python OpenCV interface i.e. the opencv module? \OpenCV\samples\python\contours.py gives following ERROR: OpenCV Python version of contours Traceback (most recent...
1
by: Claudio Grondi | last post by:
OpenCV means Intel® Open Source Computer Vision Library. It is a collection of C functions and a few C++ classes that implement some popular Image Processing and Computer Vision algorithms. OpenCV...
3
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : ...
0
by: mkd | last post by:
Hi there To compile opencv I need to use: g++ `pkg-config --cflags opencv` -o face face.c `pkg-config --libs opencv` Now I want to compile in KDevelop, but it chooses gcc instead Does...
3
by: jlark | last post by:
Hello, I have just started working with opencv in python for my undergrad thesis. Im Trying to build a simple GUI which supports mouse inputs on an image. This is fairly simple in C and C++ ,...
4
by: hhx83 | last post by:
I'm trying to develop a MFC C++ app. How do you grab frames using Matrox ActiveMIL-lite library, and display using OpenCV where I can then use the image to do face detection? Hope someone can...
4
by: kurapix | last post by:
Hi there!!! I've been working on recognizing EAN barcodes from images. Yes it's about recognizing barcodes from images but from bars not from the digit with the help of OCR software but with...
1
by: aneuryzma | last post by:
Hi guys, I'm doing a project with both ogre3d and openCV and now I have to merge the code. I have 2 Visual C++ solutions and either of them has his own configuration. Can you give me some...
2
by: aneuryzma | last post by:
Hi guys, I'm doing a project with both ogre3d and openCV and now I have to merge the code. I have 2 Visual C++ solutions and either of them has his own configuration. Can you give me some...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.