Comments (6)
The rpi_name, image = image_hub.recv_image()
statement is a "blocking" statement. That is, the statement will wait to return the text, image
tuple until one is actually received. Each time a text, image
tuple is received, the statement completes and the while loop iterates. In my own applications, I specifically want the loop to wait until the next image is received.
There may be other ways to call image_hub.recv_image()
so that it is not blocking, such as putting it in a thread that updates a queue. But I haven't tried that.
In all my programs, the blocking nature of the image_hub.recv_image()
is the desired behavior.
from imagezmq.
ZMQ supports a polling operation against sockets. This allows for not calling your recv( ) until there is actually something waiting.
https://learning-0mq-with-pyzmq.readthedocs.io/en/latest/pyzmq/multisocket/zmqpoller.html
from imagezmq.
Working on threading, which has alleviated the problem of blocking, however the image frames seem to be a bit glitchy with very small interruptions. Trying to slap together a GUI with Tkinter.
from imagezmq.
Thought it might be useful on SO with respect to Tkinter and threading:
https://stackoverflow.com/q/77565550/22099779
from imagezmq.
I have had great success with using this also. All UI controls and updating take place in the main thread. A single background thread does the blocking I/O.
https://gist.github.com/shumwaymark/16787e48d4917bbeefc3d469f0636da1
See line 141 for the read and process loop with the blocking I/O. The imageZMQ recv() is encapsulated by the DataFeed class. The background thread sets a "Data Ready" event whenever new image data is available. See the update() routine at the bottom of the module for how this is consumed.
from imagezmq.
Threading alone seemed to work in my case. Oddly enough, to solve my flickering issue, I merely use a Label or a Button in Tkinter, and set its image
property to the frame, versus using a Canvas?!?
from imagezmq.
Related Issues (20)
- Sender's closure detection HOT 1
- Utilizing ImageZMQ to stream video using a webcam and PiCamera from one device HOT 2
- Extension of the library for audio HOT 1
- Issue while sending live frames from Jetson Nano to PC HOT 5
- Traceback (most recent call last): File "OBUclientTCP.py", line 14, in <module> sender.send_image(client_name,image) File "/home/ubuntu/.local/lib/python3.8 if image.flags['C_CONTIGUOUS']: AttributeError: 'tuple' object has no attribute 'flags' HOT 1
- Reading the last message in the queue with ImageHub HOT 2
- Sending kivy android video feed to imagezmq server HOT 8
- Converting minimal demo to Pub/Sub only transmits single frame. HOT 5
- UDP Support? HOT 2
- Ability to Specify Port for Binding HOT 6
- PUB/SUB subscriber stops working after a while HOT 5
- Does ImageZMQ works with remote servers not on the same network? HOT 4
- Connection hangs if no publisher HOT 1
- REQ/RESP One sender multiple recievers HOT 1
- Is there any optio to use this library over websocket HOT 2
- Question ?? HOT 1
- handle reading threaded frames from the Imagezmq HOT 1
- Attribute Error HOT 1
- Delay in receiving the video frame HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagezmq.