WO2019127504A1 - Similarity measurement method and device, and storage device - Google Patents

Similarity measurement method and device, and storage device Download PDF

Info

Publication number
WO2019127504A1
WO2019127504A1 PCT/CN2017/120231 CN2017120231W WO2019127504A1 WO 2019127504 A1 WO2019127504 A1 WO 2019127504A1 CN 2017120231 W CN2017120231 W CN 2017120231W WO 2019127504 A1 WO2019127504 A1 WO 2019127504A1
Authority
WO
WIPO (PCT)
Prior art keywords
feature
difference
similarity
preset template
calculating
Prior art date
Application number
PCT/CN2017/120231
Other languages
French (fr)
Chinese (zh)
Inventor
韩琨
阳光
Original Assignee
深圳配天智能技术研究院有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳配天智能技术研究院有限公司 filed Critical 深圳配天智能技术研究院有限公司
Priority to CN201780036577.XA priority Critical patent/CN109313709A/en
Priority to PCT/CN2017/120231 priority patent/WO2019127504A1/en
Publication of WO2019127504A1 publication Critical patent/WO2019127504A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures

Definitions

  • the present application relates to the field of identification technologies, and in particular, to a method and device for measuring similarity and a device having a storage function.
  • the technical problem to be solved by the present application is to provide a method and device for measuring similarity and a device having a storage function, which can improve recognition speed and recognition rate.
  • a technical solution adopted by the present application is to provide a method for measuring similarity, the method comprising: acquiring features of an object to be identified; and calculating a difference between a feature of the object and a feature of the preset template. And using the preset strategy to process the difference, so that the processed difference is greater than or equal to the difference before the processing; and using the processed difference to calculate the similarity between the object and the preset template.
  • a similarity measuring device comprising a processor, a memory and a communication circuit, the processor is coupled to the memory and the communication circuit; the processor is working Obtaining, by the communication circuit, a feature of the object to be identified, and then calculating a difference between the feature of the object and a feature of the preset template, and processing the difference by using a preset strategy, so that the processed difference is greater than or It is equal to the difference before processing; the similarity between the object and the preset template is calculated by using the processed difference.
  • another technical solution adopted by the present application is to provide a device having a storage function, the device storing a program, and when the program is executed, the above-mentioned measure of similarity is implemented.
  • the beneficial effects of the present application are: different from the prior art, when the similarity measure is performed between the object to be identified and the preset template, the difference is processed by the difference between the features, so that the processed difference is greater than or It is equal to the difference before processing, which can enlarge the difference between the features, so that the identification object can be identified and classified more accurately and quickly, and the recognition speed and recognition rate can be improved.
  • FIG. 1 is a schematic flow chart of a first embodiment of a method for measuring similarity of the present application
  • FIG. 2 is a schematic flow chart of a second embodiment of a method for measuring similarity of the present application
  • 3 is a template coding method of a one-dimensional code in a UPC-A code
  • FIG. 4 is a schematic structural diagram of a first embodiment of a similarity measuring apparatus of the present application.
  • FIG. 5 is a schematic structural diagram of a first embodiment of an apparatus having a storage function according to the present application.
  • the present application provides a method and device for measuring similarity, which can be applied to at least an image recognition processing scenario, in particular, a scene in which features are relatively similar and confusing between a given plurality of preset templates.
  • an image recognition processing scenario in particular, a scene in which features are relatively similar and confusing between a given plurality of preset templates.
  • the difference between the features is processed to enlarge the difference between the features, so that the recognition image can be classified and classified more accurately and quickly, and the recognition speed and the recognition speed are improved.
  • Recognition rate The following specific expansion instructions:
  • FIG. 1 is a schematic flowchart diagram of a first embodiment of a method for measuring similarity of the present application.
  • the measure of similarity includes:
  • S101 Acquire a feature of the object to be identified.
  • the object to be identified may be an image, such as a one-dimensional code image, a two-dimensional code image, or the like.
  • the obtained object feature may be at least one of area, width, perimeter, and density, and the object features have a certain degree of discrimination for different preset templates, and the ratio of the object features to the preset template features Yes, the object to be identified can be identified and classified.
  • S102 Calculate a difference between the feature of the object and the feature of the preset template, and process the difference by using a preset strategy, so that the processed difference is greater than or equal to the difference before the process.
  • the preset template corresponding to the object to be identified is selected, and the object to be identified is compared with the preset template, and the difference between the object feature and the preset template feature is calculated to calculate the object to be identified and the pre-determined object.
  • the difference is processed by using a preset strategy, so that the processed difference is greater than or equal to the difference before the processing.
  • the difference between the features can be expanded, which is equivalent to a penalty for the original similarity; the similarity between the object feature and the preset template feature can be reduced to achieve a better global similarity. Sex.
  • the difference of all the features can be processed, or only the difference of the partial features can be processed.
  • the difference between the object feature and the preset template feature can be calculated by using a similarity coefficient function and a distance function.
  • the distance difference between the feature A1 in the object to be identified and the feature A in the preset template is calculated according to the conventional distance function.
  • the difference may be doubled.
  • the square of the normal difference is taken as the final difference, then the final difference becomes 9 (the square of 3).
  • the difference between the object feature and the preset template feature becomes larger, which is even more dissimilar. It is easier to distinguish similar features. Improve recognition speed and recognition rate.
  • S103 Calculate the similarity between the object and the preset template by using the processed difference.
  • the difference between all the features is integrated to calculate the similarity between the object to be identified and the preset template.
  • FIG. 2 is a schematic flowchart of a second embodiment of a method for measuring similarity of the present application.
  • the object features are clustered, and the similarity is measured after clustering.
  • the measure of similarity includes:
  • S202 Calculate a metric value of the object feature to be identified, and cluster the object feature.
  • the metric value of each guest feature (such as width) is calculated, and the metric value of each guest feature can be calculated by using a binarization algorithm, a Gabor wavelet transform algorithm, or a deep convolution network algorithm. These feature values can be combined into an n-dimensional vector, where n is the number of features.
  • the guest features are clustered.
  • the features can be divided into two categories, four categories, and the like.
  • Object features can be clustered using k-menas clustering algorithm, Otsu algorithm (OSTU) or density algorithm.
  • S203 Calculate a difference between the feature of the object and the feature of the preset template, and process the difference by using a preset strategy, so that the processed difference is greater than or equal to the difference before the processing.
  • the preset template corresponding to the object to be identified is selected to perform similarity comparison, and the similarity between the object and the preset template is calculated.
  • the way to calculate the similarity between the object and the preset template is different.
  • simple distance calculation or sorting may be used, and the similarity function or distance function may be used to calculate the object to be identified and The similarity between preset templates.
  • the distance difference when calculating the similarity measure between the features, for example, when calculating the distance difference, the distance difference is processed by using a preset strategy, and the preset strategy may be calculating the square value and the cubic value of the distance difference; The difference is added or the distance difference is amplified by other formula algorithms; so that the processed distance difference is greater than or equal to the distance difference before processing, the difference between the features is enlarged, and the similarity between the features is reduced.
  • the final similarity measure may be processed as a whole, that is, after the overall similarity measure is obtained, the square value, the cubic value, and the like of the overall similarity measure are calculated.
  • a formula Calculating a distance difference between the object feature to be identified and the preset template feature where d is the total distance difference after processing, M is the number of features, and r i is the feature value of the i-th feature in the preset template , w i is the feature value of the i-th feature in the object to be identified.
  • the formula is applicable to the case where the distance difference between the object feature and the preset template feature is greater than 1.
  • the distance difference is greater than 1
  • the squared distance difference is calculated, and the distance difference is increased, so that the distance difference is increased.
  • S204 Calculate the similarity between the object and the preset template by using the processed difference.
  • S205 Perform similarity ranking on the similarity between the object and the preset template or exclude the preset template that is less than the preset threshold between the object and the object.
  • the obtained similarity may be processed, for example, sorting the similarity from high to low, or excluding a preset template whose similarity is less than a preset threshold, etc., where According to different application scenarios, the difference between the preset templates is preset, and the preset threshold is adaptively set. If the similarity between the object and the preset template is higher, it indicates that the object object is likely to belong to the same class as the preset template; and the lower the similarity between the object and the preset template, the lower the similarity between the object and the preset template The object object may not belong to the preset template. In this way, the recognition rate can be greatly improved, and for objects with relatively clear features, the recognition result can be directly obtained.
  • the measure of similarity provided by the present application can be applied to identify a one-dimensional code image. specifically,
  • One-dimensional codes are usually composed of black and white bars of varying widths.
  • each character is composed of two black bars and two white bars; the black bar with the smallest width Or the width of a white bar is called a module, then the total width of a character is 7 modules. Allowing the width of the black and white bars to be 1, 2, 3, and 4 times of a module, respectively, then one character is composed of four widths, each width is expressed as several times the width of the module, and the width combinations of different characters are different.
  • the UPC-A code only supports 0-9 for a total of 10 digits. Each digit has a different width encoding method. Please refer to Figure 3.
  • Figure 3 shows the width encoding of the one-dimensional code in the UPC-A code, as shown in Figure 3.
  • the width codes of the numbers 0-9 are respectively, the numbers 0: (3, 2, 1, 1); the numbers 1: (2, 2, 2, 1); the numbers 2: (2, 1, 2, 2) ); number 3: (1, 4, 1, 1); number 4: (1, 1, 3, 2); number 5: (1, 2, 3, 1); number 6: (1, 1, 1) , 4); number 7: (1, 3, 1, 2); number 8: (1, 2, 1, 3); number 9: (3, 1, 1, 2).
  • the simple feature ie the width
  • the width of each black and white strip can be counted after binarization.
  • the statistical method is obtained by simply counting the number of pixels.
  • the width can be classified. If the above barcode contains 4 widths, then the width is classified, and any classification method can be used, such as simple clustering using kmenas, each black and white strip represented by pixels. The width is divided into four categories of 1, 2, 3, and 4.
  • d is the total difference after processing, error!
  • the reference source was not found. For coding errors! The reference source was not found. In the first mistake! The reference source was not found. The width of the position, wrong! The reference source was not found. For the first mistake! The reference source was not found. The first mistake of the characters! The reference source was not found. The width of the black and white bar, M is the number of widths. The larger the difference, the greater the difference between features, the lower the similarity. This formula is applicable to the case where the difference in width at a certain position is larger than 1, because when the difference in width is larger than 1, the square of the difference in width can be made larger. For example, the wrong code width! The reference source was not found. The first mistake of the characters! The reference source was not found.
  • the width of the black and white bar is 2, and the result of the calculated width is 4, which is not a simple calculation of the classification deviation of 2 (4 minus 2), but a penalty of 4 (2 times 2), that is to say In the case where the width differs by more than 1, the possibility of not being encoded is greater.
  • the width of a character is classified as 2, 2, 2, 1, then the width similarity to the coded character 1 is 0, and the penalty for other templates is larger, especially the characters 3, 6, and 8. Contains black bars or white bars that differ from the code width by more than one. It can thus be known that the character represents the number 0, or an encoding template with a very low similarity can be excluded (if not the number 3 is likely to be large).
  • these similarities can be processed, such as sorting the similarity from high to low, excluding the encoding template with low similarity, such as the encoding template of the character and 1 or 2. If the similarity is high, the probability that the character may be a number 1 or 2 is large, and the similarity between the character and the 3 or 6 encoding template is low, and the probability that the character is a number 3 or 6 is small, and Quickly identify characters or eliminate dissimilar codes to improve recognition speed and recognition rate.
  • UPC-A there are only 10 encoding methods in total, and for code128, different width encoding templates can be used in hundreds. This method can greatly eliminate dissimilar encoding methods, thereby greatly improving the recognition rate for barcode quality. Higher images can be directly identified.
  • FIG. 4 is a schematic structural diagram of a first embodiment of a similarity measuring apparatus according to the present application.
  • the similarity measurement apparatus in this embodiment may implement the above-described similarity measurement method, and the apparatus includes a processor 401, a memory 402, and a communication circuit 403.
  • the processor 401 is coupled to the memory 402 and the communication circuit 403.
  • the processor 401 executes instructions during operation to cooperate with the memory 402 and the communication circuit 403 to implement the above-mentioned similarity measurement method.
  • the specific working process is consistent with the foregoing method embodiment, so This is not repeated here.
  • the measure of similarity may be a barcode recognizer, an image scanner, or the like.
  • FIG. 5 is a schematic structural diagram of a first embodiment of an apparatus having a storage function according to the present application.
  • the storage device 50 stores a program 501, and when the program 501 is executed, the above-described similarity measurement method is implemented.
  • the specific working process is the same as that in the foregoing method embodiment, and therefore is not described here.
  • the device having the storage function may be a portable storage medium such as a USB flash drive, an optical disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, etc.
  • the medium storing the program code may also be a terminal, a server, or the like.
  • the difference is processed by the difference between the features, so that the processed difference is greater than or equal to the difference before the processing, and the feature can be enlarged.
  • the difference can be more accurately and quickly treated to identify and classify the object, and improve the recognition speed and recognition rate.
  • the disclosed system, apparatus, and method may be implemented in other manners.
  • the device implementations described above are merely illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be another division manner for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • a computer readable storage medium A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the methods described in various embodiments of the present application.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

