Bitmap smart clipping using OpenCV