-2

I have key ,value pair(key="photo" and value="image.png") in terms of binary. I want to convert to dict

imag_bytes=b'{"photo": matrix data}'

How can I convert into dict for accessing matrix data

Data=photo["photo"] What's to matrix data.

Suggest me.

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
REDDY
  • 49
  • 5
  • You are aware that you question is not really intelligible, aren't you? It is not just the English part. Not just what should be code: there is no way one can meaningfully help you with what you've posted here. – jsbueno Jun 07 '22 at 17:09
  • Please provide enough code so others can better understand or reproduce the problem. – Community Jun 07 '22 at 17:32
  • 1
    Ask someone around you to formulate your question in English. –  Jun 07 '22 at 19:59
  • again, do not use json, do not use base64. send the file itself, in binary. https://stackoverflow.com/questions/72515981/poco-client-sending-image-using-c – Christoph Rackwitz Jun 07 '22 at 21:45
  • this should never have been tagged as `OpenCV`. it's a plain python question. – Christoph Rackwitz Jun 08 '22 at 11:46
  • yes after getting data i want to show using imshow using opencv – REDDY Jun 09 '22 at 03:59

1 Answers1

-1

You can convert the image to a base64 string. This is a common way of sending binary data over text based protocols.

Shimmy568
  • 503
  • 2
  • 8