title: OpenCV (in C++) to MQTT broker
body: <p>My goal is to publish from OpenCV (C++) a JSON stream of (x, y) coordinates to an MQTT broker. I'm confused as to a good way to transmit the JSON data to MQTT from OpenCV.</p>
  
  <p>I currently have an MQTT broker that manages a JSON message queue between a Python publisher script on Computer 1 and a Javascript client script on Computer 2. I have Computer 3 running OpenCV and need to send many small JSON blobs of (x, y) coordinates in near real-time to the MQTT broker. </p>
  
  <p>I initially considered continuously writing coordinates from OpenCV to a local text file, which is then continuously read by a Python MQTT publisher script that runs in parallel. However, there are issues around file locking and it seems that writing to disk is unnecessary.</p>
  
  <p>Ideally, I'm hoping for the stream of coordinates to stay in memory and published to the MQTT broker often, say every 10ms. I'm struggling to find a way to use stdin/stdout to work between the OpenCV code and a Python publisher script. </p>
  
  <p>Your guidance is appreciated. Thank you.</p>