I recommend two books:
(1) R. C. Gonzalez and R. E. Woods, Digital Image Processing, 3rd ed. Prentice Hall, Aug. 2007.
(2) G. Bradski and A. Kaehler, Learning OpenCV: Computer Vision with the OpenCV Library, 1st ed. O'Reilly Media, Oct. 2008.
Visit the OpenCV documentation to get updated reference to the OpenCV functions (the Learning OpenCV book uses version 1.0 but the current version is 2.3). You can buy cheap access to the digital version of the book using Safari Books.