Tutorial for Image Publisher/Subscriber in Python (Video Stream)

asked 2019-04-18 00:25:34 -0600

hassanyf gravatar image

Is there any tutorial or code for image publisher/subscriber in Python?

http://wiki.ros.org/image_transport/Tutorials/PublishingImages#Adding_video_stream_from_a_webcam The code works perfectly using images in C++ but when I run the video stream code, I get an error:

kubuntu@ros-kubuntu:~/catkin_ws$ rosrun image_transport_tutorial my_subscriber
QSettings::value: Empty key passed
QSettings::value: Empty key passed
OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow, file /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/highgui/src/window.cpp, line 331
terminate called after throwing an instance of 'cv::Exception'
  what():  /tmp/binarydeb/ros-kinetic-opencv3-3.3.1/modules/highgui/src/window.cpp:331: error: (-215) size.width>0 && size.height>0 in function imshow

Aborted (core dumped)

There are a lot of python code for image publish and subscribe but I see none for video stream from a webcam.

edit retag flag offensive close merge delete