Problem streaming from webcam - Raspberry Pi Forums


hi,
having problem think should simple process. aim use pi 2 track objects via opencv, have seen plenty of videos of working.
now, try run simple script open webcam through opencv , display onscreen all. tried using code form link http://opencv-srf.blogspot.co.uk/2011/0 ... ideos.html.
however, when try compile it, gives me this.:

code: select all

/tmp/ccxez8tv.o: in function `cv::operator<<(std::basic_ostream<char, std::char_traits<char> >&, cv::mat const&)': testvid1.cpp:(.text+0x68): undefined reference `cv::formatter::get(char const*)' /tmp/ccxez8tv.o: in function `main': testvid1.cpp:(.text+0xe4): undefined reference `cv::videocapture::videocapture()' testvid1.cpp:(.text+0xf4): undefined reference `cv::videocapture::open(int)' testvid1.cpp:(.text+0x118): undefined reference `cv::videocapture::get(int)' testvid1.cpp:(.text+0x15c): undefined reference `cv::videocapture::get(int)' testvid1.cpp:(.text+0x190): undefined reference `cv::videocapture::set(int, double)' testvid1.cpp:(.text+0x1a4): undefined reference `cv::videocapture::set(int, double)' testvid1.cpp:(.text+0x1c8): undefined reference `cv::videocapture::get(int)' testvid1.cpp:(.text+0x20c): undefined reference `cv::videocapture::get(int)' testvid1.cpp:(.text+0x238): undefined reference `cv::videocapture::isopened() const' testvid1.cpp:(.text+0x274): undefined reference `cv::videocapture::isopened() const' testvid1.cpp:(.text+0x2ec): undefined reference `cv::videocapture::grab()' testvid1.cpp:(.text+0x300): undefined reference `cv::videocapture::retrieve(cv::mat&, int)' testvid1.cpp:(.text+0x37c): undefined reference `cv::_inputarray::_inputarray(cv::mat const&)' testvid1.cpp:(.text+0x3a4): undefined reference `cv::imwrite(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cv::_inputarray const&, std::vector<int, std::allocator<int> > const&)' testvid1.cpp:(.text+0x420): undefined reference `cv::videocapture::~videocapture()' testvid1.cpp:(.text+0x46c): undefined reference `cv::videocapture::~videocapture()' /tmp/ccxez8tv.o: in function `cv::mat::mat(int, int, int, cv::scalar_<double> const&)': testvid1.cpp:(.text._zn2cv3matc2eiiirkns_7scalar_idee[_zn2cv3matc5eiiirkns_7scalar_idee]+0x6c): undefined reference `cv::mat::operator=(cv::scalar_<double> const&)' /tmp/ccxez8tv.o: in function `cv::mat::~mat()': testvid1.cpp:(.text._zn2cv3matd2ev[_zn2cv3matd5ev]+0x3c): undefined reference `cv::fastfree(void*)' /tmp/ccxez8tv.o: in function `cv::mat::create(int, int, int)': testvid1.cpp:(.text._zn2cv3mat6createeiii[cv::mat::create(int, int, int)]+0xc4): undefined reference `cv::mat::create(int, int const*, int)' /tmp/ccxez8tv.o: in function `cv::mat::release()': testvid1.cpp:(.text._zn2cv3mat7releaseev[cv::mat::release()]+0x58): undefined reference `cv::mat::deallocate()' collect2: ld returned 1 exit status 
think should simple please me this.

here program:

code: select all

#include "opencv2/highgui/highgui.hpp" #include <iostream>  using namespace cv; using namespace std;  int main(int argc, char* argv[]) {     videocapture cap(0); // open video camera no. 0      if (!cap.isopened())  // if not success, exit program     {         cout << "cannot open video cam" << endl;         return -1;     }     double dwidth = cap.get(cv_cap_prop_frame_width); //get width of frames of video    double dheight = cap.get(cv_cap_prop_frame_height); //get height of frames of video      cout << "frame size : " << dwidth << " x " << dheight << endl;      namedwindow("myvideo",cv_window_autosize); //create window called "myvideo"      while (1)     {         mat frame;          bool bsuccess = cap.read(frame); // read new frame video           if (!bsuccess) //if not success, break loop         {              cout << "cannot read frame video stream" << endl;              break;         }          imshow("myvideo", frame); //show frame in "myvideo" window          if (waitkey(30) == 27) //wait 'esc' key press 30ms. if 'esc' key pressed, break loop        {             cout << "esc key pressed user" << endl;             break;         }     }     return 0;  } /////////////////////////////////////////////////////////////////////////////////

the undefined reference link problem. linking opencv library? can post command using compile , link?


raspberrypi



Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support