C++ OpenCV image sending through socket

后端 未结 5 1205
轮回少年
轮回少年 2020-12-01 04:14

I\'m trying to implement a streaming service using OpenCV and sockets. The server side loads a given image and sends it to the client, which receives it through the socket a

5条回答
  •  栀梦
    栀梦 (楼主)
    2020-12-01 04:38

    In Microsoft Visual Studio 2012, I have a red line under imgSize in sockData[imgSize] saying expression must have a constant value. I then changed int imgSize to const int imgSize. It still shows me the same problem.

     Mat img = Mat::zeros(100,100, CV_8UC3);
     const int imgSize = img.total()*img.elemSize();
     uchar sockData[imgSize];
    

提交回复
热议问题