如何使用 Node.js 比较两个图像 [英] How to compare two images using Node.js

查看:37
本文介绍了如何使用 Node.js 比较两个图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种方法来比较两张图片,看看它们有多相似.谷歌搜索它会产生大量的图像处理结果(裁剪、调整大小等),但无法对图像进行近似比较.有一个 Node.js 库,但它是 0.0.1 版本,并且依赖于各种 3rd 方系统包,因此不稳定或可移植.

I am looking for a way to compare two images to see how similar they are. Googling it produces tons of image processing results (cropping, re-sizing, etc.), but nothing that would do approximate comparisons of images. There is one Node.js library, but it is version 0.0.1 and relies on various 3rd party system packages, so not stable or portable.

类似的东西:

var imgComparator = require('some-awesome-image-comparator-module');
// result would be between 1.0 and 0.0, where 1.0 would mean exact match
var result = imgComparator.compare('/path/to/image/1.png', '/path/to/image/2.png');

推荐答案

node-opencv 模块,您可以使用它来执行图像比较等繁重的操作.很好的主题在这里:简单快速的比较图像的方法相似度

There is node-opencv module, you might use it in order to perform heavy operation like image comparison. Good topic on that is here: Simple and fast method to compare images for similarity

这篇关于如何使用 Node.js 比较两个图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