First time here? Check out the FAQ!
answered 2018-04-24 01:15:56 -0600
your temp Mat is CV_8UC1, so you have to use:
temp.at<uchar>(contour[0][i])=255;
in general, please try to avoid per-pixel access, and use builtin functions, like drawContours() here.