Closed aaronwong1989 closed 5 years ago
@ww23 添加中文的文字水印,有什么方案嘛?
@aaronwong1989 OpenCV 不支持 non-ACSII,你可以尝试使用 Java 2D。
已修复。DFT 要抗 JPG 或者 JPEG 压缩需要加强水印强度,这样出来的图片效果不好。还有另一种方法是换成 DCT (这个我有打算做)。
@ww23 神了,确实好使了,但是代码只是条了下“格式”而已啊,就是显式的定义了一下变量而已怎么就好了。。。
@aaronwong1989 这样做可以保证 channel 一样,我换了种写法,应该比较好理解。
libpng warning: iCCP: profile 'ICC PROFILE': 60515C6Fh: exceeds application limits libpng warning: iCCP: CRC error libpng warning: iCCP: profile 'ICC PROFILE': 60515C6Fh: exceeds application limits libpng warning: iCCP: CRC error libpng warning: iCCP: profile 'ICC PROFILE': 60515C6Fh: exceeds application limits libpng warning: iCCP: CRC error 2018-11-29 16:18:20.715 ERROR 8716 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context wi th path [] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: OpenCV(3.4.2) C:\projects\javacpp-presets\opencv\cppbuild\wi ndows-x86_64\opencv-3.4.2\modules\core\src\arithm.cpp:659: error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arr ays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function 'cv::arithm_op' ] with root cause java.lang.RuntimeException: OpenCV(3.4.2) C:\projects\javacpp-presets\opencv\cppbuild\windows-x86_64\opencv-3.4.2\modules\core\src\arithm.cpp:659: error: (-209:Siz es of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scal ar', nor 'scalar op array' in function 'cv::arithm_op' at org.bytedeco.javacpp.opencv_core.subtract(Native Method) ~[opencv-3.4.2-1.4.2.jar!/:3.4.2-1.4.2]
这个问题怎么修复的?
libpng warning: iCCP: profile 'ICC PROFILE': 60515C6Fh: exceeds application limits libpng warning: iCCP: CRC error libpng warning: iCCP: profile 'ICC PROFILE': 60515C6Fh: exceeds application limits libpng warning: iCCP: CRC error libpng warning: iCCP: profile 'ICC PROFILE': 60515C6Fh: exceeds application limits libpng warning: iCCP: CRC error 2018-11-29 16:18:20.715 ERROR 8716 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context wi th path [] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: OpenCV(3.4.2) C:\projects\javacpp-presets\opencv\cppbuild\wi ndows-x86_64\opencv-3.4.2\modules\core\src\arithm.cpp:659: error: (-209:Sizes of input arguments do not match) The operation is neither 'array op array' (where arr ays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array' in function 'cv::arithm_op' ] with root cause java.lang.RuntimeException: OpenCV(3.4.2) C:\projects\javacpp-presets\opencv\cppbuild\windows-x86_64\opencv-3.4.2\modules\core\src\arithm.cpp:659: error: (-209:Siz es of input arguments do not match) The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scal ar', nor 'scalar op array' in function 'cv::arithm_op' at org.bytedeco.javacpp.opencv_core.subtract(Native Method) ~[opencv-3.4.2-1.4.2.jar!/:3.4.2-1.4.2]
这个问题怎么修复的?
见 4fbd970088a3c1428c7f924b948c499301c04d49 ,要保证图片在同一个 channels。
我的代码见 https://github.com/aaronwong1989/blind-watermark 。