try this (not tested):
(used different test
and unsigned char
instead of char
for (int j =dst.cols-1; j>=0; j--)
{
bool white = true;
for (int i =dst.rows-1; i>=0; i--)
{
if (dst.at<unsigned char>(i,j) > 0)
{
white = false;
}
if(white)
dst.at<unsigned char>(i,j)=255;
else
dst.at<unsigned char>(i,j)=0;
}
}
edited: added a > 0
instead of == 255
to check whether the binary condition holds.