for(int row = 0; row < src.rows; row++)
{
uchar *pValue = src.ptr<uchar>(row);
for (int col = 0; col < src.cols; col++)
{
uchar bValue = pValue[3*col + 0];
uchar gValue = pValue[3*col + 1];
uchar rValue = pValue[3*col + 2];
if (bValue < 200 && gValue < 220 && rValue < 200 /*|| row < 200 || row > 600*/)
{
pValue[3*col + 0] = 255;
pValue[3*col + 1] = 255;
pValue[3*col + 2] = 255;
}
else
{
pValue[3*col + 0] = 0;
pValue[3*col + 1] = 0;
pValue[3*col + 2] = 0;
}
}
}