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


ADVERTISEMENT

Visual C++ :: How To Implement HD Video Recording Using DirectShow

Jun 19, 2013

I am using DirectShow to Play / Pause / Stop and Capture Video files. But Capturing and playing of video files is simple. I want to Implement HD Video recording in my project.

how to Implement HD Video Capturing using DirectShow.?

Or Apart from DirectShow, is there any other method to Implement HD Video recording in MFC.

View 6 Replies View Related

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++ :: 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 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/C++ :: Read Video Frame By Frame Through Program

May 1, 2012

I m trying to read a video frame by frame through a c program for which i need to know the format of .wmv (native video file for windows) file,can i get it??

View 6 Replies View Related

C/C++ :: Accepting Input For Functions?

Apr 7, 2014

how would one Be able to accept input for a function, for example:

#include <iostream>
using namespace std;
int numSubtract (int x){
if (x==1)
return 1;
else
return numSubtract (x-1);
}
int main (){
cout << numSubtract (5) ;
}

how would I be able to have the user input their own number instead of 5 in this example, and then output that?

View 2 Replies View Related

C++ ::  how To Input Values Into Array Via Functions

Sep 5, 2014

What "int values" is supposed to mean as parameters to these functions? I'm not sure what do with them. Also how to input values into the array via functions. I was trying to but I just don't understand how to connect a user's input to a function to then enter into an array.

// input reads “values” integers from the user to place in the array data. It prompts the user for each value individually with the ordinal position of the value.
void input (int data [size], int values);
// Places the sum of corresponding values from arrays a and b and places the results in array s. The first “values” integers in the array are processed.
void do_sums (int a [size], int b [size], int s [size], int values);

[Code]...

View 2 Replies View Related

C++ :: Elevate Input Number Without Using Advanced Functions

Oct 9, 2013

Last night I was trying to see if is possible to multiply one number to another without using any given function(like pow) or the multiply sign or whatever. Just using addition and subtract signs (+and -) with a for loop. It worked.

Now I am trying to understand if is possible to elevate one given number (inserted by the user) to another number without using again any function or the multiply / divide/ etc functions. Just add and subtract functions.

View 3 Replies View Related

C :: Functions That Declare Arrays In Function Input Even Though Already Declared In Main

Mar 6, 2015

I have seen functions that declare arrays in the function input even thou the arrays is already declared in main. Why do you do this?

For example:

int ova(int antal, char glosorSv[][MAX], char glosorEn[][MAX])
int main(void)

char glosorSv[][MAX]
char glosorEn[][MAX]

View 2 Replies View Related

C++ :: Output Vowel From User Input - Error With Strings And Functions

Nov 25, 2014

The program is supposed to read in a string from the user and then output the number of each vowel that the string has. My first function is initializing the vectors, and the one that I'm having trouble with is the function used to read the string from the user and save it.

Here's my code:

#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
using namespace std;

// FUNCTION PROTOTYPES GO HERE:
void init_vectors(vector<char> & vowels, vector<int> & frequencies);
string read_text(const string & prompt);

[Code] ....

And I'm getting the error:

freq.cpp: In function ‘std::string read_text(const std::string&)’:
freq.cpp:74: error: no matching function for call to ‘getline(std::istream&, const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)’

I'm not too sure if I can't use the function getline here or if there is something wrong with the function prototype itself but I'm pretty sure there isn't an error there as it was given to me.

View 4 Replies View Related

C++ :: Implement Member Functions Of Class Function - Failing To Get Input

Aug 17, 2013

I am supposed to implement the member functions of class Person.

