tdicola / pi-facerec-box

Raspberry Pi powered box which uses face recognition with OpenCV to lock and unlock itself.
Other
113 stars 49 forks source link

Fix call to undefined function and order of params in cv2.resize call #1

Closed csk157 closed 10 years ago

csk157 commented 10 years ago

Hello, I found this nice project on Adafruit and noticed a few issues:

In the face.py file function is called crop instead of crop_face as referenced in a hardware.py.

Also, I couldn't figure out why I am not recognised (predicted as 2). So after poking around it turned out that image that is checked was resized to a wrong dimensions (crop would end up being 112x92, while eigenface images were 92x112), so I changed the order of params. This change solved my problems.

I hope that these changes can save someone a few minutes :)

P.S. I did not try the project on raspberry yet, played with pieces of code though.

tdicola commented 10 years ago

Hrm, I'm not sure how it was working for me with that undefined call--perhaps I still had an old version around that python was finding it. Merging in your fix, thanks!

tdicola commented 10 years ago

Oh sorry--the code for detection I run is actually in box.py. The version in hardware.py is dead code that I refactored out but forgot to remove. I'll wipe out that code so it doesn't confuse other folks.