First time here? Check out the FAQ!
answered 2017-04-10 13:11:26 -0600
imshow() does some tricks under the hood, i.e float images are assumed to be in [0..1] range, and thus multiplied by 255 internally.
cv::imshow("Training image", trainingMat / 255);
will probably look ok in your case.