Should I provide references to a function which is used as part of a programming language?
In this case I would opt to cite the paper in which Canny edge detection was introduced. Citing OpenCV as a whole is more appropriate than referring to a specific function, e.g. "we obtained our results using OpenCV [Bradski00]". Since you use OpenCV, you should also cite the related paper.

I would only refer to a specific function in a software package if it does not implement a known algorithm and therefore requires special attention.