I try to do a loop over a new zero matrix and change every pixel to white.
cv::Mat background = cv::Mat::zeros(frame.rows, frame.cols,frame.type());
for (int i=0; i<frame.rows; i++)
{
for (int j=0; j<frame.cols; j++)
{
background.at<char>(i,j)=255;
}
}
Normally at the end i have to have a matrix totally white But i don't understand why finally i have this picture:
Thanks
EDIT: solution:
cv::Mat background = cv::Mat::zeros(frame.rows, frame.cols,frame.type());
for (int i=0; i<frame.rows; i++)
{
for (int j=0; j<frame.cols; j++)
{
Vec3b bgrPixel = Vec3b(255,255,255);
background.at<Vec3b>(i,j)=bgrPixel;
// background.at<char>(i,j)=255;
}
}
Thank you !