opencv

Tracking rectangles with opencv

I want to define the orientation and location of the rectangle from web-camera. I used the algorithm camshift, but it gave poor results (high dependence on lighting). Tell my what mechanisms exist to solve this problem. May be exits some source code with similar program? ...

MacOS and OpenCV

Morning SO. I would like to compile openCV to make it work on a webcam capture using Qt 4.7. For that purpose, OpenCV must be compiled for a 64bit system. So, I've tried 3 compilations : Compiling from the source with cmake : sudo cmake -G "Unix Makefiles" . it works, but I can't dump a video into a file using cvCreateVideoWriter ...

covariance matrix in opencv

Hi everyone, Here is my code to calculate covariance matrix over a particular area of color image,But it always gives all zeroes.Please help me where am going wrong. IplImage* img = cvLoadImage("image.png",1); cvShowImage("input",img); cvSetImageROI(img,cvRect(10,10,30,30)); { CvMat* covarMatrix=cvCreateMat(3,3,CV_32FC1)...

Find Exact Matches of SURF in openCV

I am using openCV Surf tracker to find exact points in two images. as you know, Surf returns many Feature points in both images. what i want to do is using these feature parameters to find out which matches are exactly correct (true positive matches). In my application i need only true positive matches. These parameters existed : Hessia...

Changing the dataype of a Mat class instance in OpenCV C++ Interface

Hi all, How can i change the datatype used in storing the pixels in a Mat class instance? For example after reading an image using the line below Mat I = imread(file,0); i obtain a grayscale image with pixels of type unsigned char. I want to change this to a double. What's the best way to do the conversion? I wasn't able to find a f...

Opencv store to database

Hi, Is there a way to save opencv objects to database (like oracle, mysql a.s.o) instead of xml file ? CvSave is like a blackbox. Thx ...

Dynamically changing a texture in OpenGL

I have some (OpenCV) code that generates images. I'm displaying these using OpenGL. When new images are created I run the following function (each time) with the same texture name and a new image: void loadCVTexture(GLuint& texture, const cv::Mat_<Vec3f>& image){ if(texture != 0){ glBindTexture(GL_TEXTURE_2D, texture); glTexSu...

Where to get backgound sample images for haar training?

I need collection of sample images (negative images, or also called background images) for haar training using opencv. It is written that I need to have a lot of them. About 5000 or 10000. Do you know where to get them? ...

Camera and projector calibration

Hi everyone, I have a question about camera calibration. I've followed approach shown in a book Learning OpenCV for camera calibration process. But the calibrated(undistorted) image is worse than the original one. Is it possible that my camera don't need calibration anymore?(means that the calibration is done by some driver or somethin...

cvCreateCameraCapture returns null

Hi, I've got a webcam which is working perfectly in vlc, and is available as /dev/video0. However, whenever I use cvCreateCameraCapture, it returns null. I've used 0,1,-1 as indexes. What could be causing the problem? I'm on Ubuntu 9.10 BTW, using openCV 2.1.0.1 ppa. ...

Detecting a circle of a specific color (or gray level) with openCV

Hi, Is there a way to detect a circle with a specific grey level using openCV? I want to detect a circle that marks out from the others. Currently, I'm using cvHoughCircles to detect my circles. I know the method returns an array of cvSeq containing the info on each circle (point and radius), but it does not provide any color informati...

logic behind the code

could any one explain me logic behind this code?? pt1.x = cvRound(x0 + 1000*(-b)); pt1.y = cvRound(y0 + 1000*(a)); pt2.x = cvRound(x0 - 1000*(-b)); pt2.y = cvRound(y0 - 1000*(a)); ...

How to load a png image received through http post to OpenCV IplImage format.

I am writing a webserver which receives an image and do some processing and replys with results. The image is in the png format. It is received as a byte[] via POST using PHP. I have to convert this byte[] to OpenCV IplImage format. What are the steps I should follow to get this done? The way I am currently doing it is reading the imag...

Parse php image data to an OpenCV function

Is there a way to parse image data in a php variable to an opencv function? I want to do this without writing image to the hard disk using php and then reading it back to feed OpenCV function. This is related to this question ...

Image detection inside an image

I usually play a game called Burako. It has some color playing pieces with numbers from 1-13. After a match finishes you have to count your points. For example: 1 == 15 points 2 == 20 points I want to create an app that takes a picture and count the pieces for me. So I need something that recognizes an image inside an image. I was...

Is there any function in OpenCV or Emgu CV desktop capture options? (addons, libs, classes)

Is there any function in OpenCV or Emgu CV desktop capture options? (addons, libs, classes) So I know we can capture camera in a very easy way, is there any option for desktop capturing that way? ...

How do I recognize squares in this image?

Hey everyone, So I'm using openCV to do square recognition on this image. I compiled the squares.c file on an image that I took and here are the results: http://www.learntobe.org/urs/index1.php The image on the left is the original and on the right is the image that is a result of running the square detection. The results aren't...

OpenCV: IplImage versus Mat, which to use?

Hi All, I'm pretty new to OpenCV (about 2 months now). I have the book Learning OpenCV by Bradski and Kaehler. My question is, if I want to do everything in a 2.0+ manner, when should I use Matrices (Mat) and when should I use IplImage? Bradky's book states upfront (Preface) that it's written based on OpenCV 2.0, and it mostly uses Ipl...

opencv matrix (cv::Mat) from NSImage

This is not really a question but since I didn't find any information on such a transformation and because the transformation is not as trivial as it seems, I thought I'd post some code here. The code is part of http://rubyk.org (BSD licence) so feel free to reuse. Is there anything wrong with this code, or do you have a better alterna...

Looking for a C++ open source matrix storage library

The library needs to: record vector or matrices in "frames" (timestamped) enable multiple streams and markers It would be good if the library: had a BSD licence was well documented was written in C++ enabled non-linear access I have found a library that is very interesting and does points (1) and (2): SDIF. But the documentation ...