question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Load base64 image

See original GitHub issue

Is it possible to load a base64 string image as a ImageRGB?

I’ve been trying to do it using the examples of opencv-express with imdecode and fr.CvImage, but the detectFaces and locateFaces returns an empty array. It works fine when I load the same image using cv.imread.

I noticed that the results I get of imread and imdecode are different for the same image, maybe this has something to do with the IMREAD_COLOR flag applied automatically to imread in the opencv source code(?)

"imread": { "step": 276, "elemSize": 3, "sizes": [ 112, 92 ], "empty": false, "depth": 0, "dims": 2, "channels": 3, "type": 16, "cols": 92, "rows": 112 }, "imdecode": { "step": 92, "elemSize": 1, "sizes": [ 112, 92 ], "empty": false, "depth": 0, "dims": 2, "channels": 1, "type": 0, "cols": 92, "rows": 112 }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
xAKLxcommented, Feb 22, 2018

Hello,

I tried to convert the image to RGB, but it didn’t work either. After resizing the image using the resize method of the cvimage, the face was detected properly. Thanks for your help.

detector.locateFaces(fr.CvImage(decodeFromBase64(base64String).resize(128, 128)))

0reactions
justadudewhohackscommented, Feb 22, 2018

Okay that’s strange. I would expect fr.CvImage to return complete garbage if you give it a 1 channel matrix.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Base64 to Image Decoder / Converter - Code Beautify
Best Online tool to converts base64 string into image. It's easy to use base64 image decoder which helps to decode picture and Download....
Read more >
How to display Base64 images in HTML - Stack Overflow
Save this answer. Show activity on this post. First convert your image to Base64 (encode to Base64). You can do it online or...
Read more >
How to Display Base64 Images in HTML - W3docs
Images encoded with Base64 can be embedded in HTML by using the <img> tag. This can help to increase the page load time...
Read more >
Base64 to Image | Base64 Decode | Base64 Converter
Convert Base64 to image online using a free decoding tool which allows you to decode Base64 as image and preview it directly in...
Read more >
Base64 to Image Decode (jpg,png,gif) - RapidTables.com
Base64 to image converter tool.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found