Mat downs,ups,s1,s2,m,salient; s1 = ups / downs; s2 = downs / ups;
for (int i = 0; i < ups.cols; i++)
{
for (int j = 0; j < ups.rows; j++)
{
if (s1.at<uchar>(i, j) > s2.at<uchar>(i, j))
{
m.at<uchar>(i, j) = s2.at<uchar>(i, j);
}
else
{
m.at<uchar>(i, j) = s1.at<uchar>(i, j);
}
salient.at<uchar>(i, j) = 1 - m.at<uchar>(i, j);
}
}