#查找轮廓
Mat result = new Mat(rect.size(),CvType.CV_8U);
// 查找轮廓
List<MatOfPoint> contours = new ArrayList<>();
Mat hierarchy = new Mat();
//RETR_EXTERNAL 只检测出最外轮廓。第一个轮廓指向最外的序列,除此之外没有别的连接。
Imgproc.findContours(result, contours, hierarchy, Imgproc.RETR_EXTERNAL, Imgproc.CHAIN_APPROX_SIMPLE);