js如何添加文字干扰码防止ocr文字识别?
网友回复
可添加背景杂质和文字扭曲变形,效果如下:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Text Anti-OCR</title> <style> .anti-ocr-canvas { background-color: #f0f0f0; border: 1px solid #ccc; } </style> </head> <body> <canvas id="anti-ocr-canvas" width="400" height="100"></canvas> <script> function drawTextToCanvas(text, canvasId) { let canvas = document.getElementById(canvasId); ...
点击查看剩余70%