CN106599307B - Image matching method and device - Google Patents
Image matching method and device Download PDFInfo
- Publication number
- CN106599307B CN106599307B CN201611247094.8A CN201611247094A CN106599307B CN 106599307 B CN106599307 B CN 106599307B CN 201611247094 A CN201611247094 A CN 201611247094A CN 106599307 B CN106599307 B CN 106599307B
- Authority
- CN
- China
- Prior art keywords
- image
- matching
- client
- queue
- image recognition
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/50—Information retrieval; Database structures therefor; File system structures therefor of still image data
- G06F16/58—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
- G06F16/5866—Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using information manually generated, e.g. tags, keywords, comments, manually generated location and time information
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Library & Information 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
The invention provides an image matching method and device, wherein the method comprises the following steps: receiving an image matching request from a client, wherein 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; matching a queue corresponding to the first key in queues which are stored in a database and take different keys as indexes, wherein image identification documents of images from different clients but with the same key are stored in each queue; reading the matched image recognition documents in the queue, matching the image recognition documents according to preset matching logic to obtain an image matching result, and correspondingly obtaining the matching result of the client and other clients based on the image matching result. By adopting the method and the system, the relationship among the images from different clients can be embodied, so that the interaction mode among the different clients is increased, and the social contact and the interestingness of the clients are improved.
Description
Technical Field
The invention relates to the field of computer science and technology, in particular to an image matching method and device.
Background
With the development of internet technology, technologies in many other fields are also being developed. Along with this, the demands on the quality of life are becoming higher and higher. Images are the main source of information acquired and exchanged by human beings, and therefore, the application of image processing also necessarily involves aspects of human life. Although people face different problems in daily life, more and more methods can be used for solving the problems. However, there are many problems in processing images at present.
With the continuous development of image processing technology, the image processing field relates to various aspects of human life, work and the like. Image processing techniques in the prior art are more and more mature, and different images can be identified by analyzing feature information of different images, so that different images can be effectively distinguished.
However, most of the technologies related to image processing in the client end at present analyze a single image to obtain some important information in the single image, and such technologies are independent from each other in the process of processing different images, and the processing results of the obtained images are not necessarily related. Therefore, the existing image processing mode is single, which is not beneficial to analyzing and acquiring the relation among a plurality of images, and meanwhile, the single image is processed, which is not beneficial to the interaction among a plurality of clients.
Therefore, there is a need for a processing method capable of conveniently providing a user with an image satisfying his or her needs.
Disclosure of Invention
In view of the above, the present invention has been made to provide an image matching method and apparatus that overcome or at least partially solve the above problems.
Based on one aspect of the invention, the invention provides an image matching method, which comprises the following steps:
receiving an image matching request from a client, wherein 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;
matching a queue corresponding to the first key in queues which are stored in a database and take different keys as indexes, wherein image identification documents of images from different clients but with the same key are stored in each queue;
reading the matched image recognition documents in the queue, matching the image recognition documents according to preset matching logic to obtain an image matching result, and correspondingly obtaining the matching result of the client and other clients based on the image matching result.
Optionally, after receiving the image matching request from the client, the method further includes: and starting timing by taking the receiving time as a starting point to obtain the timing duration of the matching process.
Optionally, before reading the image recognition documents in the matched queue, the method further includes:
judging whether the timing duration exceeds the rated duration matched at this time;
if yes, stopping the matching operation;
if not, the reading operation of each image recognition file is executed.
Optionally, after the stopping of the matching operation, the method further includes: and sending an error code with unsuccessful matching to the client.
Optionally, the executing the reading operation of each image recognition document and matching each image recognition document according to a preset matching logic includes:
counting the image recognition patterns in the matched queue to obtain a counting result;
if the counting result is more than or equal to 2, executing the matching step of each image recognition scheme;
and if the counting result is less than 2, reading the matched image recognition documents in the queue again at a specified time interval.
Optionally, the reading of the matched image recognition documents in the queue at the interval specified time again includes: the matched image recognition documents in the queue are read again at an interval of 1 ms.
Optionally, the matching the image recognition documents according to a preset matching logic to obtain an image matching result includes:
carrying out weighted calculation on each image recognition case to obtain a weighted value of each image recognition case;
and comparing the weighted value of each image recognition case to obtain an image matching result.
Optionally, the performing weighted calculation on each image recognition case to obtain a weighted value of each image recognition case includes:
when each image comprises a plurality of main lines, setting a weight and a weight proportion for the case information of each main line independently;
and carrying out weighted calculation on each image recognition case to obtain the total weighted value of each image recognition case.
Optionally, obtaining a matching result between the client and another client based on the image matching result includes:
the queue also stores a client ID for uploading images to obtain an image identification file, and correspondingly stores the client ID and the image identification file of the uploaded images;
when an image matching result is obtained, reversely finding out a corresponding client ID according to each image identification file participating in the matching operation, and further confirming a client corresponding to the client ID;
and displaying the image matching result as the matching result between the client and the confirmed other clients.
Optionally, after obtaining the matching result between the client and the other clients based on the image matching result, the method includes:
selecting another client with the highest matching degree with the client from the matching results of the client and other clients;
and returning the selected other client and the corresponding matching result to the client.
Optionally, the image recognition documents in each queue are generated as follows:
receiving an image identification request from a client, wherein the image identification request carries an image to be identified and key information provided by the client;
carrying out image recognition on the image carried in the image recognition request to obtain an image recognition result;
calculating the key information of the image identification according to the preset rule to obtain a corresponding key;
and establishing a queue taking the key as an index in the database for the key, and placing the image identification pattern into the queue.
Based on another aspect of the present invention, the present invention also provides an image matching apparatus, comprising:
the system comprises a receiving module, a sending module and a receiving module, wherein the receiving module is suitable for receiving an image matching request from a client, and the image matching request carries key information of the client;
the calculation module is suitable for calculating the key information according to a preset rule to obtain a first keyword key;
the queue matching module is suitable for matching a queue corresponding to the first key in queues which are stored in a database and take different keys as indexes, wherein image identification documents of images from different clients but with the same key are stored in each queue;
and the image matching module is suitable for reading the matched image recognition documents in the queue, matching the image recognition documents according to preset matching logic to obtain an image matching result, and correspondingly obtaining the matching result of the client and other clients based on the image matching result.
Optionally, the apparatus further comprises:
and the timing module is suitable for starting timing by taking the receiving moment as a starting point after receiving the image matching request from the client to obtain timing duration.
Optionally, the timing module is further adapted to determine whether the timing duration exceeds a rated duration of the current matching before the image recognition documents in the matched queue are read;
if yes, stopping the matching operation;
if not, triggering the image matching module to execute the reading operation of each image identification file.
Optionally, the apparatus further comprises:
and the sending module is suitable for sending the error code with unsuccessful matching to the client after the matching operation is stopped.
Optionally, the image matching module is further adapted to:
counting the image recognition patterns in the matched queue to obtain a counting result;
if the counting result is more than or equal to 2, executing the matching step of each image recognition scheme;
and if the counting result is less than 2, reading the matched image recognition documents in the queue again at a specified time interval.
Optionally, the image matching module is further adapted to: the matched image recognition documents in the queue are read again at an interval of 1 ms.
Optionally, the image matching module is further adapted to:
carrying out weighted calculation on each image recognition case to obtain a weighted value of each image recognition case;
and comparing the weighted value of each image recognition case to obtain an image matching result.
Optionally, the image matching module is further adapted to:
when each image comprises a plurality of main lines, setting a weight and a weight proportion for the case information of each main line independently;
and carrying out weighted calculation on each image recognition case to obtain the total weighted value of each image recognition case.
Optionally, the image matching module is further adapted to:
the queue also stores a client ID for uploading images to obtain an image identification file, and correspondingly stores the client ID and the image identification file of the uploaded images;
when an image matching result is obtained, reversely finding out a corresponding client ID according to each image identification file participating in the matching operation, and further confirming a client corresponding to the client ID;
and displaying the image matching result as the matching result between the client and the confirmed other clients.
Optionally, the apparatus further comprises:
the selection module is suitable for selecting another client side with the highest matching degree with the client side from the matching results of the client side and other client sides after the matching results of the client side and other client sides are correspondingly obtained based on the image matching results; and returning the selected other client and the corresponding matching result to the client.
Optionally, the apparatus further comprises:
the pattern recognition module is suitable for generating the image recognition patterns in each queue according to the following steps:
receiving at least two images from a client, wherein the at least two images carry the same key information;
respectively carrying out image recognition on the at least two images to obtain image recognition results;
calculating the key information of the image identification according to the preset rule to obtain a corresponding key;
and establishing a queue taking the key as an index in the database for the key, and placing each image identification file into the queue.
In the embodiment of the invention, a plurality of queues are stored in advance in the database, each queue takes a key as an index, and each queue stores the image identification file of each image from different clients but with the same key, namely, the database stores the images requested to be identified by the clients in groups, and stores the images with the same key into the same queue, thereby providing a data basis for the subsequent matching operation. Further, if an image matching request from the client is received, the key information carried in the matching request is calculated to obtain a first key, the first key is further matched with each queue in the database, the queue corresponding to the first key is found, namely the queue taking the first key as an index, and each image identification file in the queue taking the first key as the index can be obtained. And then reading each image recognition case in the queue with the first key as the index, and matching each image recognition case according to preset matching logic to obtain an image matching result. Because the image recognition documents come from different clients, the matching results of the client and other clients are correspondingly obtained based on the image matching results. The matching result can reflect the relationship among the images from different clients, so that the interaction mode among the different clients is increased, and the social contact and the interestingness of the clients are improved. In addition, for the user using the client, the interaction among the images owned by different users can be increased, and the communication among different users can be improved. 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 identification files of the images from different clients but with the same key, the security of the images sent to the server by other clients is ensured, and the private information of the user cannot be easily leaked.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments thereof, taken in conjunction with the accompanying drawings.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 shows a schematic flow diagram of an image matching method according to an embodiment of the invention;
FIG. 2 illustrates a process flow diagram of a method for generating an image recognition document in a queue according to one embodiment of the invention;
FIG. 3 is a schematic diagram showing a structure of an image matching apparatus according to an embodiment of the present invention; and
fig. 4 is a schematic diagram showing another structure of an image matching apparatus according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In order 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 shows a schematic flow diagram of an image matching method according to an embodiment of the invention, see fig. 1, the method comprising at least steps S102 to S110.
Step S102, receiving an image matching request from a client, wherein the image matching request carries key information of the client;
step S104, calculating the key information according to a preset rule to obtain a first keyword key;
step S106, matching a queue corresponding to the first key in queues which are stored in a database and take different keys as indexes, wherein image identification documents of images from different clients but with the same key are stored in each queue;
and S108, reading the matched image recognition documents in the queue, matching the image recognition documents according to preset matching logic to obtain an image matching result, and correspondingly obtaining the matching result of the client and other clients based on the image matching result.
In the embodiment of the invention, a plurality of queues are stored in advance in the database, each queue takes a key as an index, and each queue stores the image identification file of each image from different clients but with the same key, namely, the database stores the images requested to be identified by the clients in groups, and stores the images with the same key into the same queue, thereby providing a data basis for the subsequent matching operation. Further, if an image matching request from the client is received, the key information carried in the matching request is calculated to obtain a first key, the first key is further matched with each queue in the database, the queue corresponding to the first key is found, namely the queue taking the first key as an index, and each image identification file in the queue taking the first key as the index can be obtained. And then reading each image recognition case in the queue with the first key as the index, and matching each image recognition case according to preset matching logic to obtain an image matching result. Because the image recognition documents come from different clients, the matching results of the client and other clients are correspondingly obtained based on the image matching results. The matching result can reflect the relationship among the images from different clients, so that the interaction mode among the different clients is increased, and the social contact and the interestingness of the clients are improved. In addition, for the user using the client, the interaction among the images owned by different users can be increased, and the communication among different users can be improved. 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 identification files of the images from different clients but with the same key, the security of the images sent to the server by other clients is ensured, and the private information of the user cannot be easily leaked.
It should be noted that the image identification documents in the queue are images uploaded by the clients identified in advance by the server, and corresponding image identification requests are obtained. Specifically, fig. 2 shows a processing flow diagram of a method for generating image recognition patterns 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, receiving an image identification request from a client, wherein the image identification request carries an image to be identified and key information provided by the client;
step S204, carrying out image recognition on the image carried in the image recognition request to obtain an image recognition result;
step S206, calculating the key information of the image identification according to the preset rule to obtain a corresponding key;
and S208, establishing a queue taking the key as an index in the database for the key, and placing the image identification pattern into the queue.
After the client has uploaded the image, the client may initiate the image matching request mentioned in step S102 above, and search for other clients matching the client. In an embodiment of the present invention, after receiving the image matching request from the client, timing may be started from a time when the matching request is received as a starting point, so as to obtain a timing duration of the matching process. Due to the different complexity of different image contents, if the image contents are more complex, more image recognition and image matching time is required. In addition, in the transmission process of the image, emergencies such as file loss, network interruption and the like may exist, at this time, the matching process can be timed, the time spent in the image matching process can be effectively controlled, and corresponding solutions are adopted according to different timing durations, so that the matching efficiency of the image matching is improved.
Specifically, before reading each image recognition document from the queue indexed by the first key, it may be determined whether a timing duration from a time of the matching request exceeds a rated duration of the current matching, if so, the current matching operation is terminated, and if not, the reading operation of each image recognition document is executed. In this embodiment, the rated time length of the matching may be preset, for example, the rated time length is set to 2 seconds, if the time length exceeds 2 seconds from the time when the matching request is received, the matching operation is terminated this time, and if the time length does not exceed 2 seconds from the time when the matching request is received, each image recognition document is read from the queue indexed by the first key according to the first key. If yes, the matching operation is directly stopped, an error code with unsuccessful matching is sent to the client, and the client is informed that the matching operation is finished.
With reference to the step S108, in an embodiment of the present invention, in order to ensure that the content read from the queue is effective and complete and can complete the subsequent matching operation, when the image recognition documents are read from the queue, the image recognition documents in the queue may be counted to obtain a counting result, and the counting result is correspondingly determined. If the counting result is greater than or equal to 2, at least 2 image recognition documents are stored in the certification queue, and the matching operation of the image recognition documents can be performed, then the present example continues to execute the matching step of each image recognition scheme, if the counting result is less than 2, the situation that only 1 image recognition document is stored may occur in the certification queue, even if any image recognition document is not stored in the queue, the matching operation cannot be performed, but the current matching time does not exceed the rated time of the current matching and is still within the effective matching time, then the present example may read the image recognition documents in the queue again at the interval of the specified time. The image recognition documents with the image recognition rate less than 2 appear in the queue, which may be caused by that the server has not completed the recognition operation of other images, or the image recognition documents are deleted due to the fact that the image recognition rate exceeds the storage time of the queue in the storage process, or may be caused by data loss and the like.
In this embodiment, the interval time may be set to be 1ms, of course, other interval times may also be set, such as 0.9ms, 1.5ms, and the like, and the specific value of the interval time may be set according to the actual situation, which is not limited in this embodiment of the present invention.
Referring to step S108, in an embodiment of the present invention, the image recognition documents are matched, and the matching process may specifically be that, first, weighting calculation is performed on each image recognition document to obtain a weighted value of each image recognition document. And then, comparing the weighted values of the image identification documents to obtain an image matching result, and further taking the image matching result as the matching result of the client and other clients.
In this embodiment, if each image includes a plurality of main lines, the server needs to draw the main lines of each image in advance, and the following describes a drawing process of the main lines of the image specifically.
Firstly, the edge of each line in the image can be detected by adopting an edge detection algorithm to obtain a detection result image of the edge detection algorithm. For example, Canny operator can be used for edge detection of the image, and the essence of Canny operator edge detection is to solve the problem of maximum value of a signal function to judge image edge pixel points.
And further, carrying out self-adaptive contour extraction operation on the lines according to the detection result graph obtained by the edge detection algorithm to obtain the line contour of each line. A binary image is output according to the self-adaptive contour extraction operation requirement, namely the image only has black gray and white gray, one gray represents the edge, the other gray represents the background, and the line contour can be clearer by performing deeper processing on the edge information.
After the preliminary acquired line profile, there may be some profile with moire interference. In order to further obtain a complete and clear main line profile, the obtained line profiles of the lines can be subjected to screening processing, so that the line profile meeting the main line standard is obtained.
When the obtained line profile of each line is subjected to screening processing, the numerical value of the pixel point of each line profile can be calculated. And after the numerical value of the pixel point of each line profile is determined, deleting the line profiles of which the number of the pixel points is less than N. In the embodiment of the present invention, N is 20. Therefore, the numerical value of the pixel point of each line profile in the image obtained at this time is not less than 20. After the steps, if the ratio of the numerical value of the pixel point of each line profile to the total pixel point of the image is higher than the set ratio, adjusting the edge detection algorithm, and detecting the edge of each line in the image again by using a new edge detection algorithm until the line profile meeting the main line standard is obtained. In the embodiment of the present invention, the set ratio is taken to be 3%. That is to say, when the ratio of the numerical value of the pixel point of each line profile to the total pixel point of the image is higher than 3%, the edge detection algorithm is adjusted, and the edge of each line in the image is detected again by using a new edge detection algorithm until the line profile meeting the main line standard is obtained. It should be noted that the value of N is 20 and the value of the set ratio is 3%, which are merely exemplary of the embodiment of the present invention, and the embodiment is not particularly limited thereto, and the specific values of N and the set ratio are determined by specific situations, for example, N may also be 30, or may also be 40, and the set ratio may also be 4, or may also be 5%.
And finally, determining the area where the main line is located according to the screened line profile, and then merging the line profiles in the area to draw the corresponding main line.
The method for drawing the main lines is mainly based on the principle that the image is provided with enough and sufficient information by the main lines, various complex images are analyzed and processed, the main lines are extracted, the content of the image is simplified, clarified and obvious, the image information content can be well extracted, and important information in the image caused by the blurring of the image is prevented from being ignored.
After the main lines of each image are drawn, a weight and a weight proportion can be set for the case information of each main line individually, and then the image recognition cases are weighted and calculated according to the weight and the weight proportion of each main line, so as to obtain the total weight of each image recognition case.
The following describes a process of calculating the weight of the image recognition pattern in an embodiment, where the image recognition pattern is an image recognition pattern related to a flower, in this case, the client provides a rose image, the other clients provide a lily image and a rose image, and all three clients use the same key information 1234.
For example, since the overall contour and the pistil of each flower are different from one another and the characteristics of the flower can be clearly expressed, the contour and the length of the pistil of each flower can be used as a main line.
After the server identifies and obtains the image identification pattern of the rose, the image identification pattern of the lily and the image identification pattern of the rose, the three image identification patterns are put into the same queue, and the index of the queue is 01 obtained by calculating the key information 1234.
Subsequently, when receiving a matching request initiated by the client, the server reads the image identification patterns of the roses, the lily and the pistil from the queue with key of 01, and sets the weight proportions of the outlines of the flowers and the lengths of the pistils to be 60% and 40% respectively.
Firstly, matching the image recognition patterns of the roses and the lily. The pattern information of the lily flower image is respectively provided with 70 and 30 weight values of the outline of the flower and the length of the stamen, and the total weight value S1 of the lily flower image identification pattern is calculated to be 70 × 60% +30 × 40% + 54. The weight values of the outline of the flower and the length of the stamen are respectively set to be 40 and 10 in the pattern information of the rose image, and the total weight value S2 of the identification pattern of the rose image is calculated to be 40 × 60% +10 × 40% + 28. Comparing the total weight value S1 with the total weight value S2 results in a larger difference between the total weight values 54 and 28, i.e., a larger difference between the lily image and the rose image.
In addition, in combination with real life situations, there is indeed a large difference between lily and rose. The petals of the lily are strip-shaped, and the whole flower is provided with a layer of petals. The petals of the rose are similar to a circle, and the whole flower has multiple layers of petals. The stamen of the lily in the open state is obvious, the length of the stamen of the lily is long, the stamen of the rose in the open state is surrounded in the petals layer by layer and is not obvious, and the length of the stamen of the rose is short.
And secondly, matching the image recognition patterns of the roses and the image recognition patterns of the Chinese roses. In the pattern information of the rose image, the weight values of the outline of the flower and the length of the flower core are respectively set to be 30 and 20, and the total weight value S2 of the pattern recognition of the rose image is calculated to be 30 × 60% +20 × 40% + 26. The weight values of the outline of the flower and the length of the stamen are respectively set to be 40 and 10 in the pattern information of the rose image, and the total weight value S2 of the identification pattern of the rose image is calculated to be 40 × 60% +10 × 40% + 28. Comparing the total weight value S2 with the total weight value S3 results in a smaller difference between the total weight values 28 and 26. Therefore, the difference between the images of the Chinese rose flowers and the images of the rose flowers is not great.
After obtaining the image matching result, step S108 also mentions that the matching result of the client and the other clients can be correspondingly obtained based on the image matching result. In order to ensure that the client and the image can be identified correspondingly, specifically, the queue provided by the embodiment of the invention further stores the client ID for uploading the image to obtain the image identification file, and stores the client ID and the image identification file of the uploaded image correspondingly. And when an image matching result is obtained, reversely finding the corresponding client ID according to each image identification file participating in the matching operation, and further confirming the client corresponding to the client ID. Therefore, the corresponding relation between the image recognition file and the client can be formed, and the image matching result can reflect the matching result between the clients, so that the image matching result can be displayed as the matching result between the client and the confirmed other clients.
In order to improve the data statistics result and increase the sociability of the client, another client with the highest matching degree with the client may be selected from the matching results of the client and the other clients, and the selected another client and the corresponding matching result are returned to the client.
Based on the same inventive concept, the embodiment of the present invention further provides an image matching apparatus, which is used to support the image matching method provided by any one of the above preferred embodiments or a combination thereof. Fig. 3 shows a schematic structural diagram of an image matching apparatus according to an embodiment of the present invention. Referring to fig. 3, the apparatus comprises at least:
a receiving module 310, adapted to receive an image matching request from a client, where the image matching request carries key information of the client;
the calculation module 320 is coupled with the receiving module 310 and is adapted 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 queues indexed by different keys stored in the database, wherein each queue stores image recognition documents of each image from different clients but having the same key;
and the image matching module 340 is coupled with the queue matching module 330 and is adapted to read the image recognition documents in the matched queue, match the image recognition documents according to a preset matching logic to obtain an image matching result, and correspondingly obtain a matching result between the client and other clients based on the image matching result.
In a preferred embodiment, referring to fig. 4, the image matching apparatus may further include:
the timing module 350, coupled to the receiving module 310, is adapted to start timing by using the receiving time as a starting point after receiving the image matching request from the client, so as to obtain a timing duration.
In a preferred embodiment, the timing module 350 is further adapted to determine whether the timing duration exceeds a rated duration of the matching before the image recognition documents in the matched queue are read;
if yes, stopping the matching operation;
if not, the image matching module 340 is triggered to execute the reading operation of each image recognition file.
In a preferred embodiment, referring to fig. 4, the image matching apparatus may further include:
a sending module 360, coupled to the timing module 350, adapted to send an error code indicating that the matching is unsuccessful to the client after the matching operation is terminated.
In a preferred embodiment, the image matching module 340 may be further adapted to:
counting the image recognition patterns in the matched queue to obtain a counting result;
if the counting result is more than or equal to 2, executing the matching step of each image recognition scheme;
and if the counting result is less than 2, reading the matched image recognition documents in the queue again at a specified time interval.
In a preferred embodiment, the image matching module 340 may be further adapted to: the matched image recognition documents in the queue are read again at an interval of 1 ms.
In a preferred embodiment, the image matching module 340 may be further adapted to:
carrying out weighted calculation on each image recognition case to obtain a weighted value of each image recognition case;
and comparing the weighted value of each image recognition case to obtain an image matching result.
In a preferred embodiment, the image matching module 340 may be further adapted to:
when each image comprises a plurality of main lines, setting a weight and a weight proportion for the case information of each main line independently;
and carrying out weighted calculation on each image recognition case to obtain the total weighted value of each image recognition case.
In a preferred embodiment, the image matching module 340 may be further adapted to:
the queue also stores a client ID for uploading images to obtain an image identification file, and correspondingly stores the client ID and the image identification file of the uploaded images;
when an image matching result is obtained, reversely finding out a corresponding client ID according to each image identification file participating in the matching operation, and further confirming a client corresponding to the client ID;
and displaying the image matching result as the matching result between the client and the confirmed other clients.
In a preferred embodiment, referring to fig. 4, the image matching apparatus may further include:
the selection module 370, coupled to the image matching module 340, is adapted to select another client with the highest matching degree with the current client from the matching results of the current client and the other clients after obtaining the matching results of the current client and the other clients based on the image matching results; and returning the selected other client and the corresponding matching result to the client.
In a preferred embodiment, referring to fig. 4, the image matching apparatus may further include:
the pattern recognition module 380, coupled to the queue matching module 330, is adapted to generate image recognition patterns in each queue as follows:
receiving at least two images from a client, wherein the at least two images carry the same key information;
respectively carrying out image recognition on the at least two images to obtain image recognition results;
calculating the key information of the image identification according to the preset rule to obtain a corresponding key;
and establishing a queue taking the key as an index in the database for the key, and placing each image identification file into the queue.
The image matching method and the image matching device provided by the embodiment of the invention can achieve the following beneficial effects:
in the embodiment of the invention, a plurality of queues are stored in advance in the database, each queue takes a key as an index, and each queue stores the image identification file of each image from different clients but with the same key, namely, the database stores the images requested to be identified by the clients in groups, and stores the images with the same key into the same queue, thereby providing a data basis for the subsequent matching operation. Further, if an image matching request from the client is received, the key information carried in the matching request is calculated to obtain a first key, the first key is further matched with each queue in the database, the queue corresponding to the first key is found, namely the queue taking the first key as an index, and each image identification file in the queue taking the first key as the index can be obtained. And then reading each image recognition case in the queue with the first key as the index, and matching each image recognition case according to preset matching logic to obtain an image matching result. Because the image recognition documents come from different clients, the matching results of the client and other clients are correspondingly obtained based on the image matching results. The matching result can reflect the relationship among the images from different clients, so that the interaction mode among the different clients is increased, and the social contact and the interestingness of the clients are improved. In addition, for the user using the client, the interaction among the images owned by different users can be increased, and the communication among different users can be improved. 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 identification files of the images from different clients but with the same key, the security of the images sent to the server by other clients is ensured, and the private information of the user cannot be easily leaked.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed 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 furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components of an image matching apparatus according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may 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 may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
Thus, it should be appreciated by those skilled in the art that while a number of exemplary embodiments of the invention have been illustrated and described in detail herein, many other variations or modifications consistent with the principles of the invention may be directly determined or derived from the disclosure of the present invention without departing from the spirit and scope of the invention. Accordingly, the scope of the invention should be understood and interpreted to cover all such other variations or modifications.
Claims (22)
1. An image matching method, comprising:
receiving an image matching request from a client, wherein 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;
matching a queue corresponding to the first key in queues which are stored in a database and take different keys as indexes, wherein image identification documents of images from different clients but with the same key are stored in each queue;
reading the matched image recognition documents in the queue, matching the image recognition documents according to preset matching logic to obtain an image matching result, and correspondingly obtaining the matching result of the client and other clients based on the image matching result.
2. The method of claim 1, wherein after receiving the image matching request from the client, further comprising: and starting timing by taking the receiving time as a starting point to obtain the timing duration of the matching process.
3. The method of claim 1 or 2, wherein the reading the matched image recognition documents in the queue is preceded by:
judging whether the timing duration exceeds the rated duration matched at this time;
if yes, stopping the matching operation;
if not, the reading operation of each image recognition file is executed.
4. The method according to claim 3, wherein after the suspending the matching operation, further comprising: and sending an error code with unsuccessful matching to the client.
5. The method of claim 3, wherein the reading operation of each image recognition document is performed, and the matching of each image recognition document is performed according to preset matching logic, and comprises the following steps:
counting the image recognition patterns in the matched queue to obtain a counting result;
if the counting result is more than or equal to 2, executing the matching step of each image recognition scheme;
and if the counting result is less than 2, reading the matched image recognition documents in the queue again at a specified time interval.
6. The method of claim 5, wherein the interval-specified time to re-read the matched image recognition documents in the queue comprises: the matched image recognition documents in the queue are read again at an interval of 1 ms.
7. The method according to claim 1 or 2, wherein the matching of the image recognition documents according to the preset matching logic to obtain the image matching result comprises:
carrying out weighted calculation on each image recognition case to obtain a weighted value of each image recognition case;
and comparing the weighted value of each image recognition case to obtain an image matching result.
8. The method of claim 7, wherein the performing a weighted calculation on each image recognition document to obtain a weighted value of each image recognition document comprises:
when each image comprises a plurality of main lines, setting a weight and a weight proportion for the case information of each main line independently;
and carrying out weighted calculation on each image recognition case to obtain the total weighted value of each image recognition case.
9. The method according to claim 1 or 2, wherein obtaining the matching results of the client and other clients based on the image matching results respectively comprises:
the queue also stores a client ID for uploading images to obtain an image identification file, and correspondingly stores the client ID and the image identification file of the uploaded images;
when an image matching result is obtained, reversely finding out a corresponding client ID according to each image identification file participating in the matching operation, and further confirming a client corresponding to the client ID;
and displaying the image matching result as the matching result between the client and the confirmed other clients.
10. The method according to claim 1 or 2, wherein after obtaining the matching result of the client and the other clients based on the image matching result, the method comprises:
selecting another client with the highest matching degree with the client from the matching results of the client and other clients;
and returning the selected other client and the corresponding matching result to the client.
11. A method according to claim 1 or claim 2, wherein the image recognition documents in each queue are generated by:
receiving an image identification request from a client, wherein the image identification request carries an image to be identified and key information provided by the client;
carrying out image recognition on the image carried in the image recognition request to obtain an image recognition result;
calculating the key information of the image identification according to the preset rule to obtain a corresponding key;
and establishing a queue taking the key as an index in the database for the key, and placing the image identification pattern into the queue.
12. An image matching apparatus comprising:
the system comprises a receiving module, a sending module and a receiving module, wherein the receiving module is suitable for receiving an image matching request from a client, and the image matching request carries key information of the client;
the calculation module is suitable for calculating the key information according to a preset rule to obtain a first keyword key;
the queue matching module is suitable for matching a queue corresponding to the first key in queues which are stored in a database and take different keys as indexes, wherein image identification documents of images from different clients but with the same key are stored in each queue;
and the image matching module is suitable for reading the matched image recognition documents in the queue, matching the image recognition documents according to preset matching logic to obtain an image matching result, and correspondingly obtaining the matching result of the client and other clients based on the image matching result.
13. The apparatus of claim 12, further comprising:
and the timing module is suitable for starting timing by taking the receiving moment as a starting point after receiving the image matching request from the client to obtain timing duration.
14. The apparatus of claim 12 or 13,
the timing module is also suitable for judging whether the timing time length exceeds the rated time length of the current matching before reading the matched image recognition file in the queue;
if yes, stopping the matching operation;
if not, triggering the image matching module to execute the reading operation of each image identification file.
15. The apparatus of claim 14, further comprising:
and the sending module is suitable for sending the error code with unsuccessful matching to the client after the matching operation is stopped.
16. The apparatus of claim 14, wherein the image matching module is further adapted to:
counting the image recognition patterns in the matched queue to obtain a counting result;
if the counting result is more than or equal to 2, executing the matching step of each image recognition scheme;
and if the counting result is less than 2, reading the matched image recognition documents in the queue again at a specified time interval.
17. The apparatus of claim 16, wherein the image matching module is further adapted to: the matched image recognition documents in the queue are read again at an interval of 1 ms.
18. The apparatus of claim 12 or 13, wherein the image matching module is further adapted to:
carrying out weighted calculation on each image recognition case to obtain a weighted value of each image recognition case;
and comparing the weighted value of each image recognition case to obtain an image matching result.
19. The apparatus of claim 18, wherein the image matching module is further adapted to:
when each image comprises a plurality of main lines, setting a weight and a weight proportion for the case information of each main line independently;
and carrying out weighted calculation on each image recognition case to obtain the total weighted value of each image recognition case.
20. The apparatus of claim 12 or 13, wherein the image matching module is further adapted to:
the queue also stores a client ID for uploading images to obtain an image identification file, and correspondingly stores the client ID and the image identification file of the uploaded images;
when an image matching result is obtained, reversely finding out a corresponding client ID according to each image identification file participating in the matching operation, and further confirming a client corresponding to the client ID;
and displaying the image matching result as the matching result between the client and the confirmed other clients.
21. The apparatus of claim 12 or 13, further comprising:
the selection module is suitable for selecting another client side with the highest matching degree with the client side from the matching results of the client side and other client sides after the matching results of the client side and other client sides are correspondingly obtained based on the image matching results; and returning the selected other client and the corresponding matching result to the client.
22. The apparatus of claim 12 or 13, further comprising:
the pattern recognition module is suitable for generating the image recognition patterns in each queue according to the following steps:
receiving at least two images from a client, wherein the at least two images carry the same key information;
respectively carrying out image recognition on the at least two images to obtain image recognition results;
calculating the key information of the image identification according to the preset rule to obtain a corresponding key;
and establishing a queue taking the key as an index in the database for the key, and placing each image identification file into the queue.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611247094.8A CN106599307B (en) | 2016-12-29 | 2016-12-29 | Image matching method and device |
PCT/CN2017/117433 WO2018121375A1 (en) | 2016-12-29 | 2017-12-20 | Image matching method and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611247094.8A CN106599307B (en) | 2016-12-29 | 2016-12-29 | Image matching method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106599307A CN106599307A (en) | 2017-04-26 |
CN106599307B true CN106599307B (en) | 2020-04-24 |
Family
ID=58605214
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611247094.8A Active CN106599307B (en) | 2016-12-29 | 2016-12-29 | Image matching method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106599307B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018121375A1 (en) * | 2016-12-29 | 2018-07-05 | 北京奇虎科技有限公司 | Image matching method and apparatus |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106055704A (en) * | 2016-06-22 | 2016-10-26 | 重庆中科云丛科技有限公司 | Image retrieving and matching method and system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10318576B2 (en) * | 2013-12-12 | 2019-06-11 | Nant Holdings Ip, Llc | Image recognition verification |
-
2016
- 2016-12-29 CN CN201611247094.8A patent/CN106599307B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106055704A (en) * | 2016-06-22 | 2016-10-26 | 重庆中科云丛科技有限公司 | Image retrieving and matching method and system |
Also Published As
Publication number | Publication date |
---|---|
CN106599307A (en) | 2017-04-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11381556B2 (en) | Method and device for information interaction and association between human biological feature data and account | |
CA3040856C (en) | Methods and apparatus for false positive minimization in facial recognition applications | |
JP6316447B2 (en) | Object search method and apparatus | |
CN106157344B (en) | Verification picture generation method and device | |
US10282366B2 (en) | Multi-dimensional decomposition computing method and system | |
US9633272B2 (en) | Real time object scanning using a mobile phone and cloud-based visual search engine | |
WO2020044099A1 (en) | Service processing method and apparatus based on object recognition | |
US20170180506A1 (en) | Method and apparatus for obtaining user account | |
CN106162303B (en) | Information processing method, information processing unit and user equipment | |
CN102063659B (en) | Method, server and system for collecting and making electronic photo | |
WO2020125217A1 (en) | Expression recognition method and apparatus and recommendation method and apparatus | |
US20230308411A1 (en) | Relationship-agnostic messaging system | |
CN106599307B (en) | Image matching method and device | |
CN102063660B (en) | Acquisition method for electronic photograph, client, server and system | |
CN106384058A (en) | Method and device for posting picture | |
CN106682201B (en) | Image matching method and device | |
CN112200961B (en) | Page generation method, device, system, electronic equipment and computer readable medium | |
CN104424485A (en) | Method and device for obtaining specific information based on image recognition | |
WO2015165331A9 (en) | Information processing method and apparatus | |
CN106846351B (en) | Image processing method and client | |
CN115984977A (en) | Living body detection method and system | |
CN105718314B (en) | Event execution method and apparatus and system | |
CN109271771A (en) | Account information method for retrieving, device, computer equipment | |
CN106888335A (en) | A kind of information determines method, server and terminal | |
WO2018121375A1 (en) | Image matching method and apparatus |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |