I'm trying to display a live stream video of an IP camera in my raspberry Pi. What I want to know is the difference of using capVideo.read(img) instead capVideo >> img. My program is in C++.
using namespace cv;
using namespace std;
int main(){
Mat frame;
VideoCapture cap("rtsp://ipofmycamera/11");
while(cap.isOpened()){
cap >> frame; // cap.read(frame)
if(frame.empty()) {
cout << "no frame" << endl;
break;
}
imshow("video", frame);
if(waitKey(30) >= 0) break;
}
}