opencv

Mask / Zero out area outside specified ROI

Greetings! I am working on a project using OpenCV on template matching, and I want to limit the search region on an image. Image is captured continuously from a camera. Is there any way to Zero / mask out image outside ROI defined, so that template matching process can be specific on remaining region, faster and accurate? Thanks is ad...

OpenCV, Matlab and STL containers

Many functions in the latest release of OpenCV require the use of STL containers. I run into problems when trying to use them in a Matlab MEX file. I am compiling the MEX files from within Matlab. Both OpenCV and Matlab use the "/MD" flag which is "Multithreaded DLL" for code generation. Compiler: MSVC++ 9.0 Matlab 2010a OpenCV latest f...

OpenCV 2.1 Mac OS X webcam issues 32 and 64 bit

I have installed opencv 2.1 on my mac mini using macports (automatic) 64 bit compile. the sample programs work EXCEPT for the camera based ones. i have a logitech c200 webcam. However, when i compile opencv with -arch i386 and -m32 everything works fine including connecting to the camera. i have read this is because quicktime is 32 bit...

OpenCV and AMD processors

I know that in the past OpenCV was based on IPP and was optimized to run on Intel CPUs. Is this still the case with OpenCV 2.0? Thanks, SW. ...

How do I track a blob using OpenCV and Python

I've gotten OpenCV working with Python and I can even detect a face through my webcam. What I really want to do though, is see movement and find the point in the middle of the blob of movement. The camshift sample is close to what I want, but I don't want to have to select which portion of the video to track. Bonus points for being able ...

How do I track motion using OpenCV in Python?

I can get frames from my webcam using OpenCV in Python. The camshift example is close to what I want, but I don't want human intervention to define the object. I want to get the center point of the total pixels that have changed over the course of several frame, i.e. the center of the moving object. ...

Counting objects in image

Dear Sir I want to count no of objects in an image using open cv. I have a soybean image and now I want to count the soybean numbers. If possible please help me and let me know the counting algorithms. Thanks and I look forward to hear from you. Regards, Sumon ...

C++ OpenCV2 cv::Mat::copyTo error in linux

Hi, while trying to compile the following code in OpenCV2 in linux, cv::Mat image1, image2; cv::Rect rect1, rect2; ... image1(rect1).copyTo(image2(rect2)); I get the following error: x.cpp: In member function ‘cv::Mat Process(cv::Mat)’: x.cpp:241: error: no matching function for call to ‘cv::Mat::copyTo(cv::Mat)’ cxcore.hpp:7...

Opencv expected constructor, desctructor or type conversion

When I compile the code below I get the following errors: ./main.cpp:150: error: expected constructor, destructor, or type conversion before ‘(’ token ../main.cpp:154: error: expected constructor, destructor, or type conversion before ‘(’ token ../main.cpp:156: error: expected constructor, destructor, or type conversion before ‘(’ toke...

OpenCV HoughCircles

Hi there Im using Xcode and c++ I have copied the HoughCircles code from the OpenCV documentation: #include <cv.h> #include <highgui.h> #include <math.h> using namespace cv; int main(int argc, char** argv) { Mat img, gray; if( argc != 2 && !(img=imread(argv[1], 1)).data) return -1; cvtColor(img, gray, CV_BGR2GRAY...

What kind of histogram does opencv CAMSHIFT use, is it ratio or weighted ?

Hi, I want to know the kind of histogram is used in opencv along with the camshift algorithm. Is it the ratio histogram or is it the weighted histogram ?? Many Thanks ...

OpenCV: How to merge two static images into one and emboss text on it?

Hi there, I have completed an image processing algorithm where I extract certain features from two similar images. I'm using OpenCV2.1 and I wish to showcase a comparison between these two similar images. I wish to combine both the images into one, where the final image will have both the images next to one another. Like in the figure ...

how to save output video into a file in opencv

hello i want to save the output video into a file instead of displaying it and tried using cvcaptureimage but still unable to get the result #include <highgui.h> int main(int argc, char *argv[]) { // Create a "Capture" object from 1st command line argument CvCapture *video = cvCaptureFromFile(argv[1]); // this is the struct...

Mat::convertTo used with inplace matrix cause buffer overflow

I have a problem in with a inplace Mat::convertTo cause buffer overflow if destination and source data type is different. Please, anyone having this problem too? Can I fix? ...

haar feature calculation

any one can help me to calculate haar features from given image. and the weak classifier output ( interpretation ) please thanks in advance ...

Opencv: Detect a black to white gradient in an area

Hi, I uploaded an example image for better understanding: http://www.imagebanana.com/view/kaja46ko/test.jpg In the image you can see some scanlines and a marker (the white retangle with the circle in it). I want opencv to go along a specified area (in the example outlined trough the scanlines) that should be around 5x5. If that area co...

What is the OpenCV svm type parameter

The opencv SVM implementation takes a parameter labeled as "SVM type" which must be used in the CVSVMParams structure used in training the SVM. All the explanation I can find is: // SVM type enum { C_SVC=100, NU_SVC=101, ONE_CLASS=102, EPS_SVR=103, NU_SVR=104 }; Anyone know what these different values represent? ...

modify inRangeS for hsv color filtering

Hi, I'am currently trying to use cvInRangeS to check that the hue value of an HSV image is in some range. The problem is cvInRangeS allows the specification of only ONE continous range. In the following example is 20<=H<40 , 0<=S<255 , 0<=V<255 . CvScalar lower = cvScalar (20, 0, 0); CvScalar upper = cvScalar (40, 255,255); cvInRange...

How to detect points which are drastically different than their neighbours

Hey I'm doing some image processing, and am trying to keep track of points similar to those circled below, a very dark spot of a couple of pixels diameter, with all neighbouring pixels being bright. I'm sure there are algorithms and methods which are designed for this, but I just don't know what they are. I don't think edge detection wo...

[OpenCV] Is there a quick way to convert tree-based haar cascades to stump-based haar cascades?

It seems like most algorithms are more optimized for stump-based Haar cascades - I'm not actually sure of the format (it would be great to see a stump-based cascade and its equivalent) so not sure how to restructure it myself. I was wondering if there was an existing converter or if anyone had a particular cascade in both tree and stump ...