Load base64 image
See original GitHub issueIs 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:
- Created 6 years ago
- Comments:5 (5 by maintainers)
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)))
Okay that’s strange. I would expect
fr.CvImage
to return complete garbage if you give it a 1 channel matrix.