When changing device orientation (portrait -> landscape, etc.) the detection rectangle is drawn at a wrong position.