You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 2, 2019. It is now read-only.
Its not working here. I have a frame, mat numpy, and just want to send with telepot.
In [10]: cap_ch11 = cv2.VideoCapture(ch11_url)
In [11]: ret, frame = cap_ch11.read()
In [12]: img_str = cv2.imencode('.jpg', frame)[1].tostring()
In [13]: bot.sendPhoto(chat_id,('image.jpg', StringIO.StringIO(img_str)))
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-13-44c7306ef45c> in <module>
----> 1 bot.sendPhoto(chat_id,('image.jpg', StringIO.StringIO(img_str)))
NameError: name 'bot' is not defined
In [14]: import io
In [15]: bot.sendPhoto(chat_id,('image.jpg', io.StringIO(img_str)))
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-21-010b054911d2> in <module>
----> 1 bot.sendPhoto(chat_id,('image.jpg', io.StringIO(img_str)))
TypeError: initial_value must be str or None, not bytes
Hello,
I've this code. frame is a Mat variable of opencv that contains an image
img_str = cv2.imencode('.jpg', frame)[1].tostring()
bot.sendPhoto(chat_id,['image.jpg', img_str])
I used this code some months ago and all worked fine but now don't.
The text was updated successfully, but these errors were encountered: