The above code is all I have so far. I got confused when I got to the part where my book on C tells me I need to use the cvCalcOpticalFlowFarneback() function to compare 2 consecutive images from the webcam and create the optical flow, and then measure movement between the frames to detect whether or not a person is moving through the room. How to do this, and the OpenCV wiki wasn't very descriptive on how to set it up for beginners. Honestly, the parameters just confused me and I didn't see a return value listed, or how you would get data from it.
I am trying to switch between 2 states, and the event that determines which state i am in is based on the key i've pressed. So in this case i want the webcam to start automatically, and when key is pressed it then turns it off. The way I've done it is like this :
bool webcam_on() { int c = 0; VideoCapture cap(0); if ( !cap.isOpened() ) // if not success, exit program
[Code] .....
The problem with this method is that cin.get() blocks the video stream.. I wanted something that the webcam turned on until i press some key, which would trigger the release.. How can this be done?
How to to interface my digital camera or webcam with the c++ so that the camera can capture continuously when the camera or webcam detect a badminton shuttlecock. I am using Dev C++.
I want to write a program that is going to turn on my webcam and then display whatever the webcam is pointing at on the app. But I am more interested in knowing how I can get a video recording as input from the webcam to one of the program functions, because I suppose that is what should happen.
I'm having a bit of problem. I've set the string 'Absent' to all student in a file. However, I want to replace 'Absent' with 'present' when the correct ID assigned to a student is entered. In other words, 'Absent' will only change to 'Present' for a specific person at a time. I'm not sure how to implement this
I am trying to run an OpenCV program from command line, but it gave error like "The program can`t start because opencv_220d.dll is missing from your computer." Try reinstalling the program to fix this problem. I am using Windows 7 & Microsoft VC++ 2010. How can I run the program?
I have source code that is shared between two compilers, one supports TR1 and one doesn't. I've reverse engineered a few of the TR1 templates for the older compiler, but I need to be able to detect whether TR1 is supported or not, so as to include the correct header.
I am tying to compare two histograms, but it gives error. Here I have given my code, histogram file and error message. Histogram file 3*5 matrix(output_test.txt):
1 2 3 4 5 5 2 1 4 2 2 1 2 4 2
code:
int main(..........) { ................................................ Mat first_histogram(1,feature_vector_size, CV_32F); Mat second_histogram(1,feature_vector_size, CV_32F); for(i=0;i<count_row;i++) { for(j=0;j<count_row;j++) {
Say a user installs and uses the software for awhile. Then they uninstall it. Client wants the database containing client data to remain behind, in case they ever re-install the software. Which is fine.
So then.. they re-install the software. Client wants them to have the choice to either use the existing database, or to create a new one. When the software fires up, it always checks for the database, and creates one if it's not there. So how can I determine if the instance is a new install, or a current install, given that the database will be there no matter what?
I am trying to run an OpenCV program from command line, but it gave error like "The program can`t start because opencv_220d.dll is missing from your computer." Try reinstalling the program to fix this problem. I am using Windows 7 & Microsoft VC++ 2010. How can I run the program?
I have a direct2d application and I want to be able to detect mouse clicks. One example is, (in my borderless window) I would like to have an X at the top right of the screen, that when clicked would close the window. How can I do something like this?
Just wrote this extremely simple program but it seems to be malfunctioning. It counts correctly the number of uppercase letters in a string so long as i don't use the space-bar. once I add a space it only counts the number of uppercase letters of the first word..
printf("I ..........ing love programming");
Code:
#include <stdio.h> main() { char text[200]; int i = 0; int uppercase = 0; printf("Enter text:"); scanf("%s", text);
I am performing arithmetic operations on very large integers that operate around the threshold of the maximum positive integer an int variable can handle (i.e. 2147483647) for a 32-bit machine. I have been studying the in-built functions in the C++ Standard Library for some time now where I came across some error detecting functions in the <cmath> and <cerrno> header files. The impression I got from the literature is that they are solely used in conjunction with functions contained in the <cmath> header file and not necessarily with fundamental arithmetic operations like addition and subtraction.
I need a means to know when my arithmetic operations generate overflows/underflows! Is there any way I can adapt the functionalities of these functions to my needs?
I have a text file which consist of several values. These values represent distance from origin to any point in the triangle. How can I create histogram from these values? Is there any functions in OpenCV which can create histogram from these values?
Below my sample values are given: .......................... 3.4 1.2 6.9 0.2 5.1 2.9 ........................
I am tying to compare two histograms, but it gives error. Here I have given my code, histogram file and error message. Histogram file 3*5 matrix(output_test.txt):
1 2 3 4 5 5 2 1 4 2 2 1 2 4 2
code:
Code: int main(..........) { ................................................ Mat first_histogram(1,feature_vector_size, CV_32F); Mat second_histogram(1,feature_vector_size, CV_32F);
I am doing a project, which requires me to create a program which would calibrate the camera. The code is below.
#include<opencvcv.h> #include<opencvhighgui.h> #include<stdlib.h> #include<stdio.h> #include<vector> using namespace cv; int main() { int numBoards = 0;
I am trying to detect keys pressed on a keyboard and mouse on both, Windows and Linux but I am unsure what would be the best practice way to do so. Will I have to detect the keys for each platform individually? Would you make use of an event listener? What's the best way to detect the input-devices?
I am currently planning on splitting my image into 3 channels so i can get the RGB values of an image to plot a scatter graph so i can model is using a normal distribtion calculating the covariance matrix, mean, etc. then calculate distance between the background points and the actual image to segment the image.
Now in my first task, i have wrote the following code.
VideoCapture cam(0); //int id=0; Mat image, Rch,Gch,Bch; vector<Mat> rgb(3); //RGB is a vector of 3 matrices namedWindow("window");
[Code] ....
but as soon as it reaches the split function, i step through it, it causes a unhandled exception error. access violation writing location 0xfeeefeee.
I am still new to opencv, so am not used to dealing with unhandled exception error.
I tried adding items into the vector still error, either via push_back or general assignment i.e. rgb[0] = Rch or Bch still error.
I would like the user to insert a CD into their computer and click on an button on my application that allows them to read the CD-ROM and find a specific file type, e.g. csv, and then grab the info in the csv file.
I already have my StreamReader setup grabbing a filepath.
Now I am just wondering...how do I detect the CD-ROM and how do I grab the filepath of the only CSV file on the CD-ROM?
What's behind detecting a CD-ROM and grabbing a specific file type from a CD-ROM?
I heard about DriveInfo
However, that only allows me to detect a drive but not look at it's contents.
I have a text file which consist of several values. These values represent distance from origin to any point in the triangle. How can I create histogram from these values? Is there any functions in OpenCV which can create histogram from these values? Below my sample values are given: