First time here? Check out the FAQ!
answered 2017-09-23 09:07:14 -0600
Your srcImage type is not correct. Make sure it is single channel (which should be) and it's depth is CV_8U.
srcImage
CV_8U