class Person {
public:
Person();
Person(string pname, int page);
void get_name() const;
void get_age() const;

[Code] ....

The code I wrote is below. Where I am struggling is the program does not allow me to input age. Therefore, I cannot test if my temp for age works. It automatically defaults to 0 because it hasn't taken input. Here is my code:

// Program Title: Person function
// Program Description: The program prompts the user for first and last name and age.
// It then prints the output that was provided by the user.

#include<iostream>
#include<string>
using namespace std;
class Person {

[Code] .....

View 13 Replies View Related

C :: Multiple Functions Within A Program

Jan 22, 2013

I am getting an error on lines 31 and 36 about an expected identifier on my program that computes area and circumference. Is something wrong with my external functions outside of main?

Code:
#include <stdio.h>
#define PI 3.14159

double area;
double circum;

double find_circum (double radius);
double find_area (double radius);

[Code] ....

View 2 Replies View Related

C++ :: Functions - Declaring First And Defining Later In Program

Apr 6, 2013

I am looking at functions still and can't see the point in declaring the function at the top of the program, and then defining later i.e.

Code:
#include <iostream>
int add (int x, int y) {
return x + y;

[Code] .....

I obviously don't have much real world experience with this and am interested to see where declaring and defining later would be useful and/or beneficial.

View 14 Replies View Related

C :: Remove The Functions In A Program By Pre-processing

Jun 16, 2013

Is there a program that can remove the functions in a program by preprocessing

Code:

#include<stdio.h>
int is_even(int number);
int main(void)
{
if(is_even(number))
{
printf("%d is even", number);
}
}

[Code]...

To something like

Code:

#include<stdio.h>
int is_even(int number);
int main(void)
{
if( number%2 ==0 )
{
printf("%d is even", number);
}
}

I use the "-E" option when compiling with gcc on linux but its output still contains funcitons. Is there a preprocessing program that can remove functions from a program?

View 6 Replies View Related

C :: Program On Multiplication Of Matrices Using Functions

Feb 26, 2013

when i am running this program no errors are being shown but as soon as i press ctr+f9 to run the program my tc++ window closes.....

Code:
#include<stdio.h>
#include<conio.h>
void multiply(int m1[50][50],int ,int,int m2[50][50],int ,int );
void main() {
int i,j,m,n,p,q,m1[50][50],m2[50][50];

[Code] ....

View 4 Replies View Related

C :: Scanning Equations / Functions Into Program

Nov 15, 2014

I have to make a numerical integration program, how I can write my code so that the user is able to write their own function that they want to integrate?

E.g. they would see the message: 'please enter your function' and would be able to write whatever they wanted e.g. 'x +5' then this would then be integrated by the program.

I have already written a program that can integrate a known function but would prefer that the user could choose their own.

View 2 Replies View Related

C++ :: Program To Check Validation Of Functions

Apr 12, 2013

I'm writing a program to check whether codes from a file are invalid, valid, inactive, or valid and active, but can't get it to work properly. The invalid codes are being found, but the other three are not. I think it may have something to do with my "active" function.

#include <iostream>
#include <fstream>
#include <string>
#include <cctype>
using namespace std;

struct ActiveCodes {
string code;
bool flag;

[Code] ....

View 19 Replies View Related

C++ :: Executing Multiple Functions In Program

Mar 24, 2013

We have been assigned to create a program that uses multiple functions. The professor has given us code for two of the functions, one to open a file and then another one to read the files contents and output them. I have put these into my program but they will not execute. The program does run, but the functions themselves are not executing. I have practiced with other functions that contain no parameters and those run fine, but the functions she gave us have multiple parameters.

The code I have so far is below:

#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
void PrintFile (string FileName, ifstream& inFile);
int main () {
ifstream inFile;
string fileName;

[Code] .....

View 1 Replies View Related

C :: Calling Functions From Parallel (MPI) Fortran Program

Apr 24, 2013

I'm working on a parallel Fortran program by using MPI, which calls a very good random number generator function from C (drand48 and srand48 for seed).

My Fortran program file "Par_PICFort_4.f95" is smt. like:

Code: PROGRAM main
IMPLICIT NONE
Include 'mpif.h'

[Code]....

I compile the code as: Code: mpif77 -o PIC Par_PICFort_4.f95 drand48.c Program seem to be running, but after checking the simulation results, I see that drand48 is not working in a parallel way. Creating independent random numbers which different seeds is very important for me.

Question: Is it possible to run the drand48.c file as parallel?

View 2 Replies View Related

C :: ATM Program - Withdraw And Fastcash Functions Are Not Working

Apr 19, 2013

My ATM program compiles but my withdraw and fastcash functions are not working right in my program.

Here is my program:

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

int fn_balance(int *);
void fn_deposit(int *);
void fn_withdraw(int *);
void printReceipt(int *);
void mainMenu(int *);
void FastCashMenu(int *);

[Code] .....

View 1 Replies View Related

C :: Using Prototype Functions To Run Loops And To Pause The Program?

Oct 25, 2013

So i have to use these prototype functions to run loops and to pause the program, the only problem is after i select a loop option and enter a number of dots to print in the loop it goes into an infinite loop and why, also when i try using the 4 option to exit it still asks me how many dots i want to print.

Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int pause(char *);
int getInt(char *);
void whileFunction(int);
void doWhileFunction(int);
void forFunction(int);

[Code] .....

View 12 Replies View Related

C :: Write A Program With Two Functions Both Called From Main

Mar 14, 2013

Write a program with two functions both called from main(). The first function just prints "Hello". In the second function ask the user to enter a number. Calculate the square root of the number and return the result to main(). In main() print the square root value.

Code:

#include<stdio.h>
#include<math.h>
float fun3 (float );
main()
}

[code]...

View 3 Replies View Related

C++ :: Use Functions In A Program To Show Names And Grades

May 19, 2013

how to use functions in a program to show the names and grades of students, their average, total, highest and lowest grades.

View 1 Replies View Related

C++ :: Program To Display Other Functions In Int Main Function

Oct 13, 2013

I would like my program to display other functions in the int main function. For example, this is what my program looks like:

int Function1(int &var1, int &var2, int &var3) {
cout << "blah blah blah" ;
cin >> var1 ;
var2 = var1 * 3 ; //example
var3 = var1 * var2 ; //example
if(blah blah blah)

[Code]...

View 2 Replies View Related







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