WPF InkCanvas - 如何确定它是否已“签名”

时间:2023-01-02 23:58:56

I'm using a WPF InkCanvas control to capture signatures in a Tablet PC application.

我正在使用WPF InkCanvas控件来捕获Tablet PC应用程序中的签名。

One of my requirements is to validate whether or not the application has really been "signed". Right now I'm doing this by checking the Strokes collection of the InkCanvas - if there are 0 strokes, then I know the user has not "signed".

我的一个要求是验证应用程序是否真的已经“签名”。现在我通过检查InkCanvas的Strokes集合来做这个 - 如果有0个笔画,那么我知道用户没有“签名”。

However, if the user enters a single slash, or even a single dot, this counts as a stroke and my validation test will pass, even though the signature isn't really valid.

但是,如果用户输入单个斜杠,或者甚至是单个点,则计为笔划并且我的验证测试将通过,即使签名不是真正有效。

Any ideas about how to build a better test for this? Granted, the use case for what is and is not a valid signature is pretty fuzzy, but I want to try to eliminate obviously bad signatures.

关于如何为此建立更好的测试的任何想法?当然,有效签名的用例非常模糊,但我想尝试消除明显不好的签名。

Or is this simply unsolvable in any straightforward way?

或者这简直无法以任何直接的方式解决?

1 个解决方案

#1


I know there are algorithms to test if a signature is a valid match for an existing signature, like the one outlined here. However, finding out if something is a signature in the first place seems to be much more complex.

我知道有一些算法可以测试签名是否是现有签名的有效匹配,如此处所述。然而,首先发现某些东西是否是签名似乎要复杂得多。

From Wikipedia:

On legal documents, an illiterate signatory can make a "mark" (often an "X" but occasionally a personalized symbol)
...
Several cultures whose languages use writing systems other than alphabets do not share the Western notion of signatures per se: the "signing" of one's name results in a written product no different from the result of "writing" one's name in the standard way. For these languages, to write or to sign involves the same written characters. Three such examples are Chinese, Japanese, and Korean.

在法律文件上,文盲签字人可以制作“标记”(通常是“X”,但偶尔也是个性化的符号)......一些文化,其语言使用字母以外的书写系统,并不赞同西方的签名概念本身:一个人姓名的“签名”导致书面产品与标准方式“写”一个人姓名的结果没有什么不同。对于这些语言,写入或签名涉及相同的书写字符。三个这样的例子是中国人,日本人和韩国人。

While this could be approached using Intelligent Character Recognition, I also know that my signature rarely looks like it has any characters in it. It's even worse if I am using one of those UPS or FedEx package singing pads. Next time a package arrives though I will try signing with just a dash and a dot and see if it allows it (Which I think it will allow since it's already close enough to that).

虽然可以使用智能字符识别来解决这个问题,但我也知道我的签名很少看起来像是有任何字符。如果我使用其中一个UPS或FedEx包装唱歌垫,情况会更糟。下次一个包到达虽然我会尝试只用一个破折号和一个点签名,看看它是否允许它(我认为它将允许它,因为它已经足够接近它)。

Because a signature may not match any recognizable words or characters, trying to 'validate' it any further then you currently are could actually be discarding some valid signatures. If for some reason you do still need to know if there is something more then a dot, take a look at validating instead that the signature fills a certain sized rectangle. That still may invalidate results that shouldn't be, so if you do attempt to add any validation to it make sure to document fully the expectations of a valid signature.

由于签名可能与任何可识别的单词或字符不匹配,因此尝试进一步“验证”它,那么您当前实际上可能会丢弃一些有效的签名。如果由于某种原因你仍然需要知道是否还有一个点,那么请看一下验证,即签名填充一定大小的矩形。这仍然可能使不应该的结果无效,因此如果您尝试向其添加任何验证,请确保完全记录有效签名的期望。

#1


I know there are algorithms to test if a signature is a valid match for an existing signature, like the one outlined here. However, finding out if something is a signature in the first place seems to be much more complex.

我知道有一些算法可以测试签名是否是现有签名的有效匹配,如此处所述。然而,首先发现某些东西是否是签名似乎要复杂得多。

From Wikipedia:

On legal documents, an illiterate signatory can make a "mark" (often an "X" but occasionally a personalized symbol)
...
Several cultures whose languages use writing systems other than alphabets do not share the Western notion of signatures per se: the "signing" of one's name results in a written product no different from the result of "writing" one's name in the standard way. For these languages, to write or to sign involves the same written characters. Three such examples are Chinese, Japanese, and Korean.

在法律文件上,文盲签字人可以制作“标记”(通常是“X”,但偶尔也是个性化的符号)......一些文化,其语言使用字母以外的书写系统,并不赞同西方的签名概念本身:一个人姓名的“签名”导致书面产品与标准方式“写”一个人姓名的结果没有什么不同。对于这些语言,写入或签名涉及相同的书写字符。三个这样的例子是中国人,日本人和韩国人。

While this could be approached using Intelligent Character Recognition, I also know that my signature rarely looks like it has any characters in it. It's even worse if I am using one of those UPS or FedEx package singing pads. Next time a package arrives though I will try signing with just a dash and a dot and see if it allows it (Which I think it will allow since it's already close enough to that).

虽然可以使用智能字符识别来解决这个问题,但我也知道我的签名很少看起来像是有任何字符。如果我使用其中一个UPS或FedEx包装唱歌垫,情况会更糟。下次一个包到达虽然我会尝试只用一个破折号和一个点签名,看看它是否允许它(我认为它将允许它,因为它已经足够接近它)。

Because a signature may not match any recognizable words or characters, trying to 'validate' it any further then you currently are could actually be discarding some valid signatures. If for some reason you do still need to know if there is something more then a dot, take a look at validating instead that the signature fills a certain sized rectangle. That still may invalidate results that shouldn't be, so if you do attempt to add any validation to it make sure to document fully the expectations of a valid signature.

由于签名可能与任何可识别的单词或字符不匹配,因此尝试进一步“验证”它,那么您当前实际上可能会丢弃一些有效的签名。如果由于某种原因你仍然需要知道是否还有一个点,那么请看一下验证,即签名填充一定大小的矩形。这仍然可能使不应该的结果无效,因此如果您尝试向其添加任何验证,请确保完全记录有效签名的期望。