资源简介
linux下实现的摄像头实时视频数据传输demo,可根据自己的需求更改,可用cmake编译(需完整安装opencv),也可用g++编译(需部分编译pence库-lopencv_core -lopencv_video -lopencv_highgui -lopencv_imgproc):服务端 g++ simple_server_main.cpp ServerSocket.cpp Socket.cpp -o server -I . -I/usr/local/include -L/usr/local/lib -lopencv_core -lopencv_video -lopencv_highgui -lopencv_imgproc 客户端: g++ simple_client_main.cpp ClientSocket.cpp Socket.cpp -o client -I ~/work/experiment/c++/socket/socket-opencv/src -I/usr/local/include -L/usr/local/lib -lopencv_core -lopencv_video -lopencv_highgui -lopencv_imgproc 也可用你自己的IDE编译
代码片段和文件信息
// Implementation of the ClientSocket class
#include “ClientSocket.h“
#include “SocketException.h“
ClientSocket::ClientSocket ( std::string host int port )
{
if ( ! Socket::create() )
{
throw SocketException ( “Could not create client socket.“ );
}
if ( ! Socket::connect ( host port ) )
{
throw SocketException ( “Could not bind to port.“ );
}
}
const ClientSocket& ClientSocket::operator << ( const std::string& s ) const
{
if ( ! Socket::send ( s ) )
{
throw SocketException ( “Could not write to socket.“ );
}
return *this;
}
const ClientSocket& ClientSocket::operator << ( const cv::Mat& mat ) const
{
if ( ! Socket::send ( mat ) )
{
throw SocketException ( “Could not write to socket.“ );
}
return *this;
}
const ClientSocket& ClientSocket::operator >> ( std::string& s ) const
{
if ( ! Socket::recv ( s ) )
{
throw SocketException ( “Could not read from socket.“ );
}
return *this;
}
const ClientSocket& ClientSocket::operator >> ( cv::Mat& mat ) const
{
if ( ! Socket::recv ( mat ) )
{
throw SocketException ( “Could not read from socket.“ );
}
return *this;
}
- 上一篇:基于MFC的图像处理
- 下一篇:写入磁盘小工具(将bin写入到img磁盘)
相关资源
- opencv绘制点与坐标系
- linux下C语言实现FTP上传文件源码200行
- linux操作系统下C++封装的基础库
- Linux下Shell命令解释步骤程序实现
- 图片浏览器实现和图像编辑器实现源
- danmu 基于opencv平台编写的单目相机标
- linux下C语言从N模数、E公钥指数、D私
- linux c++ 获取目录下所有文件
- OpenCV边缘检测程序 by浅墨
- Linux qtcreator下kafka之librdkafka库的C++语
- c++视频教程opencv视频图像处理机器视
- Linux下用C语言实现ls命令
- OpenCV单目视觉定位测量C++代码
- YUV数据转换成opencv的Mat的RGB<
- HJ212TCPServerMFC.rar(MFC HJ212TCP Socket服务
-
c语言解析xm
l格式代码。 - 一种多尺度检测的KCF的python实现代码
- linux下可用的静态ImageMagick C库
- libstdc++.so.6.0.17和libstdc++.so.6.0.19以及
- C语言https POST提交openSSL的应用可作为
- c++二维码识别opencv+zbar
- HJ212TCPServerC.rar(TCP Socket多线程服务端
- C++ 纯SOCKET实现FTP客户端类
- 图像识别细胞检测与计数系统vc源码
- 通过封装的opencv函数进行yuv.nv12到jp
- MFC网络编程源代码vc网络编程mfc sock
- semtech公司 LoRaWAN协议官方服务器源码
- Linux oracle 11gR2安装说明及依赖包全套
- Linux下C语言实现文件拷贝
- Hands-On System Programming with C++17
评论
共有 条评论