问题描述
我正在寻找一种比较两个图像的方法,以查看它们的相似程度.谷歌搜索它会产生大量的图像处理结果(裁剪,调整大小等),但是没有什么可以做图像的近似比较.有一个Node.js库,但它的版本为0.0.1,并且依赖于各种第三方系统软件包,因此不稳定或可移植.
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比较两个图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!