A similar graphic retrieval method and device
By calculating the average value of the standardized farthest distance of the graph as the feature value, the similarity calculation problem under the influence of the graph size and rotation in the prior art is solved, and the accurate recognition of similar graphics is achieved.
Patent Information
- Application Number
- CN202210363883.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-07
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2042-04-07
AI Technical Summary
The prior art cannot effectively deal with the problems of different graphic sizes and graphic rotation when calculating graphic similarity, resulting in poor recognition effect.
By obtaining the feature values of the pictures to be retrieved and the target graphics, calculate the similarity between each of the searched graphics and the target graphics, and use the average value of the standardized farthest distance as the feature value to overcome the impact of graph size and rotation on recognition.
Retrieval of similar graphics with constant graphic size and rotation is realized, improving the accuracy and efficiency of graphics recognition.
Smart Images

Figure CN114638979B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of financial technology, specifically to the field of image recognition, and more specifically to a method, device, electronic device, medium and computer program product for similar graphic retrieval. Background Art
[0002] With the development of computer technology, human society has entered the era of informatization and automation, and computer intelligent recognition has also developed rapidly. In particular, computer processing technology for pattern recognition has made unprecedented progress and applications.
[0003] When recognizing graphics in the prior art, the edit distance is generally used to calculate the similarity of graphics, such as Hamming distance, Levenshtein distance, etc. When the calculated similarity meets the threshold, the current graphic and the target graphic are considered to be similar. However, the above method of using the edit distance to calculate the similarity of graphics cannot solve the problem of different sizes and rotation of graphics. Summary of the invention
[0004] In view of the above problems, the present disclosure provides a method, apparatus, device, medium and program product for improving similar graphic retrieval.
[0005] According to the first aspect of the present disclosure, a similar graphic retrieval method is provided, comprising: a similar graphic retrieval method, characterized in that it comprises: obtaining a picture to be retrieved, obtaining a graphic to be retrieved from the picture to be retrieved; obtaining a target graphic; calculating a feature value of each of the graphics to be retrieved and a feature value of the target graphic; calculating the similarity between each of the graphics to be retrieved and the target graphic based on the feature value of each of the graphics to be retrieved and the feature value of the target graphic; outputting the graphics to be retrieved whose similarity meets a preset condition as a similar graphic of the target graphic.
[0006] Optionally, calculating the characteristic values of each of the to-be-retrieved graphics and the target graphics includes: setting each of the to-be-retrieved graphics and the target graphics as graphics to be identified in turn; obtaining the maximum distance from each pixel point in the graphics to be identified to other pixels; standardizing the maximum distance of each pixel point in the graphics to be identified to obtain the standardized maximum distance of each pixel point; and calculating the average value of the standardized maximum distance of each pixel point to obtain the characteristic value of the graphics to be identified.
[0007] Optionally, the farthest distance of each pixel in the to-be-identified graphic is standardized to obtain the standardized farthest distance of each pixel, which includes: dividing the farthest distance of each pixel in the to-be-identified graphic by the maximum value of the farthest distances of each pixel to obtain the standardized farthest distance of each pixel.
[0008] Optionally, based on the characteristic values of each of the graphics to be retrieved and the target graphics, calculating the similarity between each of the graphics to be retrieved and the target graphics includes: calculating the absolute value of the difference between the characteristic value of the graphics to be retrieved and the characteristic value of the target graphics; calculating the ratio of the absolute value to the characteristic value of the target graphics, and subtracting the ratio from one to obtain the similarity between the graphics to be retrieved and the target graphics.
[0009] Optionally, obtaining the picture to be retrieved, and obtaining the graphic to be retrieved from the picture to be retrieved includes: preprocessing the picture to be retrieved, wherein the preprocessing of the picture to be retrieved includes grayscale processing, noise reduction filtering and binarization processing of the picture to be retrieved.
[0010] Optionally, acquiring the target graphic includes: acquiring the target graphic from the graphics to be retrieved according to user demand.
[0011] Optionally, acquiring the target graphic includes: acquiring the target graphic from a preset graphic database according to user requirements.
[0012] According to the second aspect of the present disclosure, a similar graphic retrieval device is provided, characterized in that it includes: a graphic acquisition module to be retrieved, used to acquire a picture to be retrieved, and acquire a graphic to be retrieved from the picture to be retrieved; a target graphic acquisition module, used to acquire a target graphic; a feature value calculation module, used to calculate the feature value of each of the graphics to be retrieved and the feature value of the target graphic; a similarity calculation module, used to calculate the similarity between each of the graphics to be retrieved and the target graphic based on the feature value of each of the graphics to be retrieved and the feature value of the target graphic; and a similar graphic output module, used to output the graphics to be retrieved whose similarity meets a preset condition as a similar graphic of the target graphic.
[0013] According to a third aspect of the present disclosure, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned method.
[0014] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which executable instructions are stored, and when the instructions are executed by a processor, the processor executes the above method.
[0015] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program, and the computer program implements the above method when executed by a processor.
[0016] The similar graphic retrieval method, device, equipment, medium and program product provided by the present disclosure solve the problem that the graphic recognition algorithm that calculates similarity by editing distance cannot recognize graphics of different sizes and graphics rotation. The similar graphic retrieval method provided by the embodiment of the present disclosure can identify graphics similar to a specific graphic based on the specific graphic, and can be applied to application scenarios such as identifying the similarity of certain graphics in pictures and comparing image similarity. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:
[0018] Figure 1 A schematic diagram showing an application scenario of a similar graphic retrieval method, apparatus, device, medium, and program product according to an embodiment of the present disclosure;
[0019] Figure 2 A flowchart of a similar graphic retrieval method according to an embodiment of the present disclosure is schematically shown;
[0020] Figure 3 A flowchart of a method for calculating a characteristic value of a graphic to be identified according to an embodiment of the present disclosure is schematically shown;
[0021] Figure 4 A flowchart of a method for determining the similarity between a current graph to be retrieved and a target graph according to an embodiment of the present disclosure is schematically shown;
[0022] Figure 5 A flowchart of a method for selecting a target graphic from graphics to be retrieved according to an embodiment of the present disclosure is schematically shown;
[0023] Figure 6 The structure block diagram of the similar pattern retrieval device according to the embodiment of the present disclosure is schematically shown;
[0024] Figure 7 A structural block diagram of a feature value calculation module according to an embodiment of the present disclosure is schematically shown; and
[0025] Figure 8 A block diagram of an electronic device suitable for implementing a similar graphic retrieval method according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0026] An embodiment of the present disclosure provides a similar graphic retrieval method, including obtaining a picture to be retrieved, obtaining a graphic to be retrieved from the picture to be retrieved; obtaining a target graphic; calculating a feature value of each graphic to be retrieved and a feature value of the target graphic; calculating the similarity between each graphic to be retrieved and the target graphic based on the feature value of each graphic to be retrieved and the feature value of the target graphic; and outputting the graphic to be retrieved whose similarity exceeds a preset threshold as a similar graphic to the target graphic.
[0027] Figure 1 The following schematically shows an application scenario diagram of the similar pattern retrieval device according to an embodiment of the present disclosure. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present disclosure can be applied, in order to help those skilled in the art understand the technical content of the present disclosure, but it does not mean that the embodiments of the present disclosure cannot be used in other devices, systems, environments or scenarios.
[0028] like Figure 1 As shown, the application scenario 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0029] The user can use the terminal devices 101, 102, 103 to interact with the server 105 through the network 104 to receive or send messages, etc. The terminal devices 101, 102, 103 may be installed with an application having a function of browsing web pages with images.
[0030] The terminal devices 101 , 102 , and 103 may be various electronic devices having a display screen and supporting image browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0031] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for web pages with images browsed by users using the terminal devices 101, 102, and 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results to the terminal device.
[0032] It should be noted that the similar graphic retrieval method provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the similar graphic retrieval device provided in the embodiment of the present disclosure can generally be set in the server 105. The similar graphic retrieval method provided in the embodiment of the present disclosure can also be executed by a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105. Accordingly, the similar graphic retrieval device provided in the embodiment of the present disclosure can also be set in a server or server cluster that is different from the server 105 and can communicate with the terminal devices 101, 102, 103 and / or the server 105.
[0033] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0034] The method and device for similar image retrieval disclosed in the present invention can be used in the computer field of the financial field, and can also be used in any field other than the financial field.
[0035] The following will be based on Figure 1 The scene described by Figure 2 to Figure 5 The similar graphic retrieval method of the disclosed embodiment is described in detail.
[0036] Figure 2 The flowchart of the similar graphic retrieval method according to the embodiment of the present disclosure is schematically shown.
[0037] like Figure 2 As shown, the similar graphic retrieval method of this embodiment includes operations S210 to S250.
[0038] In operation S210, a to-be-searched picture is obtained, and a to-be-searched graphic is obtained from the to-be-searched picture.
[0039] According to an embodiment of the present disclosure, the picture to be retrieved includes multiple graphics to be retrieved.
[0040] According to the disclosed embodiment, after obtaining the image to be retrieved, the image to be retrieved needs to be preprocessed. Preprocessing the image to be retrieved includes grayscale processing, noise reduction filtering and binarization processing of the image to be retrieved. Grayscale processing is to make the components of the three colors R, G, and B in the image the same. Noise reduction filtering is to remove noise in the image, wherein the noise reduction filtering methods include linear filtering, mean filtering, Gaussian filtering, median filtering, bilateral filtering and other methods. Binarization processing is to convert each pixel of the image into a value of 0 or 1, thereby converting the image into a binary two-dimensional digital matrix. The image to be retrieved obtained by preprocessing retains the information that can be used for identification in the original image, reduces information redundancy, and performs traversal search through the two-dimensional matrix in the subsequent search process, thereby improving the search efficiency.
[0041] According to an embodiment of the present disclosure, a method for obtaining a to-be-retrieved graphic is as follows: a search window is set in the to-be-retrieved graphic, and the to-be-retrieved graphic is traversed through the to-be-retrieved graphic using the search window to obtain the to-be-retrieved graphic.
[0042] In operation S220, a target graphic is acquired.
[0043] According to an embodiment of the present disclosure, there are two ways to obtain the target graphics.
[0044] One is to obtain the target image from the image to be retrieved according to user needs. There are multiple images to be retrieved in the image to be retrieved. Now the user selects one of the images to be retrieved as the target image according to needs to determine whether other images to be retrieved in the image to be retrieved are similar to the target image. For example, Figure 5 As shown, the figure to be retrieved on the right side selected from the picture to be retrieved is the target figure, and it is detected whether there are similar figures in other figures to be retrieved.
[0045] The other is to obtain the target graphic from the preset graphic database according to user needs. That is, a preset graphic database is set in advance, and the preset graphic database includes multiple preset graphics, such as triangles, pentagons, rectangles, etc. Now the user selects a graphic from the preset graphic database as the target graphic according to needs to determine whether there is a graphic to be retrieved similar to the target graphic in the image to be retrieved. For example, a pentagon is selected as the target graphic in the preset graphic database to detect whether there is a similar graphic in the graphic to be retrieved.
[0046] In operation S230, feature values of each to-be-searched graphic and feature values of the target graphic are calculated.
[0047] According to the embodiment of the present disclosure, each to-be-retrieved graphic and target graphic are sequentially set as the to-be-recognized graphic. Then, according to the calculation method of the characteristic value of the to-be-recognized graphic, the corresponding characteristic values of each to-be-retrieved graphic and target graphic are calculated.
[0048] According to the embodiment of the present disclosure, the method for calculating the characteristic value of the graphic to be identified is as follows: Figure 3 The method for calculating the feature value of the graphic to be identified in this embodiment includes operations S310 to S330.
[0049] In operation S310, the farthest distance from each pixel to other pixels in the figure to be identified is obtained. For example, the figure to be identified is composed of multiple pixels on a straight line. Assuming that the first pixel is at the end point of the straight line, the pixel farthest from the first pixel is the pixel at the other end point of the straight line, then the farthest distance of the first pixel is the distance between the two end points, and so on to obtain the farthest distance of each pixel on the straight line. In the present disclosure, the distance between two pixels is selected as an important element for calculating the graphic features, which can overcome the similarity recognition error caused by the rotation of the graphic.
[0050] According to an embodiment of the present disclosure, the algorithm for calculating the distance between two pixel points may be a Euclidean distance algorithm, an urban area distance algorithm, or a chessboard distance algorithm.
[0051] In operation S320, the farthest distance of each pixel in the figure to be identified is standardized to obtain the standardized farthest distance of each pixel. Among them, the specific step of standardizing the farthest distance of each pixel in the figure to be identified is to divide the farthest distance of each pixel in the figure to be identified by the maximum value of the farthest distance of each pixel to obtain the standardized farthest distance of each pixel. For example, after obtaining the farthest distance of each pixel on a straight line, the maximum value of the farthest distance is selected, that is, the distance between the two endpoints of the straight line is selected, and the farthest distance of each pixel is divided by the farthest distance between the two endpoints to obtain the standardized farthest distance of each pixel. The process of standardizing the farthest distance disclosed in the present invention can eliminate the error caused by the difference in the size of the graphics when judging the similarity, so that even if the graphics to be retrieved and the target graphics are of different sizes, as long as the shapes are similar, the graphics to be retrieved are similar graphics to the target graphics.
[0052] In operation S330, the average value of the standardized farthest distance of each pixel is calculated to obtain the characteristic value of the image to be identified. For example, after obtaining the standardized farthest distance of each pixel on a straight line, the standardized farthest distance of each pixel is accumulated and then divided by the number of pixels to obtain the average value of the standardized farthest distance of each pixel. This average value is the characteristic value of the image.
[0053] According to the above steps, the specific calculation formula of the characteristic value C of the graphic to be identified is:
[0054]
[0055] Among them, i is 1, 2...n, n is the number of all pixels included in the figure to be identified, l iis the distance from the i-th pixel to the farthest pixel in the image to be identified, l imax for l i The maximum value of .
[0056] In operation S240, the similarity between each of the to-be-retrieved graphics and the target graphics is calculated according to the feature value of each of the to-be-retrieved graphics and the feature value of the target graphics.
[0057] According to an embodiment of the present disclosure, a method for calculating the similarity between the current search graph and the target graph is as follows: Figure 4 The method for calculating the similarity between the current to-be-searched graph and the target graph in this embodiment includes operations S410 to S420.
[0058] In operation S410, the absolute value of the difference between the feature value of the current pattern to be retrieved and the feature value of the target pattern is calculated.
[0059] In operation S420, the ratio of the absolute value to the characteristic value of the target graph is calculated, and the ratio is subtracted from one to obtain the similarity between the current graph to be retrieved and the target graph.
[0060] In the present disclosure, the characteristic value reflects the characteristics of the graph, and the closer the two characteristic values are, the more similar the graph to be retrieved and the target graph are. The value obtained by the similarity calculation method intuitively reflects the similarity between the graph to be retrieved and the target graph.
[0061] According to the above steps, assuming that the characteristic value of the target graph is C1 and the characteristic value of the graph to be retrieved is C2, the specific calculation formula of the similarity S is:
[0062]
[0063] In operation S250, the to-be-searched graph whose similarity exceeds a preset threshold is output as a similar graph to the target graph.
[0064] According to the disclosed embodiment, after calculating the similarity between each to-be-searched graph and the target graph one by one, each similarity is compared with a preset threshold, and all to-be-searched graphs whose similarity exceeds the preset threshold are output, and each output to-be-searched graph is a similar graph of the target graph. For example, the threshold is set to 0.95, and all to-be-searched graphs whose similarity exceeds 0.95 are output as similar graphs of the target graph.
[0065] The similar graphics retrieval method provided by the embodiment of the present disclosure solves the problem that the graphics recognition algorithm that calculates similarity by editing distance cannot recognize graphics of different sizes and graphics rotation. The similar graphics retrieval method provided by the embodiment of the present disclosure can identify graphics similar to a specific graphic based on the specific graphic, and can be applied to application scenarios such as identifying the similarity of certain graphics in a picture and comparing image similarities.
[0066] Based on the above similar graphic retrieval method, the present disclosure also provides a similar graphic retrieval device. Figure 6 The device is described in detail.
[0067] Figure 6 The structural block diagram of the similar graphic retrieval device according to the embodiment of the present disclosure is schematically shown.
[0068] like Figure 6 As shown, the similar graphic retrieval device 600 of this embodiment includes a to-be-retrieved graphic acquisition module 610 , a target graphic acquisition module 620 , a feature value calculation module 630 , a similarity calculation module 640 and a similar graphic output module 650 .
[0069] The to-be-retrieved graphics acquisition module 610 is used to acquire the to-be-retrieved graphics, and acquire the to-be-retrieved graphics from the to-be-retrieved graphics. In one embodiment, the to-be-retrieved graphics acquisition module 610 can be used to acquire the to-be-retrieved graphics from the to-be-retrieved graphics containing multiple to-be-retrieved graphics. Before acquiring the to-be-retrieved graphics, the to-be-retrieved graphics need to be preprocessed.
[0070] The target graphic acquisition module 620 is used to acquire the target graphic. In one embodiment, the target graphic module 620 can acquire the target graphic from the graphics to be retrieved according to user requirements. Figure 5 As shown, the to-be-searched graphic on the right selected from the to-be-searched picture is the target graphic. The target graphic module 620 can also obtain the target graphic from the preset graphic database according to user needs. That is, a preset graphic database is pre-set, and the preset graphic database includes multiple preset graphics, such as triangles, five-pointed stars, rectangles, etc. Now the user can select a pentagon as the target graphic from the preset graphic database according to needs.
[0071] The feature value calculation module 630 is used to calculate the feature values of each of the to-be-searched graphics and the feature value of the target graphics. Figure 7 As shown, the characteristic value calculation module 630 includes a to-be-recognized graphics setting unit 631 and a to-be-recognized graphics characteristic value calculation unit 632. The to-be-recognized graphics setting unit 631 is used to sequentially set each to-be-retrieved graphics and target graphics as to-be-recognized graphics. The to-be-recognized graphics characteristic value calculation unit 632 is used to calculate the characteristic value of the to-be-recognized graphics. The calculation formula of the to-be-recognized graphics characteristic value C calculated by the to-be-recognized graphics characteristic value calculation unit 632 is:
[0072]
[0073] Among them, i is 1, 2...n, n is the number of all pixels included in the figure to be identified, l i is the distance from the i-th pixel to the farthest pixel in the image to be identified, limax for l i The maximum value of .
[0074] According to the embodiment of the present disclosure, each to-be-searched graphic or target graphic enters the to-be-recognized graphic setting unit 631 and is set as a to-be-recognized graphic, and then obtains its own feature value through the to-be-recognized graphic feature value calculation unit 632. Figure 5 The picture to be retrieved shown contains two graphics to be retrieved. Now the right graphics to be retrieved is set as the target graphics. The target graphics are first input into the graphics to be identified setting unit 631 to be set as the graphics to be identified, and the characteristic value of the target graphics is obtained by the graphics to be identified characteristic value calculation unit 632. Then the left graphics to be retrieved are input into the graphics to be identified setting unit 631 and the graphics to be identified characteristic value calculation unit 632 to obtain the characteristic value of the left graphics to be retrieved. It can be understood that the input order of the target graphics and the graphics to be retrieved can be exchanged.
[0075] The similarity calculation module 640 is used to calculate the similarity between each to-be-retrieved graphic and the target graphic according to the feature value of each to-be-retrieved graphic and the feature value of the target graphic. In one embodiment, the formula for calculating the similarity S by the similarity calculation module 640 is:
[0076]
[0077] The similarity graph output module 650 is used to output the to-be-searched graph whose similarity meets the preset condition as a similar graph of the target graph. In one embodiment, the similarity graph output module 650 compares the similarity between each to-be-searched graph and the target graph with a preset threshold, and outputs all to-be-searched graphs whose similarity exceeds the preset threshold, and each output to-be-searched graph is a similar graph of the target graph. For example, the threshold is set to 0.95, and all to-be-searched graphs whose similarity exceeds 0.95 are output as similar graphs of the target graph.
[0078] According to an embodiment of the present disclosure, any multiple modules among the to-be-retrieved graphics acquisition module 610, the target graphics acquisition module 620, the eigenvalue calculation module 630, the similarity calculation module 640, and the similar graphics output module 650 can be combined in one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. According to an embodiment of the present disclosure, at least one of the to-be-retrieved graphics acquisition module 610, the target graphics acquisition module 620, the eigenvalue calculation module 630, the similarity calculation module 640, and the similar graphics output module 650 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware, and firmware, or in any appropriate combination of any of them. Alternatively, at least one of the to-be-retrieved graphic acquisition module 610, the target graphic acquisition module 620, the feature value calculation module 630, the similarity calculation module 640 and the similar graphic output module 650 can be at least partially implemented as a computer program module, which can execute corresponding functions when the computer program module is executed.
[0079] Figure 8 A block diagram of an electronic device suitable for implementing a similar graphic retrieval method according to an embodiment of the present disclosure is schematically shown.
[0080] like Figure 8 As shown, the electronic device 800 according to an embodiment of the present disclosure includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 to a random access memory (RAM) 803. The processor 801 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 801 may also include an onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.
[0081] In RAM 803, various programs and data required for the operation of electronic device 800 are stored. Processor 801, ROM 802 and RAM 803 are connected to each other via bus 804. Processor 801 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 802 and / or RAM 803. It should be noted that the program can also be stored in one or more memories other than ROM 802 and RAM 803. Processor 801 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in one or more memories.
[0082] According to an embodiment of the present disclosure, the electronic device 800 may further include an input / output (I / O) interface 805, which is also connected to the bus 804. The electronic device 800 may further include one or more of the following components connected to the I / O interface 805: an input portion 806 including a keyboard, a mouse, etc.; an output portion 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 808 including a hard disk, etc.; and a communication portion 809 including a network interface card such as a LAN card, a modem, etc. The communication portion 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the I / O interface 805 as needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage portion 808 as needed.
[0083] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.
[0084] According to an embodiment of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 802 and / or RAM 803 described above and / or one or more memories other than ROM 802 and RAM 803.
[0085] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the item recommendation method provided by the embodiment of the present disclosure.
[0086] The above functions defined in the system / device of the embodiment of the present disclosure are executed when the computer program is executed by the processor 801. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.
[0087] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 809, and / or installed from a removable medium 811. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0088] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the processor 801, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.
[0089] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).
[0090] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0091] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.
[0092] The embodiments of the present disclosure are described above. However, these embodiments are only for illustrative purposes and are not intended to limit the scope of the present disclosure. Although the embodiments are described above separately, this does not mean that the measures in the various embodiments cannot be used in combination to advantage. The scope of the present disclosure is defined by the attached claims and their equivalents. Without departing from the scope of the present disclosure, those skilled in the art may make a variety of substitutions and modifications, which should all fall within the scope of the present disclosure.
Claims
1. A similar graph retrieval method, characterized in that: include: Obtaining a picture to be retrieved, and obtaining a graphic to be retrieved from the picture to be retrieved; Get the target graphics; Calculating the characteristic values of each of the to-be-searched graphics and the characteristic value of the target graphics; Calculating the similarity between each of the to-be-retrieved graphics and the target graphics according to the feature values of each of the to-be-retrieved graphics and the feature values of the target graphics; Outputting the to-be-searched graph whose similarity satisfies a preset condition as a similar graph to the target graph; Wherein, each of the to-be-retrieved graphics and the target graphics is sequentially set as a to-be-recognized graphics; Obtaining the maximum distance from each pixel to other pixels in the to-be-recognized image; Normalizing the maximum distance of each pixel in the to-be-recognized image to obtain a standardized maximum distance of each pixel; The average value of the standardized maximum distance of each pixel point is calculated to obtain the characteristic value of the pattern to be identified.
2. The similar graphic retrieval method according to claim 1, characterized in that: The step of normalizing the maximum distance of each pixel in the to-be-recognized graphic to obtain the normalized maximum distance of each pixel comprises: The farthest distance of each pixel in the to-be-recognized graphic is divided by the maximum value of the farthest distances of each pixel to obtain the standardized farthest distance of each pixel.
3. The similar graphic retrieval method according to claim 1, characterized in that: The calculating the similarity between each of the to-be-searched graphics and the target graphics according to the feature values of each of the to-be-searched graphics and the target graphics comprises: Calculating the absolute value of the difference between the characteristic value of the current image to be retrieved and the characteristic value of the target image; The ratio of the absolute value to the characteristic value of the target graphic is calculated, and the ratio is subtracted from one to obtain the similarity between the current graphic to be retrieved and the target graphic.
4. The similar graphic retrieval method according to claim 1, characterized in that: The step of obtaining the image to be retrieved and obtaining the graphic to be retrieved from the image to be retrieved comprises: Preprocessing the image to be retrieved, wherein the preprocessing of the image to be retrieved includes performing grayscale processing, noise reduction filtering and binarization processing on the image to be retrieved.
5. The similar graphic retrieval method according to claim 1, characterized in that: The acquiring of the target graph comprises: According to user requirements, the target graphic is obtained from the graphics to be retrieved.
6. The similar graphic retrieval method according to claim 1, characterized in that: The acquiring of the target graph comprises: According to user requirements, the target graphic is obtained from a preset graphic database.
7. A similar pattern retrieval device, characterized in that: include: A to-be-retrieved graphic acquisition module is used to acquire the to-be-retrieved picture and obtain the to-be-retrieved graphic from the to-be-retrieved picture; A target graphics acquisition module is used to acquire the target graphics; The feature value calculation module is used to calculate the feature value of each of the to-be-searched graphics and the feature value of the target graphics; wherein each of the to-be-searched graphics and the target graphics are sequentially set as the to-be-recognized graphics; the farthest distance from each pixel in the to-be-recognized graphics to other pixels is obtained; the farthest distance of each pixel in the to-be-recognized graphics is standardized to obtain the standardized farthest distance of each pixel; the average value of the standardized farthest distance of each pixel is calculated to obtain the feature value of the to-be-recognized graphics; A similarity calculation module, used for calculating the similarity between each to-be-retrieved graphic and the target graphic according to the characteristic value of each to-be-retrieved graphic and the characteristic value of the target graphic; The similarity graph output module is used to output the to-be-searched graph whose similarity meets a preset condition as a similar graph of the target graph.
8. An electronic device, comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors execute the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method for retrieving similar images
CN101710340A
Remote multi-target efficient detection and identification method
CN112784709A