A similarity measurement method and device, and a device having a storage function, relating to the technical field of identification. The method comprises: acquiring a feature of an object to be identified (S101); calculating a difference between the feature of the object and a feature of a preset template, and processing the difference by using a preset policy, such that a processed difference is greater than or equal to the difference before processing (S102); and calculating similarity between the object and the preset template by using the processed difference (S103). The method accurately and quickly identifies and classifies an object to be identified, thereby improving the speed and success rate of identification.

Description

一种相似度的度量方法、装置及存储装置Method, device and storage device for similarity measurement 【技术领域】[Technical Field]
本申请涉及识别技术领域,特别是涉及一种相似度的度量方法、装置及具有存储功能的装置。The present application relates to the field of identification technologies, and in particular, to a method and device for measuring similarity and a device having a storage function.
【背景技术】【Background technique】
在对一些信息进行识别处理时,通常是通过计算信息中的某些特征,这些特征对不同的目标而言可能具有一定的区分度,然后再将这些特征与预设模板的特征进行比对,以完成对信息的识别分类。例如,在一些简单的分类场景中,我们只需要给定阈值就可以进行识别区分。但是,本申请的发明人在长期的研发过程中,发现这种方法的识别速度和准确率较低,如阈值的给定可能会造成误分类问题,特别是在一些相对复杂的场景中,给定的不同预设模板之间的特征较为相似,容易引起混淆,不仅容易引起识别错误,造成误分类,还会降低识别速率,甚至对一些可能引起混淆的特征不能进行判断。When some information is identified, it is usually calculated by calculating certain features in the information, which may have a certain degree of discrimination for different targets, and then compare these features with the features of the preset template. To complete the identification of the information classification. For example, in some simple classification scenarios, we only need to give a threshold to identify the distinction. However, the inventor of the present application found that the recognition speed and accuracy of the method are low in the long-term development process, and the threshold value may cause misclassification problems, especially in some relatively complicated scenarios. The characteristics of different preset templates are similar, which is easy to cause confusion, which not only causes identification errors, causes misclassification, but also reduces the recognition rate, and even can not judge some features that may cause confusion.
【发明内容】[Summary of the Invention]
本申请主要解决的技术问题是提供一种相似度的度量方法、装置及具有存储功能的装置,能够提高识别速度和识别率。The technical problem to be solved by the present application is to provide a method and device for measuring similarity and a device having a storage function, which can improve recognition speed and recognition rate.
为解决上述技术问题,本申请采用的一个技术方案是:提供一种相似度的度量方法,所述方法包括:获取待识别客体的特征;计算客体特征与预设模板的特征之间的差值,并利用预设策略对所述差值进行处理,以使处理后的差值大于或等于处理前的差值;利用处理后的差值计算客体与预设模板之间的相似度。To solve the above technical problem, a technical solution adopted by the present application is to provide a method for measuring similarity, the method comprising: acquiring features of an object to be identified; and calculating a difference between a feature of the object and a feature of the preset template. And using the preset strategy to process the difference, so that the processed difference is greater than or equal to the difference before the processing; and using the processed difference to calculate the similarity between the object and the preset template.
为解决上述技术问题,本申请采用的另一个技术方案是:提供一种相似度的度量装置,所述装置包括处理器、存储器和通信电路,处理器耦接存储器和通信电路;处理器在工作时,通过通信电路获取待识别客体的特征,随后计算客体特征与预设模板的特征之间的差值,并利用预设策略对所述差值进行处理,以使处理后的差值大于或等于处理前的差 值;利用处理后的差值计算客体与预设模板之间的相似度。In order to solve the above technical problem, another technical solution adopted by the present application is to provide a similarity measuring device, the device comprising a processor, a memory and a communication circuit, the processor is coupled to the memory and the communication circuit; the processor is working Obtaining, by the communication circuit, a feature of the object to be identified, and then calculating a difference between the feature of the object and a feature of the preset template, and processing the difference by using a preset strategy, so that the processed difference is greater than or It is equal to the difference before processing; the similarity between the object and the preset template is calculated by using the processed difference.
为解决上述技术问题,本申请采用的另一个技术方案是:提供一种具有存储功能的装置,所述装置存储有程序,所述程序被执行时实现上述的相似度的度量方法。In order to solve the above technical problem, another technical solution adopted by the present application is to provide a device having a storage function, the device storing a program, and when the program is executed, the above-mentioned measure of similarity is implemented.
本申请的有益效果是:区别于现有技术的情况,本申请在对待识别客体与预设模板之间进行相似度度量时,通过特征间的差值进行处理,使处理后的差值大于或等于处理前的差值,能够放大特征之间的差异,从而能够更准确快速的对待识别客体进行识别分类,提高识别速度和识别率。The beneficial effects of the present application are: different from the prior art, when the similarity measure is performed between the object to be identified and the preset template, the difference is processed by the difference between the features, so that the processed difference is greater than or It is equal to the difference before processing, which can enlarge the difference between the features, so that the identification object can be identified and classified more accurately and quickly, and the recognition speed and recognition rate can be improved.
【附图说明】[Description of the Drawings]
图1是本申请相似度的度量方法第一实施方式的流程示意图;1 is a schematic flow chart of a first embodiment of a method for measuring similarity of the present application;
图2是本申请相似度的度量方法第二实施方式的流程示意图;2 is a schematic flow chart of a second embodiment of a method for measuring similarity of the present application;
图3是UPC-A码中一维码的模板编码方式;3 is a template coding method of a one-dimensional code in a UPC-A code;
图4是本申请相似度的度量装置第一实施例的结构示意图;4 is a schematic structural diagram of a first embodiment of a similarity measuring apparatus of the present application;
图5是本申请具有存储功能的装置第一实施方式的结构示意图。FIG. 5 is a schematic structural diagram of a first embodiment of an apparatus having a storage function according to the present application.
【具体实施方式】【Detailed ways】
为使本申请的目的、技术方案及效果更加清楚、明确,以下参照附图并举实施例对本申请进一步详细说明。In order to make the objects, technical solutions and effects of the present application more clear and clear, the present application will be further described in detail below with reference to the accompanying drawings.
本申请提供一种相似度的度量方法及装置,至少可以应用于图像识别处理场景中,特别是在给定的多个预设模板之间特征比较相似容易混淆的场景中。通过在计算待识别图像与预设模板之间的相似度时,对特征间的差值进行处理,以放大特征间的差异,从而能够更准确快速的对待识别图像进行识别分类,提高识别速度和识别率。下面具体展开说明:The present application provides a method and device for measuring similarity, which can be applied to at least an image recognition processing scenario, in particular, a scene in which features are relatively similar and confusing between a given plurality of preset templates. By calculating the similarity between the image to be recognized and the preset template, the difference between the features is processed to enlarge the difference between the features, so that the recognition image can be classified and classified more accurately and quickly, and the recognition speed and the recognition speed are improved. Recognition rate. The following specific expansion instructions:
请参阅图1,图1是本申请相似度的度量方法第一实施方式的流程示意图。如图1所示,在该实施方式中,相似度的度量方法包括:Please refer to FIG. 1. FIG. 1 is a schematic flowchart diagram of a first embodiment of a method for measuring similarity of the present application. As shown in FIG. 1, in this embodiment, the measure of similarity includes:
S101:获取待识别客体的特征。S101: Acquire a feature of the object to be identified.
本步骤中,待识别客体可以是图像,如一维码图像、二维码图像等。所获取的客体特征可以为面积、宽度、周长、密度中的至少一种,这些 客体特征对不同的预设模板而言具有一定的区分度,通过对这些客体特征与预设模板特征的比对,能够对该待识别客体进行识别分类。In this step, the object to be identified may be an image, such as a one-dimensional code image, a two-dimensional code image, or the like. The obtained object feature may be at least one of area, width, perimeter, and density, and the object features have a certain degree of discrimination for different preset templates, and the ratio of the object features to the preset template features Yes, the object to be identified can be identified and classified.
S102:计算客体特征与预设模板的特征之间的差值,并利用预设策略对所述差值进行处理,以使处理后的差值大于或等于处理前的差值。S102: Calculate a difference between the feature of the object and the feature of the preset template, and process the difference by using a preset strategy, so that the processed difference is greater than or equal to the difference before the process.
具体地,选择与待识别客体相对应的预设模板,将待识别客体与预设模板进行相似度比对,通过计算客体特征与预设模板特征之间的差值,计算待识别客体与预设模板之间的相似度。其中,在计算客体特征与预设模板的特征之间的差值时,利用预设策略对所述差值进行处理,以使处理后的差值大于或等于处理前的差值。通过处理差值,把差值放大,能够扩大特征间的差异,相当于对原有相似度进行了一个惩罚;可以降低客体特征与预设模板特征之间的相似度,达到较好的全局相似性。在对差值进行处理时,可以对所有特征的差值进行处理,也可以只对部分特征的差值进行处理。Specifically, the preset template corresponding to the object to be identified is selected, and the object to be identified is compared with the preset template, and the difference between the object feature and the preset template feature is calculated to calculate the object to be identified and the pre-determined object. Set the similarity between the templates. Wherein, when calculating a difference between the feature of the object and the feature of the preset template, the difference is processed by using a preset strategy, so that the processed difference is greater than or equal to the difference before the processing. By processing the difference and amplifying the difference, the difference between the features can be expanded, which is equivalent to a penalty for the original similarity; the similarity between the object feature and the preset template feature can be reduced to achieve a better global similarity. Sex. When the difference is processed, the difference of all the features can be processed, or only the difference of the partial features can be processed.
其中,客体特征与预设模板特征之间的差异越小说明该客体特征与预设模板特征越相近,则它们之间的相似度就越大,其对应的相似度度量值也越大;相反,客体特征与预设模板特征之间的差异越大说明该客体特征与预设模板特征越疏远,那么它们之间的相似度就越小,其对应的相似度度量值也越小。其中,客体特征与预设模板特征之间的差异可以利用相似系数函数和距离函数等计算。The smaller the difference between the object feature and the preset template feature, the closer the object feature is to the preset template feature, the greater the similarity between them, and the corresponding similarity measure is larger; The greater the difference between the object feature and the preset template feature, the more distant the object feature and the preset template feature are, the smaller the similarity between them is, and the smaller the similarity measure is. The difference between the object feature and the preset template feature can be calculated by using a similarity coefficient function and a distance function.
例如,按照常规距离函数计算出待识别客体中特征A1与预设模板中特征A的距离差值为3,在本申请的相似度的度量方法中,可以对该差值进行翻倍处理,将正常差值的平方作为最后的差值,那么最后的差值就变为9(3的平方),这样作处理后,客体特征与预设模板特征之间的差异变大,也就更加不相似,更容易区分类似相近的特征。提高识别速度和识别率。For example, the distance difference between the feature A1 in the object to be identified and the feature A in the preset template is calculated according to the conventional distance function. In the method for measuring the similarity of the present application, the difference may be doubled. The square of the normal difference is taken as the final difference, then the final difference becomes 9 (the square of 3). After this processing, the difference between the object feature and the preset template feature becomes larger, which is even more dissimilar. It is easier to distinguish similar features. Improve recognition speed and recognition rate.
S103:利用处理后的差值计算客体与预设模板之间的相似度。S103: Calculate the similarity between the object and the preset template by using the processed difference.
处理得到特征间的差值后,综合所有特征的差值计算待识别客体与预设模板之间的相似度。After the difference between the features is processed, the difference between all the features is integrated to calculate the similarity between the object to be identified and the preset template.
请参阅图2,图2是本申请相似度的度量方法第二实施方式的流程 示意图。在该实施方式中,在获取待识别客体的特征后,先对这些客体特征进行聚类,聚类后再进行相似度的度量。通过先对特征进行聚类,能够简化计算步骤,提高识别速度和识别率。如图2所示,在该实施方式中,相似度的度量方法包括:Referring to FIG. 2, FIG. 2 is a schematic flowchart of a second embodiment of a method for measuring similarity of the present application. In this embodiment, after acquiring the features of the object to be identified, the object features are clustered, and the similarity is measured after clustering. By first clustering features, the calculation steps can be simplified, and the recognition speed and recognition rate can be improved. As shown in FIG. 2, in this embodiment, the measure of similarity includes:
S201:获取待识别客体的特征。S201: Acquire a feature of the object to be identified.
S202:计算待识别客体特征的度量值,并对所述客体特征进行聚类。S202: Calculate a metric value of the object feature to be identified, and cluster the object feature.
首先计算每个客体特征(例如宽度)的度量值,可以利用二值化算法、Gabor小波变换算法或深度卷积网络算法等计算每个客体特征的度量值。这些特征值可以组合成n维向量,其中n为特征的个数。First, the metric value of each guest feature (such as width) is calculated, and the metric value of each guest feature can be calculated by using a binarization algorithm, a Gabor wavelet transform algorithm, or a deep convolution network algorithm. These feature values can be combined into an n-dimensional vector, where n is the number of features.
得到每个客体特征的度量值后,对所述客体特征进行聚类。根据应用识别环境可以将特征分为两类、四类等。可以利用k-menas聚类算法、大津算法(OSTU)或密度算法对客体特征进行聚类。After obtaining the metric value of each guest feature, the guest features are clustered. According to the application identification environment, the features can be divided into two categories, four categories, and the like. Object features can be clustered using k-menas clustering algorithm, Otsu algorithm (OSTU) or density algorithm.
S203:计算客体特征与预设模板的特征之间的差值,并利用预设策略对所述差值进行处理,以使处理后的差值大于或等于处理前的差值。S203: Calculate a difference between the feature of the object and the feature of the preset template, and process the difference by using a preset strategy, so that the processed difference is greater than or equal to the difference before the processing.
得到特征的分类结果之后,选择与待识别客体相对应的预设模板进行相似度比对,计算客体与预设模板之间的相似度。对于不同的识别场景,计算客体与预设模板之间的相似度的方式不同,对于简单的应用场景可以是简单的距离计算或排序等,也可以利用相似系数函数或距离函数计算待识别客体与预设模板之间的相似度。After obtaining the classification result of the feature, the preset template corresponding to the object to be identified is selected to perform similarity comparison, and the similarity between the object and the preset template is calculated. For different recognition scenarios, the way to calculate the similarity between the object and the preset template is different. For a simple application scenario, simple distance calculation or sorting may be used, and the similarity function or distance function may be used to calculate the object to be identified and The similarity between preset templates.
其中,在计算特征间的相似度度量值时,如在计算距离差值时,利用预设策略对距离差值进行处理,预设策略可以是计算距离差值的平方值、立方值;将距离差值相加或通过其他公式算法放大该距离差值;以使处理后的距离差值大于或等于处理前的距离差值,放大特征间的差异,降低特征间的相似度。在其他实施方式中,也可以将最后的相似度度量值进行整体处理,即得到整体相似度度量值后,计算整体相似度度量值的平方值、立方值等。Wherein, when calculating the similarity measure between the features, for example, when calculating the distance difference, the distance difference is processed by using a preset strategy, and the preset strategy may be calculating the square value and the cubic value of the distance difference; The difference is added or the distance difference is amplified by other formula algorithms; so that the processed distance difference is greater than or equal to the distance difference before processing, the difference between the features is enlarged, and the similarity between the features is reduced. In other embodiments, the final similarity measure may be processed as a whole, that is, after the overall similarity measure is obtained, the square value, the cubic value, and the like of the overall similarity measure are calculated.
可选地,利用公式
Figure PCTCN2017120231-appb-000001
计算待识别客体特征与预设模板特征之间的距离差值,其中,d为处理后的总距离差值,M为特征的个数,r i为预设模板中第i个特征的特征值,w i为待识别客体中 第i个特征的特征值。其中,该公式适用于客体特征与预设模板特征之间的距离差值大于1的情况,当距离差值大于1时,将距离差值计算平方后,会使该距离差值增大,使特征间的差异变大,相似度变小。
Alternatively, using a formula
Figure PCTCN2017120231-appb-000001
Calculating a distance difference between the object feature to be identified and the preset template feature, where d is the total distance difference after processing, M is the number of features, and r i is the feature value of the i-th feature in the preset template , w i is the feature value of the i-th feature in the object to be identified. Wherein, the formula is applicable to the case where the distance difference between the object feature and the preset template feature is greater than 1. When the distance difference is greater than 1, the squared distance difference is calculated, and the distance difference is increased, so that the distance difference is increased. The difference between features becomes larger and the similarity becomes smaller.
S204:利用处理后的差值计算客体与预设模板之间的相似度。S204: Calculate the similarity between the object and the preset template by using the processed difference.
S205:对客体与预设模板之间的相似度进行相似度排序或排除与客体之间的相似度小于预设阈值的预设模板。S205: Perform similarity ranking on the similarity between the object and the preset template or exclude the preset template that is less than the preset threshold between the object and the object.
在计算得到客体与预设模板之间的相似度后,可以对所得相似度进行处理,如对相似度从高到低排序,或排除相似度小于预设阈值的预设模板等,其中,可以根据不同的应用场景,预设模板之间的差异大小,适应性设置该预设阈值。如客体与预设模板之间的相似度越高,则说明该客体对象有很大的可能是与预设模板归属于同一类;而客体与预设模板之间的相似度越低,则说明该客体对象可能不属于预设模板的那一类。通过这种方式,能够大大提高识别率,对于特征相对明确的对象,可以直接得到识别结果。After calculating the similarity between the object and the preset template, the obtained similarity may be processed, for example, sorting the similarity from high to low, or excluding a preset template whose similarity is less than a preset threshold, etc., where According to different application scenarios, the difference between the preset templates is preset, and the preset threshold is adaptively set. If the similarity between the object and the preset template is higher, it indicates that the object object is likely to belong to the same class as the preset template; and the lower the similarity between the object and the preset template, the lower the similarity between the object and the preset template The object object may not belong to the preset template. In this way, the recognition rate can be greatly improved, and for objects with relatively clear features, the recognition result can be directly obtained.
在一个应用场景中,本申请所提供的相似度的度量方法可以应用于识别一维码图像。具体地,In an application scenario, the measure of similarity provided by the present application can be applied to identify a one-dimensional code image. specifically,
一维码通常由一些宽度不等的黑白条组成,对于简单的商品编码,如UPC-A码,它的每个字符是由两个黑条和两个白条构成的;把宽度最小的黑条或白条的宽度称为模块,那么一个字符的总宽度为7个模块。允许黑条和白条的宽度分别为一个模块的1,2,3,4倍,那么一个字符由四个宽度构成,每个宽度表示为模块宽度的几倍,不同的字符黑白条的宽度组合不同。UPC-A码只支持0-9一共10个数字,每个数字都有不同的宽度编码方式,请参阅图3,图3是UPC-A码中一维码的宽度编码方式,如图3所示,数字0-9的宽度编码方式分别为,数字0:(3,2,1,1);数字1:(2,2,2,1);数字2:(2,1,2,2);数字3:(1,4,1,1);数字4:(1,1,3,2);数字5:(1,2,3,1);数字6:(1,1,1,4);数字7:(1,3,1,2);数字8:(1,2,1,3);数字9:(3,1,1,2)。One-dimensional codes are usually composed of black and white bars of varying widths. For simple commodity codes, such as UPC-A codes, each character is composed of two black bars and two white bars; the black bar with the smallest width Or the width of a white bar is called a module, then the total width of a character is 7 modules. Allowing the width of the black and white bars to be 1, 2, 3, and 4 times of a module, respectively, then one character is composed of four widths, each width is expressed as several times the width of the module, and the width combinations of different characters are different. . The UPC-A code only supports 0-9 for a total of 10 digits. Each digit has a different width encoding method. Please refer to Figure 3. Figure 3 shows the width encoding of the one-dimensional code in the UPC-A code, as shown in Figure 3. The width codes of the numbers 0-9 are respectively, the numbers 0: (3, 2, 1, 1); the numbers 1: (2, 2, 2, 1); the numbers 2: (2, 1, 2, 2) ); number 3: (1, 4, 1, 1); number 4: (1, 1, 3, 2); number 5: (1, 2, 3, 1); number 6: (1, 1, 1) , 4); number 7: (1, 3, 1, 2); number 8: (1, 2, 1, 3); number 9: (3, 1, 1, 2).
对于一副条码图像而言,首先计算简单特征,即宽度。每个黑白条的宽度可以在二值化后进行统计。统计方法是通过简单的统计像素个数 就可以得到。For a bar code image, the simple feature, ie the width, is first calculated. The width of each black and white strip can be counted after binarization. The statistical method is obtained by simply counting the number of pixels.
得到宽度值后,可以对宽度进行分类,如上述条码包含4种宽度,那么则对宽度进行分类,可以使用任何分类方法,如简单的使用kmenas进行聚类,将用像素表示的每个黑白条的宽度分为1,2,3,4四个类。After the width value is obtained, the width can be classified. If the above barcode contains 4 widths, then the width is classified, and any classification method can be used, such as simple clustering using kmenas, each black and white strip represented by pixels. The width is divided into four categories of 1, 2, 3, and 4.
特征分类后,将这些特征与一维码的编码宽度进行对比计算相似度。利用公式(1)对第错误!未找到引用源。个字符宽度与编码宽度的相似度进行惩罚处理:After feature classification, these features are compared with the coding width of the one-dimensional code to calculate the similarity. Use formula (1) for the first error! The reference source was not found. The difference between the character width and the code width is penalized:
Figure PCTCN2017120231-appb-000002
Figure PCTCN2017120231-appb-000002
其中,d为处理后的总差值,错误!未找到引用源。为编码错误!未找到引用源。在第错误!未找到引用源。个位置的宽度,错误!未找到引用源。为第错误!未找到引用源。个字符的第错误!未找到引用源。根黑白条宽度,M为宽度的个数。差值越大,特征间的差异越大,则相似度越低。该公式适用于某个位置的宽度差大于1的情况,因为宽度差大于1时,计算宽度差的平方能够使该宽度差变大。比如编码宽度中第错误!未找到引用源。个字符的第错误!未找到引用源。根黑白条的宽度要求为2,而计算宽度分类后的结果为4,则不是简单的计算分类偏差为2(4减2),而是惩罚为4(2乘以2),也就是说认为宽度相差大于1的情况下,不是该编码的可能性更大。Where d is the total difference after processing, error! The reference source was not found. For coding errors! The reference source was not found. In the first mistake! The reference source was not found. The width of the position, wrong! The reference source was not found. For the first mistake! The reference source was not found. The first mistake of the characters! The reference source was not found. The width of the black and white bar, M is the number of widths. The larger the difference, the greater the difference between features, the lower the similarity. This formula is applicable to the case where the difference in width at a certain position is larger than 1, because when the difference in width is larger than 1, the square of the difference in width can be made larger. For example, the wrong code width! The reference source was not found. The first mistake of the characters! The reference source was not found. The width of the black and white bar is 2, and the result of the calculated width is 4, which is not a simple calculation of the classification deviation of 2 (4 minus 2), but a penalty of 4 (2 times 2), that is to say In the case where the width differs by more than 1, the possibility of not being encoded is greater.
例如,得到一个字符的宽度分类结果为2,2,2,1,那么与编码字符1的宽度相似度惩罚为0,与其他模板的惩罚则较大,尤其是字符3,6,8,均包含与编码宽度差不止为1的黑条或白条。因而可以得知该字符表示数字0,或者可以排除相似度很低的编码模板(如不是数字3的可能很大)。For example, if the width of a character is classified as 2, 2, 2, 1, then the width similarity to the coded character 1 is 0, and the penalty for other templates is larger, especially the characters 3, 6, and 8. Contains black bars or white bars that differ from the code width by more than one. It can thus be known that the character represents the number 0, or an encoding template with a very low similarity can be excluded (if not the number 3 is likely to be large).
得到字符与编码模板之间的相似度后,可以对这些相似度进行处理,如对相似度从高到低排序,排除相似度很低的编码模板等,如这个字符与1或2的编码模板的相似度较高,则该字符可能是数字1或2的概率较大,而这个字符与3或6的编码模板的相似度较低,则该字符是数字3或6的概率较小,能够快速识别字符或排除不相似的编码,提高识别速度和识别率。对UPC-A而言,一共只有10种编码方式,而对于 code128而言,不同的宽度编码模板可以上百,使用该方法可以大大排除不相似的编码方式,从而大大提高识别率,对于条码质量较高的图像,可以直接得到识别结果。After obtaining the similarity between the character and the encoding template, these similarities can be processed, such as sorting the similarity from high to low, excluding the encoding template with low similarity, such as the encoding template of the character and 1 or 2. If the similarity is high, the probability that the character may be a number 1 or 2 is large, and the similarity between the character and the 3 or 6 encoding template is low, and the probability that the character is a number 3 or 6 is small, and Quickly identify characters or eliminate dissimilar codes to improve recognition speed and recognition rate. For UPC-A, there are only 10 encoding methods in total, and for code128, different width encoding templates can be used in hundreds. This method can greatly eliminate dissimilar encoding methods, thereby greatly improving the recognition rate for barcode quality. Higher images can be directly identified.
请参阅图4,图4是本申请相似度的度量装置第一实施例的结构示意图。本实施例中的相似度的度量装置可以实现上述的相似度的度量方法,该装置包括处理器401、存储器402及通信电路403。处理器401耦接存储器402和通信电路403,处理器401在工作时执行指令,以配合存储器402和通信电路403实现上述相似度的度量方法,具体工作过程与上述方法实施例中一致,故在此不再赘述,详细请参阅以上对应方法步骤的说明。其中,相似度的度量装置可以是条码识别器,图像扫描器等。Please refer to FIG. 4. FIG. 4 is a schematic structural diagram of a first embodiment of a similarity measuring apparatus according to the present application. The similarity measurement apparatus in this embodiment may implement the above-described similarity measurement method, and the apparatus includes a processor 401, a memory 402, and a communication circuit 403. The processor 401 is coupled to the memory 402 and the communication circuit 403. The processor 401 executes instructions during operation to cooperate with the memory 402 and the communication circuit 403 to implement the above-mentioned similarity measurement method. The specific working process is consistent with the foregoing method embodiment, so This is not repeated here. For details, please refer to the description of the corresponding method steps above. The measure of similarity may be a barcode recognizer, an image scanner, or the like.
请参阅图5,图5是本申请具有存储功能的装置第一实施方式的结构示意图。本实施例中存储装置50存储有程序501,程序501被执行时实现上述相似度的度量方法。具体工作过程与上述方法实施例中一致,故在此不再赘述,详细请参阅以上对应方法步骤的说明。其中具有存储功能的装置可以是便携式存储介质如U盘、光盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟等各种可以存储程序代码的介质,也可以是终端、服务器等。Please refer to FIG. 5. FIG. 5 is a schematic structural diagram of a first embodiment of an apparatus having a storage function according to the present application. In the present embodiment, the storage device 50 stores a program 501, and when the program 501 is executed, the above-described similarity measurement method is implemented. The specific working process is the same as that in the foregoing method embodiment, and therefore is not described here. For details, refer to the description of the corresponding method steps. The device having the storage function may be a portable storage medium such as a USB flash drive, an optical disk, a mobile hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, etc. The medium storing the program code may also be a terminal, a server, or the like.
以上方案,本申请在对待识别客体与预设模板之间进行相似度度量时,通过特征间的差值进行处理,使处理后的差值大于或等于处理前的差值,能够放大特征之间的差异,从而能够更准确快速的对待识别客体进行识别分类,提高识别速度和识别率。In the above solution, when the similarity measure is performed between the object to be identified and the preset template, the difference is processed by the difference between the features, so that the processed difference is greater than or equal to the difference before the processing, and the feature can be enlarged. The difference can be more accurately and quickly treated to identify and classify the object, and improve the recognition speed and recognition rate.
在本申请所提供的几个实施方式中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施方式仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是 通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus, and method may be implemented in other manners. For example, the device implementations described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施方式方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
另外,在本申请各个实施方式中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施方式所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application, in essence or the contribution to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) or a processor to perform all or part of the steps of the methods described in various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .
以上所述仅为本申请的实施方式,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above description is only the embodiment of the present application, and thus does not limit the scope of the patent application, and the equivalent structure or equivalent process transformation of the specification and the drawings of the present application, or directly or indirectly applied to other related technologies. The fields are all included in the scope of patent protection of this application.

