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

总是提示out of range #28

Closed
yanggeorge opened this issue Oct 15, 2020 · 4 comments
Closed

总是提示out of range #28

yanggeorge opened this issue Oct 15, 2020 · 4 comments

Comments

@yanggeorge
Copy link

方框一直在摄像头内,人脸拉远也不行。

@xuchaoyang123
Copy link

同问。。。 是BUG吗

@coneypo
Copy link
Owner

coneypo commented Jan 7, 2021

Hi

https://github.com/coneypo/Dlib_face_recognition_from_camera/blob/master/get_faces_from_camera.py

Line 101 flag, img_rd = stream.read() # Get camera video stream

你可以在这里打印出来拿到的摄像头窗口的尺寸,我这边是按照 640x480 做 “Out of range” 的错误检测的,或者你可以直接把这段判断给删了

@xuchaoyang123
Copy link

请问具体怎么修改啊 。代码如何修改 。

@xuchaoyang123
Copy link

我直接把这里修改了就可以了。
https://github.com/coneypo/Dlib_face_recognition_from_camera/blob/master/get_faces_from_camera.py

               # 6. 判断人脸矩形框是否超出 480x640 / If the size of ROI > 480x640
                #if (d.right()+ww) > 640 or (d.bottom()+hh > 480) or (d.left()-ww < 0) or (d.top()-hh < 0):
                if (d.right()+ww) < 640 or (d.bottom()+hh < 480) or (d.left()-ww < 0) or (d.top()-hh < 0):

@coneypo coneypo closed this as completed Jun 4, 2021
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

3 participants