
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@hzab/opencv-qr
Advanced tools
本库的主要特点是:
在线测试:https://leidenglai.github.io/opencv-js-qrcode/
demo code: leidenglai/opencv-js-qrcode Example · GitHub
本库中采用的是自定义编译的opencv库作为继承,添加了三方组件wechat_qrcode微信二维码引擎,并且去掉不需要的库。封装一些基本方法方便使用。
npm install opencv-qr --save
// ES6 import
import OpencvQr from "opencv-qr";
// CommonJS require
const OpencvQr = require("opencv-qr");
// 加载模型文件,模型文件请自行保存在静态目录
const cvQr = new OpencvQr({
dw: "http://xxx.com/models/detect.caffemodel",
sw: "http://xxx.com/models/sr.caffemodel",
});
也可直接在浏览器中使用
<script src="dist/OpencvQr.js"></script>
<script>
const cvQr = new OpencvQr({
dw: "http://xxx.com/models/detect.caffemodel",
sw: "http://xxx.com/models/sr.caffemodel",
});
</script>
OpencvQr暴露一个加载方法和三个使用方法, 支持typescript类型 OpencvQr.d.ts
// 初始化时需自行加载模型文件,模型文件请自行保存为静态文件,不可编译转换
const cvQr = new OpencvQr({
dw: "http://xxx.com/models/detect.caffemodel",
sw: "http://xxx.com/models/sr.caffemodel",
});
// 加载canvas中的图像
const result = cvQr.load("canvasInput");
// 返回解析结果字符
const infos = result?.getInfos();
// 返回解析的二维码截取图像 ImageData
const images = result?.getImages();
// 返回已识别的二维码图像相对于原图的位置信息 坐标和宽高
const sizes = result?.getSizes();
// 清除加载图片,释放内存
result?.clear();
// or
cvQr.clear();
暨WebAssembly兼容性,基本上现代浏览器都是支持的:

FAQs
You can use Opencv JS to decode QR codes in photos.
We found that @hzab/opencv-qr demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers 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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.