hey, nein, schon richtig: für den Pi, also für Linux.
Habe es so gemacht, USB cam eingestöpselt, und das allererste Programm versucht zu erstellen,
Code:
#include "opencv2/opencv.hpp"
using namespace cv;
int main(int argc, char** argv)
{
VideoCapture cap;
// open the default camera, use something different from 0 otherwise;
// Check VideoCapture documentation.
if(!cap.open(0))
return 0;
for(;;)
{
Mat frame;
cap >> frame;
if( frame.empty() ) break; // end of video stream
imshow("this is you, smile! :)", frame);
if( waitKey(10) == 27 ) break; // stop capturing by pressing ESC
}
// the camera will be closed automatically upon exit
// cap.close();
return 0;
}
per Geany compile/build settings wie hier angegeben, aber tonnenweise errors:
Code:
g++ -Wall -pthread -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads -o "camtest" "camtest.c" -lshapes -L/opt/vc/lib -lOpenVG -lEGL -lwiringPi -lrt -lpigpio -lArduiPi_OLED (im Verzeichnis: /home/pi/programs/cam)
/tmp/ccQSKrEJ.o: In function `main':
camtest.c:(.text+0x68): undefined reference to `cv::VideoCapture::VideoCapture()'
camtest.c:(.text+0x78): undefined reference to `cv::VideoCapture::open(int)'
camtest.c:(.text+0x110): undefined reference to `cv::_InputArray::_InputArray(cv::Mat const&)'
camtest.c:(.text+0x124): undefined reference to `cv::imshow(std::string const&, cv::_InputArray const&)'
camtest.c:(.text+0x144): undefined reference to `cv::waitKey(int)'
camtest.c:(.text+0x198): undefined reference to `cv::VideoCapture::~VideoCapture()'
camtest.c:(.text+0x1dc): undefined reference to `cv::VideoCapture::~VideoCapture()'
camtest.c:(.text+0x1f0): undefined reference to `cv::VideoCapture::operator>>(cv::Mat&)'
/tmp/ccQSKrEJ.o: In function `cv::Mat::~Mat()':
camtest.c:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x3c): undefined reference to `cv::fastFree(void*)'
/tmp/ccQSKrEJ.o: In function `cv::Mat::release()':
camtest.c:(.text._ZN2cv3Mat7releaseEv[_ZN2cv3Mat7releaseEv]+0x58): undefined reference to `cv::Mat::deallocate()'
collect2: error: ld returned 1 exit status
Kompilierung fehlgeschlagen.
wo soll man jetzt anfangen?
Sicher fehlen schon mal eine ganze Menge compile/build parameter.
Aber welche?
Lesezeichen