# Confusion over sample code in camshiftdemo.cpp

This should hopefully be a fairly simple question for someone who understands the relevant code. In the camshiftdemo.cpp file in the samples directory, on line 30 the code is:

selection &= Rect(0, 0, image.cols, image.rows);


and frankly, I have no idea what it's doing. Syntactically, I can see it's a bitwise AND of the cv::Rect called selection, and another cv::Rect, but I'm not sure what this achieves? Thanks in advance.

edit retag close merge delete