From 1601ac9cb832c020613c62f706aff2e1242ba353 Mon Sep 17 00:00:00 2001 From: Ouyang Date: Wed, 10 Jun 2020 17:48:27 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E8=A7=86=E9=A2=91=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=8E=BB=E6=B0=B4=E5=8D=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...1\207\345\216\273\346\260\264\345\215\260" | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 "\350\247\206\351\242\221\345\233\276\347\211\207\345\216\273\346\260\264\345\215\260" diff --git "a/\350\247\206\351\242\221\345\233\276\347\211\207\345\216\273\346\260\264\345\215\260" "b/\350\247\206\351\242\221\345\233\276\347\211\207\345\216\273\346\260\264\345\215\260" new file mode 100644 index 0000000..f1581e2 --- /dev/null +++ "b/\350\247\206\351\242\221\345\233\276\347\211\207\345\216\273\346\260\264\345\215\260" @@ -0,0 +1,21 @@ +while (capture.read(frame)) { + double shift = index++ % repeat * offset; + int left = view.width() - width - (int) shift; + Rect rect = new Rect(left, 0, width, height); + Mat roi = view.submat(rect); + frame.copyTo(roi); + Mat logo = maskLogo.submat(rect), mosaic = maskMosaic.submat(rect); + for (Map.Entry entry : wrapperLogo.entrySet()) { + Rect wrapper = maskService.wrapper(rect, entry.getValue()); + if (null == wrapper) continue; + Imgproc.rectangle(frame, wrapper, new Scalar(0, 255, 0)); + Mat mat = frame.submat(wrapper), image = mat.clone(); + Core.absdiff(image, sa, image); + Core.divide(image, sb, image); + image.copyTo(mat, logo.submat(wrapper)); + watermarkService.detach(frame.submat(wrapper), logo.submat(wrapper), null); + } + writer.write(frame); + gui.imshow(cvService.bufferedImage(frame)); + gui.repaint(); +} -- Gitee