Claims (19)

  1. 一种相似度的度量方法,其特征在于,所述方法包括:A method for measuring similarity, characterized in that the method comprises:
    获取待识别客体的特征;Obtaining the characteristics of the object to be identified;
    计算所述客体特征与预设模板的特征之间的差值,并利用预设策略对所述差值进行处理,以使处理后的差值大于或等于处理前的差值;Calculating a difference between the object feature and a feature of the preset template, and processing the difference by using a preset strategy, so that the processed difference is greater than or equal to the difference before the processing;
    利用处理后的差值计算所述客体与所述预设模板之间的相似度。A similarity between the object and the preset template is calculated using the processed difference.
  2. 根据权利要求1所述的方法,其特征在于,所述计算客体特征与预设模板的特征之间的差值,利用预设策略对所述差值进行处理,以使处理后的差值大于或等于处理前的差值包括:The method according to claim 1, wherein the difference between the feature of the object and the feature of the preset template is calculated, and the difference is processed by using a preset strategy, so that the processed difference is greater than Or equal to the difference before processing includes:
    利用公式
    Figure PCTCN2017120231-appb-100001
    计算所述客体特征与所述预设模板特征之间的差值,其中,d为处理后的总差值,M为特征的个数,r i为预设模板中第i个特征的特征值,w i为待识别客体中第i个特征的特征值,且(r i-w i)大于1。
    Using formula
    Figure PCTCN2017120231-appb-100001
    Calculating a difference between the object feature and the preset template feature, where d is the total difference after processing, M is the number of features, and r i is the feature value of the i-th feature in the preset template , w i is a feature value of the i-th feature in the object to be identified, and (r i -w i ) is greater than 1.
  3. 根据权利要求1所述的方法,其特征在于,所述计算客体特征与预设模板的特征之间的差值之前包括:计算所述客体特征的度量值,并对所述客体特征进行聚类。The method according to claim 1, wherein the calculating the difference between the object feature and the feature of the preset template comprises: calculating a metric value of the object feature, and clustering the object feature .
  4. 根据权利要求3所述的方法,其特征在于,所述计算客体特征与预设模板的特征之间的差值包括:利用距离函数计算聚类后的所述客体特征与预设模板的特征之间的距离差值。The method according to claim 3, wherein the calculating the difference between the object feature and the feature of the preset template comprises: calculating the feature of the clustered object and the preset template by using a distance function The difference in distance between them.
  5. 根据权利要求3所述的方法,其特征在于,所述对客体特征进行聚类包括:利用k-menas聚类算法、大津算法或密度算法对所述客体特征进行聚类。The method according to claim 3, wherein the clustering the guest features comprises: clustering the guest features using a k-menas clustering algorithm, an Otsu algorithm or a density algorithm.
  6. 根据权利要求3所述的方法,其特征在于,所述计算客体特征的度量值包括:利用二值化算法、Gabor小波变换算法或深度卷积网络计算所述客体特征的度量值。The method according to claim 3, wherein the calculating the metric value of the guest feature comprises: calculating a metric value of the guest feature using a binarization algorithm, a Gabor wavelet transform algorithm, or a deep convolution network.
  7. 根据权利要求1所述的方法,其特征在于,所述利用处理后的差值计算所述客体与所述预设模板之间的相似度之后包括:The method according to claim 1, wherein the calculating the similarity between the object and the preset template by using the processed difference value comprises:
    对所述客体与所述预设模板之间的相似度进行相似度排序或排除 与所述客体之间的相似度小于预设阈值的预设模板。Performing similarity ranking on the similarity between the object and the preset template or excluding a preset template whose similarity with the object is less than a preset threshold.
  8. 根据权利要求1所述的方法,其特征在于,所述客体特征为面积、宽度、周长、密度中的至少一种。The method of claim 1 wherein said guest features are at least one of area, width, perimeter, and density.
  9. 根据权利要求1所述的方法,其特征在于,所述待识别客体为一维码图像。The method according to claim 1, wherein the object to be identified is a one-dimensional code image.
  10. 一种相似度的度量装置,其特征在于,所述装置包括处理器、存储器和通信电路,所述处理器耦接所述存储器和通信电路;A similarity measuring device, characterized in that the device comprises a processor, a memory and a communication circuit, the processor is coupled to the memory and the communication circuit;
    所述处理器在工作时,通过所述通信电路获取待识别客体的特征,随后计算所述客体特征与预设模板的特征之间的差值,并利用预设策略对所述差值进行处理,以使处理后的差值大于或等于处理前的差值;利用处理后的差值计算所述客体与所述预设模板之间的相似度。When the processor is in operation, acquiring, by the communication circuit, a feature of the object to be identified, then calculating a difference between the feature of the object and a feature of the preset template, and processing the difference by using a preset strategy. So that the processed difference is greater than or equal to the difference before the processing; the similarity between the object and the preset template is calculated by using the processed difference.
  11. 根据权利要求10所述的装置,其特征在于,所述计算客体特征与预设模板的特征之间的差值,利用预设策略对所述差值进行处理,以使处理后的差值大于或等于处理前的差值包括:The device according to claim 10, wherein the difference between the feature of the object and the feature of the preset template is processed by using a preset strategy, so that the processed difference is greater than Or equal to the difference before processing includes:
    所述处理器在工作时,利用公式
    Figure PCTCN2017120231-appb-100002
    计算所述客体特征与所述预设模板特征之间的差值,其中,d为处理后的总差值,M为特征的个数,r i为预设模板中第i个特征的特征值,w i为待识别客体中第i个特征的特征值,且(r i-w i)大于1。
    The processor uses a formula while working
    Figure PCTCN2017120231-appb-100002
    Calculating a difference between the object feature and the preset template feature, where d is the total difference after processing, M is the number of features, and r i is the feature value of the i-th feature in the preset template , w i is a feature value of the i-th feature in the object to be identified, and (r i -w i ) is greater than 1.
  12. 根据权利要求10所述的装置,其特征在于,所述计算客体特征与预设模板的特征之间的差值之前包括:The apparatus according to claim 10, wherein the calculating the difference between the object feature and the feature of the preset template comprises:
    所述处理器在工作时,计算所述客体特征的度量值,并对所述客体特征进行聚类。The processor, when in operation, calculates a metric value of the guest feature and clusters the guest feature.
  13. 根据权利要求12所述的装置,其特征在于,所述计算客体特征与预设模板的特征之间的差值包括:The device according to claim 12, wherein the difference between the feature of the computing object and the feature of the preset template comprises:
    所述处理器在工作时,利用距离函数计算聚类后的所述客体特征与所述预设模板的特征之间的距离差值。The processor calculates a distance difference between the clustered object feature and the feature of the preset template by using a distance function during operation.
  14. 根据权利要求12所述的装置,其特征在于,所述对客体特征进行聚类包括:利用k-menas聚类算法、大津算法或密度算法对所述客体特征进行聚类。The apparatus according to claim 12, wherein the clustering the guest features comprises: clustering the guest features using a k-menas clustering algorithm, an Otsu algorithm or a density algorithm.
  15. 根据权利要求12所述的装置,其特征在于,所述计算客体特征的度量值包括:利用二值化算法、Gabor小波变换算法或深度卷积网络计算所述客体特征的度量值。The apparatus according to claim 12, wherein the calculating the metric value of the guest feature comprises: calculating a metric value of the guest feature using a binarization algorithm, a Gabor wavelet transform algorithm, or a deep convolution network.
  16. 根据权利要求10所述的装置,其特征在于,所述利用处理后的差值计算所述客体与所述预设模板之间的相似度之后包括:The apparatus according to claim 10, wherein the calculating the similarity between the object and the preset template by using the processed difference value comprises:
    所述处理器在工作时,对所述客体与所述预设模板之间的相似度进行相似度排序或排除与所述客体之间的相似度小于预设阈值的预设模板。During operation, the processor performs similarity ranking on the similarity between the object and the preset template or excludes a preset template that is less than a predetermined threshold between the object and the object.
  17. 根据权利要求10所述的装置,其特征在于,所述客体特征为面积、宽度、周长、密度中的至少一种。The apparatus of claim 10 wherein said guest features are at least one of area, width, perimeter, and density.
  18. 根据权利要求10所述的装置,其特征在于,所述待识别客体为一维码图像。The apparatus according to claim 10, wherein the object to be identified is a one-dimensional code image.
  19. 一种具有存储功能的装置,其特征在于,所述装置存储有程序,所述程序被执行时实现权利要求1至9任一项所述的相似度的度量方法。A device having a storage function, characterized in that the device stores a program, and when the program is executed, the method for measuring the similarity according to any one of claims 1 to 9 is implemented.
