You get the error because &
requires the l-value, which are not for both roi_ + cv::Size(10, 0)
and roi_ + cv::Size(0, 10)
.
You need to change
if (&(roi_ + cv::Size(10, 0)) != NULL)
...
if (&(roi_ + cv::Size(0, 10)) != NULL)
to
if ((roi_.x + roi_.width + 10) < img.cols)
...
if ((roi_.y + roi_.height + 10) < img.rows)