小编Ali*_*Ali的帖子

数组新长度错误

我正在尝试显示来自网络摄像机的视频,但当我声明摄像机 ulr 时,程序显示错误的数组新长度。

#include <stdio.h>
#include <iostream>
#include <opencv2/opencv.hpp>

int main(int, char**) {
    cv::VideoCapture vcap;
    cv::Mat image;

    // This works on a D-Link CDS-932Lrtsp://<Admin:mmcc2019>@10.5.1.101/

    const std::string videoSt = "http://192.168.226.101:8080/video?x.mjpeg";
    std::cout <<"lenght og the cmera ulr is" <<videoSt.length() << std::endl;

    //open the video stream and make sure it's opened
    if (!vcap.open(videoSt)) {
        std::cout << "Error opening video stream or file" << std::endl;
        return -1;
    }

    for (;;) {
        if (!vcap.read(image)) {
            std::cout << "No frame" << std::endl;
            cv::waitKey();
        }
        cv::imshow("Output Window", …
Run Code Online (Sandbox Code Playgroud)

c++ opencv

1
推荐指数
1
解决办法
1463
查看次数

标签 统计

c++ ×1

opencv ×1