Echo is a simple and efficient interprocess communication (IPC) library for Linux written in C++11. This library is an extension that enables OpenCV matrix serialization as Echo messages.
- Luka Čehovin (developer, maintainer)
Extensions to Echo IPC library for easy work with OpenCV structures.
Izvajanje callback funkcije v novi niti, na kanalu, kjer prebira numpy matriko s funkcijo readMat, povzroči zamrznitev aplikacije.
Potencialna rešitev je premik tega izvajanja v glavno nit, kar pa ima druge nezaželjene implikacije. Podobnih problemov nisem zaznal v funkcijah readString, readInt...
Primer kode prejemnika
import threading
import numpy
import time
from echolib import pyecho
import echocv
import cv2
def callbackThread(message):
print("Callback before matread...")
reader = pyecho.MessageReader(message)
img = echocv.readMat(reader)
print("Callback after read...")
print(img.shape)
def callback(message):
threading.Thread(target=callbackThread, args=[message]).start()
#reader = pyecho.MessageReader(message)
#img = echocv.readMat(reader)
#print(img.shape)
def main():
loop = pyecho.IOLoop()
client = pyecho.Client()
loop.add_handler(client)
p0 = pyecho.Subscriber(client, "test", "numpy.ndarray", callback)
try:
while loop.wait(10):
time.sleep(0.001)
except KeyboardInterrupt:
pass
if __name__ == '__main__':
main()
Primer kode pošiljatelja
from echolib import pyecho
import echocv
import cv2
import time
import sys
class Demo():
def __init__(self):
self.loop = pyecho.IOLoop()
self.client = pyecho.Client()
self.loop.add_handler(self.client)
self.dockerCommandOut = pyecho.Publisher(self.client, "test", "numpy.ndarray")
self.loop.wait(10)
self.count = 0
def main():
demo = Demo()
camera = cv2.VideoCapture(0)
try:
while demo.loop.wait(10):
ret, frame = camera.read()
writer = pyecho.MessageWriter()
echocv.writeMat(writer, frame)
demo.dockerCommandOut.send(writer)
demo.count += 1
time.sleep(1.0)
except KeyboardInterrupt:
pass
if __name__=='__main__':
main()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.