[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

WO2018121375A1 - Image matching method and apparatus - Google Patents

Image matching method and apparatus Download PDF

Info

Publication number
WO2018121375A1
WO2018121375A1 PCT/CN2017/117433 CN2017117433W WO2018121375A1 WO 2018121375 A1 WO2018121375 A1 WO 2018121375A1 CN 2017117433 W CN2017117433 W CN 2017117433W WO 2018121375 A1 WO2018121375 A1 WO 2018121375A1
Authority
WO
WIPO (PCT)
Prior art keywords
image recognition
image
matching
client
copy
Prior art date
Application number
PCT/CN2017/117433
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
Priority claimed from CN201611247094.8A external-priority patent/CN106599307B/en
Priority claimed from CN201611251384.XA external-priority patent/CN106682201B/en
Application filed by 北京奇虎科技有限公司 filed Critical 北京奇虎科技有限公司
Publication of WO2018121375A1 publication Critical patent/WO2018121375A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor

Definitions

  • the present invention relates to the field of computer science and technology, and in particular, to an image matching method and apparatus.
  • image processing technology With the continuous development of image processing technology, the field of image processing involves various aspects such as human life and work.
  • the image processing technology in the prior art is more and more mature. By analyzing the feature information of different images, different images can be identified, so that different images can be effectively distinguished.
  • the present invention has been made in order to provide an image matching method and apparatus that overcomes the above problems or at least partially solves the above problems.
  • an image matching method including:
  • Receiving an image matching request from a client where the image matching request carries key information of the client; calculating the key information according to a preset rule to obtain a first keyword key; storing in a database The queues indexed by different keys are matched with the queue corresponding to the first key, wherein each queue stores image recognition files of images from different clients but having the same key; the read matches The images in the queue identify the copy, and match each image recognition copy according to the preset matching logic to obtain the image matching result, and obtain the matching result between the client and other clients according to the image matching result.
  • an image matching method including:
  • the first image recognition copy and the second image recognition copy are placed in the queue for storage; when the matching request of the first client and the second client is received, according to Key to the queue to read the first image recognition copy and the second image recognition copy; matching the first image recognition copy and the second image recognition copy to obtain the first customer The result of the matching between the terminal and the second client.
  • an image matching apparatus comprising:
  • the receiving module is adapted to receive an image matching request from the client, where the image matching request carries the key information of the client, and the calculating module is configured to calculate the key information according to a preset rule to obtain a first keyword key; a queue matching module, configured to match a queue corresponding to the first key in a queue indexed by a different key stored in a database, wherein each queue stores a code from a different client, but An image recognition copy of each image having the same key; the image matching module is adapted to read the image recognition copy in the matched queue, and match each image recognition copy according to a preset matching logic to obtain an image matching result, and based on The image matching result is matched by the client and other clients.
  • an image matching apparatus comprising:
  • the first receiving module is adapted to receive a first image recognition request from the first client that carries the first image and the key information, and identify the first image to obtain a first image recognition copy; the second receiving module, Suitable for receiving a second image recognition request from the second client carrying the second image and the key information, identifying the second image to obtain a second image recognition copy; and a storage module adapted to be preset according to the preset
  • the rule calculates the key information, obtains a keyword key, and establishes a queue indexed by the key, and places the first image recognition copy and the second image recognition copy into the queue for storage; a module, configured to read the first image recognition copy and the second image recognition copy into the queue when receiving a matching request between the first client and the second client; a matching module, And matching the first image recognition copy and the second image recognition copy to obtain a matching result between the first client and the second client.
  • a computer program comprising computer readable code, when said computer readable code is run on a computing device, causing said computing device to perform according to any of the above Image matching method.
  • a plurality of queues are pre-stored in the database, and each queue is indexed by a key.
  • Each queue stores image recognition files of images from different clients but having the same key, that is, a database to the client.
  • the image requested for identification is stored in groups, and the same key is stored in the same queue, which provides a data basis for subsequent matching operations.
  • the key information carried in the matching request is calculated, and the first key is obtained, and then the first key is matched with each queue in the database, and the first key is matched.
  • the queue that is, the queue indexed by the first key, can obtain each image recognition copy in the queue indexed by the first key.
  • each image recognition copy in the queue indexed by the first key is read, and each image recognition copy is matched according to a preset matching logic to obtain an image matching result. Because, and the image recognition copy is from different clients, the matching result between the client and other clients is obtained based on the image matching result.
  • the matching result can reflect the relationship between the images from different clients, which not only increases the interaction between different clients, but also improves the sociality and fun of the client. In addition, for users who use the client, not only can the interaction between images owned by different users be increased, but also communication and communication between different users can be enhanced.
  • the matching request carries the key information
  • the key information is used as the key information of the matching queue, so that the matching operation can be limited to the image recognition copy of each image from different clients but having the same key, and the other clients are guaranteed to send to
  • the security of the image of the server makes the user's private information not easily leaked.
  • FIG. 1 is a flow chart showing an image matching method according to an embodiment of the present invention
  • FIG. 2 is a process flow diagram of a method for generating an image recognition copy in a queue according to an embodiment of the present invention
  • FIG. 3 is a flow chart showing an image matching method according to another embodiment of the present invention.
  • FIG. 4 is a flow chart showing an image matching method according to another embodiment of the present invention.
  • FIG. 5 is a flow chart showing an image matching method according to another embodiment of the present invention.
  • FIG. 6 is a block diagram showing the structure of an image matching apparatus according to an embodiment of the present invention.
  • FIG. 7 is a block diagram showing another structure of an image matching apparatus according to an embodiment of the present invention.
  • FIG. 8 is a block diagram showing the structure of an image matching apparatus according to another embodiment of the present invention.
  • FIG. 9 is a block diagram showing the structure of an image matching apparatus according to another embodiment of the present invention.
  • Figure 10 is a schematic block diagram showing a computing device for performing an image matching method in accordance with the present invention.
  • Fig. 11 schematically shows a storage unit for holding or carrying program code implementing the image matching method according to the present invention.
  • FIG. 1 is a schematic flow chart of an image matching method according to an embodiment of the present invention. Referring to FIG. 1, the method includes at least steps S102 to S110.
  • Step S102 Receive an image matching request from a client, where the image matching request carries key information of the client.
  • Step S104 Perform calculation on the key information according to a preset rule to obtain a first keyword key
  • Step S106 Matching queues corresponding to the first key in the queues indexed by different keys stored in the database, wherein each queue stores image recognition of images from different clients but having the same key Copywriting
  • Step S108 Read the image recognition copy in the matched queue, and match each image recognition copy according to the preset matching logic to obtain an image matching result, and obtain a matching result between the client and other clients according to the image matching result. .
  • a plurality of queues are pre-stored in the database, and each queue is indexed by a key.
  • Each queue stores image recognition files of images from different clients but having the same key, that is, database pairs.
  • the images identified by the client request are stored in groups, and the same key is stored in the same queue, which provides a data foundation for subsequent matching operations. Further, if the image matching request from the client is received, the key information carried in the matching request is calculated, and the first key is obtained, and then the first key is matched with each queue in the database, and the first key is matched.
  • the queue that is, the queue indexed by the first key, can obtain each image recognition copy in the queue indexed by the first key.
  • each image recognition copy in the queue indexed by the first key is read, and each image recognition copy is matched according to a preset matching logic to obtain an image matching result. Because, and the image recognition copy is from different clients, the matching result between the client and other clients is obtained based on the image matching result.
  • the matching result can reflect the relationship between the images from different clients, which not only increases the interaction between different clients, but also improves the sociality and fun of the client. In addition, for users who use the client, not only can the interaction between images owned by different users be increased, but also communication and communication between different users can be enhanced.
  • the matching request carries the key information
  • the key information is used as the key information of the matching queue, so that the matching operation can be limited to the image recognition copy of each image from different clients but having the same key, and the other clients are guaranteed to send to
  • the security of the image of the server makes the user's private information not easily leaked.
  • FIG. 2 shows a process flow diagram of a method for generating an image recognition copy in a queue according to an embodiment of the present invention. Referring to FIG. 2, the method includes at least steps S202 to S208:
  • Step S202 Receive an image recognition request from a client, where the image recognition request carries an image to be identified and key information provided by the client.
  • Step S204 Perform image recognition on the image carried in the image recognition request to obtain an image recognition result.
  • Step S206 calculating key information of the current image identification according to the preset rule, to obtain a corresponding key
  • Step S208 establishing a queue indexed by the key in the database for the key, and placing the image recognition copy into the queue.
  • the client may initiate the image matching request mentioned in step S102 above to find other clients that match the client.
  • the timing may be started from the time when the matching request is received, thereby obtaining the timing of the matching process. Due to the complexity of different image content, if the image content is more complicated, it takes more image recognition and image matching time. In addition, in the process of image transmission, there may be unexpected situations such as file loss or network interruption. At this time, the time of the image matching process can be effectively controlled by timing the matching process, and differently The timing of the time takes a corresponding solution to improve the matching efficiency of image matching.
  • the rated duration of the current matching may be preset, for example, the rated duration is 2 seconds, and if the matching request request is received for more than 2 seconds, the matching operation is suspended, if received from the receiving
  • the matching request time starts no more than 2 seconds
  • each image recognition copy is read according to the first key to the queue indexed by the first key. If the timeout expires, the matching operation is directly suspended, and an unsuccessful error code is sent to the client to inform the client that the matching operation has ended.
  • step S108 in order to ensure that the content read from the queue is valid and complete, and the subsequent matching operation can be completed, when the image recognition copy is read from the queue, The image recognition copy in the queue is counted, the counting result is obtained, and the counting result is judged correspondingly. If the counting result is greater than or equal to 2, at least 2 image recognition files have been stored in the verification queue, and the image recognition copy matching operation can be performed.
  • the matching step of each image recognition scheme is continued, and if the counting result is less than 2, It may be found that only one image recognition copy may be stored in the queue, and even no image recognition copy may be stored in the queue, and the matching operation cannot be performed, but at this time, the rated duration of the match is not exceeded yet, and it is still valid.
  • the image recognition copy in the queue can be read again at a specified time interval. An image recognition file of less than 2 appears in the queue, which may be because the server has not completed the recognition operation of other images, or the image recognition copy may be deleted during the storage process due to exceeding the queue storage time, or may be data loss.
  • the interval time may be set to an interval of 1 ms.
  • other interval times may be set, such as 0.9 ms, 1.5 ms, etc., and the value of the specific interval time may be set according to actual conditions, in the embodiment of the present invention. There is no limit to this.
  • each image recognition copy is matched, and the matching process may be: first, performing weighting calculation on each image recognition copy to obtain a weight value of each image recognition copy. . Then, the weighted values of each image recognition copy are compared to obtain an image matching result, and the image matching result is used as a matching result between the client and other clients.
  • each image includes a plurality of main lines
  • the server needs to first draw the main lines of each image, and the following describes the drawing process of the main lines of the image.
  • the edge detection algorithm can be used to detect the edge of each line in the image, and the detection result of the edge detection algorithm is obtained.
  • the Canny operator can be used to detect the edge of the image.
  • the essence of the Canny operator to detect the edge is to determine the maximum value of the signal function to determine the pixel edge of the image.
  • an adaptive contour extraction operation of the line is performed on the detection result map obtained according to the edge detection algorithm, and the line outline of each line is obtained.
  • the adaptive contour extraction operation it is required to output a binarized image, that is, only two images of black and white, one gray represents the edge, and the other gray represents the background, and the deeper processing of the edge information can be performed. Make the outline of the line clearer.
  • the values of the pixel points of each line contour can be calculated.
  • the line outline in which the number of pixel points is less than N is deleted.
  • N takes a value of 20. Therefore, the value of the pixel point of each line outline in the image obtained at this time is not less than 20.
  • the set ratio is 3%. That is to say, when the value of the pixel point of each line outline is higher than 3% of the total pixel point of the image, the edge detection algorithm is adjusted, and the edge of each line in the image is re-detected by using a new edge detection algorithm until Get the line outline that meets the main line standard.
  • N is 20
  • the value of the set ratio is 3%, which is only an example of the embodiment of the present invention.
  • the embodiment does not specifically limit the specific value of N and the set ratio by specific circumstances. For example, N may be 30 or 40, and the set ratio may be 4% or 5%.
  • the contour of the line is determined according to the selected contour of the line, and then the contour of the line in the area is merged to draw the corresponding main line.
  • the drawing method of the above main line is mainly based on the principle that the image is usually provided with sufficient information by the main line, and the more complicated various images are analyzed and processed, and the main lines are extracted to make the content of the image simple. It is clear, clear, and obvious, so that the amount of image information can be better extracted, and the important information in the image caused by the blurring of the image itself is avoided.
  • the image recognition copy is an image recognition copy related to a flower.
  • the client provides a rose image, and other clients. Lily images and rose flower images are provided, and the same key information 1234 is used by all three clients.
  • the outlines of the flowers and the length of the stamen can be used as a main line.
  • the server After the server respectively recognizes the image recognition copy of the rose, the image recognition copy of the lily, and the image recognition copy of the rose, the three image recognition files are placed in the same queue, and the index of the queue is the key information 1234.
  • the calculated key 01.
  • the weight ratios of the length of the flower and the length of the stamen are 60% and 40%, respectively.
  • the image recognition copy of the rose and the image recognition copy of the lily are matched.
  • the petals of the lily are long and the petals have a layer of petals.
  • the petals of the rose are similar to a circle, and the flower has multiple layers of petals.
  • the lily of the open lily is more pronounced, and the length of the lily is longer, while the flower of the open rose is surrounded by the petals of the layer, which is not obvious, and the length of the rose is shorter.
  • the image recognition copy of the rose and the image recognition copy of the rose flower are matched.
  • step S108 also mentions that the matching result of the client and other clients can be obtained correspondingly based on the image matching result.
  • the queue provided by the embodiment of the present invention further stores an uploaded image to obtain a client ID of the image recognition copy, and correspondingly matches the client ID with the image recognition copy of the uploaded image. storage.
  • the image matching result is obtained, the corresponding client ID is reversely searched according to each image recognition copy participating in the matching operation, and then the client corresponding to the client ID is confirmed. Therefore, the image recognition copy and the client can be correspondingly formed, so that the image matching result can reflect the matching result between the clients. Therefore, the image matching result can be displayed as a match between the client and other confirmed clients. result.
  • Embodiments of the present invention provide another image matching method, which is applied to a server.
  • FIG. 3 is a schematic flowchart diagram of an image matching method according to an embodiment of the present invention. Referring to FIG. 3, the method includes at least steps S302 to S310.
  • Step S302 Receive a first image recognition request from the first client that carries the first image and the key information, and identify the first image to obtain a first image recognition copy.
  • the key information may be a password input by the user, and the composition form of the password, the length of the password, and the like may be set by the user.
  • the key information may be a digital password such as "1234", or an alphanuclear password such as "abcd", or a combination of any characters.
  • the specific form of the key information is not limited in the embodiment of the present invention.
  • Step S304 receiving a second image recognition request from the second client that carries the second image and the key information, and identifying the second image to obtain a second image recognition copy.
  • step S302 only the key information sent by the second client is consistent with the key information sent by the first client in step S302.
  • the server can send the received first client.
  • the first image and the second image sent by the second client are placed in the same storage space after the end of the identification for subsequent matching processing.
  • Step S306 Calculate the key information according to the preset rule, obtain a keyword key, and establish a queue indexed by the key, and store the first image recognition copy and the second image recognition copy in a queue.
  • the keyword key is a corresponding calculation result obtained by calculating the key information by a preset rule.
  • the keyword key may be a calculated machine code composed of “0” and “1”, and also It can be a string of random numbers, and can also be any other form of string.
  • the embodiment of the present invention does not specifically limit the form of the calculation result.
  • the function of the keyword key is mainly to perform related indexing on the queue established by the server. In the queue, the keyword key can correspond to two image recognition files related to one key information.
  • the queue mentioned in the step may be in the form of a table
  • the keyword key may correspond to a line of content in the table, a column of content, or content in a certain cell, and according to the keyword key, the specified in the table may be found.
  • the content that is, the index relationship is established between the keyword key and the queue.
  • the storage content of the queue can be set to be time-sensitive. If it is longer than one time, it can be deleted from the queue to ensure the timeliness and validity of the information.
  • the queue can be kept in the specified database, and multiple queues can be saved in the database at the same time.
  • Step S308 when receiving the matching request of the first client and the second client, reading the first image recognition copy and the second image recognition copy according to the key to the queue.
  • the server may obtain the keyword key according to the matching request, and then use the keyword key to index from the queue.
  • the first image recognition copy and the second image recognition copy corresponding to the keyword key are saved in the queue.
  • Step S310 matching the first image recognition copy and the second image recognition copy to obtain a matching result between the first client and the second client.
  • the server respectively receives image related information (including image and key information) from the first client and the second client, so that two image recognitions can be separately generated according to image related information from different clients. Copywriting.
  • the server may further calculate the received key information according to a preset rule to obtain a keyword key, and at the same time, use the keyword key to establish a key-indexed queue, and put two image recognition files into the queue. In storage.
  • the server receives the matching request of the first client and the second client, the corresponding two image recognition files are read according to the keyword key to the queue, and then the read two image recognition files are matched to obtain Corresponding matching results.
  • the matching result can reflect the relationship between the images from the first client and the second client respectively, which not only increases the interaction between different clients, but also improves the sociality and interest of the client.
  • users who use the client not only can the interaction between images owned by different users be increased, but also communication and communication between different users can be enhanced.
  • the server receives the key information input by the user of the first client and the user of the second client, respectively, so that the first image and the second image received by the server are not maliciously stolen, thereby ensuring the client.
  • the embodiment of the invention further provides a method for reading an image recognition copy, which is used for reading a corresponding image recognition copy from a queue in which an image recognition copy is pre-stored.
  • the method may at least include steps S402 to S410.
  • Step S402 receiving a matching request of the first client and/or the second client.
  • the matching request carries the key information.
  • the key information can be entered by a user of the first client and/or the second client.
  • Step S404 parsing the matching request to obtain the key information carried therein.
  • Step S406 Calculate the key information according to the preset rule, and obtain a key corresponding to the key information.
  • a keyword key corresponding to the key information can be obtained, and the keyword key is used to index the corresponding image recognition copy from the queue.
  • step S408 the key corresponding to the key information is matched with each queue in the database, and a matching queue indexed by the key is found.
  • the matching is performed by using the keyword key calculated in step S406 and the keyword key in each queue in the database.
  • the keyword key is matched, the matching queue with the key index can be found, and the image recognition copy in the corresponding queue is found from the queue according to the saved index relationship.
  • Step S410 reading the first image recognition copy and the second image recognition copy into the queue.
  • the method for image matching of the present invention is introduced in a specific embodiment, and the method includes at least steps S502 to S522.
  • step S502 is performed to receive a first image recognition request from the first client that carries the first image and the key information, and call the image processing engine to identify the first image to obtain a first image recognition copy.
  • step S504 is executed to receive a second image recognition request from the second client carrying the second image and the key information, and call the image processing engine to identify the second image to obtain a second image recognition copy. After the first image recognition copy and the second image recognition copy are obtained, step S506 is performed.
  • Step S506 Calculate the key information according to the preset rule, obtain a keyword key, and establish a queue indexed by the key, and store the first image recognition copy and the second image recognition copy in a queue, and then perform step S508. .
  • the file expiration time of the first image recognition copy and the second image recognition copy may also be set, and the image recognition copy is correspondingly performed by monitoring the time stored in the queue by the image recognition copy and the second image recognition copy. Processing. Specifically, if the first image recognition copy and the second image recognition copy are stored in the queue for more than a set copy time, the first image recognition copy and the second image recognition copy are automatically invalidated. For example, if the file expiration time is set to 2 days, if the image recognition copy is stored in the queue for more than 2 days, the server can automatically delete the expired image recognition copy, or can also identify the expired image recognition copy as unavailable. status.
  • the image recognition copy may be subjected to other processing, which is not specifically limited in the embodiment of the present invention.
  • Step S508 when receiving the matching request of the first client and the second client, starting timing with the receiving time of the matching request as a starting point, obtaining the time duration of the matching process, and then performing step S510.
  • step S510 it is determined whether the timing duration exceeds the rated duration of the current match. If yes, step S522 is executed to end the current matching. If no, step S512 is executed to count the image recognition copy in the queue to obtain a counting result. After the counting result is obtained, step S514 is performed.
  • step S514 it is determined whether the counting result is 2. If yes, go to step S516, if no, go to step S518.
  • Step S516 reading the first image recognition copy and the second image recognition copy according to the key to the queue, and executing step S520.
  • Step S518, the image recognition copy in the queue is read again at the specified time interval. Further, the above S510 is executed again.
  • Step S520 matching the first image recognition copy and the second image recognition copy to obtain a matching result between the first client and the second client.
  • Step S522 is executed to end the current match.
  • steps S514 to S518 above if it is determined that the count result of the image recognition copy in the queue is 2, and the first image recognition copy and the second image recognition copy have been stored in the proof queue, then this example continues to perform each image recognition.
  • the matching step of the scheme if the counting result is less than 2, it may be found that only the first image recognition copy or the second image recognition copy may be stored in the queue, and even the image recognition copy may not be stored in the queue, and the matching operation cannot be performed. However, at this time, the rated duration of this match has not been exceeded, and it is still in the valid matching time. At this time, the image recognition copy in the queue can be read again at this time. An image recognition file of less than 2 appears in the queue. It may be because the server has not completed the recognition operation of one or two images. It may also be that the image recognition copy is deleted during the storage process due to exceeding the queue storage time, or it may be data loss. And other reasons.
  • FIG. 6 is a block diagram showing the structure of an image matching apparatus according to an embodiment of the present invention.
  • the device includes at least:
  • the receiving module 310 is adapted to receive an image matching request from the client, where the image matching request carries the key information of the client;
  • the calculation module 320 is coupled to the receiving module 310, and is configured to calculate the key information according to a preset rule to obtain a first keyword key;
  • the queue matching module 330 is coupled to the computing module 320, and is adapted to match a queue corresponding to the first key in a queue indexed by a different key stored in a database, where each queue stores, from different clients, However, the image recognition copy of each image having the same key;
  • the image matching module 340 is coupled to the queue matching module 330, and is adapted to read the image recognition copy in the matched queue, and match each image recognition copy according to the preset matching logic to obtain an image matching result, and based on the image matching result. Corresponding to the matching results between this client and other clients.
  • the image matching apparatus may further include:
  • the timing module 350 is coupled to the receiving module 310, and is adapted to receive the image matching request from the client, and start timing according to the receiving time to obtain the time duration.
  • the timing module 350 is further adapted to determine whether the timing duration exceeds the rated duration of the current match before reading the image recognition copy in the matched queue; if yes, the termination The sub-matching operation; if not, triggering the image matching module 340 to perform a reading operation of each image-recognition copy.
  • the image matching apparatus may further include:
  • the sending module 360 is coupled to the timing module 350, and is configured to send an unsuccessful error code to the client after the current matching operation is suspended.
  • the image matching module 340 can also be adapted to:
  • the image matching module 340 is further adapted to read the image recognition copy in the matched queue again at intervals of 1 ms.
  • the image matching module 340 can also be adapted to:
  • Each image recognition copy is weighted to obtain a weighted value of each image recognition copy; the weighted value of each image recognition copy is compared to obtain an image matching result.
  • the image matching module 340 is further adapted to: when each image includes a plurality of main lines, separately set a weight and a weight ratio for the copy information of each main line; and weight each image recognition copy Calculate to obtain the total weighted value of each image recognition copy.
  • the image matching module 340 can also be adapted to:
  • the queue also stores an uploaded image to obtain a client ID of the image recognition copy, and stores the client ID corresponding to the image recognition copy of the uploaded image; when the image matching result is obtained, according to each image recognition participating in the matching operation
  • the copy file reversely finds the corresponding client ID, and then confirms the client corresponding to the client ID; the image matching result is displayed as a matching result between the client and other confirmed clients.
  • the image matching apparatus may further include:
  • the selection module 370 is coupled to the image matching module 340, and is adapted to obtain a matching result between the client and other clients based on the image matching result, and select the highest matching degree with the client according to the matching result between the client and the other client. Another client; return another client selected and the corresponding matching result to the client.
  • the image matching apparatus may further include:
  • the document identification module 380 is coupled to the queue matching module 330, and is adapted to generate an image recognition copy in each queue by receiving at least two images from the client, and the at least two images carry the same key information; Performing image recognition on the at least two images to obtain an image recognition result; calculating key information of the current image recognition according to the preset rule to obtain a corresponding key; establishing the key in the database for the key
  • the queue is indexed and each image recognition copy is placed in this queue.
  • FIG. 8 is a schematic structural diagram of an image matching device according to an embodiment of the present invention.
  • the image matching device 400 includes at least a first receiving module 410 and a second.
  • the receiving module 420, the storage module 430, the reading module 440, and the matching module 450 are included in the image matching device 400.
  • the first receiving module 410 is adapted to receive a first image recognition request from the first client that carries the first image and the key information, and identify the first image to obtain a first image recognition copy;
  • the second receiving module 420 is coupled to the first receiving module 410, and is adapted to receive a second image from the second client that carries the second image and the key information, and identify the second image to obtain a second image recognition copy. ;
  • the storage module 430 is coupled to the second receiving module 420, and is adapted to calculate key information according to a preset rule, obtain a keyword key, and establish a queue indexed by the key, and identify the first image and the second image. Identify the copy and put it in the queue for storage;
  • the reading module 440 is coupled to the storage module 430, and is adapted to read the first image recognition copy and the second image recognition copy into the queue when receiving the matching request of the first client and the second client;
  • the matching module 450 is coupled to the reading module 440 and is adapted to match the first image recognition copy and the second image recognition copy to obtain a matching result between the first client and the second client.
  • FIG. 9 is a schematic structural diagram of an image matching device according to another embodiment of the present invention.
  • the image matching device 400 includes the components shown in FIG.
  • a timing module 510 can also be included.
  • the timing module 510 is coupled to the reading module 440, and is adapted to start timing when the reading module 440 receives the matching request of the first client and the second client, starting from the receiving time of the matching request, and obtaining the timing of the matching process. duration.
  • the timing module 510 is further adapted to determine whether the chronograph duration exceeds the rated duration of the current match before the reading module 440 reads the first image recognition copy and the second image recognition copy in the queue. If yes, the matching operation is aborted; if not, the reading operation of each image recognition copy is performed.
  • the reading module 440 is further adapted to count the image recognition copy in the queue to obtain a counting result; if the counting result is 2, perform a matching step of each image recognition scheme; if the counting result is less than 2.
  • the image recognition copy in the queue is read again at the specified time interval.
  • the reading module 440 is further adapted to read the image recognition copy in the queue again at intervals of 1 ms.
  • the reading module 440 is further adapted to first parse the matching request to obtain the key information carried therein, and calculate the key information according to a preset rule to obtain a key corresponding to the key information, and then Matching the key corresponding to the key information with each queue in the database, finding a matching queue indexed by the key, and finally reading the first image recognition copy and the second image recognition copy into the queue.
  • the matching module 450 is further configured to perform weighting calculation on the first image recognition copy and the second image recognition copy respectively, and obtain weight values of the first image recognition copy and the second image recognition copy, and compare The weighted values of the first image recognition copy and the second image recognition copy obtain an image matching result, and the image matching result is used as a matching result between the first client and the second client.
  • the matching module 450 is further adapted to separately set a weight and a weight ratio for the copy information of each main line when the first image and/or the second image includes a plurality of main lines, according to each main line
  • the weight and the weight ratio respectively perform weighting calculation on each image recognition copy to obtain a total weight value of each image recognition copy.
  • a plurality of queues are pre-stored in the database, and each queue is indexed by a key.
  • Each queue stores image recognition files of images from different clients but having the same key, that is, database pairs.
  • the images identified by the client request are stored in groups, and the same key is stored in the same queue, which provides a data foundation for subsequent matching operations. Further, if the image matching request from the client is received, the key information carried in the matching request is calculated, and the first key is obtained, and then the first key is matched with each queue in the database, and the first key is matched.
  • the queue that is, the queue indexed by the first key, can obtain each image recognition copy in the queue indexed by the first key.
  • each image recognition copy in the queue indexed by the first key is read, and each image recognition copy is matched according to a preset matching logic to obtain an image matching result. Because, and the image recognition copy is from different clients, the matching result between the client and other clients is obtained based on the image matching result.
  • the matching result can reflect the relationship between the images from different clients, which not only increases the interaction between different clients, but also improves the sociality and fun of the client. In addition, for users who use the client, not only can the interaction between images owned by different users be increased, but also communication and communication between different users can be enhanced.
  • the matching request carries the key information
  • the key information is used as the key information of the matching queue, so that the matching operation can be limited to the image recognition copy of each image from different clients but having the same key, and the other clients are guaranteed to send to
  • the security of the image of the server makes the user's private information not easily leaked.
  • modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment.
  • the modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components.
  • any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined.
  • Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor DSP
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals.
  • signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • Figure 10 illustrates a block diagram of a computing device in which an image matching method in accordance with the present invention can be implemented.
  • the computing device conventionally includes a processor 1010 and a computer program product or computer readable medium in the form of a memory 1020.
  • the memory 1020 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
  • Memory 1020 has a storage space 1030 that stores program code 1031 for performing any of the method steps described above.
  • the storage space 1030 storing program code may store respective program codes 1031 for implementing various steps in the above methods, respectively.
  • the program code can be read from or written to one or more computer program products.
  • These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. Such computer program products are typically portable or fixed storage units as shown in FIG.
  • the storage unit may have storage segments, storage spaces, and the like that are similarly arranged to memory 1020 in the computing device of FIG.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit comprises computer readable program code 1031' storing program steps for performing the method according to the invention, ie program code readable by a processor such as 1010, when the program code is run by the computing device, The computing device is caused to perform the various steps in the methods described above.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Provided are an image matching method and apparatus. The method comprises: receiving an image matching request from a client, wherein the image matching request carries key information about the client; according to a pre-set rule, calculating the key information to obtain a first keyword key; matching a queue corresponding to a first key from queues with different keys as indices stored in a database, wherein each queue stores an image recognition document of each image from different clients but with the same key; and reading a matched image recognition document of a queue, and matching each image recognition document according to a pre-set matching logic to obtain an image matching result, and based on the image matching result, correspondingly obtaining a matching result between the present client and other clients. A relationship existing between each image respectively coming from different clients can be embodied by means of the present invention, not only increasing interaction approaches between different clients, but also improving the sociability and interestingness of a client.

Description

图像匹配方法及装置Image matching method and device 技术领域Technical field
本发明涉及计算机科学与技术领域,特别是涉及一种图像匹配方法及装置。The present invention relates to the field of computer science and technology, and in particular, to an image matching method and apparatus.
背景技术Background technique
随着互联网技术的发展,许多其他领域的技术也被带动地发展起来。随之,人们对生活品质的要求也变得越来越高。图像是人类获取和交换信息的主要来源,因此,图像处理的应用也必然涉及到人类生活的方方面面。虽然人们在日常生活中面对不同的问题时,可以有越来越多的方法来解决。但是,现阶段,人们在对图像进行处理时还存在许多问题。With the development of Internet technology, many other fields of technology have also been driven to develop. As a result, people's demands for quality of life have become higher and higher. Images are the main source of human access and exchange of information. Therefore, the application of image processing must also involve all aspects of human life. Although people face different problems in their daily lives, there are more and more ways to solve them. However, at this stage, there are still many problems when people process images.
随着图像处理技术的不断发展,图像处理领域涉及到人类生活、工作等各个方面。现有技术中的图像处理技术越来越成熟,通过分析不同图像的特征信息可以识别出各个不同的图像,从而可以有效地区分出不同的图像。With the continuous development of image processing technology, the field of image processing involves various aspects such as human life and work. The image processing technology in the prior art is more and more mature. By analyzing the feature information of different images, different images can be identified, so that different images can be effectively distinguished.
但是,目前大多数客户端中的有关图像的处理的技术都是针对单张的图像进行分析,获取单张图像中的一些重要信息,这种图像的处理的技术在处理不同图像的过程中是相互独立的,且得到的各个图像的处理结果也没有必然的联系。因此,现有的图像处理方式较为单一,不利于分析和获取多个图像之间存在的联系,同时,对单张图像进行处理也不利于多个客户端之间的互动。However, most of the current techniques for image processing in the client are to analyze a single image to obtain some important information in a single image. The processing technique of this image is in the process of processing different images. Independent of each other, and the resulting processing results of the individual images are not necessarily related. Therefore, the existing image processing method is relatively single, which is not conducive to analyzing and acquiring the relationship between multiple images. At the same time, processing a single image is not conducive to interaction between multiple clients.
因此,现在亟需一种能够方便地为用户提供满足其需求的图像的处理方法。Therefore, there is a need for a processing method that can conveniently provide users with images that meet their needs.
发明内容Summary of the invention
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的图像匹配方法及装置。In view of the above problems, the present invention has been made in order to provide an image matching method and apparatus that overcomes the above problems or at least partially solves the above problems.
基于本发明的一个方面,提供了一种图像匹配方法,包括:According to an aspect of the present invention, an image matching method is provided, including:
接收来自客户端的图像匹配请求,其中,所述图像匹配请求中携带所述客户端的密钥信息;根据预设规则对所述密钥信息进行计算,以得到第一关键字key;在数据库中存储的以不同key为索引的队列中匹配出与所述第一key对应的队列,其中,各队列中存储有来自不同客户端的、但具备同一key的各图像的图像识别文案;读取匹配到的队列中的图像识别文案,并根据预设匹配逻辑对各图像识别文案进行匹配,得到图像匹配结果,并基于图像匹配结果相应得到本客户端与其他客户端的匹配结果。Receiving an image matching request from a client, where the image matching request carries key information of the client; calculating the key information according to a preset rule to obtain a first keyword key; storing in a database The queues indexed by different keys are matched with the queue corresponding to the first key, wherein each queue stores image recognition files of images from different clients but having the same key; the read matches The images in the queue identify the copy, and match each image recognition copy according to the preset matching logic to obtain the image matching result, and obtain the matching result between the client and other clients according to the image matching result.
基于本发明的另一个方面,还提供了一种图像匹配方法,包括:According to another aspect of the present invention, an image matching method is further provided, including:
接收来自第一客户端的、携带第一图像和密钥信息的第一图像识别请求,对所述第一图像进行识别,得到第一图像识别文案;接收来自第二客户端的、携带第二图像和所述密钥信息的第二图像识别请求,对所述第二图像进行识别,得到第二图像识别文案;根据预设规则对所述密钥信息进行计算,得到关键字key,并建立以key为索引的队列,将所述第一图像识别文案与所述第二图像识别文案放入所述队列中存储;当接收到所述第一客户端与所述第二客户端的匹配请求时,根据key到所述队列中读取所述第一图像识别文案和所述第二图像识别文案;对所述第一图像识别文案和所述第二图像识别文案进行匹配,以得到所述第一客户端与所述第二客户端的匹配结果。Receiving, by the first client, a first image recognition request carrying the first image and the key information, identifying the first image to obtain a first image recognition copy; receiving the second image from the second client a second image recognition request of the key information, identifying the second image to obtain a second image recognition copy; calculating the key information according to a preset rule, obtaining a keyword key, and establishing a key For the indexed queue, the first image recognition copy and the second image recognition copy are placed in the queue for storage; when the matching request of the first client and the second client is received, according to Key to the queue to read the first image recognition copy and the second image recognition copy; matching the first image recognition copy and the second image recognition copy to obtain the first customer The result of the matching between the terminal and the second client.
基于本发明的另一个方面,还提供了一种图像匹配装置,包括:According to another aspect of the present invention, there is also provided an image matching apparatus comprising:
接收模块,适于接收来自客户端的图像匹配请求,其中,所述图像匹配请求中携带所述客户端的密钥信息;计算模块,适于根据预设规则对所述密钥信息进行计算,以得到第一关键字key;队列匹配模块,适于在数据库中存储的以不同key为索引的队列中匹配出与所述第一key对应的队列,其中,各队列中存储有来自不同客户端的、但具备同一key的各图像的图像识别文案;图像匹配模块,适于读取匹配到的队列中的图像识别文案,并根据预设匹配逻辑对各图像识别文案进行匹配,得到图像匹配结果,并基于图像匹配结果相应得到本客户端与其他客户端的匹配结果。The receiving module is adapted to receive an image matching request from the client, where the image matching request carries the key information of the client, and the calculating module is configured to calculate the key information according to a preset rule to obtain a first keyword key; a queue matching module, configured to match a queue corresponding to the first key in a queue indexed by a different key stored in a database, wherein each queue stores a code from a different client, but An image recognition copy of each image having the same key; the image matching module is adapted to read the image recognition copy in the matched queue, and match each image recognition copy according to a preset matching logic to obtain an image matching result, and based on The image matching result is matched by the client and other clients.
基于本发明的另一方面,还提供了一种图像匹配装置,包括:According to another aspect of the present invention, there is also provided an image matching apparatus comprising:
第一接收模块,适于接收来自第一客户端的、携带第一图像和密钥信息的第一图像识别请求,对所述第一图像进行识别,得到第一图像识别文案;第二接收模块,适于接收来自第二客户端的、携带第二图像和所述密钥信息的第二图像识别请求,对所述第二图像进行识别,得到第二图像识别文案;存储模块,适于根据预设规则对所述密钥信息进行计算,得到关键字key,并建立以key为索引的队列,将所述第一图像识别文案与所述第二图像识别文案放入所述队列中存储;读取模块,适于当接收到所述第一客户端与所述第二客户端的匹配请求时,到所述队列中读取所述第一图像识别文案和所述第二图像识别文案;匹配模块,适于对所述第一图像识别文案和所述第二图像识别文案进行匹配,以得到所述第一客户端与所述第二客户端的匹配结果。The first receiving module is adapted to receive a first image recognition request from the first client that carries the first image and the key information, and identify the first image to obtain a first image recognition copy; the second receiving module, Suitable for receiving a second image recognition request from the second client carrying the second image and the key information, identifying the second image to obtain a second image recognition copy; and a storage module adapted to be preset according to the preset The rule calculates the key information, obtains a keyword key, and establishes a queue indexed by the key, and places the first image recognition copy and the second image recognition copy into the queue for storage; a module, configured to read the first image recognition copy and the second image recognition copy into the queue when receiving a matching request between the first client and the second client; a matching module, And matching the first image recognition copy and the second image recognition copy to obtain a matching result between the first client and the second client.
基于本发明的另一个方面,还提供了一种计算机程序,包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行根据上述任一项所述的图像匹配方法。According to another aspect of the present invention, there is also provided a computer program comprising computer readable code, when said computer readable code is run on a computing device, causing said computing device to perform according to any of the above Image matching method.
基于本发明的另一个方面,还提供了一种计算机可读介质,其中存储了如上所述的计算机程序。According to another aspect of the present invention, there is also provided a computer readable medium storing a computer program as described above.
在本发明中,数据库中预先存储有多个队列,各队列以key为索引,每个队列中存储有来自不同客户端的、但具备同一key的各图像的图像识别文案,即,数据库对客户端请求识别的图像进行了分组存储,将具备同一key的存储进同一队列,为后续的匹配操作提供了数据基础。进一步,若接收来自客户端的图像匹配请求,则对匹配请求中所携带的密钥信息进行计算,得到第一key,进而将第一key与数据库中各队列进行匹配,查找到与第一key对应的队列,即以第一key为索引的队列,就可以获得以第一key为索引的队列中的各图像识别文案。随后,读取以第一key为索引的队列中的各图像识别文案,并根据预设匹配逻辑对各图像识别文案进行匹配,得到图像匹配结果。由于,并图像识别文案是由来自不同客户端,因此,基于图像匹配结果相应得到本客户端与其他客户端的匹配结果。匹配结果可以体现出分别来自不同客户端的各个图像之间存在的关系,不仅增加了不同客户端之间的互动方式,还提高了客户端的社交性和趣味性。此外,对于使用该客户端的用户来说,不仅可以增加不同用户所拥有的各图像之间的交互,还可以增进不同用户之间的沟通和交流。另外,匹配请求中携带密钥信息,将密钥信息作为匹配队列的关键信息,使得匹配操作能够限于来自不同客户端的、但具备同一key的各图像的图像识别文案,保证了其他客户端发送至服务器的图像的安全性,使得用户的私人信息不会被轻易的泄露。In the present invention, a plurality of queues are pre-stored in the database, and each queue is indexed by a key. Each queue stores image recognition files of images from different clients but having the same key, that is, a database to the client. The image requested for identification is stored in groups, and the same key is stored in the same queue, which provides a data basis for subsequent matching operations. Further, if the image matching request from the client is received, the key information carried in the matching request is calculated, and the first key is obtained, and then the first key is matched with each queue in the database, and the first key is matched. The queue, that is, the queue indexed by the first key, can obtain each image recognition copy in the queue indexed by the first key. Then, each image recognition copy in the queue indexed by the first key is read, and each image recognition copy is matched according to a preset matching logic to obtain an image matching result. Because, and the image recognition copy is from different clients, the matching result between the client and other clients is obtained based on the image matching result. The matching result can reflect the relationship between the images from different clients, which not only increases the interaction between different clients, but also improves the sociality and fun of the client. In addition, for users who use the client, not only can the interaction between images owned by different users be increased, but also communication and communication between different users can be enhanced. In addition, the matching request carries the key information, and the key information is used as the key information of the matching queue, so that the matching operation can be limited to the image recognition copy of each image from different clients but having the same key, and the other clients are guaranteed to send to The security of the image of the server makes the user's private information not easily leaked.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可 依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solutions of the present invention, and the above-described and other objects, features and advantages of the present invention can be more clearly understood. Specific embodiments of the invention are set forth below.
附图说明DRAWINGS
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those skilled in the art from a The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting. Throughout the drawings, the same reference numerals are used to refer to the same parts. In the drawing:
图1示出了根据本发明一个实施例的图像匹配方法的流程示意图;1 is a flow chart showing an image matching method according to an embodiment of the present invention;
图2示出了根据本发明一个实施例的队列中图像识别文案的生成方法的处理流程图;2 is a process flow diagram of a method for generating an image recognition copy in a queue according to an embodiment of the present invention;
图3示出了根据本发明另一个实施例的图像匹配方法的流程示意图;FIG. 3 is a flow chart showing an image matching method according to another embodiment of the present invention; FIG.
图4示出了根据本发明另一个实施例的图像匹配方法的流程示意图;4 is a flow chart showing an image matching method according to another embodiment of the present invention;
图5示出了根据本发明另一个实施例的图像匹配方法的流程示意图;FIG. 5 is a flow chart showing an image matching method according to another embodiment of the present invention; FIG.
图6示出了根据本发明一个实施例的图像匹配装置的一种结构示意图;FIG. 6 is a block diagram showing the structure of an image matching apparatus according to an embodiment of the present invention; FIG.
图7示出了根据本发明一个实施例的图像匹配装置的另一种结构示意图;FIG. 7 is a block diagram showing another structure of an image matching apparatus according to an embodiment of the present invention; FIG.
图8示出了根据本发明另一个实施例的图像匹配装置的结构示意图;FIG. 8 is a block diagram showing the structure of an image matching apparatus according to another embodiment of the present invention; FIG.
图9示出了根据本发明另一个实施例的图像匹配装置的结构示意图;FIG. 9 is a block diagram showing the structure of an image matching apparatus according to another embodiment of the present invention; FIG.
图10示意性地示出了用于执行根据本发明的图像匹配方法的计算设备的框图;以及Figure 10 is a schematic block diagram showing a computing device for performing an image matching method in accordance with the present invention;
图11示意性地示出了用于保持或者携带实现根据本发明的图像匹配方法的程序代码的存储单元。Fig. 11 schematically shows a storage unit for holding or carrying program code implementing the image matching method according to the present invention.
具体实施方式detailed description
下面结合附图和具体的实施方式对本发明作进一步的描述。The invention is further described below in conjunction with the drawings and specific embodiments.
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While the embodiments of the present invention have been shown in the drawings, the embodiments Rather, these embodiments are provided so that this disclosure will be more fully understood and the scope of the disclosure will be fully disclosed.
为解决上述技术问题,本发明实施例提供了一种图像匹配方法,该方法应用于服务器。图1示出了根据本发明一个实施例的图像匹配方法的流程示意图,参见图1,该方法至少包括步骤S102至步骤S110。To solve the above technical problem, an embodiment of the present invention provides an image matching method, which is applied to a server. FIG. 1 is a schematic flow chart of an image matching method according to an embodiment of the present invention. Referring to FIG. 1, the method includes at least steps S102 to S110.
步骤S102、接收来自客户端的图像匹配请求,其中,所述图像匹配请求中携带所述客户端的密钥信息;Step S102: Receive an image matching request from a client, where the image matching request carries key information of the client.
步骤S104、根据预设规则对所述密钥信息进行计算,以得到第一关键字key;Step S104: Perform calculation on the key information according to a preset rule to obtain a first keyword key;
步骤S106、在数据库中存储的以不同key为索引的队列中匹配出与所述第一key对应的队列,其中,各队列中存储有来自不同客户端的、但具备同一key的各图像的图像识别文案;Step S106: Matching queues corresponding to the first key in the queues indexed by different keys stored in the database, wherein each queue stores image recognition of images from different clients but having the same key Copywriting
步骤S108、读取匹配到的队列中的图像识别文案,并根据预设匹配逻辑对各图像识别文案进行匹配,得到图像匹配结果,并基于图像匹配结果相应得到本客户端与其他客户端的匹配结果。Step S108: Read the image recognition copy in the matched queue, and match each image recognition copy according to the preset matching logic to obtain an image matching result, and obtain a matching result between the client and other clients according to the image matching result. .
在本发明实施例中,数据库中预先存储有多个队列,各队列以key为索引,每个队列 中存储有来自不同客户端的、但具备同一key的各图像的图像识别文案,即,数据库对客户端请求识别的图像进行了分组存储,将具备同一key的存储进同一队列,为后续的匹配操作提供了数据基础。进一步,若接收来自客户端的图像匹配请求,则对匹配请求中所携带的密钥信息进行计算,得到第一key,进而将第一key与数据库中各队列进行匹配,查找到与第一key对应的队列,即以第一key为索引的队列,就可以获得以第一key为索引的队列中的各图像识别文案。随后,读取以第一key为索引的队列中的各图像识别文案,并根据预设匹配逻辑对各图像识别文案进行匹配,得到图像匹配结果。由于,并图像识别文案是由来自不同客户端,因此,基于图像匹配结果相应得到本客户端与其他客户端的匹配结果。匹配结果可以体现出分别来自不同客户端的各个图像之间存在的关系,不仅增加了不同客户端之间的互动方式,还提高了客户端的社交性和趣味性。此外,对于使用该客户端的用户来说,不仅可以增加不同用户所拥有的各图像之间的交互,还可以增进不同用户之间的沟通和交流。另外,匹配请求中携带密钥信息,将密钥信息作为匹配队列的关键信息,使得匹配操作能够限于来自不同客户端的、但具备同一key的各图像的图像识别文案,保证了其他客户端发送至服务器的图像的安全性,使得用户的私人信息不会被轻易的泄露。In the embodiment of the present invention, a plurality of queues are pre-stored in the database, and each queue is indexed by a key. Each queue stores image recognition files of images from different clients but having the same key, that is, database pairs. The images identified by the client request are stored in groups, and the same key is stored in the same queue, which provides a data foundation for subsequent matching operations. Further, if the image matching request from the client is received, the key information carried in the matching request is calculated, and the first key is obtained, and then the first key is matched with each queue in the database, and the first key is matched. The queue, that is, the queue indexed by the first key, can obtain each image recognition copy in the queue indexed by the first key. Then, each image recognition copy in the queue indexed by the first key is read, and each image recognition copy is matched according to a preset matching logic to obtain an image matching result. Because, and the image recognition copy is from different clients, the matching result between the client and other clients is obtained based on the image matching result. The matching result can reflect the relationship between the images from different clients, which not only increases the interaction between different clients, but also improves the sociality and fun of the client. In addition, for users who use the client, not only can the interaction between images owned by different users be increased, but also communication and communication between different users can be enhanced. In addition, the matching request carries the key information, and the key information is used as the key information of the matching queue, so that the matching operation can be limited to the image recognition copy of each image from different clients but having the same key, and the other clients are guaranteed to send to The security of the image of the server makes the user's private information not easily leaked.
需要说明的是,队列中的图像识别文案是由服务器提前识别各客户端上传的图像,并得到相应的图像识别请求。具体的,图2示出了根据本发明一个实施例的队列中图像识别文案的生成方法的处理流程图。参见图2,该方法至少包括步骤S202至步骤S208:It should be noted that the image recognition copy in the queue is that the server recognizes the image uploaded by each client in advance, and obtains a corresponding image recognition request. Specifically, FIG. 2 shows a process flow diagram of a method for generating an image recognition copy in a queue according to an embodiment of the present invention. Referring to FIG. 2, the method includes at least steps S202 to S208:
步骤S202、接收来自客户端的图像识别请求,其中,所述图像识别请求中携带有待识别图像以及由本客户端提供的密钥信息;Step S202: Receive an image recognition request from a client, where the image recognition request carries an image to be identified and key information provided by the client.
步骤S204、对所述图像识别请求中携带的图像进行图像识别,得到图像识别结果;Step S204: Perform image recognition on the image carried in the image recognition request to obtain an image recognition result.
步骤S206、根据所述预设规则对本次图像识别的密钥信息进行计算,得到对应key;Step S206, calculating key information of the current image identification according to the preset rule, to obtain a corresponding key;
步骤S208、为该key在所述数据库中建立以该key为索引的队列,并将图像识别文案放置入本队列中。Step S208, establishing a queue indexed by the key in the database for the key, and placing the image recognition copy into the queue.
在客户端已上传图像之后,客户端可以发起上文步骤S102所提及的图像匹配请求,查找与本客户端相匹配的其他客户端。在本发明一实施例中,当接收来自客户端的图像匹配请求之后,还可以从接收到匹配请求的时刻为起点开始计时,从而得到匹配过程的计时时长。由于不同图像内容的复杂程度不同,若图像内容较为复杂,则需要花费较多图像识别以及图像匹配时间。另外,在图像的传送过程中还可能存在文件丢失、或者网络中断等突发情况,此时可以通过对匹配过程进行计时,可以对图像匹配过程所花费的时间进行有效地把控,并针对不同的计时时长采取相应的解决办法,从而提高图像匹配的匹配效率。After the client has uploaded the image, the client may initiate the image matching request mentioned in step S102 above to find other clients that match the client. In an embodiment of the present invention, after receiving the image matching request from the client, the timing may be started from the time when the matching request is received, thereby obtaining the timing of the matching process. Due to the complexity of different image content, if the image content is more complicated, it takes more image recognition and image matching time. In addition, in the process of image transmission, there may be unexpected situations such as file loss or network interruption. At this time, the time of the image matching process can be effectively controlled by timing the matching process, and differently The timing of the time takes a corresponding solution to improve the matching efficiency of image matching.
具体地,在根据第一key到以第一key为索引的队列中读取各图像识别文案之前,可以先判断从匹配请求的时刻开始的计时时长是否超过本次匹配的额定时长,若是,则中止本次匹配操作,若否,则执行各图像识别文案的读取操作。在该实施例中,本次匹配的额定时长可以进行预先设定,例如设定额定时长为2秒,若从接收到匹配请求时刻开始超过2秒,则中止本次匹配操作,若从接收到匹配请求时刻开始未超过2秒,则根据第一key到以第一key为索引的队列中读取各图像识别文案。若超时则直接中止本次匹配操作,并发送匹配不成功的错误码至客户端,告知客户端本次匹配操作已结束。Specifically, before reading each image recognition copy in the queue according to the first key to the first key index, it may be determined whether the time duration from the time of the matching request exceeds the rated duration of the current match, and if so, The matching operation is suspended, and if not, the reading operation of each image recognition copy is performed. In this embodiment, the rated duration of the current matching may be preset, for example, the rated duration is 2 seconds, and if the matching request request is received for more than 2 seconds, the matching operation is suspended, if received from the receiving When the matching request time starts no more than 2 seconds, each image recognition copy is read according to the first key to the queue indexed by the first key. If the timeout expires, the matching operation is directly suspended, and an unsuccessful error code is sent to the client to inform the client that the matching operation has ended.
继续参见上文步骤S108,在本发明一实施例中,为了保证从队列中读取到的内容有效且完整、能够完成后续的匹配操作,还可以在从队列中读取图像识别文案时,对队列中的图 像识别文案进行计数,得到计数结果,并对计数结果进行相应的判断。若计数结果为大于等于2,证明队列中已存储了至少2个图像识别文案,能够进行图像识别文案的匹配操作,那么本例则继续执行各图像识别方案的匹配步骤,若计数结果小于2,证明队列中可能出现只存储了1个图像识别文案的情况,甚至队列中可能并未存储任何图像识别文案,无法进行匹配操作,但是此时又尚未超出本次匹配的额定时长,仍处于有效的匹配时间内,那么此时本例可以间隔指定时间再次读取队列中的图像识别文案。队列中出现小于2的图像识别文案,可能因服务器尚未完成其他图像的识别操作,也可能是图像识别文案在存储的过程中因超出队列存储时长被删除,还可能是数据丢失等原因。Continuing to refer to step S108 above, in an embodiment of the present invention, in order to ensure that the content read from the queue is valid and complete, and the subsequent matching operation can be completed, when the image recognition copy is read from the queue, The image recognition copy in the queue is counted, the counting result is obtained, and the counting result is judged correspondingly. If the counting result is greater than or equal to 2, at least 2 image recognition files have been stored in the verification queue, and the image recognition copy matching operation can be performed. Then, in this example, the matching step of each image recognition scheme is continued, and if the counting result is less than 2, It may be found that only one image recognition copy may be stored in the queue, and even no image recognition copy may be stored in the queue, and the matching operation cannot be performed, but at this time, the rated duration of the match is not exceeded yet, and it is still valid. During the matching time, then in this case, the image recognition copy in the queue can be read again at a specified time interval. An image recognition file of less than 2 appears in the queue, which may be because the server has not completed the recognition operation of other images, or the image recognition copy may be deleted during the storage process due to exceeding the queue storage time, or may be data loss.
在该实施例中,间隔时间可以设定为间隔1ms,当然,还可以设定其他的间隔时间如0.9ms、1.5ms等,具体间隔时间的数值可以根据实际情况进行设定,本发明实施例对此不做限定。In this embodiment, the interval time may be set to an interval of 1 ms. Of course, other interval times may be set, such as 0.9 ms, 1.5 ms, etc., and the value of the specific interval time may be set according to actual conditions, in the embodiment of the present invention. There is no limit to this.
参见上文步骤S108,在本发明一实施例中,对各图像识别文案进行匹配,其匹配过程具体可以是,首先,对各图像识别文案分别进行加权计算,以得到各图像识别文案的加权值。然后,比较各图像识别文案的加权值,得到图像匹配结果,进而以图像匹配结果作为本客户端与其他客户端的匹配结果。Referring to step S108 above, in an embodiment of the present invention, each image recognition copy is matched, and the matching process may be: first, performing weighting calculation on each image recognition copy to obtain a weight value of each image recognition copy. . Then, the weighted values of each image recognition copy are compared to obtain an image matching result, and the image matching result is used as a matching result between the client and other clients.
在该实施例中,若各图像包括多条主线,服务器需要先行对各个图像的主线条进行绘制,下面对图像主线条的绘制过程进行具体介绍。In this embodiment, if each image includes a plurality of main lines, the server needs to first draw the main lines of each image, and the following describes the drawing process of the main lines of the image.
首先,可以采用边缘检测算法检测出图像中各线条的边缘,得到边缘检测算法的检测结果图。例如,可以采用Canny算子对图像进行边缘检测,Canny算子检测边缘的实质是求信号函数的极大值问题来判定图像边缘像素点。First, the edge detection algorithm can be used to detect the edge of each line in the image, and the detection result of the edge detection algorithm is obtained. For example, the Canny operator can be used to detect the edge of the image. The essence of the Canny operator to detect the edge is to determine the maximum value of the signal function to determine the pixel edge of the image.
进而,对根据边缘检测算法获得的检测结果图进行线条的自适应轮廓提取操作,获取各线条的线条轮廓。在自适应轮廓提取操作要求输出一个二值化图像,即只有黑、白两个灰度的图像,一个灰度表示边缘,另一个灰度表示背景,通过对边缘信息做更深层次的处理,可以使线条轮廓更加清晰。Further, an adaptive contour extraction operation of the line is performed on the detection result map obtained according to the edge detection algorithm, and the line outline of each line is obtained. In the adaptive contour extraction operation, it is required to output a binarized image, that is, only two images of black and white, one gray represents the edge, and the other gray represents the background, and the deeper processing of the edge information can be performed. Make the outline of the line clearer.
在初步获取到的线条轮廓之后,可能还会存在一些带有杂纹干扰的轮廓。为了进一步获得完整、清晰的主线条轮廓,还可以对获取的各线条的线条轮廓进行筛选处理,从而得到满足主线条标准的线条轮廓。After the initial outline of the line, there may be some contours with stray interference. In order to further obtain a complete and clear outline of the main line, it is also possible to filter the line outlines of the acquired lines to obtain a line outline that satisfies the main line standard.
其中,在对获取的各线条的线条轮廓进行筛选处理时,可以计算各线条轮廓的像素点的数值。确定出各线条轮廓的像素点的数值之后,将其中像素点个数小于N的线条轮廓删除。在本发明实施例中,N取值为20。因此,此时获得的图像中各线条轮廓的像素点的数值都不小于20。经过上述步骤之后,若各线条轮廓的像素点的数值在图像的总像素点的比值高于设定比值,则调整边缘检测算法,并利用新的边缘检测算法重新检测图像中各线条的边缘,直至得到满足主线条标准的线条轮廓。在本发明实施例中,取设定比值为3%。也就是说,在各线条轮廓的像素点的数值在图像的总像素点的比值高于3%时,则调整边缘检测算法,并利用新的边缘检测算法重新检测图像中各线条的边缘,直至得到满足主线条标准的线条轮廓。需要说明的是,N取值为20、设定比值取值3%,仅为本发明实施例的例举,该实施例对其不做具体限定,N和设定比值的具体数值由具体情况而定,例如,N也可能为30,也可能为40,设定比值也可能为4%,也可能为5%。Wherein, when the line contours of the acquired lines are filtered, the values of the pixel points of each line contour can be calculated. After determining the value of the pixel point of each line outline, the line outline in which the number of pixel points is less than N is deleted. In the embodiment of the present invention, N takes a value of 20. Therefore, the value of the pixel point of each line outline in the image obtained at this time is not less than 20. After the above steps, if the ratio of the pixel points of each line contour to the total pixel point of the image is higher than the set ratio, the edge detection algorithm is adjusted, and the edge of each line in the image is re-detected by the new edge detection algorithm. Until you get a line outline that meets the main line criteria. In the embodiment of the present invention, the set ratio is 3%. That is to say, when the value of the pixel point of each line outline is higher than 3% of the total pixel point of the image, the edge detection algorithm is adjusted, and the edge of each line in the image is re-detected by using a new edge detection algorithm until Get the line outline that meets the main line standard. It should be noted that the value of N is 20, and the value of the set ratio is 3%, which is only an example of the embodiment of the present invention. The embodiment does not specifically limit the specific value of N and the set ratio by specific circumstances. For example, N may be 30 or 40, and the set ratio may be 4% or 5%.
最后,根据筛选得到的线条轮廓确定出主线条所在的区域,进而将该区域中的线条轮 廓合并绘制出对应的主线条。Finally, the contour of the line is determined according to the selected contour of the line, and then the contour of the line in the area is merged to draw the corresponding main line.
采用上述主线条的绘制方法,主要基于图像通常由主线条提供足够充分的信息这一原理,对较为复杂的各种图像进行分析处理,将其主线条提取出来,使得图像所包含内容变得简单化、清晰化、明显化,使得图像信息量能够得到较好的提取,避免因图像本身模糊所导致的图像中的重要信息被忽略。The drawing method of the above main line is mainly based on the principle that the image is usually provided with sufficient information by the main line, and the more complicated various images are analyzed and processed, and the main lines are extracted to make the content of the image simple. It is clear, clear, and obvious, so that the amount of image information can be better extracted, and the important information in the image caused by the blurring of the image itself is avoided.
在绘制出各图像的主线条之后,可以先为各条主线条的文案信息单独设置权值以及权值比例,然后根据各条主线的权值以及权值比例分别对各图像识别文案进行加权计算,进而得到各图像识别文案的总加权值。After drawing the main lines of each image, you can separately set the weights and weight ratios for the copy information of each main line, and then weight the image recognition files according to the weights and weight ratios of each main line. And further, the total weighting value of each image recognition copy is obtained.
下面以一个具体实施例对图像识别文案的加权计算过程进行介绍,该实施例中,图像识别文案是与花朵有关的图像识别文案,本例中本客户端提供的是玫瑰花图像,其他客户端提供的是百合花图像和月季花图像,且三个客户端均使用同一密钥信息1234。In the following, a weighting calculation process of an image recognition copy is introduced in a specific embodiment. In this embodiment, the image recognition copy is an image recognition copy related to a flower. In this example, the client provides a rose image, and other clients. Lily images and rose flower images are provided, and the same key information 1234 is used by all three clients.
例如,由于不同的花朵其整体轮廓和花蕊各不相同,并能够明确地体现出花朵的特征,因此,可以以花朵的轮廓和花蕊的长度分别作为一条主线。For example, since different flowers have different overall contours and stamens and can clearly express the characteristics of the flowers, the outlines of the flowers and the length of the stamen can be used as a main line.
在服务器分别识别得到玫瑰花的图像识别文案、百合花的图像识别文案和玫瑰花的图像识别文案之后,将这三个图像识别文案放入同一队列,该队列的索引为对密钥信息1234进行计算后得到的key=01。After the server respectively recognizes the image recognition copy of the rose, the image recognition copy of the lily, and the image recognition copy of the rose, the three image recognition files are placed in the same queue, and the index of the queue is the key information 1234. The calculated key = 01.
随后,接收到本客户端发起的匹配请求时,服务器从key=01的队列中读取玫瑰花的图像识别文案、百合花的图像识别文案和玫瑰花的图像识别文案,并设置各个花朵的轮廓和花蕊长度的权值比例分别为60%和40%。Then, upon receiving the matching request initiated by the client, the server reads the image recognition copy of the rose, the image recognition copy of the lily, and the image recognition copy of the rose from the queue of key=01, and sets the outline of each flower. The weight ratios of the length of the flower and the length of the stamen are 60% and 40%, respectively.
首先,对玫瑰花的图像识别文案和百合花的图像识别文案进行匹配。在百合花图像的文案信息中分别设置花朵的轮廓和花蕊长度的权值分别为70和30,计算得到百合花图像识别文案的总加权值S1=70*60%+30*40%=54。在玫瑰花图像的文案信息中分别设置花朵的轮廓和花蕊长度的权值分别为40和10,计算得到玫瑰花图像识别文案的总加权值S2=40*60%+10*40%=28。比较总加权值S1和总加权值S2可以得到,两者之间的总加权值54和28之间的差值较大,即百合花图像和玫瑰花图像的差别较大。First, the image recognition copy of the rose and the image recognition copy of the lily are matched. In the copy information of the lily image, the weights of the outline of the flower and the length of the stamen are respectively set to 70 and 30, and the total weighted value of the lily image recognition copy is calculated as S1=70*60%+30*40%=54. In the copy information of the rose image, the weights of the outline of the flower and the length of the stamen are respectively set to 40 and 10, and the total weighted value of the rose image recognition copy is calculated as S2=40*60%+10*40%=28. Comparing the total weighting value S1 and the total weighting value S2 can be obtained, and the difference between the total weighting values 54 and 28 between the two is large, that is, the difference between the lily image and the rose image is large.
另外,结合现实生活情况,百合花和玫瑰花两者之间的确存在较大的差别。百合花的花瓣呈长条形、花朵整体有一层花瓣。而玫瑰花的花瓣近似于圆形,花朵整体有多层花瓣。处于开放状态的百合花的花蕊较为明显,且百合花的花蕊长度较长,而处于开放状态的玫瑰花的花蕊被包围在层层花瓣中,并不明显,且玫瑰花的花蕊长度较短。In addition, combined with real life, there is indeed a big difference between lily and rose. The petals of the lily are long and the petals have a layer of petals. The petals of the rose are similar to a circle, and the flower has multiple layers of petals. The lily of the open lily is more pronounced, and the length of the lily is longer, while the flower of the open rose is surrounded by the petals of the layer, which is not obvious, and the length of the rose is shorter.
其次,对玫瑰花的图像识别文案和月季花的图像识别文案进行匹配。在月季花图像的文案信息中分别设置花朵的轮廓和花蕊长度的权值分别为30和20,计算得到月季花图像识别文案的总加权值S2=30*60%+20*40%=26。在玫瑰花图像的文案信息中分别设置花朵的轮廓和花蕊长度的权值分别为40和10,计算得到玫瑰花图像识别文案的总加权值S2=40*60%+10*40%=28。比较总加权值S2和总加权值S3可以得到,两者之间的总加权值28和26之间的差值较小。因此,月季花图像和玫瑰花图像的差别不大。Secondly, the image recognition copy of the rose and the image recognition copy of the rose flower are matched. In the copy information of the rose flower image, the weights of the outline of the flower and the length of the stamen are respectively set to 30 and 20, and the total weighted value of the rosette image recognition copy is calculated as S2=30*60%+20*40%=26. In the copy information of the rose image, the weights of the outline of the flower and the length of the stamen are respectively set to 40 and 10, and the total weighted value of the rose image recognition copy is calculated as S2=40*60%+10*40%=28. Comparing the total weighting value S2 with the total weighting value S3 can be obtained, and the difference between the total weighting values 28 and 26 between the two is small. Therefore, there is little difference between the rose flower image and the rose image.
在得到图像匹配结果之后,步骤S108还提及可以基于图像匹配结果相应得到本客户端与其他客户端的匹配结果。为保证客户端与图像能够对应识别,具体地,本发明实施例提供的队列中还存储有上传图像以获取图像识别文案的客户端ID,并将客户端ID与其上传的图像的图像识别文案对应存储。当得到图像匹配结果时,根据参与本次匹配操作的各图像识 别文案反向查找到对应的客户端ID,进而确认该客户端ID对应的客户端。由此可以将图像识别文案和客户端间形成对应关系,进而使得图像匹配结果能够体现客户端间的匹配结果,因此,可以将图像匹配结果显示为本客户端与确认的其他客户端间的匹配结果。After obtaining the image matching result, step S108 also mentions that the matching result of the client and other clients can be obtained correspondingly based on the image matching result. In order to ensure that the client and the image can be correspondingly identified, in particular, the queue provided by the embodiment of the present invention further stores an uploaded image to obtain a client ID of the image recognition copy, and correspondingly matches the client ID with the image recognition copy of the uploaded image. storage. When the image matching result is obtained, the corresponding client ID is reversely searched according to each image recognition copy participating in the matching operation, and then the client corresponding to the client ID is confirmed. Therefore, the image recognition copy and the client can be correspondingly formed, so that the image matching result can reflect the matching result between the clients. Therefore, the image matching result can be displayed as a match between the client and other confirmed clients. result.
前文提及,队列中可能存在大于2以上的图像识别文案,那么本客户端与其他客户端间就必须存在两种以上的匹配结果,此时,为完善数据统计结果,增加客户端的社交性,可以根据本客户端与其他客户端的匹配结果,从中选择与本客户端匹配程度最高的另一客户端,将选择的另一客户端以及对应的匹配结果返回至本客户端。As mentioned above, there may be more than 2 image recognition files in the queue. Therefore, there must be more than two matching results between the client and other clients. In this case, to improve the statistics of the data, increase the sociality of the client. According to the matching result of the client and other clients, another client matching the client with the highest degree can be selected, and the selected other client and the corresponding matching result are returned to the client.
本发明实施例提供了另一种图像匹配方法,该方法应用于服务器。图3示出了根据本发明一个实施例的图像匹配方法的流程示意图,参见图3,该方法至少包括步骤S302至步骤S310。Embodiments of the present invention provide another image matching method, which is applied to a server. FIG. 3 is a schematic flowchart diagram of an image matching method according to an embodiment of the present invention. Referring to FIG. 3, the method includes at least steps S302 to S310.
步骤S302,接收来自第一客户端的、携带第一图像和密钥信息的第一图像识别请求,对第一图像进行识别,得到第一图像识别文案。Step S302: Receive a first image recognition request from the first client that carries the first image and the key information, and identify the first image to obtain a first image recognition copy.
在该步骤中,密钥信息可以为用户输入的密码,该密码的组成形式、密码长度等都可以由用户进行设定。例如,密钥信息可以为“1234”等数字密码、也可以为“abcd”等字母密码,还可以为任意字符组合成的密码,本发明实施例对密钥信息的具体形式不做限定。In this step, the key information may be a password input by the user, and the composition form of the password, the length of the password, and the like may be set by the user. For example, the key information may be a digital password such as "1234", or an alphanuclear password such as "abcd", or a combination of any characters. The specific form of the key information is not limited in the embodiment of the present invention.
步骤S304,接收来自第二客户端的、携带第二图像和密钥信息的第二图像识别请求,对第二图像进行识别,得到第二图像识别文案。Step S304, receiving a second image recognition request from the second client that carries the second image and the key information, and identifying the second image to obtain a second image recognition copy.
在该步骤中,只有第二客户端发送的密钥信息和上文步骤S302中第一客户端发送的密钥信息一致,在后续的步骤中,服务器才可以将接收到的第一客户端发送的第一图像和第二客户端发送的第二图像在识别结束后放入相同的存储空间内,以供后续匹配处理。In this step, only the key information sent by the second client is consistent with the key information sent by the first client in step S302. In the subsequent step, the server can send the received first client. The first image and the second image sent by the second client are placed in the same storage space after the end of the identification for subsequent matching processing.
步骤S306,根据预设规则对密钥信息进行计算,得到关键字key,并建立以key为索引的队列,将第一图像识别文案与第二图像识别文案放入队列中存储。Step S306: Calculate the key information according to the preset rule, obtain a keyword key, and establish a queue indexed by the key, and store the first image recognition copy and the second image recognition copy in a queue.
在该步骤中,关键字key是由预设规则对密钥信息进行计算得到的相应的计算结果,例如,关键字key可以为计算得到的由“0”、“1”组成的机器码,也可以为一串随机数,还可以为其他任何组成形式的字符串,本发明实施例对计算结果的形式不做具体限定。关键字key的作用主要是对服务器建立的队列进行相关的索引,在队列中该关键字key可以对应一个密钥信息相关的两个图像识别文案。In this step, the keyword key is a corresponding calculation result obtained by calculating the key information by a preset rule. For example, the keyword key may be a calculated machine code composed of “0” and “1”, and also It can be a string of random numbers, and can also be any other form of string. The embodiment of the present invention does not specifically limit the form of the calculation result. The function of the keyword key is mainly to perform related indexing on the queue established by the server. In the queue, the keyword key can correspond to two image recognition files related to one key information.
另外,该步骤中提及的队列可以是表格的形式,关键字key可以对应表格中的一行内容、一列内容或者是某一个单元格中的内容,根据该关键字key就可以查找到表格中指定的内容,即在关键字key和队列之间建立了索引关系。而队列的存储内容可以设置为具备时效性的,若超过一次的时长,则可以从队列中删除,以保证信息的及时性和有效性。在该实施例中,队列可以保存在指定数据库中,且数据库中可以同时保存多个队列。In addition, the queue mentioned in the step may be in the form of a table, and the keyword key may correspond to a line of content in the table, a column of content, or content in a certain cell, and according to the keyword key, the specified in the table may be found. The content, that is, the index relationship is established between the keyword key and the queue. The storage content of the queue can be set to be time-sensitive. If it is longer than one time, it can be deleted from the queue to ensure the timeliness and validity of the information. In this embodiment, the queue can be kept in the specified database, and multiple queues can be saved in the database at the same time.
步骤S308,当接收到第一客户端与第二客户端的匹配请求时,根据key到队列中读取第一图像识别文案和第二图像识别文案。Step S308, when receiving the matching request of the first client and the second client, reading the first image recognition copy and the second image recognition copy according to the key to the queue.
在该步骤中,当服务器接收到第一客户端和第二客户端中任意一个客户端发出的匹配请求时,可以根据匹配请求获取到关键字key,进而利用关键字key从队列中索引出之前保存在队列中的、与该关键字key相对应的第一图像识别文案和第二图像识别文案。In this step, when the server receives the matching request sent by any one of the first client and the second client, the server may obtain the keyword key according to the matching request, and then use the keyword key to index from the queue. The first image recognition copy and the second image recognition copy corresponding to the keyword key are saved in the queue.
步骤S310,对第一图像识别文案和第二图像识别文案进行匹配,以得到第一客户端与第二客户端的匹配结果。Step S310, matching the first image recognition copy and the second image recognition copy to obtain a matching result between the first client and the second client.
在本发明实施例中,服务器分别接收来自第一客户端和第二客户端中的图像相关信息(包括图像和密钥信息),从而可以依据来自不同客户端的图像相关信息分别生成两个图像识别文案。并且,服务器还可以根据预设规则对接收到的密钥信息进行计算,以得到关键字key,同时,利用该关键字key建立以key为索引的队列,并将两个图像识别文案放入队列中存储。在服务器接收到第一客户端、第二客户端的匹配请求时,根据关键字key到队列中读取相应的两个图像识别文案,进而对读取到的两个图像识别文案进行匹配,以得到相应的匹配结果。匹配结果可以体现出分别来自第一客户端和第二客户端的各个图像之间存在的关系,不仅增加了不同客户端之间的互动方式,还提高了客户端的社交性和趣味性。此外,对于使用该客户端的用户来说,不仅可以增加不同用户所拥有的各图像之间的交互,还可以增进不同用户之间的沟通和交流。In the embodiment of the present invention, the server respectively receives image related information (including image and key information) from the first client and the second client, so that two image recognitions can be separately generated according to image related information from different clients. Copywriting. Moreover, the server may further calculate the received key information according to a preset rule to obtain a keyword key, and at the same time, use the keyword key to establish a key-indexed queue, and put two image recognition files into the queue. In storage. When the server receives the matching request of the first client and the second client, the corresponding two image recognition files are read according to the keyword key to the queue, and then the read two image recognition files are matched to obtain Corresponding matching results. The matching result can reflect the relationship between the images from the first client and the second client respectively, which not only increases the interaction between different clients, but also improves the sociality and interest of the client. In addition, for users who use the client, not only can the interaction between images owned by different users be increased, but also communication and communication between different users can be enhanced.
进一步地,服务器通过分别接收第一客户端的用户和第二客户端的用户输入的密钥信息,从而可以保证服务器接收到的第一图像和第二图像不会别被恶意的窃取,保证了客户端发送至服务器的图像的安全性,使得用户的私人信息不会被轻易的泄露。Further, the server receives the key information input by the user of the first client and the user of the second client, respectively, so that the first image and the second image received by the server are not maliciously stolen, thereby ensuring the client. The security of the image sent to the server, so that the user's private information will not be easily leaked.
本发明实施例还提供了一种读取图像识别文案的方法,该方法用于从预先保存有图像识别文案的队列中读取相应的图像识别文案。参见图4,该方法至少可以包括步骤S402至步骤S410。The embodiment of the invention further provides a method for reading an image recognition copy, which is used for reading a corresponding image recognition copy from a queue in which an image recognition copy is pre-stored. Referring to FIG. 4, the method may at least include steps S402 to S410.
步骤S402,接收第一客户端和/或第二客户端的匹配请求。Step S402, receiving a matching request of the first client and/or the second client.
该步骤中,匹配请求中携带有密钥信息,该密钥信息的具体形式请参见上文实施例。该密钥信息可以由第一客户端和/或第二客户端的用户输入。In this step, the matching request carries the key information. For the specific form of the key information, refer to the foregoing embodiment. The key information can be entered by a user of the first client and/or the second client.
步骤S404,解析匹配请求得到其中携带的密钥信息。Step S404, parsing the matching request to obtain the key information carried therein.
步骤S406,根据预设规则对密钥信息进行计算,得到该密钥信息对应的key。Step S406: Calculate the key information according to the preset rule, and obtain a key corresponding to the key information.
该步骤中,通过对密钥信息按照指定的预设规则进行计算,可以得到与该密钥信息相对应的关键字key,该关键字key用于从队列中索引出相应的图像识别文案。In this step, by calculating the key information according to the specified preset rule, a keyword key corresponding to the key information can be obtained, and the keyword key is used to index the corresponding image recognition copy from the queue.
步骤S408,以该密钥信息对应的key与数据库中各队列进行匹配,查找到匹配的、以该key为索引的队列。In step S408, the key corresponding to the key information is matched with each queue in the database, and a matching queue indexed by the key is found.
由于队列中已经建立了关键字key和队列中的指定内容之间的索引关系,因此,通过利用步骤S406中计算得到的关键字key与数据库中的各个队列中的关键字key进行匹配,当匹配到一致的关键字key时,可以查找到匹配一致的、以该key为索引的队列,进而从该队列中依据保存的索引关系查找到相应的队列中的图像识别文案。Since the index relationship between the keyword key and the specified content in the queue has been established in the queue, the matching is performed by using the keyword key calculated in step S406 and the keyword key in each queue in the database. When the keyword key is matched, the matching queue with the key index can be found, and the image recognition copy in the corresponding queue is found from the queue according to the saved index relationship.
步骤S410,到队列中读取第一图像识别文案和第二图像识别文案。Step S410, reading the first image recognition copy and the second image recognition copy into the queue.
通过利用用户输入的密钥信息,从而可以保证服务器接收到的第一图像和第二图像不会别被恶意的窃取,保证了客户端发送至服务器的图像的安全性,使得用户的私人信息不会被轻易的泄露。By utilizing the key information input by the user, it can be ensured that the first image and the second image received by the server are not maliciously stolen, thereby ensuring the security of the image sent by the client to the server, so that the private information of the user is not Will be easily leaked.
为了更加清楚地体现本发明实施例的方案,现以一个具体实施例对本发明的图像匹配的方法进行介绍,该方法至少包括步骤S502至步骤S522。In order to more clearly illustrate the solution of the embodiment of the present invention, the method for image matching of the present invention is introduced in a specific embodiment, and the method includes at least steps S502 to S522.
首先,执行步骤S502,接收来自第一客户端的、携带第一图像和密钥信息的第一图像识别请求,并调用图像处理引擎对第一图像进行识别,得到第一图像识别文案。First, step S502 is performed to receive a first image recognition request from the first client that carries the first image and the key information, and call the image processing engine to identify the first image to obtain a first image recognition copy.
然后,执行步骤S504,接收来自第二客户端的、携带第二图像和密钥信息的第二图像识别请求,并调用图像处理引擎对第二图像进行识别,得到第二图像识别文案。在得到第一 图像识别文案和第二图像识别文案之后,执行步骤S506。Then, step S504 is executed to receive a second image recognition request from the second client carrying the second image and the key information, and call the image processing engine to identify the second image to obtain a second image recognition copy. After the first image recognition copy and the second image recognition copy are obtained, step S506 is performed.
步骤S506,根据预设规则对密钥信息进行计算,得到关键字key,并建立以key为索引的队列,将第一图像识别文案与第二图像识别文案放入队列中存储,之后执行步骤S508。Step S506: Calculate the key information according to the preset rule, obtain a keyword key, and establish a queue indexed by the key, and store the first image recognition copy and the second image recognition copy in a queue, and then perform step S508. .
在步骤S506中,还可以设定第一图像识别文案和第二图像识别文案的文案过期时间,通过监测一图像识别文案和第二图像识别文案在队列中存储的时间,对图像识别文案进行相应的处理。具体地,若第一图像识别文案和第二图像识别文案在队列中存储的时间超过设定的文案过期时间,那么该第一图像识别文案和第二图像识别文案则自动失效。例如,设定文案过期时间为2天,若图像识别文案在队列中存储的时间超过2天,那么服务器可以自动将过期的图像识别文案删除,或者还可以将过期的图像识别文案标识为不可用状态。当然还可以对图像识别文案进行其他处理,本发明实施例对此不做具体限定。In step S506, the file expiration time of the first image recognition copy and the second image recognition copy may also be set, and the image recognition copy is correspondingly performed by monitoring the time stored in the queue by the image recognition copy and the second image recognition copy. Processing. Specifically, if the first image recognition copy and the second image recognition copy are stored in the queue for more than a set copy time, the first image recognition copy and the second image recognition copy are automatically invalidated. For example, if the file expiration time is set to 2 days, if the image recognition copy is stored in the queue for more than 2 days, the server can automatically delete the expired image recognition copy, or can also identify the expired image recognition copy as unavailable. status. Of course, the image recognition copy may be subjected to other processing, which is not specifically limited in the embodiment of the present invention.
步骤S508,当接收到第一客户端与第二客户端的匹配请求时,以匹配请求的接收时刻为起点开始计时,得到匹配过程的计时时长,继而执行步骤S510。Step S508, when receiving the matching request of the first client and the second client, starting timing with the receiving time of the matching request as a starting point, obtaining the time duration of the matching process, and then performing step S510.
步骤S510,判断计时时长是否超过本次匹配的额定时长。若是,则执行步骤S522,结束本次匹配,若否,则执行步骤S512,对队列中的图像识别文案进行计数,得到计数结果。得到计数结果之后,继而执行步骤S514。In step S510, it is determined whether the timing duration exceeds the rated duration of the current match. If yes, step S522 is executed to end the current matching. If no, step S512 is executed to count the image recognition copy in the queue to obtain a counting result. After the counting result is obtained, step S514 is performed.
步骤S514,判断计数结果是否为2。若是,则执行步骤S516,若否,则执行步骤S518。In step S514, it is determined whether the counting result is 2. If yes, go to step S516, if no, go to step S518.
步骤S516,根据key到队列中读取第一图像识别文案和第二图像识别文案,并执行步骤S520。Step S516, reading the first image recognition copy and the second image recognition copy according to the key to the queue, and executing step S520.
步骤S518,间隔指定时间再次读取队列中的图像识别文案。进而再次执行上述S510。Step S518, the image recognition copy in the queue is read again at the specified time interval. Further, the above S510 is executed again.
步骤S520,对第一图像识别文案和第二图像识别文案进行匹配,以得到第一客户端与第二客户端的匹配结果。执行步骤S522,结束本次匹配。Step S520, matching the first image recognition copy and the second image recognition copy to obtain a matching result between the first client and the second client. Step S522 is executed to end the current match.
参见上文步骤S514至S518,若判断得到队列中的图像识别文案的计数结果为2,证明队列中已存储了第一图像识别文案和第二图像识别文案,那么本例则继续执行各图像识别方案的匹配步骤,若计数结果小于2,证明队列中可能出现只存储了第一图像识别文案或者第二图像识别文案的情况,甚至队列中可能并未存储任何图像识别文案,无法进行匹配操作,但是此时又尚未超出本次匹配的额定时长,仍处于有效的匹配时间内,那么此时本例可以间隔指定时间再次读取队列中的图像识别文案。队列中出现小于2的图像识别文案,可能因服务器尚未完成其中一张或两张图像的识别操作,也可能是图像识别文案在存储的过程中因超出队列存储时长被删除,还可能是数据丢失等原因。Referring to steps S514 to S518 above, if it is determined that the count result of the image recognition copy in the queue is 2, and the first image recognition copy and the second image recognition copy have been stored in the proof queue, then this example continues to perform each image recognition. In the matching step of the scheme, if the counting result is less than 2, it may be found that only the first image recognition copy or the second image recognition copy may be stored in the queue, and even the image recognition copy may not be stored in the queue, and the matching operation cannot be performed. However, at this time, the rated duration of this match has not been exceeded, and it is still in the valid matching time. At this time, the image recognition copy in the queue can be read again at this time. An image recognition file of less than 2 appears in the queue. It may be because the server has not completed the recognition operation of one or two images. It may also be that the image recognition copy is deleted during the storage process due to exceeding the queue storage time, or it may be data loss. And other reasons.
基于同一发明构思,本发明实施例还提供了一种图像匹配装置,用以支持上述任意一个优选实施例或其组合所提供的图像匹配方法。图6示出了根据本发明一个实施例的图像匹配装置的结构示意图。参见图6,该装置至少包括:Based on the same inventive concept, an embodiment of the present invention further provides an image matching apparatus for supporting an image matching method provided by any one of the above preferred embodiments or a combination thereof. FIG. 6 is a block diagram showing the structure of an image matching apparatus according to an embodiment of the present invention. Referring to Figure 6, the device includes at least:
接收模块310,适于接收来自客户端的图像匹配请求,其中,所述图像匹配请求中携带所述客户端的密钥信息;The receiving module 310 is adapted to receive an image matching request from the client, where the image matching request carries the key information of the client;
计算模块320,与接收模块310耦合,适于根据预设规则对所述密钥信息进行计算,以得到第一关键字key;The calculation module 320 is coupled to the receiving module 310, and is configured to calculate the key information according to a preset rule to obtain a first keyword key;
队列匹配模块330,与计算模块320耦合,适于在数据库中存储的以不同key为索引的队列中匹配出与所述第一key对应的队列,其中,各队列中存储有来自不同客户端的、但具备同一key的各图像的图像识别文案;The queue matching module 330 is coupled to the computing module 320, and is adapted to match a queue corresponding to the first key in a queue indexed by a different key stored in a database, where each queue stores, from different clients, However, the image recognition copy of each image having the same key;
图像匹配模块340,与队列匹配模块330耦合,适于读取匹配到的队列中的图像识别文案,并根据预设匹配逻辑对各图像识别文案进行匹配,得到图像匹配结果,并基于图像匹配结果相应得到本客户端与其他客户端的匹配结果。The image matching module 340 is coupled to the queue matching module 330, and is adapted to read the image recognition copy in the matched queue, and match each image recognition copy according to the preset matching logic to obtain an image matching result, and based on the image matching result. Corresponding to the matching results between this client and other clients.
在一个优选的实施例中,参见图7,图像匹配装置还可以包括:In a preferred embodiment, referring to FIG. 7, the image matching apparatus may further include:
计时模块350,与接收模块310耦合,适于所述接收来自客户端的图像匹配请求之后,以接收时刻为起点开始计时,得到计时时长。The timing module 350 is coupled to the receiving module 310, and is adapted to receive the image matching request from the client, and start timing according to the receiving time to obtain the time duration.
在一个优选的实施例中,所述计时模块350还适于所述读取匹配到的队列中的图像识别文案之前,判断所述计时时长是否超过本次匹配的额定时长;若是,则中止本次匹配操作;若否,则触发所述图像匹配模块340执行各图像识别文案的读取操作。In a preferred embodiment, the timing module 350 is further adapted to determine whether the timing duration exceeds the rated duration of the current match before reading the image recognition copy in the matched queue; if yes, the termination The sub-matching operation; if not, triggering the image matching module 340 to perform a reading operation of each image-recognition copy.
在一个优选的实施例中,参见图7,图像匹配装置还可以包括:In a preferred embodiment, referring to FIG. 7, the image matching apparatus may further include:
发送模块360,与计时模块350耦合,适于所述中止本次匹配操作之后,发送匹配不成功的错误码至所述客户端。The sending module 360 is coupled to the timing module 350, and is configured to send an unsuccessful error code to the client after the current matching operation is suspended.
在一个优选的实施例中,所述图像匹配模块340还可以适于:In a preferred embodiment, the image matching module 340 can also be adapted to:
对匹配到的队列中的图像识别文案进行计数,得到计数结果;若所述计数结果大于等于2,则执行各图像识别方案的匹配步骤;若所述计数结果小于2,则间隔指定时间再次读取匹配到的队列中的图像识别文案。Counting the image recognition copy in the matched queue to obtain a counting result; if the counting result is greater than or equal to 2, performing a matching step of each image recognition scheme; if the counting result is less than 2, reading the interval at a specified time again Take the image recognition copy in the matching queue.
在一个优选的实施例中,所述图像匹配模块340还可以适于:间隔1ms再次读取匹配到的队列中的图像识别文案。In a preferred embodiment, the image matching module 340 is further adapted to read the image recognition copy in the matched queue again at intervals of 1 ms.
在一个优选的实施例中,所述图像匹配模块340还可以适于:In a preferred embodiment, the image matching module 340 can also be adapted to:
对各图像识别文案进行加权计算,得到各图像识别文案的加权值;比较各图像识别文案的加权值,得到图像匹配结果。在一个优选的实施例中,所述图像匹配模块340还可以适于:当各图像包括多条主线时,为各主线的文案信息单独设置权值以及权值比例;对各图像识别文案进行加权计算,以得到各图像识别文案的总加权值。Each image recognition copy is weighted to obtain a weighted value of each image recognition copy; the weighted value of each image recognition copy is compared to obtain an image matching result. In a preferred embodiment, the image matching module 340 is further adapted to: when each image includes a plurality of main lines, separately set a weight and a weight ratio for the copy information of each main line; and weight each image recognition copy Calculate to obtain the total weighted value of each image recognition copy.
在一个优选的实施例中,所述图像匹配模块340还可以适于:In a preferred embodiment, the image matching module 340 can also be adapted to:
队列中还存储有上传图像以获取图像识别文案的客户端ID,并将客户端ID与其上传的图像的图像识别文案对应存储;当得到图像匹配结果时,根据参与本次匹配操作的各图像识别文案反向查找到对应的客户端ID,进而确认该客户端ID对应的客户端;将图像匹配结果显示为本客户端与确认的其他客户端间的匹配结果。The queue also stores an uploaded image to obtain a client ID of the image recognition copy, and stores the client ID corresponding to the image recognition copy of the uploaded image; when the image matching result is obtained, according to each image recognition participating in the matching operation The copy file reversely finds the corresponding client ID, and then confirms the client corresponding to the client ID; the image matching result is displayed as a matching result between the client and other confirmed clients.
在一个优选的实施例中,参见图7,图像匹配装置还可以包括:In a preferred embodiment, referring to FIG. 7, the image matching apparatus may further include:
选择模块370,与图像匹配模块340耦合,适于基于图像匹配结果相应得到本客户端与其他客户端的匹配结果之后,根据本客户端与其他客户端的匹配结果,从中选择与本客户端匹配程度最高的另一客户端;将选择的另一客户端以及对应的匹配结果返回至本客户端。The selection module 370 is coupled to the image matching module 340, and is adapted to obtain a matching result between the client and other clients based on the image matching result, and select the highest matching degree with the client according to the matching result between the client and the other client. Another client; return another client selected and the corresponding matching result to the client.
在一个优选的实施例中,参见图7,图像匹配装置还可以包括:In a preferred embodiment, referring to FIG. 7, the image matching apparatus may further include:
文案识别模块380,与队列匹配模块330耦合,适于按如下步骤生成各队列中的图像识别文案:接收来自客户端的至少两张图像,且所述至少两张图像携带相同的密钥信息;分别对所述至少两张图像进行图像识别,得到图像识别结果;根据所述预设规则对本次图像识别的密钥信息进行计算,得到对应key;为该key在所述数据库中建立以该key为索引的队列,并将各图像识别文案放置入本队列中。The document identification module 380 is coupled to the queue matching module 330, and is adapted to generate an image recognition copy in each queue by receiving at least two images from the client, and the at least two images carry the same key information; Performing image recognition on the at least two images to obtain an image recognition result; calculating key information of the current image recognition according to the preset rule to obtain a corresponding key; establishing the key in the database for the key The queue is indexed and each image recognition copy is placed in this queue.
本发明实施例还提供了一种图像匹配装置,图8示出了根据本发明一个实施例的图像 匹配装置的结构示意图,参见图8,图像匹配装置400至少包括第一接收模块410、第二接收模块420、存储模块430、读取模块440以及匹配模块450。The embodiment of the present invention further provides an image matching device. FIG. 8 is a schematic structural diagram of an image matching device according to an embodiment of the present invention. Referring to FIG. 8, the image matching device 400 includes at least a first receiving module 410 and a second. The receiving module 420, the storage module 430, the reading module 440, and the matching module 450.
现介绍本发明实施例的图像匹配装置400的各组成或器件的功能以及各部分间的连接关系:The functions of the components or devices of the image matching apparatus 400 and the connection relationship between the parts of the image matching apparatus 400 of the embodiment of the present invention will now be described:
第一接收模块410,适于接收来自第一客户端的、携带第一图像和密钥信息的第一图像识别请求,对第一图像进行识别,得到第一图像识别文案;The first receiving module 410 is adapted to receive a first image recognition request from the first client that carries the first image and the key information, and identify the first image to obtain a first image recognition copy;
第二接收模块420,与第一接收模块410相耦合,适于接收来自第二客户端的、携带第二图像和密钥信息的第二图像,对第二图像进行识别,得到第二图像识别文案;The second receiving module 420 is coupled to the first receiving module 410, and is adapted to receive a second image from the second client that carries the second image and the key information, and identify the second image to obtain a second image recognition copy. ;
存储模块430,与第二接收模块420相耦合,适于根据预设规则对密钥信息进行计算,得到关键字key,并建立以key为索引的队列,将第一图像识别文案与第二图像识别文案放入队列中存储;The storage module 430 is coupled to the second receiving module 420, and is adapted to calculate key information according to a preset rule, obtain a keyword key, and establish a queue indexed by the key, and identify the first image and the second image. Identify the copy and put it in the queue for storage;
读取模块440,与存储模块430相耦合,适于当接收到第一客户端与第二客户端的匹配请求时,到队列中读取第一图像识别文案和第二图像识别文案;The reading module 440 is coupled to the storage module 430, and is adapted to read the first image recognition copy and the second image recognition copy into the queue when receiving the matching request of the first client and the second client;
匹配模块450,与读取模块440相耦合,适于对第一图像识别文案和第二图像识别文案进行匹配,以得到第一客户端与第二客户端的匹配结果。The matching module 450 is coupled to the reading module 440 and is adapted to match the first image recognition copy and the second image recognition copy to obtain a matching result between the first client and the second client.
本发明实施例还提供了另一种图像匹配装置,图9示出了根据本发明另一个实施例的图像匹配装置的结构示意图,参见图9,图像匹配装置400除了包括图8中所示各个模块之外,还可以包括计时模块510。Another embodiment of the present invention further provides an image matching device. FIG. 9 is a schematic structural diagram of an image matching device according to another embodiment of the present invention. Referring to FIG. 9, the image matching device 400 includes the components shown in FIG. In addition to the module, a timing module 510 can also be included.
计时模块510,与读取模块440相耦合,适于当读取模块440接收到第一客户端与第二客户端的匹配请求时,以匹配请求的接收时刻为起点开始计时,得到匹配过程的计时时长。The timing module 510 is coupled to the reading module 440, and is adapted to start timing when the reading module 440 receives the matching request of the first client and the second client, starting from the receiving time of the matching request, and obtaining the timing of the matching process. duration.
在本发明一实施例中,计时模块510还适于,在读取模块440到队列中读取第一图像识别文案和第二图像识别文案之前,判断计时时长是否超过本次匹配的额定时长,若是,则中止本次匹配操作;若否,则执行各图像识别文案的读取操作。In an embodiment of the invention, the timing module 510 is further adapted to determine whether the chronograph duration exceeds the rated duration of the current match before the reading module 440 reads the first image recognition copy and the second image recognition copy in the queue. If yes, the matching operation is aborted; if not, the reading operation of each image recognition copy is performed.
在本发明一实施例中,读取模块440还适于,对队列中的图像识别文案进行计数,得到计数结果;若计数结果为2,则执行各图像识别方案的匹配步骤;若计数结果小于2,则间隔指定时间再次读取队列中的图像识别文案。In an embodiment of the invention, the reading module 440 is further adapted to count the image recognition copy in the queue to obtain a counting result; if the counting result is 2, perform a matching step of each image recognition scheme; if the counting result is less than 2. The image recognition copy in the queue is read again at the specified time interval.
在本发明一实施例中,读取模块440还适于,间隔1ms再次读取队列中的图像识别文案。In an embodiment of the invention, the reading module 440 is further adapted to read the image recognition copy in the queue again at intervals of 1 ms.
在本发明一实施例中,读取模块440还适于,首先解析匹配请求得到其中携带的密钥信息,并根据预设规则对密钥信息进行计算,得到该密钥信息对应的key,然后以该密钥信息对应的key与数据库中各队列进行匹配,查找到匹配的、以该key为索引的队列,最后到队列中读取第一图像识别文案和第二图像识别文案。In an embodiment of the present invention, the reading module 440 is further adapted to first parse the matching request to obtain the key information carried therein, and calculate the key information according to a preset rule to obtain a key corresponding to the key information, and then Matching the key corresponding to the key information with each queue in the database, finding a matching queue indexed by the key, and finally reading the first image recognition copy and the second image recognition copy into the queue.
在本发明一实施例中,匹配模块450还适于,对第一图像识别文案和第二图像识别文案分别进行加权计算,得到第一图像识别文案和第二图像识别文案的加权值,并比较第一图像识别文案和第二图像识别文案的加权值,得到图像匹配结果,进而以图像匹配结果作为第一客户端与第二客户端的匹配结果。In an embodiment of the present invention, the matching module 450 is further configured to perform weighting calculation on the first image recognition copy and the second image recognition copy respectively, and obtain weight values of the first image recognition copy and the second image recognition copy, and compare The weighted values of the first image recognition copy and the second image recognition copy obtain an image matching result, and the image matching result is used as a matching result between the first client and the second client.
在本发明一实施例中,匹配模块450还适于,当第一图像和/或第二图像包括多条主线时,为各主线的文案信息单独设置权值以及权值比例,根据各主线的权值以及权值比例分别对各图像识别文案进行加权计算,以得到各图像识别文案的总加权值。In an embodiment of the present invention, the matching module 450 is further adapted to separately set a weight and a weight ratio for the copy information of each main line when the first image and/or the second image includes a plurality of main lines, according to each main line The weight and the weight ratio respectively perform weighting calculation on each image recognition copy to obtain a total weight value of each image recognition copy.
采用本发明实施例提供的图像匹配方法及装置能够达到如下有益效果:The image matching method and apparatus provided by the embodiments of the present invention can achieve the following beneficial effects:
在本发明实施例中,数据库中预先存储有多个队列,各队列以key为索引,每个队列中存储有来自不同客户端的、但具备同一key的各图像的图像识别文案,即,数据库对客户端请求识别的图像进行了分组存储,将具备同一key的存储进同一队列,为后续的匹配操作提供了数据基础。进一步,若接收来自客户端的图像匹配请求,则对匹配请求中所携带的密钥信息进行计算,得到第一key,进而将第一key与数据库中各队列进行匹配,查找到与第一key对应的队列,即以第一key为索引的队列,就可以获得以第一key为索引的队列中的各图像识别文案。随后,读取以第一key为索引的队列中的各图像识别文案,并根据预设匹配逻辑对各图像识别文案进行匹配,得到图像匹配结果。由于,并图像识别文案是由来自不同客户端,因此,基于图像匹配结果相应得到本客户端与其他客户端的匹配结果。匹配结果可以体现出分别来自不同客户端的各个图像之间存在的关系,不仅增加了不同客户端之间的互动方式,还提高了客户端的社交性和趣味性。此外,对于使用该客户端的用户来说,不仅可以增加不同用户所拥有的各图像之间的交互,还可以增进不同用户之间的沟通和交流。另外,匹配请求中携带密钥信息,将密钥信息作为匹配队列的关键信息,使得匹配操作能够限于来自不同客户端的、但具备同一key的各图像的图像识别文案,保证了其他客户端发送至服务器的图像的安全性,使得用户的私人信息不会被轻易的泄露。In the embodiment of the present invention, a plurality of queues are pre-stored in the database, and each queue is indexed by a key. Each queue stores image recognition files of images from different clients but having the same key, that is, database pairs. The images identified by the client request are stored in groups, and the same key is stored in the same queue, which provides a data foundation for subsequent matching operations. Further, if the image matching request from the client is received, the key information carried in the matching request is calculated, and the first key is obtained, and then the first key is matched with each queue in the database, and the first key is matched. The queue, that is, the queue indexed by the first key, can obtain each image recognition copy in the queue indexed by the first key. Then, each image recognition copy in the queue indexed by the first key is read, and each image recognition copy is matched according to a preset matching logic to obtain an image matching result. Because, and the image recognition copy is from different clients, the matching result between the client and other clients is obtained based on the image matching result. The matching result can reflect the relationship between the images from different clients, which not only increases the interaction between different clients, but also improves the sociality and fun of the client. In addition, for users who use the client, not only can the interaction between images owned by different users be increased, but also communication and communication between different users can be enhanced. In addition, the matching request carries the key information, and the key information is used as the key information of the matching queue, so that the matching operation can be limited to the image recognition copy of each image from different clients but having the same key, and the other clients are guaranteed to send to The security of the image of the server makes the user's private information not easily leaked.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that the embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures, and techniques are not shown in detail so as not to obscure the understanding of the description.
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, the various features of the invention are sometimes grouped together into a single embodiment, in the above description of the exemplary embodiments of the invention, Figure, or a description of it. However, the method disclosed is not to be interpreted as reflecting the intention that the claimed invention requires more features than those recited in the claims. Rather, as the following claims reflect, inventive aspects reside in less than all features of the single embodiments disclosed herein. Therefore, the claims following the specific embodiments are hereby explicitly incorporated into the embodiments, and each of the claims as a separate embodiment of the invention.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art will appreciate that the modules in the devices of the embodiments can be adaptively changed and placed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and further they may be divided into a plurality of sub-modules or sub-units or sub-components. In addition to such features and/or at least some of the processes or units being mutually exclusive, any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined. Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features that are included in other embodiments and not in other features, combinations of features of different embodiments are intended to be within the scope of the present invention. Different embodiments are formed and formed. For example, in the following claims, any one of the claimed embodiments can be used in any combination.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处 理器或者数字信号处理器(DSP)来实现根据本发明实施例的图像匹配装置中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that some or all of the functionality of some or all of the components of the image matching device in accordance with embodiments of the present invention may be implemented in practice using a microprocessor or digital signal processor (DSP). The invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein. Such a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
例如,图10示出了可以实现根据本发明的图像匹配方法的计算设备的框图。该计算设备传统上包括处理器1010和以存储器1020形式的计算机程序产品或者计算机可读介质。存储器1020可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器1020具有存储用于执行上述方法中的任何方法步骤的程序代码1031的存储空间1030。例如,存储程序代码的存储空间1030可以存储分别用于实现上面的方法中的各种步骤的各个程序代码1031。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如图11所示的便携式或者固定存储单元。该存储单元可以具有与图10的计算设备中的存储器1020类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括存储有用于执行根据本发明的方法步骤的计算机可读程序代码1031’,即可以由诸如1010之类的处理器读取的程序代码,当这些程序代码由计算设备运行时,导致该计算设备执行上面所描述的方法中的各个步骤。For example, Figure 10 illustrates a block diagram of a computing device in which an image matching method in accordance with the present invention can be implemented. The computing device conventionally includes a processor 1010 and a computer program product or computer readable medium in the form of a memory 1020. The memory 1020 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM. Memory 1020 has a storage space 1030 that stores program code 1031 for performing any of the method steps described above. For example, the storage space 1030 storing program code may store respective program codes 1031 for implementing various steps in the above methods, respectively. The program code can be read from or written to one or more computer program products. These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. Such computer program products are typically portable or fixed storage units as shown in FIG. The storage unit may have storage segments, storage spaces, and the like that are similarly arranged to memory 1020 in the computing device of FIG. The program code can be compressed, for example, in an appropriate form. In general, the storage unit comprises computer readable program code 1031' storing program steps for performing the method according to the invention, ie program code readable by a processor such as 1010, when the program code is run by the computing device, The computing device is caused to perform the various steps in the methods described above.
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。"an embodiment," or "an embodiment," or "an embodiment," In addition, it is noted that the phrase "in one embodiment" is not necessarily referring to the same embodiment.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It is to be noted that the above-described embodiments are illustrative of the invention and are not intended to be limiting, and that the invention may be devised without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as a limitation. The word "comprising" does not exclude the presence of the elements or steps that are not recited in the claims. The word "a" or "an" The invention can be implemented by means of hardware comprising several distinct elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means can be embodied by the same hardware item. The use of the words first, second, and third does not indicate any order. These words can be interpreted as names.
此外,还应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。In addition, it should be noted that the language used in the specification has been selected for the purpose of readability and teaching, and is not intended to be construed or limited. Therefore, many modifications and changes will be apparent to those skilled in the art without departing from the scope of the invention. The disclosure of the present invention is intended to be illustrative, and not restrictive, and the scope of the invention is defined by the appended claims.

Claims (40)

  1. 一种图像匹配方法,包括:An image matching method includes:
    接收来自客户端的图像匹配请求,其中,所述图像匹配请求中携带所述客户端的密钥信息;Receiving an image matching request from a client, where the image matching request carries key information of the client;
    根据预设规则对所述密钥信息进行计算,以得到第一关键字key;Calculating the key information according to a preset rule to obtain a first keyword key;
    在数据库中存储的以不同key为索引的队列中匹配出与所述第一key对应的队列,其中,各队列中存储有来自不同客户端的、但具备同一key的各图像的图像识别文案;Queues corresponding to the first key are matched in the queues indexed by different keys stored in the database, wherein each queue stores image recognition files of images from different clients but having the same key;
    读取匹配到的队列中的图像识别文案,并根据预设匹配逻辑对各图像识别文案进行匹配,得到图像匹配结果,并基于图像匹配结果相应得到本客户端与其他客户端的匹配结果。The image recognition copy in the matched queue is read, and each image recognition copy is matched according to the preset matching logic, and the image matching result is obtained, and the matching result between the client and other clients is obtained according to the image matching result.
  2. 根据权利要求1所述的方法,其中,所述接收来自客户端的图像匹配请求之后,还包括:以接收时刻为起点开始计时,得到匹配过程的计时时长。The method according to claim 1, wherein after receiving the image matching request from the client, the method further comprises: starting timing with the receiving time as a starting point, and obtaining a timing duration of the matching process.
  3. 根据权利要求1或2所述的方法,其中,所述读取匹配到的队列中的图像识别文案之前,还包括:The method according to claim 1 or 2, wherein before the reading the image recognition copy in the matched queue, the method further comprises:
    判断所述计时时长是否超过本次匹配的额定时长;Determining whether the timing duration exceeds the rated duration of the current match;
    若是,则中止本次匹配操作;If yes, the current matching operation is aborted;
    若否,则执行各图像识别文案的读取操作。If not, a read operation of each image recognition copy is performed.
  4. 根据权利要求1-3任一项所述的方法,其中,所述中止本次匹配操作之后,还包括:发送匹配不成功的错误码至所述客户端。The method according to any one of claims 1-3, wherein after the suspending the matching operation, the method further comprises: sending an error code that the matching is unsuccessful to the client.
  5. 根据权利要求1-4任一项所述的方法,其中,所述执行各图像识别文案的读取操作,并根据预设匹配逻辑对各图像识别文案进行匹配,包括:The method according to any one of claims 1 to 4, wherein the performing a read operation of each image recognition copy and matching each image recognition copy according to a preset matching logic comprises:
    对匹配到的队列中的图像识别文案进行计数,得到计数结果;Counting the image recognition copy in the matched queue to obtain a counting result;
    若所述计数结果大于等于2,则执行各图像识别方案的匹配步骤;If the counting result is greater than or equal to 2, performing a matching step of each image recognition scheme;
    若所述计数结果小于2,则间隔指定时间再次读取匹配到的队列中的图像识别文案。If the count result is less than 2, the image recognition copy in the matched queue is read again at the specified time interval.
  6. 根据权利要求1-5任一项所述的方法,其中,所述间隔指定时间再次读取匹配到的队列中的图像识别文案,包括:间隔1ms再次读取匹配到的队列中的图像识别文案。The method according to any one of claims 1 to 5, wherein the interval specifies a time to read the image recognition copy in the matched queue again, including: reading the image recognition copy in the matched queue again at intervals of 1 ms .
  7. 根据权利要求1-6任一项所述的方法,其中,所述根据预设匹配逻辑对各图像识别文案进行匹配,得到图像匹配结果,包括:The method according to any one of claims 1-6, wherein the matching of each image recognition copy according to a preset matching logic to obtain an image matching result includes:
    对各图像识别文案进行加权计算,得到各图像识别文案的加权值;Performing a weighting calculation on each image recognition copy to obtain a weighted value of each image recognition copy;
    比较各图像识别文案的加权值,得到图像匹配结果。The weighted values of each image recognition copy are compared to obtain an image matching result.
  8. 根据权利要求1-7任一项所述的方法,其中,所述对各图像识别文案进行加权计算,得到各图像识别文案的加权值,包括:The method according to any one of claims 1 to 7, wherein the weighting calculation is performed on each image recognition copy to obtain weighting values of each image recognition copy, including:
    当各图像包括多条主线时,为各主线的文案信息单独设置权值以及权值比例;When each image includes a plurality of main lines, weights and weight ratios are separately set for the copy information of each main line;
    对各图像识别文案进行加权计算,以得到各图像识别文案的总加权值。Each image recognition copy is weighted to obtain a total weighted value of each image recognition copy.
  9. 根据权利要求1-8任一项所述的方法,其中,基于图像匹配结果相应得到本客户端与其他客户端的匹配结果,包括:The method according to any one of claims 1-8, wherein the matching result between the client and other clients is obtained according to the image matching result, including:
    队列中还存储有上传图像以获取图像识别文案的客户端ID,并将客户端ID与其上传的图像的图像识别文案对应存储;The queue also stores an uploading image to obtain a client ID of the image recognition copy, and stores the client ID corresponding to the image recognition copy of the uploaded image;
    当得到图像匹配结果时,根据参与本次匹配操作的各图像识别文案反向查找到对应的客户端ID,进而确认该客户端ID对应的客户端;When the image matching result is obtained, the corresponding client ID is reversely searched according to each image recognition copy participating in the matching operation, thereby confirming the client corresponding to the client ID;
    将图像匹配结果显示为本客户端与确认的其他客户端间的匹配结果。The image matching result is displayed as a match result between the client and other clients confirmed.
  10. 根据权利要求1-9任一项所述的方法,其中,基于图像匹配结果相应得到本客户端与其他客户端的匹配结果之后,包括:The method according to any one of claims 1 to 9, wherein after the matching result of the client and the other client is obtained correspondingly based on the image matching result, the method includes:
    根据本客户端与其他客户端的匹配结果,从中选择与本客户端匹配程度最高的另一客户端;According to the matching result of the client and other clients, select another client that has the highest matching degree with the client;
    将选择的另一客户端以及对应的匹配结果返回至本客户端。Return the selected other client and the corresponding matching result to the client.
  11. 根据权利要求1-10任一项所述的方法,其中,按如下步骤生成各队列中的图像识别文案:The method according to any one of claims 1 to 10, wherein the image recognition copy in each queue is generated as follows:
    接收来自客户端的图像识别请求,其中,所述图像识别请求中携带有待识别图像以及由本客户端提供的密钥信息;Receiving an image recognition request from a client, wherein the image recognition request carries an image to be identified and key information provided by the client;
    对所述图像识别请求中携带的图像进行图像识别,得到图像识别结果;Performing image recognition on the image carried in the image recognition request to obtain an image recognition result;
    根据所述预设规则对本次图像识别的密钥信息进行计算,得到对应key;Performing calculation on the key information of the current image according to the preset rule to obtain a corresponding key;
    为该key在所述数据库中建立以该key为索引的队列,并将图像识别文案放置入本队列中。A queue indexed by the key is created in the database for the key, and the image recognition copy is placed in the queue.
  12. 一种图像匹配方法,包括:An image matching method includes:
    接收来自第一客户端的、携带第一图像和密钥信息的第一图像识别请求,对所述第一图像进行识别,得到第一图像识别文案;Receiving, by the first client, a first image recognition request carrying the first image and the key information, and identifying the first image to obtain a first image recognition copy;
    接收来自第二客户端的、携带第二图像和所述密钥信息的第二图像识别请求,对所述第二图像进行识别,得到第二图像识别文案;Receiving, by the second client, a second image recognition request carrying the second image and the key information, and identifying the second image to obtain a second image recognition copy;
    根据预设规则对所述密钥信息进行计算,得到关键字key,并建立以key为索引的队列,将所述第一图像识别文案与所述第二图像识别文案放入所述队列中存储;Calculating the key information according to a preset rule to obtain a keyword key, and establishing a queue indexed by the key, and placing the first image recognition copy and the second image recognition copy into the queue for storing ;
    当接收到所述第一客户端与所述第二客户端的匹配请求时,根据key到所述队列中读取所述第一图像识别文案和所述第二图像识别文案;When receiving the matching request of the first client and the second client, reading the first image recognition copy and the second image recognition copy according to the key to the queue;
    对所述第一图像识别文案和所述第二图像识别文案进行匹配,以得到所述第一客户端与所述第二客户端的匹配结果。Matching the first image recognition copy and the second image recognition copy to obtain a matching result between the first client and the second client.
  13. 根据权利要求12所述的方法,其中,当接收到所述第一客户端与所述第二客户端的匹配请求时,还包括:The method of claim 12, wherein when the matching request of the first client and the second client is received, the method further includes:
    以所述匹配请求的接收时刻为起点开始计时,得到匹配过程的计时时长。The timing is started starting from the reception time of the matching request, and the time duration of the matching process is obtained.
  14. 根据权利要求12或13所述的方法,其中,到所述队列中读取所述第一图像识别文案和所述第二图像识别文案之前,还包括:The method according to claim 12 or 13, wherein before the reading of the first image recognition copy and the second image recognition copy in the queue, the method further comprises:
    判断所述计时时长是否超过本次匹配的额定时长;Determining whether the timing duration exceeds the rated duration of the current match;
    若是,则中止本次匹配操作;If yes, the current matching operation is aborted;
    若否,则执行各图像识别文案的读取操作。If not, a read operation of each image recognition copy is performed.
  15. 根据权利要求12-14任一项所述的方法,其中,到所述队列中读取所述第一图像识别文案和所述第二图像识别文案,包括:The method according to any one of claims 12-14, wherein reading the first image recognition copy and the second image recognition copy into the queue comprises:
    对所述队列中的图像识别文案进行计数,得到计数结果;Counting the image recognition copy in the queue to obtain a counting result;
    若所述计数结果为2,则执行各图像识别方案的匹配步骤;If the counting result is 2, performing a matching step of each image recognition scheme;
    若所述计数结果小于2,则间隔指定时间再次读取所述队列中的图像识别文案。If the count result is less than 2, the image recognition copy in the queue is read again at the specified time interval.
  16. 根据权利要求12-15任一项所述的方法,其中,所述间隔指定时间再次读取所述 队列中的图像识别文案,包括:间隔1ms再次读取所述队列中的图像识别文案。The method according to any one of claims 12-15, wherein the interval specifying time to read the image recognition copy in the queue again comprises: reading the image recognition copy in the queue again at intervals of 1 ms.
  17. 根据权利要求12-16任一项所述的方法,其中,当接收到所述第一客户端与所述第二客户端的匹配请求时,根据key到所述队列中读取所述第一图像识别文案和所述第二图像识别文案,包括:The method according to any one of claims 12 to 16, wherein when the matching request of the first client and the second client is received, the first image is read into the queue according to a key Identifying the copy and the second image recognition copy, including:
    解析所述匹配请求得到其中携带的所述密钥信息;Parsing the matching request to obtain the key information carried therein;
    根据所述预设规则对所述密钥信息进行计算,得到该密钥信息对应的key;Calculating the key information according to the preset rule, and obtaining a key corresponding to the key information;
    以该密钥信息对应的key与数据库中各队列进行匹配,查找到匹配的、以该key为索引的队列;Matching the key corresponding to the key information with each queue in the database, and finding a matching queue indexed by the key;
    到所述队列中读取所述第一图像识别文案和所述第二图像识别文案。Reading the first image recognition copy and the second image recognition copy into the queue.
  18. 根据权利要求12-17任一项所述的方法,其中,对所述第一图像识别文案和所述第二图像识别文案进行匹配,以得到所述第一客户端与所述第二客户端的匹配结果,包括:The method according to any one of claims 12-17, wherein the first image recognition copy and the second image recognition copy are matched to obtain the first client and the second client Match results, including:
    对所述第一图像识别文案和所述第二图像识别文案分别进行加权计算,得到所述第一图像识别文案和所述第二图像识别文案的加权值;And performing weighting calculation on the first image recognition copy and the second image recognition copy respectively, and obtaining weighting values of the first image recognition copy and the second image recognition copy;
    比较所述第一图像识别文案和所述第二图像识别文案的加权值,得到图像匹配结果,进而以所述图像匹配结果作为所述第一客户端与所述第二客户端的匹配结果。Comparing the weight values of the first image recognition copy and the second image recognition copy to obtain an image matching result, and the image matching result is used as a matching result between the first client and the second client.
  19. 根据权利要求12-18任一项所述的方法,其中,对所述第一图像识别文案和所述第二图像识别文案分别进行加权计算,得到所述第一图像识别文案和所述第二图像识别文案的加权值,包括:The method according to any one of claims 12 to 18, wherein weighting calculation is performed on the first image recognition copy and the second image recognition copy, respectively, to obtain the first image recognition copy and the second The weighted value of the image recognition copy, including:
    当所述第一图像和/或所述第二图像包括多条主线时,为各主线的文案信息单独设置权值以及权值比例;When the first image and/or the second image includes a plurality of main lines, a weight and a weight ratio are separately set for the copy information of each main line;
    根据各主线的权值以及权值比例分别对所述各图像识别文案进行加权计算,以得到各图像识别文案的总加权值。The image recognition copy is weighted according to the weight of each main line and the weight ratio to obtain the total weight value of each image recognition copy.
  20. 一种图像匹配装置,包括:An image matching device includes:
    接收模块,适于接收来自客户端的图像匹配请求,其中,所述图像匹配请求中携带所述客户端的密钥信息;a receiving module, configured to receive an image matching request from a client, where the image matching request carries key information of the client;
    计算模块,适于根据预设规则对所述密钥信息进行计算,以得到第一关键字key;a calculation module, configured to calculate the key information according to a preset rule to obtain a first keyword key;
    队列匹配模块,适于在数据库中存储的以不同key为索引的队列中匹配出与所述第一key对应的队列,其中,各队列中存储有来自不同客户端的、但具备同一key的各图像的图像识别文案;a queue matching module, configured to match a queue corresponding to the first key in a queue indexed by a different key stored in a database, wherein each queue stores images of different clients but having the same key Image recognition copy;
    图像匹配模块,适于读取匹配到的队列中的图像识别文案,并根据预设匹配逻辑对各图像识别文案进行匹配,得到图像匹配结果,并基于图像匹配结果相应得到本客户端与其他客户端的匹配结果。The image matching module is adapted to read the image recognition copy in the matched queue, and match each image recognition copy according to the preset matching logic to obtain an image matching result, and obtain the client and other customers according to the image matching result. The matching result of the end.
  21. 根据权利要求20所述的装置,其中,还包括:The device according to claim 20, further comprising:
    计时模块,适于所述接收来自客户端的图像匹配请求之后,以接收时刻为起点开始计时,得到计时时长。The timing module is adapted to receive the image matching request from the client, start timing according to the receiving time, and obtain the timing duration.
  22. 根据权利要求20或21所述的装置,其中,The device according to claim 20 or 21, wherein
    所述计时模块还适于所述读取匹配到的队列中的图像识别文案之前,判断所述计时时长是否超过本次匹配的额定时长;The timing module is further adapted to determine whether the timing duration exceeds a rated duration of the current match before reading the image recognition copy in the matched queue;
    若是,则中止本次匹配操作;If yes, the current matching operation is aborted;
    若否,则触发所述图像匹配模块执行各图像识别文案的读取操作。If not, the image matching module is triggered to perform a read operation of each image recognition copy.
  23. 根据权利要求20-22任一项所述的装置,其中,还包括:The apparatus according to any one of claims 20 to 22, further comprising:
    发送模块,适于所述中止本次匹配操作之后,发送匹配不成功的错误码至所述客户端。The sending module is configured to send an error code that is unsuccessful to the client after the suspension of the matching operation.
  24. 根据权利要求20-23任一项所述的装置,其中,所述图像匹配模块还适于:The apparatus according to any one of claims 20 to 23, wherein the image matching module is further adapted to:
    对匹配到的队列中的图像识别文案进行计数,得到计数结果;Counting the image recognition copy in the matched queue to obtain a counting result;
    若所述计数结果大于等于2,则执行各图像识别方案的匹配步骤;If the counting result is greater than or equal to 2, performing a matching step of each image recognition scheme;
    若所述计数结果小于2,则间隔指定时间再次读取匹配到的队列中的图像识别文案。If the count result is less than 2, the image recognition copy in the matched queue is read again at the specified time interval.
  25. 根据权利要求20-24任一项所述的装置,其中,所述图像匹配模块还适于:间隔1ms再次读取匹配到的队列中的图像识别文案。The apparatus of any of claims 20-24, wherein the image matching module is further adapted to read the image recognition copy in the matched queue again at intervals of 1 ms.
  26. 根据权利要求20-25任一项所述的装置,其中,所述图像匹配模块还适于:The apparatus of any one of claims 20-25, wherein the image matching module is further adapted to:
    对各图像识别文案进行加权计算,得到各图像识别文案的加权值;Performing a weighting calculation on each image recognition copy to obtain a weighted value of each image recognition copy;
    比较各图像识别文案的加权值,得到图像匹配结果。The weighted values of each image recognition copy are compared to obtain an image matching result.
  27. 根据权利要求20-26任一项所述的装置,其中,所述图像匹配模块还适于:The apparatus of any one of claims 20-26, wherein the image matching module is further adapted to:
    当各图像包括多条主线时,为各主线的文案信息单独设置权值以及权值比例;When each image includes a plurality of main lines, weights and weight ratios are separately set for the copy information of each main line;
    对各图像识别文案进行加权计算,以得到各图像识别文案的总加权值。Each image recognition copy is weighted to obtain a total weighted value of each image recognition copy.
  28. 根据权利要求20-27任一项所述的装置,其中,所述图像匹配模块还适于:The apparatus of any one of claims 20-27, wherein the image matching module is further adapted to:
    队列中还存储有上传图像以获取图像识别文案的客户端ID,并将客户端ID与其上传的图像的图像识别文案对应存储;The queue also stores an uploading image to obtain a client ID of the image recognition copy, and stores the client ID corresponding to the image recognition copy of the uploaded image;
    当得到图像匹配结果时,根据参与本次匹配操作的各图像识别文案反向查找到对应的客户端ID,进而确认该客户端ID对应的客户端;When the image matching result is obtained, the corresponding client ID is reversely searched according to each image recognition copy participating in the matching operation, thereby confirming the client corresponding to the client ID;
    将图像匹配结果显示为本客户端与确认的其他客户端间的匹配结果。The image matching result is displayed as a match result between the client and other clients confirmed.
  29. 根据权利要求20-28任一项所述的装置,其中,还包括:The apparatus according to any one of claims 20 to 28, further comprising:
    选择模块,适于基于图像匹配结果相应得到本客户端与其他客户端的匹配结果之后,根据本客户端与其他客户端的匹配结果,从中选择与本客户端匹配程度最高的另一客户端;将选择的另一客户端以及对应的匹配结果返回至本客户端。The selection module is adapted to obtain a matching result between the client and the other client based on the image matching result, and select another client that has the highest matching degree with the client according to the matching result between the client and the other client; Another client and the corresponding matching result are returned to the client.
  30. 根据权利要求20-29任一项所述的装置,其中,还包括:The apparatus according to any one of claims 20 to 29, further comprising:
    文案识别模块,适于按如下步骤生成各队列中的图像识别文案:The copy identification module is adapted to generate an image recognition copy in each queue as follows:
    接收来自客户端的至少两张图像,且所述至少两张图像携带相同的密钥信息;Receiving at least two images from a client, and the at least two images carry the same key information;
    分别对所述至少两张图像进行图像识别,得到图像识别结果;Performing image recognition on the at least two images to obtain an image recognition result;
    根据所述预设规则对本次图像识别的密钥信息进行计算,得到对应key;Performing calculation on the key information of the current image according to the preset rule to obtain a corresponding key;
    为该key在所述数据库中建立以该key为索引的队列,并将各图像识别文案放置入本队列中。A queue indexed by the key is created in the database for the key, and each image recognition copy is placed in the queue.
  31. 一种图像匹配装置,包括:An image matching device includes:
    第一接收模块,适于接收来自第一客户端的、携带第一图像和密钥信息的第一图像识别请求,对所述第一图像进行识别,得到第一图像识别文案;The first receiving module is configured to receive a first image recognition request from the first client that carries the first image and the key information, and identify the first image to obtain a first image recognition copy;
    第二接收模块,适于接收来自第二客户端的、携带第二图像和所述密钥信息的第二图像识别请求,对所述第二图像进行识别,得到第二图像识别文案;The second receiving module is configured to receive a second image recognition request from the second client that carries the second image and the key information, and identify the second image to obtain a second image recognition copy;
    存储模块,适于根据预设规则对所述密钥信息进行计算,得到关键字key,并建立以key为索引的队列,将所述第一图像识别文案与所述第二图像识别文案放入所述队列中存储;a storage module, configured to calculate the key information according to a preset rule, obtain a keyword key, and establish a queue indexed by the key, and insert the first image recognition copy and the second image recognition copy Stored in the queue;
    读取模块,适于当接收到所述第一客户端与所述第二客户端的匹配请求时,到所述队列中读取所述第一图像识别文案和所述第二图像识别文案;a reading module, configured to read the first image recognition copy and the second image recognition copy into the queue when receiving a matching request between the first client and the second client;
    匹配模块,适于对所述第一图像识别文案和所述第二图像识别文案进行匹配,以得到所述第一客户端与所述第二客户端的匹配结果。The matching module is adapted to match the first image recognition copy and the second image recognition copy to obtain a matching result between the first client and the second client.
  32. 根据权利要求31所述的装置,其中,还包括:The device according to claim 31, further comprising:
    计时模块,适于当接收到所述第一客户端与所述第二客户端的匹配请求时,以所述匹配请求的接收时刻为起点开始计时,得到匹配过程的计时时长。The timing module is adapted to start timing when the matching request of the first client and the second client is received, and start timing according to the receiving moment of the matching request, and obtain a timing duration of the matching process.
  33. 根据权利要求31或32所述的装置,其中,所述计时模块还适于:到所述队列中读取所述第一图像识别文案和所述第二图像识别文案之前,The apparatus according to claim 31 or 32, wherein said timing module is further adapted to: before reading said first image recognition copy and said second image recognition copy in said queue,
    判断所述计时时长是否超过本次匹配的额定时长;Determining whether the timing duration exceeds the rated duration of the current match;
    若是,则中止本次匹配操作;If yes, the current matching operation is aborted;
    若否,则执行各图像识别文案的读取操作。If not, a read operation of each image recognition copy is performed.
  34. 根据权利要求31-33任一项所述的装置,其中,所述读取模块还适于:对所述队列中的图像识别文案进行计数,得到计数结果;The apparatus according to any one of claims 31 to 33, wherein the reading module is further adapted to: count an image recognition copy in the queue to obtain a counting result;
    若所述计数结果为2,则执行各图像识别方案的匹配步骤;If the counting result is 2, performing a matching step of each image recognition scheme;
    若所述计数结果小于2,则间隔指定时间再次读取所述队列中的图像识别文案。If the count result is less than 2, the image recognition copy in the queue is read again at the specified time interval.
  35. 根据权利要求31-34任一项所述的装置,其中,所述读取模块还适于:间隔1ms再次读取所述队列中的图像识别文案。The apparatus of any of claims 31-34, wherein the reading module is further adapted to read the image recognition copy in the queue again at intervals of 1 ms.
  36. 根据权利要求31-35任一项所述的装置,其中,所述读取模块还适于:The apparatus of any of claims 31-35, wherein the reading module is further adapted to:
    解析所述匹配请求得到其中携带的所述密钥信息;Parsing the matching request to obtain the key information carried therein;
    根据所述预设规则对所述密钥信息进行计算,得到该密钥信息对应的key;Calculating the key information according to the preset rule, and obtaining a key corresponding to the key information;
    以该密钥信息对应的key与数据库中各队列进行匹配,查找到匹配的、以该key为索引的队列;Matching the key corresponding to the key information with each queue in the database, and finding a matching queue indexed by the key;
    到所述队列中读取所述第一图像识别文案和所述第二图像识别文案。Reading the first image recognition copy and the second image recognition copy into the queue.
  37. 根据权利要求31-36任一项所述的装置,其中,所述匹配模块还适于:The apparatus of any of claims 31-36, wherein the matching module is further adapted to:
    对所述第一图像识别文案和所述第二图像识别文案分别进行加权计算,得到所述第一图像识别文案和所述第二图像识别文案的加权值;And performing weighting calculation on the first image recognition copy and the second image recognition copy respectively, and obtaining weighting values of the first image recognition copy and the second image recognition copy;
    比较所述第一图像识别文案和所述第二图像识别文案的加权值,得到图像匹配结果,进而以所述图像匹配结果作为所述第一客户端与所述第二客户端的匹配结果。Comparing the weight values of the first image recognition copy and the second image recognition copy to obtain an image matching result, and the image matching result is used as a matching result between the first client and the second client.
  38. 根据权利要求31-37任一项所述的装置,其中,所述匹配模块还适于:The apparatus of any of claims 31-37, wherein the matching module is further adapted to:
    当所述第一图像和/或所述第二图像包括多条主线时,为各主线的文案信息单独设置权值以及权值比例;When the first image and/or the second image includes a plurality of main lines, a weight and a weight ratio are separately set for the copy information of each main line;
    根据各主线的权值以及权值比例分别对所述各图像识别文案进行加权计算,以得到各图像识别文案的总加权值。The image recognition copy is weighted according to the weight of each main line and the weight ratio to obtain the total weight value of each image recognition copy.
  39. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在计算设备上运行时,导致所述计算设备执行根据权利要求1-19中的任一项所述的图像匹配方法。A computer program comprising computer readable code that, when executed on a computing device, causes the computing device to perform the image matching method of any of claims 1-19.
  40. 一种计算机可读介质,其中存储了如权利要求39所述的计算机程序。A computer readable medium storing the computer program of claim 39.
PCT/CN2017/117433 2016-12-29 2017-12-20 Image matching method and apparatus WO2018121375A1 (en)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201611247094.8 2016-12-29
CN201611251384.X 2016-12-29
CN201611247094.8A CN106599307B (en) 2016-12-29 2016-12-29 Image matching method and device
CN201611251384.XA CN106682201B (en) 2016-12-29 2016-12-29 Image matching method and device

Publications (1)

Publication Number Publication Date
WO2018121375A1 true WO2018121375A1 (en) 2018-07-05

Family

ID=62710898

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/117433 WO2018121375A1 (en) 2016-12-29 2017-12-20 Image matching method and apparatus

Country Status (1)

Country Link
WO (1) WO2018121375A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150278224A1 (en) * 2013-12-12 2015-10-01 Nant Holdings Ip, Llc Image Recognition Verification
CN106055704A (en) * 2016-06-22 2016-10-26 重庆中科云丛科技有限公司 Image retrieving and matching method and system
CN106599307A (en) * 2016-12-29 2017-04-26 北京奇虎科技有限公司 Image matching method and device
CN106682201A (en) * 2016-12-29 2017-05-17 北京奇虎科技有限公司 image matching method and image matching device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150278224A1 (en) * 2013-12-12 2015-10-01 Nant Holdings Ip, Llc Image Recognition Verification
CN106055704A (en) * 2016-06-22 2016-10-26 重庆中科云丛科技有限公司 Image retrieving and matching method and system
CN106599307A (en) * 2016-12-29 2017-04-26 北京奇虎科技有限公司 Image matching method and device
CN106682201A (en) * 2016-12-29 2017-05-17 北京奇虎科技有限公司 image matching method and image matching device

Similar Documents

Publication Publication Date Title
US10593334B2 (en) Method and apparatus for generating voiceprint information comprised of reference pieces each used for authentication
CN105095211B (en) The acquisition methods and device of multi-medium data
US11144661B2 (en) User permission allocation method and device
US20170302662A1 (en) Account information obtaining method, terminal, server and system
WO2016101766A1 (en) Method and device for obtaining similar face images and face image information
WO2018045977A1 (en) Shared resource display method, device and storage medium
CN103279764A (en) Real-name network authentication system based on face identification
WO2015196964A1 (en) Matching picture search method, picture search method and apparatuses
CN112650875A (en) House image verification method and device, computer equipment and storage medium
US20200218772A1 (en) Method and apparatus for dynamically identifying a user of an account for posting images
CN109510806A (en) Method for authenticating and device
CN103744895A (en) Method and device for obtaining resident identity information
CN109117622A (en) A kind of identity identifying method based on audio-frequency fingerprint
US20230410221A1 (en) Information processing apparatus, control method, and program
CN107391543B (en) Wireless hotspot type identification method and device
CN111488813B (en) Video emotion marking method and device, electronic equipment and storage medium
CN107656959B (en) Message leaving method and device and message leaving equipment
CN112182520B (en) Identification method and device of illegal account number, readable medium and electronic equipment
CN105488105B (en) The treating method and apparatus of the method for building up of information extraction template, knowledge data
WO2018121375A1 (en) Image matching method and apparatus
CN106682201B (en) Image matching method and device
CN111125369A (en) Tacit degree detection method, equipment, server and readable storage medium
CN106599307B (en) Image matching method and device
CN105472162B (en) A kind of information processing method and electronic equipment
CN115984977A (en) Living body detection method and system

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: 17887991

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: 17887991

Country of ref document: EP

Kind code of ref document: A1