OpenCV Troubles

I am currently working on vision tracking for my team, and while I have been very successful, I ran into a recent roadblock. Unfortunately, when writing files to the roborio to view them, I have had the following images show up, and they appear to be a combination of the images I have used across the various stages in my vision program. Does anyone know how I could fix this? And fyi, it isn’t consistent in whether or not it will have interference.

filledContours2.png
filledContours.png


filledContours2.png
filledContours.png

So I found a solution in case anyone else runs into this problem, I had to initialize my Mat in such a way as to set the starting value of each pixel, using the constructor Mat(int rows, int cols, int type, Scalar newVal)