C++ :: OpenCV - Opening And Closing Webcam

Jan 24, 2015

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?

View 7 Replies


ADVERTISEMENT

C :: OpenCV And Detecting A Person With A Webcam

Jul 2, 2013

Code:
#include "opencv2/video/tracking.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc_c.h"

#include <stdio.h>
#include <stdlib.h>

[Code] ....

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.

View 8 Replies View Related

C++ :: Interfacing Digital Camera Or Webcam

Feb 27, 2013

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++.

View 1 Replies View Related

C++ :: How To Get A Video Recording As Input From Webcam To One Of Program Functions

Mar 25, 2014

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.

View 1 Replies View Related

C Sharp :: Full Code For Webcam Alert Motion Detector?

Mar 12, 2013

i have webcam i need to make project when this webcam detect any motion in his spot give me alert ,,,

View 4 Replies View Related

C++ :: CMD From Execute Closing Instantly

Aug 13, 2014

I compiled/built a code I had and made an executed file but when i click on it the CMD closes instantly. Is there anyway to keep this open?

View 10 Replies View Related

C++ :: How To Run OpenCV Program

Mar 15, 2013

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?

View 3 Replies View Related

Visual C++ :: OpenCV In MFC App?

Feb 5, 2014

I have a C++ app that uses OpenCV. Currently i am statically linking the OpenCV libs into my app. This is adding an extra overhead of 6+ MB.

i would like to remove some of the features that i am not using in OpenCV. The features am using are,

Capture frames from Webcam.

Face detection.

Image formats (JPEG, PNG).

Image rotation & resizing.

Is it possible to remove other features and trim down the libs?

My C++ app is developed in Visual Studio 2012.

View 1 Replies View Related

C/C++ :: How To Keep Console From Closing When Executing Code

Mar 4, 2015

I tried.

cin.get();
and
return 0;

is there a better way to keep the user info displaying without closing the console window.

View 1 Replies View Related

C# :: Closing MDI Children Closes Main App?

Mar 14, 2014

The following not only closes the MDI children, but also the form I set to be an MDI container.

private void close()
{
Form[] childArray = this.MdiChildren;
foreach (Form childForm in childArray)
{
childForm.Hide();
}
}

View 5 Replies View Related

C++ :: Termination Of Namespaces With A Closing Brace Only

Jan 9, 2014

... and not with a brace followed by a semicolon like in class-definitions - reason for that?

View 2 Replies View Related

C++ :: How To Compare Two Histograms Using Opencv

Mar 6, 2013

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++)
{

[Code]...

Error message: error LNK2019: unresolved external symbol "double __cdecl cv::compareHist(class cv::Mat const &,class cv::Mat const &,int)" (?compareHist@cv@@YANABVMat@1@0H@Z)

View 5 Replies View Related

C++ :: Cannot Load OpenCV Library

Mar 22, 2014

I am trying to run a console program but for any reason it displays an error on the cv.h line.

View 5 Replies View Related

Visual C++ :: How To Run OpenCV Program

Mar 15, 2013

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?

View 4 Replies View Related

C# :: Editing A Parent Dialog Box Without Closing The Child

Sep 30, 2014

I'm using windows forms and I have a parent dialog box that consists of a text box and a drop-down that launches a child dialog box. The child takes user input and then prints dialog to the text box in the parent. However, the output does not appear in the text box until I close the child.

Now my question is, how do I get the text to appear without closing the child? I hit a button to send the info to the text box, but it still doesn't appear until the child closes. I also need to set up a button to suspend the child so that the user can click/copy/etc the parent.

View 7 Replies View Related

Visual C++ :: Closing MFC Application From Command Prompt

Jul 31, 2013

I have created a MFC dialog based application. Now I want to implement such a functionailty that I will be closing my application through command prompt. And while closing of my application the ExitInstance() method of my application should get called. What is the command which I should put in the command prompt to close my application in such a way.

View 8 Replies View Related

C++ :: How To Create Histogram From A Set Of Values In OpenCV

Mar 9, 2013

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
........................

View 2 Replies View Related

Visual C++ :: Compare Two Histograms In OpenCV?

Mar 5, 2013

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);

[Code]....

Error message: error LNK2019: unresolved external symbol "double __cdecl cv::compareHist(class cv::Mat const &,class cv::Mat const &,int)" (?compareHist@cv@@YANABVMat@1@0H@Z)

View 1 Replies View Related

C :: How To Prevent A User From Closing Output Screen During Execution

Sep 17, 2013

I created a C program that extracts some information from computer and displays it on screen. It is completed today and is going to be applied to startup programs of domain machines. It runs at logon and takes somewhat 5-10 seconds to finish execution. The output is shown on console screen & user can either close the window by clicking on 'x' or pressing 'Ctrl+c' during execution. How do i prevent both of these events?

Basically the most time consuming processes are

Code: popen("systeminfo","r");
popen("wmic qfe get installedon","r");

1st command is getting OS name,version and hotfixes installed.
2nd command gives me the date of updates installed.

I then filter out data & print required information only.

View 3 Replies View Related

C# :: StreamWriter / View Written Data Prior To Closing?

Oct 11, 2014

I've found that with streamwriter(sw) the data isn't displayed with the written to document until you either leave scope or use sw.close I'd prefer to keep sw open as I will be writing to the file in and out, sometimes very frequently, but would also prefer the data to be viewed in real time. Is there an efficient way of going about this?

View 12 Replies View Related

C++ :: FIFO Reads Endlessly After Closing It On Producer Side

May 10, 2012

Right after I close FIFO on the producer side, the app on the consumer side gets into an endless loop. select() returns that FIFO is ready to read. Below is the excerpt from the consumer code. The FIFO is opened "blocking" on both ends.

Code:

FifoClass fifo_r = FifoClass("/tmp/FIFO_READ");
int fdr = fifo_r.OpenR();// this->fd = open(name.c_str(), O_RDONLY , 0);
for(int i=0; ;i++) {
FD_ZERO(&rset);
FD_SET(fdr, &rset);

[Code] .....

View 2 Replies View Related

C++ :: OpenCV - Create A Program Which Would Calibrate Camera

Feb 1, 2013

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;

[Code] ....

I am a beginner to opencv.

View 14 Replies View Related

C++ :: Split Image To 3 Channels - Opencv Error

Mar 18, 2013

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.

View 6 Replies View Related

Visual C++ :: Create Histogram From A Set Of Values In OpenCV?

Mar 9, 2013

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

........................

View 1 Replies View Related

Visual C++ :: ActiveX Web Browser Control Not Deleting Session Cookies Even After Closing

Aug 9, 2013

I have an C++ application which uses Microsoft Web browser ActiveX control to launch any URL within the application. The browser is embedded in C++ form and It's working fine with all the feature Microsoft has exposed through Interface(IID_IWebBrowser2).But while any url that is using session cookie has been launched, even after closing the browser the session cookies are not getting deleted. For example if user login info is stored as session cookies,the url is using the cookies and getting launched without asking for user log in info.

But if I close the browser, and again relaunch , the cookies should be deleted and the url will not find the cookies to be used for log in . That is not happening here. Although this is session cookies , it's not getting deleted and being used by embedded browser. However, if the url is launched in IE, it is behaving as expected.

So, Do I need to delete the cookies explicitly? If Yes, How to do that?

View 2 Replies View Related

C :: Opening A Data File Or Not

Jul 18, 2013

I have attempted a couple of different times to open a .txt file in a program, however it always goes to the "file was not opened."

Code:

#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *inFile;

[Code]....

View 8 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved