Skip to content

ImageBabble is a lightweight C++ library to send and receive images

Notifications You must be signed in to change notification settings

cheind/image-babble

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ImageBabble is a lightweight C++ library to send and receive images via networks. It provides implementations of fast and reliable communication protocols.

The minimum example below shows the essence of an image streaming server. It uses OpenCV for image and device handling. ImageBabble itself does not dependent on OpenCV, but its design allows smooth interaction between libraries.

// Image streaming server

namespace ib = ::imagebabble;

ib::fast_server< ib::image > is;
is.startup("tcp://*:6000");

cv::VideoCapture vc(0);
cv::Mat cv_img;

while (vc.grab() && vc.retrieve(cv_img)) 
{
  ib::image ib_img;
  ib::cvt_image(cv_img, ib_img, ib::copy_mem());

  is.publish(ib_img);
}

The following snippet shows the client implementation

// Image streaming client

namespace ib = ::imagebabble;

ib::fast_client< ib::image > ic;
ic.startup("tcp://127.0.0.1:6000");

ib::image ib_image;
while (ic.receive(ib_image, 5000)) {

  cv::Mat cv_img;
  ib::cvt_image(ib_image, cv_img, ib::copy_mem());

  cv::imshow("image", cv_img);
  cv::waitKey(1);
}

About

ImageBabble is a lightweight C++ library to send and receive images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published