This program requires OpenCV 3 to be installed.
mkdir build
cd build
cmake ..
make
Detecting breathing rate of a person from video, a real time video processing application
Home Page: http://algomuse.com/c-c/developing-a-multithreaded-real-time-video-processing-application-in-opencv
/usr/bin/ld: CMakeFiles/respi.dir/realtime.cpp.o: undefined reference to symbol 'pthread_create@@GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
CMakeFiles/respi.dir/build.make:231: recipe for target 'respi' failed
make[2]: *** [respi] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/respi.dir/all' failed
make[1]: *** [CMakeFiles/respi.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
PS: Adding -lpthread
doesnt solve it.
make
Scanning dependencies of target respi
[ 20%] Building CXX object CMakeFiles/respi.dir/main.cpp.o
[ 40%] Building CXX object CMakeFiles/respi.dir/respi.cpp.o
/Users/alpullu/Downloads/realtimevideo-master/respi.cpp:104:24: error: non-constant-expression cannot be
narrowed from type 'size_type' (aka 'unsigned long') to 'int' in initializer list [-Wc++11-narrowing]
int range[2] = {0, sample.size()};
^~~~~~~~~~~~~
/Users/alpullu/Downloads/realtimevideo-master/respi.cpp:104:24: note: insert an explicit cast to silence
this issue
int range[2] = {0, sample.size()};
^~~~~~~~~~~~~
static_cast( )
1 error generated.
make[2]: *** [CMakeFiles/respi.dir/respi.cpp.o] Error 1
make[1]: *** [CMakeFiles/respi.dir/all] Error 2
make: *** [all] Error 2
I pulled the latest source code with git clone and built it.
The first time I call:
vector RealTimeVideo::getSample(){
int end = pos ;
int st = pos - sampleLen;
if(st < 0)
st = 0;
cout << "st = " << st << endl;
cout << "end = " << end << endl;
//cout << "frameBuffer.begin()+st = " << frameBuffer.begin()+st << endl;
//cout << "frameBuffer.begin()+end = " << frameBuffer.begin()+end << endl;
vector ret(frameBuffer.begin()+st, frameBuffer.begin()+end);
return ret ;
}
Starting Processor Thread
calling getSample
st = 0
Launched Threads
end = -136425020
terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
What is causing the end to be -136425020? The first time through causing the vector ret(frameBuffer.begin()+st, frameBuffer.begin()+end); to blow up?
Thanks, Ralph Waters
(email) [email protected]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.