简体   繁体   English

OpenCV比较相似的手绘图像

[英]OpenCV compare similar hand drawn images

I am trying to compare two mono-chrome, basic hand drawn images, captured electronically. 我正在尝试比较以电子方式捕获的两个单色基本手绘图像。 The scale may be different but the essences of the image is the same. 比例可能不同,但图像的本质是相同的。 I want to compare one hand drawn image to a save library of images and get a relative score of how similar they are. 我想将一张手绘图像与一个图像保存库进行比较,并获得它们相似程度的相对分数。 Think of several basic geometric shapes, lines, and curves that make up a drawing. 考虑组成图纸的几种基本几何形状,直线和曲线。

I have tried several techniques without much luck. 我尝试了几种技巧,但运气不佳。 Pixel based comparisons are too exact. 基于像素的比较过于精确。 I have tried scaling and cropping images and that did not get accurate results. 我尝试缩放和裁剪图像,但没有获得准确的结果。

I have tried OpenCV with C# and have had a little success. 我已经用C#尝试过OpenCV,但取得了一些成功。 I have experimented with SURF and it works for a few images, but not others that the eye can tell are very similar. 我已经对SURF进行了实验,它适用于一些图像,但是眼睛无法分辨的其他图像却非常相似。

So now my question: Are there any examples of using openCV or commercial software that can support comparing drawings that are not exact? 所以现在我的问题是:是否有使用openCV或商业软件的示例可以支持比较不精确的图纸? I prefer C# but I am open to any solutions. 我更喜欢C#,但我愿意接受任何解决方案。

Thanks in advance for any guidance. 在此先感谢您的指导。

(I have been working on this for over a month and have searched the internet and Stack Overflow without success. I of course could have missed something) (我已经为此工作了一个多月,并且搜索互联网和Stack Overflow都没有成功。我当然会错过一些东西)

You need to extract features from these images and after that using a basic euclidean distance would be enough to calculate similarity. 您需要从这些图像中提取特征,然后使用基本的欧式距离就足以计算相似度。 But hand writtend drawn thins are not easy to extract features. 但是手工绘制的薄片并不容易提取特征。 For example, companies that work on face recognition generally have much less accuracy on drawn face portraits. 例如,从事面部识别的公司通常对绘制的面部肖像的准确性要差得多。

I have a suggestion for you. 我有你的建议。 For a machine learning homework, one of my friends got the signature recognition assingment. 为了进行机器学习作业,我的一个朋友得到了签名识别确认。 I do not fully know how he did it with a high accuracy, but I know feature extraction part. 我不完全知道他是如何做到的,但我知道特征提取部分。 Firtstly he converted it to binary image. 他首先将其转换为二进制图像。 And than he calculated the each row's black pixel count. 然后他计算了每一行的黑色像素数。 Than he used that features to train a NN or etc. 比他使用该功能来训练NN等。

So you can use this similar approach to extract features. 因此,您可以使用这种相似的方法来提取特征。 Than use a euclidean distance to calculate similarities. 比使用欧几里得距离来计算相似度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM