esimov / pigo

Fast face detection, pupil/eyes localization and facial landmark points detection library in pure Go.
MIT License
4.39k stars 310 forks source link

Changed RgbToGrayscale to accept an image.Image interface. #20

Closed cgxeiji closed 5 years ago

cgxeiji commented 5 years ago

This is a really nice library! I have been using it on a Raspberry Pi for real-time processing and I think the proposed pull request gives better performance.

Accepting the interface image.Image makes this function easier to use with gocv.NewMat().ToImage() and other fuctions that might implement image.Image. It skips the use of pigo.ImgToNRGBA(img), which gives a performance boost when doing real-time analysis.

cgxeiji commented 5 years ago

Could this also be a possible solution for #10?

esimov commented 5 years ago

I completely agree with your point of view, this is why I'm accepting this PR.