Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
captcha-cv-ocr
Advanced tools
Readme
使用 CV (OpenCV) 和 OCR (Tesseract) 进行验证码识别
simplest | grids_and_equations | dots_and_chars | ... |
---|---|---|---|
... | |||
2348 | 2x6=? | 7RVO | ... |
因为所需的 OpenCV 支持模块 opencv4nodejs 体积较大,编译过程复杂,请手动安装,或者参考官方的安装指南:
npm i opencv4nodejs -g
第三种验证码识别改为用 sharp 和纯 JavaScript 的 CV 算法来实现,方便在树莓派上运行,但效率相比前两者很低。
第二个 Tesseract 支持模块为 tesseract.js
直接安装
npm i captcha-cv-ocr
或者
git clone https://github.com/PillarsZhang/captcha-cv-ocr
cd captcha-cv-ocr
npm install
npm link #约等于安装为全局模块
node judge_and_test.js
const path = require("path");
const cvocrModule = require("captcha-cv-ocr");
var mode = "simplest";
(async () => {
let cvocr = new cvocrModule(mode); // mode 表示验证码的种类
await cvocr.init(1); //其中的1表示需要启动的 OCR Worker 数(多线程)
let ans = await cvocr.recognize(path.join(__dirname, "docs/img", mode + ".jpg")); //支持文件地址、Base64、Buffer形式
console.log("ans:", ans)
process.exit(0);
})()
simplest | grids_and_equations | dots_and_chars |
---|---|---|
2348 | 2x6=? | 7RVO |
codes下的文件夹对应着不同种类的名字(自行命名),你可以参照已有的模板与API创建新的识别库,来适配其他各种验证码。
C++ / Python 的 OpenCV 海量资料也非常有帮助, 相应的函数基本都能在 opencv4nodejs 的 API 文档 里找到
FAQs
Verification code identification based on OCR (Tesseract) and CV (OpenCV)
The npm package captcha-cv-ocr receives a total of 4 weekly downloads. As such, captcha-cv-ocr popularity was classified as not popular.
We found that captcha-cv-ocr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.