|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
trying to use usb webcam with opencv
Hello,
My team has been trying to use the Tower tracker program to little avail, but our hardest challenge is using our Microsoft webcam as the vision input. I checked out mjpeg streamer but couldn't understand it and have gotten no where with it. Any help would be greatly appreciated/ |
|
#2
|
||||
|
||||
|
Re: trying to use usb webcam with opencv
My team isn't using the Tower Tracker program, so I can't help you with that, sorry.
But, if you are using OpenCV in C/C++, all you should have to do is declare a new VideoCapture and use the Mat that you get from the device. You can then play around with the Mat using OpenCV functions (just google what you want to do). Code:
#include "opencv2/opencv.hpp"
int main() {
VideoCapture cap(0);
Mat frame;
namedWindow("Webcam");
while (true) {
cap >> frame;
//opencv functions go here
imshow("Webcam", frame);
if (waitKey(30) >= 0) {
break;
}
}
cap.release();
}
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|