PCT/CN2017/120231 2017-12-29 2017-12-29 Similarity measurement method and device, and storage device WO2019127504A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201780036577.XA CN109313709A (en) 2017-12-29 2017-12-29 A kind of measure of similarity, device and storage device
PCT/CN2017/120231 WO2019127504A1 (en) 2017-12-29 2017-12-29 Similarity measurement method and device, and storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/120231 WO2019127504A1 (en) 2017-12-29 2017-12-29 Similarity measurement method and device, and storage device

Publications (1)

Publication Number Publication Date
WO2019127504A1 true WO2019127504A1 (en) 2019-07-04

Family

ID=65225809

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/120231 WO2019127504A1 (en) 2017-12-29 2017-12-29 Similarity measurement method and device, and storage device

Country Status (2)

Country Link
CN (1) CN109313709A (en)
WO (1) WO2019127504A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117891883A (en) * 2024-03-14 2024-04-16 山东观和集团有限公司 Mineral exploration data optimal storage method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103049750A (en) * 2013-01-11 2013-04-17 广州广电运通金融电子股份有限公司 Character recognition method
CN103426176A (en) * 2013-08-27 2013-12-04 重庆邮电大学 Video shot detection method based on histogram improvement and clustering algorithm
CN106651777A (en) * 2015-10-29 2017-05-10 小米科技有限责任公司 Image processing method and apparatus and electronic device
CN107203686A (en) * 2017-03-31 2017-09-26 苏州艾隆信息技术有限公司 medicine information difference processing method and system

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101408932B (en) * 2008-04-11 2012-06-20 浙江师范大学 Method for matching finger print image based on finger print structure feature and veins analysis
CN101604384B (en) * 2009-07-17 2012-06-27 周易 Individualized fingerprint identification method
US8209567B2 (en) * 2010-01-28 2012-06-26 Hewlett-Packard Development Company, L.P. Message clustering of system event logs
CN103336945B (en) * 2013-06-10 2017-11-10 黑龙江大学 Merge the finger vein identification method of local feature and global characteristics
CN104143086B (en) * 2014-07-18 2018-03-06 广东金杭科技有限公司 Portrait compares the application process on mobile terminal operating system
CN104766343B (en) * 2015-03-27 2017-08-25 电子科技大学 A kind of visual target tracking method based on rarefaction representation
CN104951940B (en) * 2015-06-05 2018-07-03 西安理工大学 A kind of mobile payment verification method based on personal recognition
CN105787451A (en) * 2016-02-29 2016-07-20 南京邮电大学 Fingerprint matching method based on multi-judgment point mode

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103049750A (en) * 2013-01-11 2013-04-17 广州广电运通金融电子股份有限公司 Character recognition method
CN103426176A (en) * 2013-08-27 2013-12-04 重庆邮电大学 Video shot detection method based on histogram improvement and clustering algorithm
CN106651777A (en) * 2015-10-29 2017-05-10 小米科技有限责任公司 Image processing method and apparatus and electronic device
CN107203686A (en) * 2017-03-31 2017-09-26 苏州艾隆信息技术有限公司 medicine information difference processing method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117891883A (en) * 2024-03-14 2024-04-16 山东观和集团有限公司 Mineral exploration data optimal storage method

