cleanup code of OpenCV