I want to share image between C++ and python using Redis. Now I have succeed in sharing numbers. In C++, I use hiredis as the client; in python, I just do import redis
. The code I have now is as below:
cpp to set value:
VideoCapture video(0);
Mat img;
int key = 0;
while (key != 27)
{
video >> img;
imshow("img", img);
key = waitKey(1) & 0xFF;
reply = (redisReply*)redisCommand(c, "SET %s %d", "hiredisWord", key);
//printf("SET (binary API): %s\n", reply->str);
freeReplyObject(reply);
img.da
}
python code to get value:
import redis
R = redis.Redis(host='127.0.0.1', port='6379')
while 1:
print(R.get('hiredisWord'))
Now I want to share opencv image instead of numbers. What should I do? Please help, thank you!