Also Published As

Publication number Publication date
CN109313709A (en) 2019-02-05

Similar Documents

Publication Publication Date Title
Seeland et al. Plant species classification using flower images—A comparative study of local feature representations
US9367766B2 (en) Text line detection in images
CN107239786B (en) Character recognition method and device
US9400919B2 (en) Learning deep face representation
US11294624B2 (en) System and method for clustering data
US8340439B2 (en) Image conversion method and apparatus, and pattern identification method and apparatus
US9292745B2 (en) Object detection apparatus and method therefor
US10467743B1 (en) Image processing method, terminal and storage medium
US9697439B2 (en) Efficient object detection with patch-level window processing
US9489566B2 (en) Image recognition apparatus and image recognition method for identifying object
CN107784288A (en) A kind of iteration positioning formula method for detecting human face based on deep neural network
CN108229232B (en) Method and device for scanning two-dimensional codes in batch
US10007678B2 (en) Image processing apparatus, image processing method, and recording medium
CN113837151B (en) Table image processing method and device, computer equipment and readable storage medium
CN111291824B (en) Time series processing method, device, electronic equipment and computer readable medium
CN106295710B (en) Image local feature matching process, device and terminal based on non-geometric constraint
CN115759148B (en) Image processing method, device, computer equipment and computer readable storage medium
WO2019095587A1 (en) Face recognition method, application server, and computer-readable storage medium
CN112270204A (en) Target identification method and device, storage medium and electronic equipment
CN113297870A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN110826554B (en) Infrared target detection method
CN108960246B (en) Binarization processing device and method for image recognition
CN111353514A (en) Model training method, image recognition method, device and terminal equipment
WO2019127504A1 (en) Similarity measurement method and device, and storage device
CN110704667B (en) Rapid similarity graph detection method based on semantic information

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17936134

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17936134

Country of ref document: EP

Kind code of ref document: A1