Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recognizing the face by capturing an image from webcam without opencv and detecting issue #32

Open
nagapoornima22 opened this issue Jul 29, 2020 · 1 comment

Comments

@nagapoornima22
Copy link

Hi,

I have tried capturing an image using html and passing that captured image to the frame for recognizing , I am facing the issue regarding that.

code:
if flask.request.method == "POST":
image = request.files["image"].read()
npimg = np.fromstring(image, np.uint8)
file = cv2.imdecode(npimg, cv2.IMREAD_COLOR)
frame = file

Issue: I am not able to get the frame and face id for the image captured . Whether the libfaceid is used to detect only the images captured via opencv? Please suggest me to solve

Thanks and Regards

@reviloera
Copy link

Hello,

The image should be base64 string and this partdata:image/jpg;base64, removed from the string so u are left with /9vee ... something like that.

then convert the string to numpy array like this
`
payload = request.get_json()
base64_string = payload['image']

nparr = np.fromstring(base64.b64decode(base64_string), np.uint8)
im = cv2.imdecode(nparr, cv2.IMREAD_UNCHANGED)

u can now use im with openvc

`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants