cd python
pip install -r requirements.txt
python main.py
I define four masks:
I apply the first one as a 2d convolutional filter along the image. If it's active we have an eye for sure there. Then, for each detection location, if any of the masks is active, I reduce the red channel by 150.
- I am only using the red channel, so I'm only working with it. This saves time in the conversion between numpy and
StridedImage
. - I am using scipy's convolve2d instead of rolling out my own convolution. It's using numpy, which is using Fortran, so it's much faster than what Python would be. It's also vectorized.
- I'm only applying one mask, instead of four, and then detecting the four eyes only for the pixels which are a match.