[go: up one dir, main page]

CN105989345A - Method and device for discovering friends by image matching - Google Patents

Method and device for discovering friends by image matching Download PDF

Info

Publication number
CN105989345A
CN105989345A CN201510090499.4A CN201510090499A CN105989345A CN 105989345 A CN105989345 A CN 105989345A CN 201510090499 A CN201510090499 A CN 201510090499A CN 105989345 A CN105989345 A CN 105989345A
Authority
CN
China
Prior art keywords
image
matching
matched
type
identification
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.)
Pending
Application number
CN201510090499.4A
Other languages
Chinese (zh)
Inventor
陈昌洲
韩涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201510090499.4A priority Critical patent/CN105989345A/en
Priority to PCT/CN2016/074650 priority patent/WO2016134666A1/en
Publication of CN105989345A publication Critical patent/CN105989345A/en
Pending legal-status Critical Current

Links

Classifications

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

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)
  • Image Analysis (AREA)
  • Processing Or Creating Images (AREA)
  • Studio Devices (AREA)

Abstract

本发明实施例提供一种图像匹配发现好友的方法和装置,客户端通过接收用户输入的待匹配图像的匹配类型,采用与待匹配图像的匹配类型对应的匹配算法获取待匹配图像的匹配参数,然后,将待匹配图像的匹配参数、匹配类型和匹配算法的标识发送给服务器,服务器根据待匹配图像的匹配参数、匹配类型和匹配算法的标识与图像库中的图像进行匹配,找到与待匹配图像匹配的目标图像,并向客户端返回的匹配结果,匹配结果中包括匹配到的目标图像所属的用户的信息,目标图像所属的用户即为好友。上述方法通过利用用户已有的图像资源进行图像匹配找到好友,方便用户发现好友。

Embodiments of the present invention provide a method and device for finding friends by image matching. The client receives the matching type of the image to be matched input by the user and uses a matching algorithm corresponding to the matching type of the image to be matched to obtain the matching parameters of the image to be matched. Then, the matching parameter, matching type and matching algorithm identification of the image to be matched are sent to the server, and the server matches the image in the image library according to the matching parameter, matching type and matching algorithm identification of the image to be matched, and finds the The image is matched with the target image, and the matching result is returned to the client. The matching result includes the information of the user to which the matched target image belongs, and the user to which the target image belongs is a friend. The above-mentioned method finds friends by using the user's existing image resources to perform image matching, which is convenient for the user to find friends.

Description

图像匹配发现好友的方法和装置Method and device for finding friends by image matching

技术领域technical field

本发明实施例涉及通信技术,尤其涉及一种图像匹配发现好友的方法和装置。The embodiments of the present invention relate to communication technologies, and in particular to a method and device for finding friends by image matching.

背景技术Background technique

随着移动终端的发展,社交迅猛发展,重要性日益提升,如何通过合理的引导为用户建立社交关系,成为各大厂商争相挖掘的重点,业界知名应用,都将发现好友单独作为产品的一个主入口,发现好友的手段也层出不穷。With the development of mobile terminals, social networking is developing rapidly and its importance is increasing. How to establish social relationships for users through reasonable guidance has become the focus of major manufacturers. Well-known applications in the industry will find that friends are alone as a part of the product. At the main entrance, there are endless ways to find friends.

现有技术中,一种方法是根据用户填写的账号、昵称、电话号码、工作单位、兴趣爱好、近期活动等各种信息为用户推荐潜在的好友。客户端在发现用户潜在的好友之后,将好友的账号、昵称等呈现到用户界面上,用户通过账号、昵称等进行搜索,继而添加好友。另一种方式是扫描好友生成的二维码,快速获得好友的信息,申请添加为好友。In the prior art, one method is to recommend potential friends to the user according to various information such as account number, nickname, phone number, work unit, hobbies, and recent activities filled in by the user. After discovering the potential friends of the user, the client presents the account numbers and nicknames of the friends on the user interface, and the user searches through the account numbers and nicknames, and then adds friends. Another way is to scan the QR code generated by a friend to quickly obtain the friend's information and apply to be added as a friend.

现有技术中的方法单一,灵活性差。第二种方式中,用户必须获取到朋友的二维码才能加为好友,灵活性差,不便于用户发下好友。The method in the prior art is single and has poor flexibility. In the second method, the user must obtain the QR code of the friend to add as a friend, which has poor flexibility and is not convenient for the user to send a friend.

发明内容Contents of the invention

本发明实施例提供一种图像匹配发现好友的方法和装置,能够灵活方便的发现好友。Embodiments of the present invention provide a method and device for finding friends by image matching, which can find friends flexibly and conveniently.

本发明第一方面提供一种图像匹配发现好友的方法,包括:The first aspect of the present invention provides a method for finding friends by image matching, including:

客户端接收用户输入的待匹配图像和所述待匹配图像的匹配类型;The client receives the image to be matched and the matching type of the image to be matched input by the user;

所述客户端采用与所述待匹配图像的匹配类型对应的匹配算法获取所述待匹配图像的匹配参数;The client adopts a matching algorithm corresponding to the matching type of the image to be matched to obtain the matching parameters of the image to be matched;

所述客户端将所述待匹配图像的匹配参数、所述待匹配图像的匹配类型和所述匹配算法的标识发送给服务器,以使所述服务器根据所述待匹配图像的匹配参数、所述待匹配图像的匹配类型和所述匹配算法的标识与图像库中的图像进行匹配,找到与所述待匹配图像匹配的目标图像;The client sends the matching parameters of the image to be matched, the matching type of the image to be matched, and the identification of the matching algorithm to the server, so that the server can use the matching parameters of the image to be matched, the The matching type of the image to be matched and the identification of the matching algorithm are matched with the images in the image library, and a target image matching the image to be matched is found;

所述客户端接收所述服务器返回的匹配结果,所述匹配结果中包括匹配到的所述目标图像所属的用户的信息。The client receives the matching result returned by the server, and the matching result includes information about the user to which the matched target image belongs.

结合本发明第一方面,在本发明第一方面的第一种可能的实现方式中,当所述待匹配图像的匹配类型为人脸匹配类型时,所述客户端采用与所述待匹配图像的匹配类型对应的匹配算法获取所述待匹配图像的匹配参数,包括:With reference to the first aspect of the present invention, in the first possible implementation manner of the first aspect of the present invention, when the matching type of the image to be matched is the face matching type, the client adopts the matching method of the image to be matched The matching algorithm corresponding to the matching type obtains the matching parameters of the image to be matched, including:

所述客户端采用与所述人脸匹配类型对应的匹配算法,提取所述待匹配图像的人脸特征。The client uses a matching algorithm corresponding to the face matching type to extract the face features of the image to be matched.

结合本发明第一方面,在本发明第一方面的第二种可能的实现方式中,当所述待匹配图像的匹配类型为背景匹配类型时,所述客户端采用与所述待匹配图像的匹配类型对应的匹配算法获取所述待匹配图像的匹配参数,包括:With reference to the first aspect of the present invention, in the second possible implementation manner of the first aspect of the present invention, when the matching type of the image to be matched is the background matching type, the client uses the The matching algorithm corresponding to the matching type obtains the matching parameters of the image to be matched, including:

所述客户端采用与所述背景匹配类型对应的算法,提取所述待匹配图像的背景的颜色特征。The client uses an algorithm corresponding to the background matching type to extract the color features of the background of the image to be matched.

结合本发明第一方面,在本发明第一方面的第三种可能的实现方式中,当所述待匹配图像的匹配类型为地点匹配类型时,所述客户端采用与所述待匹配图像的匹配类型对应的匹配算法获取所述待匹配图像的匹配参数,包括:With reference to the first aspect of the present invention, in a third possible implementation manner of the first aspect of the present invention, when the matching type of the image to be matched is a location matching type, the client uses the The matching algorithm corresponding to the matching type obtains the matching parameters of the image to be matched, including:

所述客户端采用与所述地点匹配类型对应的算法,提取所述待匹配图像的纹理特征。The client uses an algorithm corresponding to the location matching type to extract texture features of the image to be matched.

结合本发明第一方面的第三种可能的实现方式,在本发明第一方面的第四种可能的实现方式中,所述待匹配图像的匹配参数还包括所述待匹配图像的拍摄地点信息,则所述方法还包括:With reference to the third possible implementation of the first aspect of the present invention, in the fourth possible implementation of the first aspect of the present invention, the matching parameters of the image to be matched further include shooting location information of the image to be matched , the method also includes:

所述客户端从所述待匹配图像的文件头信息中获取所述待匹配图像的拍摄地点信息。The client acquires the shooting location information of the image to be matched from the file header information of the image to be matched.

结合本发明第一方面,在本发明第一方面的第五种可能的实现方式中,当所述待匹配图像的匹配类型为作者匹配类型时,所述客户端采用与所述待匹配图像的匹配类型对应的匹配算法获取所述待匹配图像的匹配参数,包括:With reference to the first aspect of the present invention, in the fifth possible implementation manner of the first aspect of the present invention, when the matching type of the image to be matched is the author matching type, the client adopts the The matching algorithm corresponding to the matching type obtains the matching parameters of the image to be matched, including:

所述客户端采用与所述作者匹配类型对应的算法,从所述待匹配图像的文件头信息中获取所述待匹配图像的拍摄作者的信息。The client adopts an algorithm corresponding to the author matching type to obtain the information of the photographer of the image to be matched from the file header information of the image to be matched.

本发明第二方面提供一种图像匹配发现好友的方法,包括:The second aspect of the present invention provides a method for finding friends by image matching, including:

服务器接收客户端发送的待匹配图像的匹配参数、所述待匹配图像的匹配类型和所述待匹配图像的匹配类型对应的匹配算法的标识;The server receives the matching parameters of the image to be matched sent by the client, the matching type of the image to be matched, and the identification of the matching algorithm corresponding to the matching type of the image to be matched;

所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数;The server obtains the matching parameters of the images in the image library according to the matching type of the image to be matched and the identification of the matching algorithm;

所述服务器将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像;The server matches the matching parameters of the image to be matched with the matching parameters of the images in the image library, and uses the successfully matched image as the target image;

所述服务器获取所述目标图像所属的用户的信息,根据所述目标图像所属的用户的信息生成匹配结果,并将所述匹配结果发送给所述客户端。The server acquires the information of the user to which the target image belongs, generates a matching result according to the information of the user to which the target image belongs, and sends the matching result to the client.

结合本发明第二方面,在本发明第二方面的第一种可能的实现方式中,当所述待匹配图像的匹配类型为人脸匹配类型时,所述匹配算法的标识为所述人脸匹配类型对应的匹配算法的标识;With reference to the second aspect of the present invention, in the first possible implementation manner of the second aspect of the present invention, when the matching type of the image to be matched is the face matching type, the identification of the matching algorithm is the face matching The identification of the matching algorithm corresponding to the type;

所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数,包括:The server obtains the matching parameters of the images in the image library according to the matching type of the image to be matched and the identification of the matching algorithm, including:

所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述人脸匹配类型对应的匹配算法提取所述图像库中的图像的人脸特征;According to the matching type of the image to be matched and the identification of the matching algorithm, the server uses the matching algorithm corresponding to the face matching type to extract the face features of the images in the image library;

所述服务器将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像,包括:The server matches the matching parameters of the image to be matched with the matching parameters of the images in the image library, and uses the successfully matched image as the target image, including:

所述服务器将所述待匹配图像的人脸特征与所述图像库中的图像的人脸特征进行匹配,将匹配成功的图像作为所述目标图像。The server matches the facial features of the image to be matched with the facial features of the images in the image database, and uses the successfully matched image as the target image.

结合本发明第二方面,在本发明第二方面的第二种可能的实现方式中,当所述待匹配图像的匹配类型为背景匹配类型时,所述匹配算法的标识为所述背景匹配类型对应的匹配算法的标识;With reference to the second aspect of the present invention, in the second possible implementation manner of the second aspect of the present invention, when the matching type of the image to be matched is the background matching type, the identification of the matching algorithm is the background matching type The identification of the corresponding matching algorithm;

所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数,包括:The server obtains the matching parameters of the images in the image library according to the matching type of the image to be matched and the identification of the matching algorithm, including:

所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述背景匹配类型对应的匹配算法提取所述图像库中的图像的背景的颜色特征;According to the matching type of the image to be matched and the identification of the matching algorithm, the server uses the matching algorithm corresponding to the background matching type to extract the color feature of the background of the image in the image library;

所述服务器将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像,包括:The server matches the matching parameters of the image to be matched with the matching parameters of the images in the image library, and uses the successfully matched image as the target image, including:

所述服务器将所述待匹配图像的背景的颜色特征与所述图像库中的图像的背景的颜色特征进行匹配,将匹配成功的图像作为所述目标图像。The server matches the color feature of the background of the image to be matched with the color feature of the background of the image in the image library, and uses the image that is successfully matched as the target image.

结合本发明第二方面第二种可能的实现方式,在本发明第二方面的第三种可能的实现方式中,所述服务器获取所述目标图像所属的用户的信息,根据所述目标图像所属的用户的信息生成匹配结果,将所述匹配结果发送给所述客户端,包括:With reference to the second possible implementation of the second aspect of the present invention, in the third possible implementation of the second aspect of the present invention, the server obtains the information of the user to which the target image belongs, and according to the The information of the user generates a matching result, and sends the matching result to the client, including:

所述服务器获取所述目标图像所属的用户的信息;The server obtains the information of the user to whom the target image belongs;

所述服务器判断所述目标图像所属的用户的图像中与所述待匹配图像匹配的图像个数是否大于预先设置的阈值;The server judges whether the number of images matching the image to be matched in the user's image to which the target image belongs is greater than a preset threshold;

若所述目标图像所属的用户的图像中与所述待匹配图像匹配的图像个数大于所述阈值,则所述服务器将所述目标图像所属的用户的信息添加到所述匹配结果中。If the number of images of the user to which the target image belongs matches the image to be matched is greater than the threshold, the server adds information about the user to which the target image belongs to the matching result.

结合本发明第二方面,在本发明第二方面的第四种可能的实现方式中,当所述待匹配图像的匹配类型为地点匹配类型时,所述匹配算法的标识为所述地点匹配类型对应的匹配算法的标识;With reference to the second aspect of the present invention, in the fourth possible implementation of the second aspect of the present invention, when the matching type of the image to be matched is the location matching type, the identification of the matching algorithm is the location matching type The identification of the corresponding matching algorithm;

所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数,包括:The server obtains the matching parameters of the images in the image library according to the matching type of the image to be matched and the identification of the matching algorithm, including:

所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用与所述地点匹配类型对应的算法提取所述图像库中的图像的纹理特征;According to the matching type of the image to be matched and the identification of the matching algorithm, the server uses an algorithm corresponding to the location matching type to extract the texture features of the image in the image library;

所述服务器将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将所述图像库中的匹配成功的图像作为所述目标图像,包括:The server matches the matching parameters of the image to be matched with the matching parameters of the images in the image library, and uses the successfully matched image in the image library as the target image, including:

所述服务器将所述待匹配图像的纹理特征与所述图像库中的图像的纹理特征进行匹配,将匹配成功的图像作为所述目标图像。The server matches the texture feature of the image to be matched with the texture feature of the image in the image library, and takes the image that is successfully matched as the target image.

结合本发明第二方面,在本发明第二方面的第五种可能的实现方式中,当所述待匹配图像的匹配类型为地点匹配类型时,所述匹配算法的标识为所述地点匹配类型对应的匹配算法的标识;With reference to the second aspect of the present invention, in the fifth possible implementation manner of the second aspect of the present invention, when the matching type of the image to be matched is the location matching type, the identification of the matching algorithm is the location matching type The identification of the corresponding matching algorithm;

所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数,包括:The server obtains the matching parameters of the images in the image library according to the matching type of the image to be matched and the identification of the matching algorithm, including:

所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述地点匹配类型对应的算法提取所述图像库中的图像的纹理特征,并从所述图像库中的图像的文件头信息中获取所述图像库中的图像的拍摄地点信息;According to the matching type of the image to be matched and the identification of the matching algorithm, the server uses the algorithm corresponding to the location matching type to extract the texture features of the image in the image library, and extracts the texture features from the image in the image library Obtain the shooting location information of the image in the image library from the header information of the file;

所述服务器将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像,包括:The server matches the matching parameters of the image to be matched with the matching parameters of the images in the image library, and uses the successfully matched image as the target image, including:

所述服务器将所述待匹配图像中的纹理特征和拍摄地点信息,与所述图像库中的图像的纹理特征和拍摄地点信息进行匹配,将匹配成功的图像作为所述目标图像。The server matches the texture feature and shooting location information in the image to be matched with the texture feature and shooting location information of the image in the image library, and uses the successfully matched image as the target image.

结合本发明第二方面,在本发明第二方面的第六种可能的实现方式中,当所述待匹配图像的匹配类型为作者匹配类型时,所述匹配算法的标识为所述作者匹配类型对应的匹配算法的标识;With reference to the second aspect of the present invention, in the sixth possible implementation of the second aspect of the present invention, when the matching type of the image to be matched is the author matching type, the identification of the matching algorithm is the author matching type The identification of the corresponding matching algorithm;

所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数,包括:The server obtains the matching parameters of the images in the image library according to the matching type of the image to be matched and the identification of the matching algorithm, including:

所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述作者匹配类型对应的算法,从所述图像库中的图像的文件头信息中获取所述图像库中的图像的拍摄作者的信息;According to the matching type of the image to be matched and the identification of the matching algorithm, the server adopts the algorithm corresponding to the matching type of the author to obtain the image in the image library from the file header information of the image in the image library. information about the author of the image;

所述服务器将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像,包括:The server matches the matching parameters of the image to be matched with the matching parameters of the images in the image library, and uses the successfully matched image as the target image, including:

所述服务器将所述待匹配图像的拍摄作者的信息与所述图像库中的图像的拍摄作者的信息进行匹配,将匹配成功的图像作为所述目标图像。The server matches the information of the photographer of the image to be matched with the information of the photographer of the images in the image library, and uses the image that is successfully matched as the target image.

本发明第三方面提供一种客户端,包括:A third aspect of the present invention provides a client, including:

接收模块,用于接收用户输入的待匹配图像和所述待匹配图像的匹配类型;A receiving module, configured to receive an image to be matched input by a user and a matching type of the image to be matched;

获取模块,用于采用与所述待匹配图像的匹配类型对应的匹配算法获取所述待匹配图像的匹配参数;An acquisition module, configured to acquire matching parameters of the image to be matched by using a matching algorithm corresponding to the matching type of the image to be matched;

发送模块,用于将所述待匹配图像的匹配参数、所述待匹配图像的匹配类型和所述匹配算法的标识发送给服务器,以使所述服务器根据所述待匹配图像的匹配参数、所述待匹配图像的匹配类型和所述匹配算法的标识与图像库中的图像进行匹配,找到与所述待匹配图像匹配的目标图像;A sending module, configured to send the matching parameters of the image to be matched, the matching type of the image to be matched, and the identification of the matching algorithm to a server, so that the server can The matching type of the image to be matched and the identification of the matching algorithm are matched with the images in the image library, and a target image matching the image to be matched is found;

所述接收模块,还用于接收所述服务器返回的匹配结果,所述匹配结果中包括匹配到的所述目标图像所属的用户的信息。The receiving module is further configured to receive a matching result returned by the server, where the matching result includes information about the user to which the matched target image belongs.

结合本发明第三方面,在本发明第三方面的第一种可能的实现方式中,当所述待匹配图像的匹配类型为人脸匹配类型时,所述获取模块具体用于:采用与所述人脸匹配类型对应的匹配算法,提取所述待匹配图像的人脸特征。With reference to the third aspect of the present invention, in the first possible implementation manner of the third aspect of the present invention, when the matching type of the image to be matched is a face matching type, the acquiring module is specifically configured to: use the The matching algorithm corresponding to the face matching type extracts the face features of the image to be matched.

结合本发明第三方面,在本发明第三方面的第二种可能的实现方式中,当所述待匹配图像的匹配类型为背景匹配类型时,所述获取模块具体用于:采用与所述背景匹配类型对应的算法,提取所述待匹配图像的背景的颜色特征。With reference to the third aspect of the present invention, in the second possible implementation manner of the third aspect of the present invention, when the matching type of the image to be matched is the background matching type, the acquisition module is specifically configured to: use the The algorithm corresponding to the background matching type extracts the color features of the background of the image to be matched.

结合本发明第三方面,在本发明第三方面的第三种可能的实现方式中,当所述待匹配图像的匹配类型为地点匹配类型时,所述获取模块具体用于:采用与所述地点匹配类型对应的算法,提取所述待匹配图像的纹理特征。With reference to the third aspect of the present invention, in a third possible implementation manner of the third aspect of the present invention, when the matching type of the image to be matched is a location matching type, the acquisition module is specifically configured to: use the The algorithm corresponding to the location matching type extracts the texture features of the image to be matched.

结合本发明第三方面的第三种可能的实现方式,在本发明第三方面的第四种可能的实现方式中,所述待匹配图像的匹配参数还包括所述待匹配图像的拍摄地点信息,所述获取模块还用于:从所述待匹配图像的文件头信息中获取所述待匹配图像的拍摄地点信息。With reference to the third possible implementation of the third aspect of the present invention, in the fourth possible implementation of the third aspect of the present invention, the matching parameters of the image to be matched further include shooting location information of the image to be matched The acquiring module is further configured to: acquire shooting location information of the image to be matched from file header information of the image to be matched.

结合本发明第三方面,在本发明第三方面的第五种可能的实现方式中,当所述待匹配图像的匹配类型为作者匹配类型时,所述获取模块具体用于:采用与所述作者匹配类型对应的算法,从所述待匹配图像的文件头信息中获取所述待匹配图像的拍摄作者的信息。With reference to the third aspect of the present invention, in the fifth possible implementation manner of the third aspect of the present invention, when the matching type of the image to be matched is the author matching type, the acquiring module is specifically configured to: use the The algorithm corresponding to the author matching type obtains the information of the photographer of the image to be matched from the file header information of the image to be matched.

本发明第四方面提供一种服务器,包括:A fourth aspect of the present invention provides a server, including:

接收模块,用于接收客户端发送的待匹配图像的匹配参数、所述待匹配图像的匹配类型和所述待匹配图像的匹配类型对应的匹配算法的标识;The receiving module is used to receive the matching parameters of the image to be matched sent by the client, the matching type of the image to be matched, and the identification of the matching algorithm corresponding to the matching type of the image to be matched;

获取模块,用于根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数;An acquisition module, configured to acquire the matching parameters of the images in the image library according to the matching type of the image to be matched and the identification of the matching algorithm;

匹配模块,用于将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像;A matching module, configured to match the matching parameters of the image to be matched with the matching parameters of the images in the image library, and use the successfully matched image as the target image;

发送模块,用于获取所述目标图像所属的用户的信息,根据所述目标图像所属的用户的信息生成匹配结果,并将所述匹配结果发送给所述客户端。A sending module, configured to acquire information about the user to which the target image belongs, generate a matching result according to the information about the user to which the target image belongs, and send the matching result to the client.

结合本发明第四方面,在本发明第四方面的第一种可能的实现方式中,当所述待匹配图像的匹配类型为人脸匹配类型时,所述匹配算法的标识为所述人脸匹配类型对应的匹配算法的标识,所述获取模块具体用于:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述人脸匹配类型对应的匹配算法提取所述图像库中的图像的人脸特征;With reference to the fourth aspect of the present invention, in the first possible implementation manner of the fourth aspect of the present invention, when the matching type of the image to be matched is the face matching type, the identification of the matching algorithm is the face matching The identification of the matching algorithm corresponding to the type, and the acquisition module is specifically used for: according to the matching type of the image to be matched and the identification of the matching algorithm, use the matching algorithm corresponding to the face matching type to extract the The facial features of the image;

所述匹配模块具体用于:将所述待匹配图像的人脸特征与所述图像库中的图像的人脸特征进行匹配,将匹配成功的图像作为所述目标图像。The matching module is specifically configured to: match the facial features of the image to be matched with the facial features of the images in the image library, and use the successfully matched image as the target image.

结合本发明第四方面,在本发明第四方面的第二种可能的实现方式中,当所述待匹配图像的匹配类型为背景匹配类型时,所述匹配算法的标识为所述背景匹配类型对应的匹配算法的标识,所述获取模块具体用于:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述背景匹配类型对应的匹配算法提取所述图像库中的图像的背景的颜色特征;With reference to the fourth aspect of the present invention, in the second possible implementation manner of the fourth aspect of the present invention, when the matching type of the image to be matched is the background matching type, the identification of the matching algorithm is the background matching type The identification of the corresponding matching algorithm, the acquisition module is specifically used for: according to the matching type of the image to be matched and the identification of the matching algorithm, using the matching algorithm corresponding to the background matching type to extract the image in the image library The color characteristics of the background;

所述匹配模块具体用于:将所述待匹配图像的背景的颜色特征与所述图像库中的图像的背景的颜色特征进行匹配,将匹配成功的图像作为所述目标图像。The matching module is specifically configured to: match the color feature of the background of the image to be matched with the color feature of the background of the image in the image library, and use the successfully matched image as the target image.

结合本发明第四方面的第二种可能的实现方式,在本发明第四方面的第三种可能的实现方式中,所述发送模块具体用于:With reference to the second possible implementation of the fourth aspect of the present invention, in the third possible implementation of the fourth aspect of the present invention, the sending module is specifically configured to:

获取所述目标图像所属的用户的信息;Acquiring information about the user to which the target image belongs;

判断所述目标图像所属的用户的图像中与所述待匹配图像匹配的图像个数是否大于预先设置的阈值;judging whether the number of images matching the image to be matched in the user's image to which the target image belongs is greater than a preset threshold;

若所述目标图像所属的用户的图像中与所述待匹配图像匹配的图像个数大于所述阈值,则将所述目标图像所属的用户的信息添加到所述匹配结果中。If the number of images of the user to which the target image belongs matches the image to be matched is greater than the threshold, adding the information of the user to which the target image belongs to the matching result.

结合本发明第四方面,在本发明第四方面的第四种可能的实现方式中,当所述待匹配图像的匹配类型为地点匹配类型时,所述匹配算法的标识为所述地点匹配类型对应的匹配算法的标识,所述获取模块具体用于:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用与所述地点匹配类型对应的算法提取所述图像库中的图像的纹理特征;With reference to the fourth aspect of the present invention, in a fourth possible implementation manner of the fourth aspect of the present invention, when the matching type of the image to be matched is the location matching type, the identification of the matching algorithm is the location matching type The identification of the corresponding matching algorithm, the acquisition module is specifically used to: according to the matching type of the image to be matched and the identification of the matching algorithm, use the algorithm corresponding to the matching type of the location to extract the image in the image library texture features;

所述匹配模块具体用于:将所述待匹配图像的纹理特征与所述图像库中的图像的纹理特征进行匹配,将匹配成功的图像作为所述目标图像。The matching module is specifically configured to: match the texture features of the image to be matched with the texture features of the images in the image library, and use the successfully matched image as the target image.

结合本发明第四方面,在本发明第四方面的第五种可能的实现方式中,当所述待匹配图像的匹配类型为地点匹配类型时,所述匹配算法的标识为所述地点匹配类型对应的匹配算法的标识,所述获取模块具体用于:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述地点匹配类型对应的算法提取所述图像库中的图像的纹理特征,并从所述图像库中的图像的文件头信息中获取所述图像库中的图像的拍摄地点信息;With reference to the fourth aspect of the present invention, in the fifth possible implementation manner of the fourth aspect of the present invention, when the matching type of the image to be matched is the location matching type, the identification of the matching algorithm is the location matching type The identification of the corresponding matching algorithm, the acquisition module is specifically used to: according to the matching type of the image to be matched and the identification of the matching algorithm, use the algorithm corresponding to the location matching type to extract the image in the image library Texture features, and obtain the shooting location information of the image in the image library from the file header information of the image in the image library;

所述匹配模块具体用于:将所述待匹配图像中的纹理特征和拍摄地点信息,与所述图像库中的图像的纹理特征和拍摄地点信息进行匹配,将匹配成功的图像作为所述目标图像。The matching module is specifically configured to: match the texture feature and shooting location information in the image to be matched with the texture feature and shooting location information of the image in the image library, and use the successfully matched image as the target image.

结合本发明第四方面,在本发明第四方面的第六种可能的实现方式中,当所述待匹配图像的匹配类型为作者匹配类型时,所述匹配算法的标识为所述作者匹配类型对应的匹配算法的标识,所述获取模块具体用于:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述作者匹配类型对应的算法,从所述图像库中的图像的文件头信息中获取所述图像库中的图像的拍摄作者的信息;With reference to the fourth aspect of the present invention, in the sixth possible implementation manner of the fourth aspect of the present invention, when the matching type of the image to be matched is the author matching type, the identification of the matching algorithm is the author matching type The identification of the corresponding matching algorithm, the acquisition module is specifically used for: according to the matching type of the image to be matched and the identification of the matching algorithm, using the algorithm corresponding to the matching type of the author, from the image in the image library Obtain the information of the author who took the image in the image library from the header information of the file;

所述匹配模块具体用于:将所述待匹配图像的拍摄作者的信息与所述图像库中的图像的拍摄作者的信息进行匹配,将匹配成功的图像作为所述目标图像。The matching module is specifically configured to: match the information of the photographer of the image to be matched with the information of the photographer of the images in the image library, and use the successfully matched image as the target image.

本发明实施例提供的图像匹配发现好友的方法和装置,客户端通过接收用户输入的待匹配图像的匹配类型,采用与待匹配图像的匹配类型对应的匹配算法获取待匹配图像的匹配参数,然后,将待匹配图像的匹配参数、匹配类型和匹配算法的标识发送给服务器,服务器根据待匹配图像的匹配参数、匹配类型和匹配算法的标识与图像库中的图像进行匹配,找到与待匹配图像匹配的目标图像,并向客户端返回的匹配结果,匹配结果中包括匹配到的目标图像所属的用户的信息,目标图像所属的用户即为好友。上述方法通过利用用户已有的图像资源进行图像匹配找到好友,方便用户发现好友。In the method and device for finding friends by image matching provided by the embodiments of the present invention, the client receives the matching type of the image to be matched input by the user, and adopts a matching algorithm corresponding to the matching type of the image to be matched to obtain the matching parameters of the image to be matched, and then , send the matching parameters, matching type and matching algorithm identification of the image to be matched to the server, and the server matches the image in the image library according to the matching parameters, matching type and matching algorithm identification of the image to be matched, and finds the matching image The matched target image and the matching result returned to the client, the matching result includes the information of the user to which the matched target image belongs, and the user to which the target image belongs is a friend. The above method finds friends by using image resources existing by the user for image matching, which facilitates the user to find friends.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained according to these drawings on the premise of not paying creative efforts.

图1为本发明实施例一提供的图像匹配发现好友的方法的流程图;FIG. 1 is a flowchart of a method for finding friends by image matching provided in Embodiment 1 of the present invention;

图2为本发明实施例二提供的图像匹配发现好友的方法的流程图;FIG. 2 is a flowchart of a method for finding friends by image matching provided in Embodiment 2 of the present invention;

图3为本发明实施例三提供的一种客户端的结构示意图;FIG. 3 is a schematic structural diagram of a client provided by Embodiment 3 of the present invention;

图4为本发明实施例四提供的一种服务器的结构示意图;FIG. 4 is a schematic structural diagram of a server provided in Embodiment 4 of the present invention;

图5为本发明实施例五提供的一种终端的结构示意图;FIG. 5 is a schematic structural diagram of a terminal provided in Embodiment 5 of the present invention;

图6为本发明实施例六提供的一种服务器的结构示意图.FIG. 6 is a schematic structural diagram of a server provided in Embodiment 6 of the present invention.

具体实施方式detailed description

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

图1为本发明实施例一提供的图像匹配发现好友的方法的流程图,本实施例的提供的方法由客户端执行,该客户端具体可以为终端上安装的应用(Application),如图1所示,本实施例的方法可以包括以下步骤:Fig. 1 is a flowchart of a method for finding friends by image matching provided in Embodiment 1 of the present invention. The method provided in this embodiment is executed by a client, and the client may specifically be an application (Application) installed on a terminal, as shown in Fig. 1 As shown, the method of this embodiment may include the following steps:

步骤101、客户端接收用户输入的待匹配图像和待匹配图像的匹配类型。Step 101, the client receives the image to be matched and the matching type of the image to be matched input by the user.

用户可以从客户端所在的终端的本地图像库中选择一张图像作为待匹配的图像,或者,启动照相机拍摄一张照片作为待匹配的图像。用户可以通过用户界面上的选择按钮选择待匹配图像的匹配类型,待匹配图像的匹配类型包括:人脸匹配类型、背景匹配类型、地点匹配类型和作者匹配类型等。The user can select an image from the local image library of the terminal where the client is located as the image to be matched, or start the camera to take a photo as the image to be matched. The user can select the matching type of the image to be matched through the selection button on the user interface. The matching type of the image to be matched includes: face matching type, background matching type, location matching type and author matching type, etc.

步骤102、客户端采用与待匹配图像的匹配类型对应的匹配算法获取待匹配图像的匹配参数。Step 102, the client acquires matching parameters of the image to be matched by using a matching algorithm corresponding to the matching type of the image to be matched.

本实施例中,每种匹配类型都对应不同的匹配算法,客户端根据待匹配图像的匹配类型,选择与匹配类型对应的匹配算法获取待匹配图像的匹配参数,以下将具体说明:In this embodiment, each matching type corresponds to a different matching algorithm. According to the matching type of the image to be matched, the client selects the matching algorithm corresponding to the matching type to obtain the matching parameters of the image to be matched. The following will specifically describe:

当待匹配图像的匹配类型为人脸匹配类型时,客户端采用与人脸匹配类型对应的匹配算法,提取待匹配图像的人脸特征。人脸匹配类型对应的匹配算法是指提取人脸特征使用的算法,提取人脸特征常用的方法包括:基于模板匹配的方法、基于奇异值特征方法、基于奇异值特征方法、局部保持投影方法、主成分分方法、弹性匹配方法、特征脸法(基于KL变换)、人工神经网络法、支持向量机法、基于积分图像特征法和基于概率模型法等。When the matching type of the image to be matched is the face matching type, the client uses a matching algorithm corresponding to the face matching type to extract the face features of the image to be matched. The matching algorithm corresponding to the face matching type refers to the algorithm used to extract face features. The commonly used methods for extracting face features include: template matching-based method, singular value feature-based method, singular value feature-based method, local preservation projection method, Principal component method, elastic matching method, eigenface method (based on KL transformation), artificial neural network method, support vector machine method, method based on integral image feature and method based on probability model, etc.

当待匹配图像的匹配类型为背景匹配类型时,客户端采用与背景匹配类型对应的算法,提取待匹配图像的背景的颜色特征。图像的背景是指图像的主色,图像的颜色特征是指对图像的整体色调,按照指定的算法混合得到一个主色值。背景匹配类型对应的算法是指提取图像的背景特征所使用的算法,常用的提取背景特征的方法包括:按像素颜色值聚类、颜色直方图取峰值等。When the matching type of the image to be matched is the background matching type, the client uses an algorithm corresponding to the background matching type to extract the color feature of the background of the image to be matched. The background of the image refers to the main color of the image, and the color feature of the image refers to the overall tone of the image, which is mixed according to the specified algorithm to obtain a main color value. The algorithm corresponding to the background matching type refers to the algorithm used to extract the background features of the image. Commonly used methods for extracting background features include: clustering by pixel color value, taking the peak value of the color histogram, etc.

当待匹配图像的匹配类型为地点匹配类型时,客户端采用与地点匹配类型对应的算法,提取待匹配图像的纹理特征。纹理特征是一种不依赖于颜色或亮度的反映图像中同质现象的视觉特征。地点匹配类型对应的算法是指提取图像的纹理特征所使用的方法,提取纹理特征常用的方法包括:自相关函数、傅里叶变换、行程长度分析、灰度差分分析和灰度共生矩阵分析等。When the matching type of the image to be matched is the location matching type, the client uses an algorithm corresponding to the location matching type to extract texture features of the image to be matched. Texture feature is a visual feature that does not depend on color or brightness and reflects homogeneous phenomena in images. The algorithm corresponding to the location matching type refers to the method used to extract the texture features of the image. Commonly used methods for extracting texture features include: autocorrelation function, Fourier transform, run length analysis, gray level difference analysis, and gray level co-occurrence matrix analysis, etc. .

可选地,当待匹配图像的匹配类型为地点匹配类型时,待匹配图像的匹配参数不仅包括待匹配图像的纹理特征,还包括待匹配图像的拍摄地点信息,则客户端从待匹配图像的文件头信息中获取待匹配图像的拍摄地点信息。图像的文件头信息中存储有图像的拍摄地点的信息以及图像的拍摄作者的信息,文件头信息中还可以包括拍摄人时间、拍摄图像的相机的品牌型号等信息。例如,当待匹配图像的文件格式为可交换文件格式(Exchangeable ImageFile,简称Exif)时,Exif格式图像的数据存储与JPEG格式是完全相同的,实际上Exif格式就是在JPEG格式头部插入了图像的信息,包括拍摄时的光圈、快门、白平衡、ISO、焦距、日期时间、拍摄条件以及相机品牌、型号、色彩编码、拍摄时录制的声音以及缩略图等。简单地说,Exif=JPEG+拍摄参数。Optionally, when the matching type of the image to be matched is the location matching type, the matching parameters of the image to be matched include not only the texture features of the image to be matched, but also the shooting location information of the image to be matched. The shooting location information of the image to be matched is obtained from the file header information. The file header information of the image stores the information of the shooting location of the image and the information of the photographer of the image, and the file header information may also include information such as the time of the shooter, the brand model of the camera that took the image, and the like. For example, when the file format of the image to be matched is Exchangeable ImageFile (Exif for short), the data storage of the Exif format image is exactly the same as that of the JPEG format. In fact, the Exif format is to insert the image in the JPEG format header. information, including aperture, shutter speed, white balance, ISO, focal length, date and time, shooting conditions, camera brand, model, color code, sound recorded during shooting, and thumbnail when shooting. Simply put, Exif=JPEG+shooting parameters.

当待匹配图像的匹配类型为作者匹配类型时,客户端采用与作者匹配类型对应的算法,从待匹配图像的文件头信息中获取待匹配图像的拍摄作者的信息。When the matching type of the image to be matched is the matching type of the author, the client uses an algorithm corresponding to the matching type of the author to obtain the information of the author of the image to be matched from the file header information of the image to be matched.

步骤103、客户端将待匹配图像的匹配参数、待匹配图像的匹配类型和匹配算法的标识发送给服务器,以使服务器根据待匹配图像的匹配参数、待匹配图像的匹配类型和匹配算法的标识与图像库中的图像进行匹配,找到与待匹配图像匹配的目标图像。Step 103, the client sends the matching parameters of the image to be matched, the matching type of the image to be matched and the identification of the matching algorithm to the server, so that the server can Match the images in the image library to find the target image that matches the image to be matched.

客户端在获取到待匹配图像的匹配参数之后,将待匹配图像的匹配参数、待匹配图像的匹配类型和匹配算法的标识发送给服务器。客户端具体可以通过如下报文格式发送待匹配图像的匹配参数、待匹配图像的匹配类型和匹配算法的标识:应用协议头+匹配类型+上传数据类型+匹配参数+匹配算法的标识+End or Not,其中,应用协议头包括但不限于超文本传输协议(HyperTextTransfer Protocol,简称HTTP)、基于安全套接层之上的超文本传输协议)Hyper Text Transfer Protocol over Secure Socket Layer,简称HTTPS)等。上传数据类型用于定义上传的匹配参数的类型。After obtaining the matching parameters of the image to be matched, the client sends the matching parameters of the image to be matched, the matching type of the image to be matched and the identification of the matching algorithm to the server. Specifically, the client can send the matching parameters of the image to be matched, the matching type of the image to be matched, and the identification of the matching algorithm in the following message format: application protocol header + matching type + uploaded data type + matching parameter + matching algorithm identification + End or Not, wherein, the application protocol header includes but is not limited to HyperText Transfer Protocol (HyperTextTransfer Protocol, HTTP for short), HyperText Transfer Protocol over Secure Socket Layer based on HyperText Transfer Protocol over Secure Socket Layer, HTTPS for short), etc. The upload data type is used to define the type of the uploaded match parameter.

本实施例中,当待匹配图像的匹配类型为人脸匹配类型时,待匹配图像的匹配参数为待匹配图像的人脸特征。当待匹配图像的匹配类型为背景匹配类型时,待匹配图像的匹配参数为待匹配图像的背景特征。当待匹配图像的匹配类型为地点匹配类型时,待匹配图像的匹配参数为待匹配图像的纹理特征,或者,待匹配图像的匹配参数为待匹配图像的纹理特征和拍摄地点信息。当待匹配图像的匹配类型为作者匹配类型时,待匹配图像的匹配参数为待匹配图像的拍摄作者的信息。当待匹配图像的匹配类型为其他类型时,待匹配图像的匹配参数为整幅图像。In this embodiment, when the matching type of the image to be matched is the face matching type, the matching parameter of the image to be matched is the face feature of the image to be matched. When the matching type of the image to be matched is the background matching type, the matching parameter of the image to be matched is the background feature of the image to be matched. When the matching type of the image to be matched is the location matching type, the matching parameter of the image to be matched is the texture feature of the image to be matched, or the matching parameter of the image to be matched is the texture feature and shooting location information of the image to be matched. When the matching type of the image to be matched is the author matching type, the matching parameter of the image to be matched is the information of the author of the image to be matched. When the matching type of the image to be matched is other types, the matching parameter of the image to be matched is the whole image.

服务器收到待匹配图像的匹配参数、待匹配图像的匹配类型和匹配算法的标识之后,根据待匹配图像的匹配类型和匹配算法的标识选择与客户端相同的匹配算法提取图像库中的图像的匹配参数,然后,将待匹配图像的匹配参数与图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为目标图像。After receiving the matching parameters of the image to be matched, the matching type of the image to be matched, and the identification of the matching algorithm, the server selects the same matching algorithm as the client to extract the image in the image library according to the matching type of the image to be matched and the identification of the matching algorithm. Matching parameters. Then, match the matching parameters of the image to be matched with the matching parameters of the images in the image library, and use the successfully matched image as the target image.

本实施例的方法中,通过根据匹配类型提取待匹配图像的匹配参数,大多数情况下,客户端只需要将待匹配图像的匹配参数发送给服务器,由服务器根据待匹配图像的匹配参数进行图像匹配,而不需要将整幅图像发送给服务器,由于待匹配图像的匹配参数比整幅图像小,从而可以节省占用的网络资源。In the method of this embodiment, by extracting the matching parameters of the image to be matched according to the matching type, in most cases, the client only needs to send the matching parameters of the image to be matched to the server, and the server performs image processing according to the matching parameters of the image to be matched. Matching, without sending the entire image to the server, because the matching parameters of the image to be matched are smaller than the entire image, which can save network resources occupied.

步骤104、客户端接收服务器返回的匹配结果,匹配结果中包括匹配到的目标图像所属的用户的信息。Step 104, the client receives the matching result returned by the server, and the matching result includes the information of the user to which the matched target image belongs.

服务器向客户端返回的匹配结果中包括匹配到的目标图像所属的用户的信息,目标图像所属的用户即为好友,目标图像所属的用户的信息包括:用户的账号、昵称和用户的图像等。当目标图像为多个时,服务器会生成用户信息列表,将用户信息列表发送给客户端。客户端收到匹配结果后,以列表的形式或其他形式展现给用户,用户可以通过选择添加按钮将需要的用户添加为好友。The matching result returned by the server to the client includes the information of the user to which the target image belongs. When there are multiple target images, the server will generate a user information list, and send the user information list to the client. After the client receives the matching results, it will be displayed to the user in the form of a list or other forms, and the user can add the desired user as a friend by selecting the Add button.

本实施例中,客户端通过接收用户输入的待匹配图像的匹配类型,采用与待匹配图像的匹配类型对应的匹配算法获取待匹配图像的匹配参数,然后,将待匹配图像的匹配参数、匹配类型和匹配算法的标识发送给服务器,以使服务器根据待匹配图像的匹配参数、匹配类型和匹配算法的标识与图像库中的图像进行匹配,找到与待匹配图像匹配的目标图像,并向客户端返回的匹配结果,匹配结果中包括匹配到的目标图像所属的用户的信息,目标图像所属的用户即为好友。上述方法通过利用用户已有的图像资源进行图像匹配找到好友,方便用户发现好友。In this embodiment, the client receives the matching type of the image to be matched input by the user, adopts a matching algorithm corresponding to the matching type of the image to be matched to obtain the matching parameters of the image to be matched, and then uses the matching parameters of the image to be matched, matching The type and the identification of the matching algorithm are sent to the server, so that the server can match the image in the image library according to the matching parameters, matching type and matching algorithm identification of the image to be matched, find the target image that matches the image to be matched, and send it to the client The matching result returned by the terminal, the matching result includes the information of the user to which the matched target image belongs, and the user to which the target image belongs is a friend. The above method finds friends by using image resources existing by the user for image matching, which facilitates the user to find friends.

图2为本发明实施例二提供的图像匹配发现好友的方法的流程图,本实施例从服务器的角度描述,如图2所示,本实施例提供的方法可以包括以下步骤:Fig. 2 is a flow chart of the method for finding friends by image matching provided by Embodiment 2 of the present invention. This embodiment is described from the perspective of the server. As shown in Fig. 2, the method provided by this embodiment may include the following steps:

步骤201、服务器接收客户端发送的待匹配图像的匹配参数、待匹配图像的匹配类型和待匹配图像的匹配类型对应的匹配算法的标识。Step 201, the server receives the matching parameters of the image to be matched, the matching type of the image to be matched, and the identification of the matching algorithm corresponding to the matching type of the image to be matched sent by the client.

步骤202、服务器根据待匹配图像的匹配类型和匹配算法的标识,获取图像库中的图像的匹配参数。Step 202, the server obtains the matching parameters of the images in the image database according to the matching type of the image to be matched and the identification of the matching algorithm.

客户端将待匹配图像的匹配类型和待匹配图像的匹配类型对应的匹配算法的标识发送给服务器,是为了使服务器采用相同的匹配算法提取图像库中的图像的匹配参数。The client sends the matching type of the image to be matched and the identification of the matching algorithm corresponding to the matching type of the image to the server, so that the server uses the same matching algorithm to extract the matching parameters of the images in the image library.

当待匹配图像的匹配类型为人脸匹配类型时,匹配算法的标识为人脸匹配类型对应的匹配算法的标识,服务器根据待匹配图像的匹配类型和匹配算法的标识,获取图像库中的图像的匹配参数,具体为:服务器根据待匹配图像的匹配类型和匹配算法的标识,采用人脸匹配类型对应的匹配算法提取图像库中的图像的人脸特征。When the matching type of the image to be matched is the face matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the face matching type, and the server obtains the matching information of the image in the image library according to the matching type of the image to be matched and the identification of the matching algorithm The parameters are specifically: according to the matching type of the image to be matched and the identification of the matching algorithm, the server uses the matching algorithm corresponding to the face matching type to extract the face features of the image in the image database.

当待匹配图像的匹配类型为背景匹配类型时,匹配算法的标识为背景匹配类型对应的匹配算法的标识,服务器根据待匹配图像的匹配类型和匹配算法的标识,获取图像库中的图像的匹配参数,具体为:服务器根据待匹配图像的匹配类型和匹配算法的标识,采用背景匹配类型对应的匹配算法提取图像库中的图像的背景的颜色特征。When the matching type of the image to be matched is the background matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the background matching type, and the server obtains the matching information of the image in the image library according to the matching type of the image to be matched and the identification of the matching algorithm The parameters are specifically: the server uses the matching algorithm corresponding to the background matching type to extract the background color feature of the image in the image database according to the matching type of the image to be matched and the identification of the matching algorithm.

当待匹配图像的匹配类型为地点匹配类型时,匹配算法的标识为地点匹配类型对应的匹配算法的标识,服务器根据待匹配图像的匹配类型和匹配算法的标识,获取图像库中的图像的匹配参数,具体为:服务器根据待匹配图像的匹配类型和匹配算法的标识,采用与地点匹配类型对应的算法提取图像库中的图像的纹理。或者,服务器根据待匹配图像的匹配类型和匹配算法的标识,采用地点匹配类型对应的算法提取图像库中的图像的纹理,并从图像库中的图像的文件头信息中获取图像库中的图像的拍摄地点信息。When the matching type of the image to be matched is the location matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the location matching type, and the server obtains the matching information of the image in the image library according to the matching type of the image to be matched and the identification of the matching algorithm The parameters are specifically: according to the matching type of the image to be matched and the identification of the matching algorithm, the server uses an algorithm corresponding to the location matching type to extract the texture of the image in the image library. Or, according to the matching type of the image to be matched and the identification of the matching algorithm, the server uses the algorithm corresponding to the location matching type to extract the texture of the image in the image library, and obtains the image in the image library from the file header information of the image in the image library shooting location information.

当待匹配图像的匹配类型为作者匹配类型时,匹配算法的标识为作者匹配类型对应的匹配算法的标识,服务器根据待匹配图像的匹配类型和匹配算法的标识,获取图像库中的图像的匹配参数,具体为:服务器根据待匹配图像的匹配类型和匹配算法的标识,采用作者匹配类型对应的算法,从图像库中的图像的文件头信息中获取图像库中的图像的拍摄作者的信息。When the matching type of the image to be matched is the matching type of the author, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the matching type of the author, and the server obtains the matching of the image in the image library according to the matching type of the image to be matched and the identification of the matching algorithm The parameters are specifically: according to the matching type of the image to be matched and the identification of the matching algorithm, the server adopts the algorithm corresponding to the matching type of the author, and obtains the author's information of the image in the image library from the file header information of the image in the image library.

步骤203、服务器将待匹配图像的匹配参数与图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像。Step 203, the server matches the matching parameters of the image to be matched with the matching parameters of the images in the image database, and uses the successfully matched image as the target image.

当待匹配图像的匹配类型为人脸匹配类型时,服务器将待匹配图像的人脸特征与图像库中的图像的人脸特征进行匹配,将匹配成功的图像作为目标图像。When the matching type of the image to be matched is the face matching type, the server matches the facial features of the image to be matched with the facial features of the images in the image database, and uses the successfully matched image as the target image.

当待匹配图像的匹配类型为背景匹配类型时,服务器将待匹配图像的背景的颜色特征与图像库中的图像的背景的颜色特征进行匹配,将匹配成功的图像作为目标图像。When the matching type of the image to be matched is the background matching type, the server matches the color feature of the background of the image to be matched with the color feature of the background of the image in the image library, and uses the successfully matched image as the target image.

当待匹配图像的匹配类型为地点匹配类型时,服务器将待匹配图像的纹理特征与图像库中的图像的纹理特征进行匹配,将匹配成功的图像作为目标图像。或者,服务器将待匹配图像中的纹理特征和拍摄地点信息,与图像库中的图像的纹理特征和拍摄地点信息进行匹配,将匹配成功的图像作为目标图像。When the matching type of the image to be matched is the location matching type, the server matches the texture feature of the image to be matched with the texture feature of the image in the image library, and uses the image that is successfully matched as the target image. Alternatively, the server matches the texture feature and shooting location information in the image to be matched with the texture feature and shooting location information of the image in the image library, and uses the successfully matched image as the target image.

当待匹配图像的匹配类型为作者匹配类型时,服务器将待匹配图像的拍摄作者的信息与图像库中的图像的拍摄作者的信息进行匹配,将匹配成功的图像作为目标图像。When the matching type of the image to be matched is the author matching type, the server matches the information of the author of the image to be matched with the information of the author of the image in the image database, and uses the successfully matched image as the target image.

步骤204、服务器获取目标图像所属的用户的信息,根据目标图像所属的用户的信息生成匹配结果,并将匹配结果发送给客户端。Step 204, the server acquires the information of the user to which the target image belongs, generates a matching result according to the information of the user to which the target image belongs, and sends the matching result to the client.

服务器在匹配到目标图像之后,获取目标图像所属的用户的信息,当匹配类型为人脸匹配类型、地点匹配类型和作者匹配类型时,服务器之间将目标图像所属的用户的信息发送给客户端。当匹配类型为背景匹配类型时,服务器获取到目标图像所属的用户的信息之后,判断目标图像所属的用户的图像中与待匹配图像匹配的图像个数是否大于预先设置的阈值,若目标图像所属的用户的图像中与待匹配图像匹配的图像个数大于该阈值,则服务器将目标图像所属的用户的信息添加到匹配结果中,也就是说目标图像所属的用户与有多张图像与待匹配图像匹配时,服务器才将该用户作为好友。例如,该阈值为10,那么某个用户上传的图像中,有10张以上图像的颜色特征和待匹配图像的颜色特征相差在正负3以内,则确定该用户为好友,将该用户的信息添加到匹配结果中。按照这个规则,将所有满足条件的用户找出来。After matching the target image, the server obtains the information of the user to whom the target image belongs. When the matching type is face matching type, location matching type and author matching type, the server sends the information of the user to which the target image belongs to the client. When the matching type is the background matching type, after obtaining the information of the user to which the target image belongs, the server judges whether the number of images matching the image to be matched in the user’s image to which the target image belongs is greater than the preset threshold, if the target image belongs to If the number of images matching the image to be matched in the user's image is greater than the threshold, the server will add the information of the user to which the target image belongs to the matching result, that is to say, the user to which the target image belongs has multiple images that match the image to be matched The server only considers the user as a friend if the images match. For example, if the threshold is 10, then among the images uploaded by a certain user, the difference between the color features of more than 10 images and the color features of the image to be matched is within plus or minus 3, then the user is determined to be a friend, and the user's information added to the matching results. According to this rule, find out all users who meet the conditions.

本实施例中,服务器接收客户端发送的待匹配图像的匹配参数、匹配类型和待匹配图像的匹配类型对应的匹配算法的标识,根据待匹配图像的匹配类型和匹配算法的标识,获取图像库中的图像的匹配参数,将待匹配图像的匹配参数与图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为目标图像,最后获取目标图像所属的用户的信息,根据目标图像所属的用户的信息生成匹配结果,并将匹配结果发送给客户端。上述方法通过利用用户已有的图像资源进行图像匹配找到好友,方便用户发现好友。In this embodiment, the server receives the matching parameters of the image to be matched, the matching type, and the identification of the matching algorithm corresponding to the matching type of the image to be matched sent by the client, and obtains the image database according to the matching type of the image to be matched and the identification of the matching algorithm Match the matching parameters of the image in the image, match the matching parameters of the image to be matched with the matching parameters of the image in the image library, use the successfully matched image as the target image, and finally obtain the information of the user to which the target image belongs, according to the The user's information generates a matching result and sends the matching result to the client. The above method finds friends by using image resources existing by the user for image matching, which facilitates the user to find friends.

图3为本发明实施例三提供的一种客户端的结构示意图,如图3所示,本实施例提供的客户端包括:接收模块11、获取模块12和发送模块13。FIG. 3 is a schematic structural diagram of a client provided by Embodiment 3 of the present invention. As shown in FIG. 3 , the client provided by this embodiment includes: a receiving module 11 , an acquiring module 12 and a sending module 13 .

其中,接收模块11,用于接收用户输入的待匹配图像和所述待匹配图像的匹配类型;Wherein, the receiving module 11 is used to receive the image to be matched input by the user and the matching type of the image to be matched;

获取模块12,用于采用与所述待匹配图像的匹配类型对应的匹配算法获取所述待匹配图像的匹配参数;An acquisition module 12, configured to acquire matching parameters of the image to be matched by using a matching algorithm corresponding to the matching type of the image to be matched;

发送模块13,用于将所述待匹配图像的匹配参数、所述待匹配图像的匹配类型和所述匹配算法的标识发送给服务器,以使所述服务器根据所述待匹配图像的匹配参数、所述待匹配图像的匹配类型和所述匹配算法的标识与图像库中的图像进行匹配,找到与所述待匹配图像匹配的目标图像;The sending module 13 is configured to send the matching parameters of the image to be matched, the matching type of the image to be matched, and the identification of the matching algorithm to a server, so that the server can use the matching parameters of the image to be matched, The matching type of the image to be matched and the identification of the matching algorithm are matched with the images in the image library, and a target image matching the image to be matched is found;

所述接收模块11,还用于接收所述服务器返回的匹配结果,所述匹配结果中包括匹配到的所述目标图像所属的用户的信息。The receiving module 11 is further configured to receive the matching result returned by the server, and the matching result includes the information of the user to which the matched target image belongs.

当所述待匹配图像的匹配类型为人脸匹配类型时,所述获取模块12具体用于:采用与所述人脸匹配类型对应的匹配算法,提取所述待匹配图像的人脸特征。When the matching type of the image to be matched is the face matching type, the acquisition module 12 is specifically configured to: extract the face feature of the image to be matched by using a matching algorithm corresponding to the face matching type.

当所述待匹配图像的匹配类型为背景匹配类型时,所述获取模块12具体用于:采用与所述背景匹配类型对应的算法,提取所述待匹配图像的背景的颜色特征。When the matching type of the image to be matched is the background matching type, the acquiring module 12 is specifically configured to: extract the color feature of the background of the image to be matched by using an algorithm corresponding to the background matching type.

当所述待匹配图像的匹配类型为地点匹配类型时,所述获取模块12具体用于:采用与所述地点匹配类型对应的算法,提取所述待匹配图像的纹理特征。可选的,所述待匹配图像的匹配参数还包括所述待匹配图像的拍摄地点信息,所述获取模块12还用于:从所述待匹配图像的文件头信息中获取所述待匹配图像的拍摄地点信息。When the matching type of the image to be matched is a location matching type, the acquisition module 12 is specifically configured to: extract texture features of the image to be matched by using an algorithm corresponding to the location matching type. Optionally, the matching parameters of the image to be matched further include shooting location information of the image to be matched, and the acquisition module 12 is further configured to: acquire the image to be matched from file header information of the image to be matched shooting location information.

当所述待匹配图像的匹配类型为作者匹配类型时,所述获取模块12具体用于:采用与所述作者匹配类型对应的算法,从所述待匹配图像的文件头信息中获取所述待匹配图像的拍摄作者的信息。When the matching type of the image to be matched is the author matching type, the acquisition module 12 is specifically configured to: use an algorithm corresponding to the author matching type to obtain the Information about the author who took the image.

本实施例的客户端,可用于执行实施例一的方法,具体实现方式和技术效果类似,这里不再赘述。The client in this embodiment can be used to execute the method in Embodiment 1, and the specific implementation manner and technical effect are similar, and will not be repeated here.

图4为本发明实施例四提供的一种服务器的结构示意图,如图4所示,本实施例提供的服务器包括:接收模块21、获取模块22、匹配模块23和发送模块23。FIG. 4 is a schematic structural diagram of a server provided in Embodiment 4 of the present invention. As shown in FIG. 4 , the server provided in this embodiment includes: a receiving module 21 , an acquiring module 22 , a matching module 23 and a sending module 23 .

其中,接收模块21,用于接收客户端发送的待匹配图像的匹配参数、所述待匹配图像的匹配类型和所述待匹配图像的匹配类型对应的匹配算法的标识;Wherein, the receiving module 21 is used to receive the matching parameters of the image to be matched sent by the client, the matching type of the image to be matched, and the identification of the matching algorithm corresponding to the matching type of the image to be matched;

获取模块22,用于根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数;The obtaining module 22 is used to obtain the matching parameters of the images in the image library according to the matching type of the image to be matched and the identification of the matching algorithm;

匹配模块23,用于将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像;A matching module 23, configured to match the matching parameters of the image to be matched with the matching parameters of the images in the image library, and use the successfully matched image as the target image;

发送模块24,用于获取所述目标图像所属的用户的信息,根据所述目标图像所属的用户的信息生成匹配结果,并将所述匹配结果发送给所述客户端。The sending module 24 is configured to acquire the information of the user to which the target image belongs, generate a matching result according to the information of the user to which the target image belongs, and send the matching result to the client.

当所述待匹配图像的匹配类型为人脸匹配类型时,所述匹配算法的标识为所述人脸匹配类型对应的匹配算法的标识,所述获取模块22具体用于:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述人脸匹配类型对应的匹配算法提取所述图像库中的图像的人脸特征。相应的,所述匹配模块23具体用于:将所述待匹配图像的人脸特征与所述图像库中的图像的人脸特征进行匹配,将匹配成功的图像作为所述目标图像。When the matching type of the image to be matched is the face matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the face matching type, and the acquisition module 22 is specifically configured to: according to the image to be matched The matching type and the identification of the matching algorithm, using the matching algorithm corresponding to the face matching type to extract the face features of the images in the image library. Correspondingly, the matching module 23 is specifically configured to: match the facial features of the image to be matched with those of the images in the image library, and use the successfully matched image as the target image.

当所述待匹配图像的匹配类型为背景匹配类型时,所述匹配算法的标识为所述背景匹配类型对应的匹配算法的标识,所述获取模块22具体用于:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述背景匹配类型对应的匹配算法提取所述图像库中的图像的背景的颜色特征。相应的,所述匹配模块23具体用于:将所述待匹配图像的背景的颜色特征与所述图像库中的图像的背景的颜色特征进行匹配,将匹配成功的图像作为所述目标图像。When the matching type of the image to be matched is the background matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the background matching type, and the acquisition module 22 is specifically configured to: according to the identification of the image to be matched The identification of the matching type and the matching algorithm, using the matching algorithm corresponding to the background matching type to extract the color features of the background of the image in the image library. Correspondingly, the matching module 23 is specifically configured to: match the color feature of the background of the image to be matched with the color feature of the background of the image in the image library, and use the successfully matched image as the target image.

当所述待匹配图像的匹配类型为背景匹配类型时,可选的,所述发送模块24具体用于:获取所述目标图像所属的用户的信息;判断所述目标图像所属的用户的图像中与所述待匹配图像匹配的图像个数是否大于预先设置的阈值;若所述目标图像所属的用户的图像中与所述待匹配图像匹配的图像个数大于所述阈值,则将所述目标图像所属的用户的信息添加到所述匹配结果中。When the matching type of the image to be matched is the background matching type, optionally, the sending module 24 is specifically configured to: obtain information about the user to which the target image belongs; Whether the number of images matched with the image to be matched is greater than a preset threshold; if the number of images matched with the image to be matched in the image of the user to which the target image belongs is greater than the threshold, the target The information of the user to whom the image belongs is added to the matching result.

当所述待匹配图像的匹配类型为地点匹配类型时,所述匹配算法的标识为所述地点匹配类型对应的匹配算法的标识,所述获取模块22具体用于:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用与所述地点匹配类型对应的算法提取所述图像库中的图像的纹理特征。相应的,所述匹配模块23具体用于:将所述待匹配图像的纹理特征与所述图像库中的图像的纹理特征进行匹配,将匹配成功的图像作为所述目标图像。When the matching type of the image to be matched is the location matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the location matching type, and the acquisition module 22 is specifically configured to: according to the location matching type of the image to be matched The identification of the matching type and the matching algorithm, using the algorithm corresponding to the location matching type to extract the texture features of the images in the image library. Correspondingly, the matching module 23 is specifically configured to: match the texture features of the image to be matched with the texture features of the images in the image library, and use the successfully matched image as the target image.

当所述待匹配图像的匹配类型为地点匹配类型时,所述匹配算法的标识为所述地点匹配类型对应的匹配算法的标识,所述获取模块22具体用于:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述地点匹配类型对应的算法提取所述图像库中的图像的纹理特征,并从所述图像库中的图像的文件头信息中获取所述图像库中的图像的拍摄地点信息。相应的,所述匹配模块23具体用于:将所述待匹配图像中的纹理特征和拍摄地点信息,与所述图像库中的图像的纹理特征和拍摄地点信息进行匹配,将匹配成功的图像作为所述目标图像。When the matching type of the image to be matched is the location matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the location matching type, and the acquisition module 22 is specifically configured to: according to the location matching type of the image to be matched The identification of the matching type and the matching algorithm, using the algorithm corresponding to the location matching type to extract the texture features of the images in the image library, and obtaining the image library from the file header information of the images in the image library The shooting location information of the image in . Correspondingly, the matching module 23 is specifically configured to: match the texture features and shooting location information in the image to be matched with the texture features and shooting location information of the images in the image library, and match the successfully matched images as the target image.

当所述待匹配图像的匹配类型为作者匹配类型时,所述匹配算法的标识为所述作者匹配类型对应的匹配算法的标识,所述获取模块22具体用于:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述作者匹配类型对应的算法,从所述图像库中的图像的文件头信息中获取所述图像库中的图像的拍摄作者的信息。相应的,所述匹配模块23具体用于:将所述待匹配图像的拍摄作者的信息与所述图像库中的图像的拍摄作者的信息进行匹配,将匹配成功的图像作为所述目标图像。When the matching type of the image to be matched is the author matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the author matching type, and the acquisition module 22 is specifically configured to: according to the matching algorithm of the image to be matched The identification of the matching type and the matching algorithm, using the algorithm corresponding to the author matching type, to obtain the information of the photographer of the image in the image library from the file header information of the image in the image library. Correspondingly, the matching module 23 is specifically configured to: match the information of the photographer of the image to be matched with the information of the photographer of the images in the image library, and use the successfully matched image as the target image.

本实施例的服务器,可用于执行实施例二的方法,具体实现方式和技术效果类似,这里不再赘述。The server in this embodiment can be used to execute the method in Embodiment 2, and the specific implementation manner and technical effect are similar, and will not be repeated here.

图5为本发明实施例五提供的一种终端的结构示意图,如图5所示,本实施例提供的终端300包括:处理器31、存储器32、通信接口33和通信总线34,其中,存储器32和通信接口33通过通信总线34与处理器31连接,存储器32用于存储计算机指令,通信接33口用于与其他设备通信,处理器31用于执行存储器32中存储的计算机指令,以执行如下所述的方法:FIG. 5 is a schematic structural diagram of a terminal provided in Embodiment 5 of the present invention. As shown in FIG. 32 and the communication interface 33 are connected with the processor 31 through the communication bus 34, the memory 32 is used to store computer instructions, the communication interface 33 is used to communicate with other devices, and the processor 31 is used to execute the computer instructions stored in the memory 32 to perform The method described below:

接收用户输入的待匹配图像和所述待匹配图像的匹配类型;Receive the image to be matched and the matching type of the image to be matched input by the user;

采用与所述待匹配图像的匹配类型对应的匹配算法获取所述待匹配图像的匹配参数;Acquiring matching parameters of the image to be matched by using a matching algorithm corresponding to the matching type of the image to be matched;

将所述待匹配图像的匹配参数、所述待匹配图像的匹配类型和所述匹配算法的标识发送给服务器,以使所述服务器根据所述待匹配图像的匹配参数、所述待匹配图像的匹配类型和所述匹配算法的标识与图像库中的图像进行匹配,找到与所述待匹配图像匹配的目标图像;Send the matching parameters of the image to be matched, the matching type of the image to be matched, and the identification of the matching algorithm to the server, so that the server can The matching type and the identification of the matching algorithm are matched with the images in the image library, and a target image matching the image to be matched is found;

接收所述服务器返回的匹配结果,所述匹配结果中包括匹配到的所述目标图像所属的用户的信息。The matching result returned by the server is received, and the matching result includes information about the user to which the matched target image belongs.

当所述待匹配图像的匹配类型为人脸匹配类型时,所述采用与所述待匹配图像的匹配类型对应的匹配算法获取所述待匹配图像的匹配参数,包括:采用与所述人脸匹配类型对应的匹配算法,提取所述待匹配图像的人脸特征。When the matching type of the image to be matched is a face matching type, the acquisition of the matching parameters of the image to be matched by using a matching algorithm corresponding to the matching type of the image to be matched includes: The matching algorithm corresponding to the type extracts the facial features of the image to be matched.

当所述待匹配图像的匹配类型为背景匹配类型时,所述采用与所述待匹配图像的匹配类型对应的匹配算法获取所述待匹配图像的匹配参数,包括:采用与所述背景匹配类型对应的算法,提取所述待匹配图像的背景的颜色特征。When the matching type of the image to be matched is a background matching type, the acquisition of the matching parameters of the image to be matched by using a matching algorithm corresponding to the matching type of the image to be matched includes: adopting the matching type corresponding to the background matching type The corresponding algorithm extracts the color features of the background of the image to be matched.

当所述待匹配图像的匹配类型为地点匹配类型时,所述采用与所述待匹配图像的匹配类型对应的匹配算法获取所述待匹配图像的匹配参数,包括:采用与所述地点匹配类型对应的算法,提取所述待匹配图像的纹理特征。可选的,所述待匹配图像的匹配参数还包括所述待匹配图像的拍摄地点信息,则所述处理器31还用于:从所述待匹配图像的文件头信息中获取所述待匹配图像的拍摄地点信息。When the matching type of the image to be matched is a location matching type, the acquisition of the matching parameters of the image to be matched by using a matching algorithm corresponding to the matching type of the image to be matched includes: using the matching type corresponding to the location The corresponding algorithm extracts the texture features of the image to be matched. Optionally, the matching parameters of the image to be matched further include shooting location information of the image to be matched, and the processor 31 is further configured to: obtain the image to be matched from header information of the image to be matched Information about where the image was taken.

当所述待匹配图像的匹配类型为作者匹配类型时,所述采用与所述待匹配图像的匹配类型对应的匹配算法获取所述待匹配图像的匹配参数,包括:采用与所述作者匹配类型对应的算法,从所述待匹配图像的文件头信息中获取所述待匹配图像的拍摄作者的信息。When the matching type of the image to be matched is the matching type of the author, the acquisition of the matching parameters of the image to be matched by using the matching algorithm corresponding to the matching type of the image to be matched includes: adopting the matching type with the author The corresponding algorithm obtains the information of the photographer of the image to be matched from the file header information of the image to be matched.

本实施例的终端,可用于执行实施例一的方法,具体实现方式和技术效果类似,这里不再赘述。The terminal in this embodiment can be used to execute the method in Embodiment 1, and the specific implementation manner and technical effect are similar, and will not be repeated here.

图6为本发明实施例六提供的一种服务器的结构示意图,如图6所示,本实施例提供的服务器400包括:处理器41、存储器42、通信接口43和通信总线44,其中,存储器42和通信接口43通过通信总线44与处理器41连接,存储器42用于存储计算机指令,通信接43口用于与其他设备通信,处理器41用于执行存储器42中存储的计算机指令,以执行如下所述的方法:FIG. 6 is a schematic structural diagram of a server provided in Embodiment 6 of the present invention. As shown in FIG. 6, the server 400 provided in this embodiment includes: a processor 41, a memory 42, a communication interface 43 and a communication bus 44, wherein 42 and the communication interface 43 are connected with the processor 41 through the communication bus 44, the memory 42 is used to store computer instructions, the communication interface 43 is used to communicate with other devices, and the processor 41 is used to execute the computer instructions stored in the memory 42 to perform The method described below:

接收客户端发送的待匹配图像的匹配参数、所述待匹配图像的匹配类型和所述待匹配图像的匹配类型对应的匹配算法的标识;receiving the matching parameters of the image to be matched sent by the client, the matching type of the image to be matched, and the identification of the matching algorithm corresponding to the matching type of the image to be matched;

根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数;According to the matching type of the image to be matched and the identification of the matching algorithm, the matching parameters of the images in the image library are acquired;

将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像;Matching the matching parameters of the image to be matched with the matching parameters of the images in the image library, using the successfully matched image as the target image;

获取所述目标图像所属的用户的信息,根据所述目标图像所属的用户的信息生成匹配结果,并将所述匹配结果发送给所述客户端。Acquire the information of the user to which the target image belongs, generate a matching result according to the information of the user to which the target image belongs, and send the matching result to the client.

当所述待匹配图像的匹配类型为人脸匹配类型时,所述匹配算法的标识为所述人脸匹配类型对应的匹配算法的标识。所述根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数,包括:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述人脸匹配类型对应的匹配算法提取所述图像库中的图像的人脸特征。所述将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像,包括:将所述待匹配图像的人脸特征与所述图像库中的图像的人脸特征进行匹配,将匹配成功的图像作为所述目标图像。When the matching type of the image to be matched is the face matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the face matching type. The acquiring the matching parameters of the image in the image library according to the matching type of the image to be matched and the identification of the matching algorithm includes: according to the matching type of the image to be matched and the identification of the matching algorithm, using the The matching algorithm corresponding to the face matching type extracts the face features of the images in the image library. The matching of the matching parameters of the image to be matched with the matching parameters of the images in the image library, and using the successfully matched image as the target image includes: matching the facial features of the image to be matched with the The facial features of the images in the image library are matched, and the image that is successfully matched is used as the target image.

当所述待匹配图像的匹配类型为背景匹配类型时,所述匹配算法的标识为所述背景匹配类型对应的匹配算法的标识。所述根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数,包括:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述背景匹配类型对应的匹配算法提取所述图像库中的图像的背景的颜色特征。所述将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像,包括:将所述待匹配图像的背景的颜色特征与所述图像库中的图像的背景的颜色特征进行匹配,将匹配成功的图像作为所述目标图像。When the matching type of the image to be matched is the background matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the background matching type. The acquiring the matching parameters of the image in the image library according to the matching type of the image to be matched and the identification of the matching algorithm includes: according to the matching type of the image to be matched and the identification of the matching algorithm, using the The matching algorithm corresponding to the background matching type extracts the color features of the background of the images in the image library. The matching the matching parameters of the image to be matched with the matching parameters of the images in the image library, and using the successfully matched image as the target image includes: matching the color feature of the background of the image to be matched with The background color features of the images in the image library are matched, and the successfully matched image is used as the target image.

当所述待匹配图像的匹配类型为背景匹配类型时,所述获取所述目标图像所属的用户的信息,根据所述目标图像所属的用户的信息生成匹配结果,将所述匹配结果发送给所述客户端,包括:获取所述目标图像所属的用户的信息;判断所述目标图像所属的用户的图像中与所述待匹配图像匹配的图像个数是否大于预先设置的阈值;若所述目标图像所属的用户的图像中与所述待匹配图像匹配的图像个数大于所述阈值,则将所述目标图像所属的用户的信息添加到所述匹配结果中。When the matching type of the image to be matched is the background matching type, the acquisition of the information of the user to which the target image belongs generates a matching result according to the information of the user to which the target image belongs, and sends the matching result to the The client includes: obtaining the information of the user to which the target image belongs; judging whether the number of images matching the image to be matched in the image of the user to which the target image belongs is greater than a preset threshold; if the target If the number of images that match the image to be matched among the images of the user to which the images belong is greater than the threshold, the information of the user to which the target image belongs is added to the matching result.

当所述待匹配图像的匹配类型为地点匹配类型时,所述匹配算法的标识为所述地点匹配类型对应的匹配算法的标识。所述根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数,包括:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用与所述地点匹配类型对应的算法提取所述图像库中的图像的纹理特征。所述将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将所述图像库中的匹配成功的图像作为所述目标图像,包括:将所述待匹配图像的纹理特征与所述图像库中的图像的纹理特征进行匹配,将匹配成功的图像作为所述目标图像。When the matching type of the image to be matched is the location matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the location matching type. The acquiring the matching parameters of the images in the image library according to the matching type of the image to be matched and the identification of the matching algorithm includes: according to the matching type of the image to be matched and the identification of the matching algorithm, using The algorithm corresponding to the location matching type extracts the texture features of the images in the image library. The matching the matching parameters of the image to be matched with the matching parameters of the images in the image library, and using the successfully matched image in the image library as the target image includes: matching the image to be matched The texture features of the image are matched with the texture features of the images in the image library, and the matched image is used as the target image.

当所述待匹配图像的匹配类型为地点匹配类型时,所述匹配算法的标识为所述地点匹配类型对应的匹配算法的标识。所述根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数,包括:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述地点匹配类型对应的算法提取所述图像库中的图像的纹理特征,并从所述图像库中的图像的文件头信息中获取所述图像库中的图像的拍摄地点信息。所述将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像,包括:将所述待匹配图像中的纹理特征和拍摄地点信息,与所述图像库中的图像的纹理特征和拍摄地点信息进行匹配,将匹配成功的图像作为所述目标图像。When the matching type of the image to be matched is the location matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the location matching type. The acquiring the matching parameters of the image in the image library according to the matching type of the image to be matched and the identification of the matching algorithm includes: according to the matching type of the image to be matched and the identification of the matching algorithm, using the The algorithm corresponding to the location matching type extracts the texture features of the images in the image library, and obtains the shooting location information of the images in the image library from the file header information of the images in the image library. The matching the matching parameters of the image to be matched with the matching parameters of the images in the image library, and using the successfully matched image as the target image includes: combining the texture features in the image to be matched with the photographic The location information is matched with the texture features and shooting location information of the images in the image library, and the matched image is used as the target image.

当所述待匹配图像的匹配类型为作者匹配类型时,所述匹配算法的标识为所述作者匹配类型对应的匹配算法的标识。所述根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数,包括:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述作者匹配类型对应的算法,从所述图像库中的图像的文件头信息中获取所述图像库中的图像的拍摄作者的信息。将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像,包括:将所述待匹配图像的拍摄作者的信息与所述图像库中的图像的拍摄作者的信息进行匹配,将匹配成功的图像作为所述目标图像。When the matching type of the image to be matched is the author matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the author matching type. The acquiring the matching parameters of the image in the image library according to the matching type of the image to be matched and the identification of the matching algorithm includes: according to the matching type of the image to be matched and the identification of the matching algorithm, using the The algorithm corresponding to the matching type of the author is used to obtain the information of the author who took the image in the image library from the file header information of the image in the image library. Matching the matching parameters of the image to be matched with the matching parameters of the images in the image library, and using the successfully matched image as the target image includes: combining the information of the photographer of the image to be matched with the The photographing author's information of the images in the image library is matched, and the matched image is used as the target image.

本实施例的服务器,可用于执行实施例二的方法,具体实现方式和技术效果类似,这里不再赘述。The server in this embodiment can be used to execute the method in Embodiment 2, and the specific implementation manner and technical effect are similar, and will not be repeated here.

本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps for implementing the above method embodiments can be completed by program instructions and related hardware. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the above-mentioned method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.

最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than limiting them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: It is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the various embodiments of the present invention. scope.

Claims (26)

1.一种图像匹配发现好友的方法,其特征在于,包括:1. A method for finding friends by image matching, characterized in that, comprising: 客户端接收用户输入的待匹配图像和所述待匹配图像的匹配类型;The client receives the image to be matched and the matching type of the image to be matched input by the user; 所述客户端采用与所述待匹配图像的匹配类型对应的匹配算法获取所述待匹配图像的匹配参数;The client adopts a matching algorithm corresponding to the matching type of the image to be matched to obtain the matching parameters of the image to be matched; 所述客户端将所述待匹配图像的匹配参数、所述待匹配图像的匹配类型和所述匹配算法的标识发送给服务器,以使所述服务器根据所述待匹配图像的匹配参数、所述待匹配图像的匹配类型和所述匹配算法的标识与图像库中的图像进行匹配,找到与所述待匹配图像匹配的目标图像;The client sends the matching parameters of the image to be matched, the matching type of the image to be matched, and the identification of the matching algorithm to the server, so that the server can use the matching parameters of the image to be matched, the The matching type of the image to be matched and the identification of the matching algorithm are matched with the images in the image library, and a target image matching the image to be matched is found; 所述客户端接收所述服务器返回的匹配结果,所述匹配结果中包括匹配到的所述目标图像所属的用户的信息。The client receives the matching result returned by the server, and the matching result includes information about the user to which the matched target image belongs. 2.根据权利要求1所述的方法,其特征在于,当所述待匹配图像的匹配类型为人脸匹配类型时,所述客户端采用与所述待匹配图像的匹配类型对应的匹配算法获取所述待匹配图像的匹配参数,包括:2. The method according to claim 1, wherein when the matching type of the image to be matched is a face matching type, the client uses a matching algorithm corresponding to the matching type of the image to be matched to obtain the Describe the matching parameters of the image to be matched, including: 所述客户端采用与所述人脸匹配类型对应的匹配算法,提取所述待匹配图像的人脸特征。The client uses a matching algorithm corresponding to the face matching type to extract the face features of the image to be matched. 3.根据权利要求1所述的方法,其特征在于,当所述待匹配图像的匹配类型为背景匹配类型时,所述客户端采用与所述待匹配图像的匹配类型对应的匹配算法获取所述待匹配图像的匹配参数,包括:3. The method according to claim 1, wherein when the matching type of the image to be matched is a background matching type, the client adopts a matching algorithm corresponding to the matching type of the image to be matched to obtain the Describe the matching parameters of the image to be matched, including: 所述客户端采用与所述背景匹配类型对应的算法,提取所述待匹配图像的背景的颜色特征。The client uses an algorithm corresponding to the background matching type to extract the color features of the background of the image to be matched. 4.根据权利要求1所述的方法,其特征在于,当所述待匹配图像的匹配类型为地点匹配类型时,所述客户端采用与所述待匹配图像的匹配类型对应的匹配算法获取所述待匹配图像的匹配参数,包括:4. The method according to claim 1, wherein when the matching type of the image to be matched is a location matching type, the client uses a matching algorithm corresponding to the matching type of the image to be matched to obtain the Describe the matching parameters of the image to be matched, including: 所述客户端采用与所述地点匹配类型对应的算法,提取所述待匹配图像的纹理特征。The client uses an algorithm corresponding to the location matching type to extract texture features of the image to be matched. 5.根据权利要求4所述的方法,其特征在于,所述待匹配图像的匹配参数还包括所述待匹配图像的拍摄地点信息,则所述方法还包括:5. The method according to claim 4, wherein the matching parameters of the image to be matched also include the shooting location information of the image to be matched, then the method further comprises: 所述客户端从所述待匹配图像的文件头信息中获取所述待匹配图像的拍摄地点信息。The client acquires the shooting location information of the image to be matched from the file header information of the image to be matched. 6.根据权利要求1所述的方法,其特征在于,当所述待匹配图像的匹配类型为作者匹配类型时,所述客户端采用与所述待匹配图像的匹配类型对应的匹配算法获取所述待匹配图像的匹配参数,包括:6. The method according to claim 1, wherein when the matching type of the image to be matched is the author matching type, the client uses a matching algorithm corresponding to the matching type of the image to be matched to obtain the Describe the matching parameters of the image to be matched, including: 所述客户端采用与所述作者匹配类型对应的算法,从所述待匹配图像的文件头信息中获取所述待匹配图像的拍摄作者的信息。The client adopts an algorithm corresponding to the author matching type to obtain the information of the photographer of the image to be matched from the file header information of the image to be matched. 7.一种图像匹配发现好友的方法,其特征在于,包括:7. A method for finding friends by image matching, comprising: 服务器接收客户端发送的待匹配图像的匹配参数、所述待匹配图像的匹配类型和所述待匹配图像的匹配类型对应的匹配算法的标识;The server receives the matching parameters of the image to be matched sent by the client, the matching type of the image to be matched, and the identification of the matching algorithm corresponding to the matching type of the image to be matched; 所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数;The server obtains the matching parameters of the images in the image library according to the matching type of the image to be matched and the identification of the matching algorithm; 所述服务器将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像;The server matches the matching parameters of the image to be matched with the matching parameters of the images in the image library, and uses the successfully matched image as the target image; 所述服务器获取所述目标图像所属的用户的信息,根据所述目标图像所属的用户的信息生成匹配结果,并将所述匹配结果发送给所述客户端。The server acquires the information of the user to which the target image belongs, generates a matching result according to the information of the user to which the target image belongs, and sends the matching result to the client. 8.根据权利要求7所述的方法,其特征在于,当所述待匹配图像的匹配类型为人脸匹配类型时,所述匹配算法的标识为所述人脸匹配类型对应的匹配算法的标识;8. The method according to claim 7, wherein when the matching type of the image to be matched is a face matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the matching type of the human face; 所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数,包括:The server obtains the matching parameters of the images in the image library according to the matching type of the image to be matched and the identification of the matching algorithm, including: 所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述人脸匹配类型对应的匹配算法提取所述图像库中的图像的人脸特征;According to the matching type of the image to be matched and the identification of the matching algorithm, the server uses the matching algorithm corresponding to the face matching type to extract the face features of the images in the image library; 所述服务器将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像,包括:The server matches the matching parameters of the image to be matched with the matching parameters of the images in the image library, and uses the successfully matched image as the target image, including: 所述服务器将所述待匹配图像的人脸特征与所述图像库中的图像的人脸特征进行匹配,将匹配成功的图像作为所述目标图像。The server matches the facial features of the image to be matched with the facial features of the images in the image database, and uses the successfully matched image as the target image. 9.根据权利要求7所述的方法,其特征在于,当所述待匹配图像的匹配类型为背景匹配类型时,所述匹配算法的标识为所述背景匹配类型对应的匹配算法的标识;9. The method according to claim 7, wherein when the matching type of the image to be matched is a background matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the background matching type; 所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数,包括:The server obtains the matching parameters of the images in the image library according to the matching type of the image to be matched and the identification of the matching algorithm, including: 所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述背景匹配类型对应的匹配算法提取所述图像库中的图像的背景的颜色特征;According to the matching type of the image to be matched and the identification of the matching algorithm, the server uses the matching algorithm corresponding to the background matching type to extract the color feature of the background of the image in the image library; 所述服务器将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像,包括:The server matches the matching parameters of the image to be matched with the matching parameters of the images in the image library, and uses the successfully matched image as the target image, including: 所述服务器将所述待匹配图像的背景的颜色特征与所述图像库中的图像的背景的颜色特征进行匹配,将匹配成功的图像作为所述目标图像。The server matches the color feature of the background of the image to be matched with the color feature of the background of the image in the image library, and uses the image that is successfully matched as the target image. 10.根据权利要求9所述的方法,其特征在于,所述服务器获取所述目标图像所属的用户的信息,根据所述目标图像所属的用户的信息生成匹配结果,将所述匹配结果发送给所述客户端,包括:10. The method according to claim 9, wherein the server obtains the information of the user to which the target image belongs, generates a matching result according to the information of the user to which the target image belongs, and sends the matching result to The client includes: 所述服务器获取所述目标图像所属的用户的信息;The server obtains the information of the user to whom the target image belongs; 所述服务器判断所述目标图像所属的用户的图像中与所述待匹配图像匹配的图像个数是否大于预先设置的阈值;The server judges whether the number of images matching the image to be matched in the user's image to which the target image belongs is greater than a preset threshold; 若所述目标图像所属的用户的图像中与所述待匹配图像匹配的图像个数大于所述阈值,则所述服务器将所述目标图像所属的用户的信息添加到所述匹配结果中。If the number of images of the user to which the target image belongs matches the image to be matched is greater than the threshold, the server adds information about the user to which the target image belongs to the matching result. 11.根据权利要求7所述的方法,其特征在于,当所述待匹配图像的匹配类型为地点匹配类型时,所述匹配算法的标识为所述地点匹配类型对应的匹配算法的标识;11. The method according to claim 7, wherein when the matching type of the image to be matched is a location matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the location matching type; 所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数,包括:The server obtains the matching parameters of the images in the image library according to the matching type of the image to be matched and the identification of the matching algorithm, including: 所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用与所述地点匹配类型对应的算法提取所述图像库中的图像的纹理特征;According to the matching type of the image to be matched and the identification of the matching algorithm, the server uses an algorithm corresponding to the location matching type to extract the texture features of the image in the image library; 所述服务器将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将所述图像库中的匹配成功的图像作为所述目标图像,包括:The server matches the matching parameters of the image to be matched with the matching parameters of the images in the image library, and uses the successfully matched image in the image library as the target image, including: 所述服务器将所述待匹配图像的纹理特征与所述图像库中的图像的纹理特征进行匹配,将匹配成功的图像作为所述目标图像。The server matches the texture feature of the image to be matched with the texture feature of the image in the image library, and takes the image that is successfully matched as the target image. 12.根据权利要求7所述的方法,其特征在于,当所述待匹配图像的匹配类型为地点匹配类型时,所述匹配算法的标识为所述地点匹配类型对应的匹配算法的标识;12. The method according to claim 7, wherein when the matching type of the image to be matched is a location matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the location matching type; 所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数,包括:The server obtains the matching parameters of the images in the image library according to the matching type of the image to be matched and the identification of the matching algorithm, including: 所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述地点匹配类型对应的算法提取所述图像库中的图像的纹理特征,并从所述图像库中的图像的文件头信息中获取所述图像库中的图像的拍摄地点信息;According to the matching type of the image to be matched and the identification of the matching algorithm, the server uses the algorithm corresponding to the location matching type to extract the texture features of the image in the image library, and extracts the texture features from the image in the image library Obtain the shooting location information of the image in the image library from the header information of the file; 所述服务器将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像,包括:The server matches the matching parameters of the image to be matched with the matching parameters of the images in the image library, and uses the successfully matched image as the target image, including: 所述服务器将所述待匹配图像中的纹理特征和拍摄地点信息,与所述图像库中的图像的纹理特征和拍摄地点信息进行匹配,将匹配成功的图像作为所述目标图像。The server matches the texture feature and shooting location information in the image to be matched with the texture feature and shooting location information of the image in the image library, and uses the successfully matched image as the target image. 13.根据权利要求7所述的方法,其特征在于,当所述待匹配图像的匹配类型为作者匹配类型时,所述匹配算法的标识为所述作者匹配类型对应的匹配算法的标识;13. The method according to claim 7, wherein when the matching type of the image to be matched is the author matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the author matching type; 所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数,包括:The server obtains the matching parameters of the images in the image library according to the matching type of the image to be matched and the identification of the matching algorithm, including: 所述服务器根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述作者匹配类型对应的算法,从所述图像库中的图像的文件头信息中获取所述图像库中的图像的拍摄作者的信息;According to the matching type of the image to be matched and the identification of the matching algorithm, the server adopts the algorithm corresponding to the matching type of the author to obtain the image in the image library from the file header information of the image in the image library. information about the author of the image; 所述服务器将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像,包括:The server matches the matching parameters of the image to be matched with the matching parameters of the images in the image library, and uses the successfully matched image as the target image, including: 所述服务器将所述待匹配图像的拍摄作者的信息与所述图像库中的图像的拍摄作者的信息进行匹配,将匹配成功的图像作为所述目标图像。The server matches the information of the photographer of the image to be matched with the information of the photographer of the image in the image library, and uses the image that is successfully matched as the target image. 14.一种客户端,其特征在于,包括:14. A client, characterized in that, comprising: 接收模块,用于接收用户输入的待匹配图像和所述待匹配图像的匹配类型;A receiving module, configured to receive an image to be matched input by a user and a matching type of the image to be matched; 获取模块,用于采用与所述待匹配图像的匹配类型对应的匹配算法获取所述待匹配图像的匹配参数;An acquisition module, configured to acquire matching parameters of the image to be matched by using a matching algorithm corresponding to the matching type of the image to be matched; 发送模块,用于将所述待匹配图像的匹配参数、所述待匹配图像的匹配类型和所述匹配算法的标识发送给服务器,以使所述服务器根据所述待匹配图像的匹配参数、所述待匹配图像的匹配类型和所述匹配算法的标识与图像库中的图像进行匹配,找到与所述待匹配图像匹配的目标图像;A sending module, configured to send the matching parameters of the image to be matched, the matching type of the image to be matched, and the identification of the matching algorithm to a server, so that the server can The matching type of the image to be matched and the identification of the matching algorithm are matched with the images in the image library, and a target image matching the image to be matched is found; 所述接收模块,还用于接收所述服务器返回的匹配结果,所述匹配结果中包括匹配到的所述目标图像所属的用户的信息。The receiving module is further configured to receive a matching result returned by the server, where the matching result includes information about the user to which the matched target image belongs. 15.根据权利要求14所述的客户端,其特征在于,当所述待匹配图像的匹配类型为人脸匹配类型时,所述获取模块具体用于:采用与所述人脸匹配类型对应的匹配算法,提取所述待匹配图像的人脸特征。15. The client according to claim 14, wherein when the matching type of the image to be matched is a face matching type, the acquisition module is specifically configured to: adopt a matching method corresponding to the face matching type Algorithm to extract the facial features of the image to be matched. 16.根据权利要求14所述的客户端,其特征在于,当所述待匹配图像的匹配类型为背景匹配类型时,所述获取模块具体用于:采用与所述背景匹配类型对应的算法,提取所述待匹配图像的背景的颜色特征。16. The client according to claim 14, wherein when the matching type of the image to be matched is a background matching type, the acquisition module is specifically configured to: adopt an algorithm corresponding to the background matching type, Extracting the color features of the background of the image to be matched. 17.根据权利要求14所述的客户端,其特征在于,当所述待匹配图像的匹配类型为地点匹配类型时,所述获取模块具体用于:采用与所述地点匹配类型对应的算法,提取所述待匹配图像的纹理特征。17. The client according to claim 14, wherein when the matching type of the image to be matched is a location matching type, the acquisition module is specifically configured to: adopt an algorithm corresponding to the location matching type, Extracting texture features of the image to be matched. 18.根据权利要求17所述的客户端,其特征在于,所述待匹配图像的匹配参数还包括所述待匹配图像的拍摄地点信息,所述获取模块还用于:从所述待匹配图像的文件头信息中获取所述待匹配图像的拍摄地点信息。18. The client according to claim 17, wherein the matching parameters of the image to be matched further include shooting location information of the image to be matched, and the obtaining module is further configured to: obtain the image from the image to be matched The shooting location information of the image to be matched is obtained from the header information of the file. 19.根据权利要求14所述的客户端,其特征在于,当所述待匹配图像的匹配类型为作者匹配类型时,所述获取模块具体用于:采用与所述作者匹配类型对应的算法,从所述待匹配图像的文件头信息中获取所述待匹配图像的拍摄作者的信息。19. The client according to claim 14, wherein when the matching type of the image to be matched is an author matching type, the acquisition module is specifically configured to: adopt an algorithm corresponding to the author matching type, The information of the shooter of the image to be matched is acquired from the file header information of the image to be matched. 20.一种服务器,其特征在于,包括:20. A server, characterized in that, comprising: 接收模块,用于接收客户端发送的待匹配图像的匹配参数、所述待匹配图像的匹配类型和所述待匹配图像的匹配类型对应的匹配算法的标识;The receiving module is used to receive the matching parameters of the image to be matched sent by the client, the matching type of the image to be matched, and the identification of the matching algorithm corresponding to the matching type of the image to be matched; 获取模块,用于根据所述待匹配图像的匹配类型和所述匹配算法的标识,获取图像库中的图像的匹配参数;An acquisition module, configured to acquire the matching parameters of the images in the image library according to the matching type of the image to be matched and the identification of the matching algorithm; 匹配模块,用于将所述待匹配图像的匹配参数与所述图像库中的图像的匹配参数进行匹配,将匹配成功的图像作为所述目标图像;A matching module, configured to match the matching parameters of the image to be matched with the matching parameters of the images in the image library, and use the successfully matched image as the target image; 发送模块,用于获取所述目标图像所属的用户的信息,根据所述目标图像所属的用户的信息生成匹配结果,并将所述匹配结果发送给所述客户端。A sending module, configured to acquire information about the user to which the target image belongs, generate a matching result according to the information about the user to which the target image belongs, and send the matching result to the client. 21.根据权利要求20所述的服务器,其特征在于,当所述待匹配图像的匹配类型为人脸匹配类型时,所述匹配算法的标识为所述人脸匹配类型对应的匹配算法的标识,所述获取模块具体用于:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述人脸匹配类型对应的匹配算法提取所述图像库中的图像的人脸特征;21. The server according to claim 20, wherein when the matching type of the image to be matched is a face matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the face matching type, The acquisition module is specifically configured to: extract the face features of the images in the image library by using the matching algorithm corresponding to the face matching type according to the matching type of the image to be matched and the identification of the matching algorithm; 所述匹配模块具体用于:将所述待匹配图像的人脸特征与所述图像库中的图像的人脸特征进行匹配,将匹配成功的图像作为所述目标图像。The matching module is specifically configured to: match the facial features of the image to be matched with the facial features of the images in the image library, and use the successfully matched image as the target image. 22.根据权利要求20所述的服务器,其特征在于,当所述待匹配图像的匹配类型为背景匹配类型时,所述匹配算法的标识为所述背景匹配类型对应的匹配算法的标识,所述获取模块具体用于:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述背景匹配类型对应的匹配算法提取所述图像库中的图像的背景的颜色特征;22. The server according to claim 20, wherein when the matching type of the image to be matched is a background matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the background matching type, so The acquisition module is specifically used for: according to the matching type of the image to be matched and the identification of the matching algorithm, using the matching algorithm corresponding to the background matching type to extract the color feature of the background of the image in the image library; 所述匹配模块具体用于:将所述待匹配图像的背景的颜色特征与所述图像库中的图像的背景的颜色特征进行匹配,将匹配成功的图像作为所述目标图像。The matching module is specifically configured to: match the color feature of the background of the image to be matched with the color feature of the background of the image in the image library, and use the successfully matched image as the target image. 23.根据权利要求22所述的服务器,其特征在于,所述发送模块具体用于:23. The server according to claim 22, wherein the sending module is specifically used for: 获取所述目标图像所属的用户的信息;Acquiring information about the user to which the target image belongs; 判断所述目标图像所属的用户的图像中与所述待匹配图像匹配的图像个数是否大于预先设置的阈值;judging whether the number of images matching the image to be matched in the user's image to which the target image belongs is greater than a preset threshold; 若所述目标图像所属的用户的图像中与所述待匹配图像匹配的图像个数大于所述阈值,则将所述目标图像所属的用户的信息添加到所述匹配结果中。If the number of images of the user to which the target image belongs matches the image to be matched is greater than the threshold, adding the information of the user to which the target image belongs to the matching result. 24.根据权利要求20所述的服务器,其特征在于,当所述待匹配图像的匹配类型为地点匹配类型时,所述匹配算法的标识为所述地点匹配类型对应的匹配算法的标识,所述获取模块具体用于:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用与所述地点匹配类型对应的算法提取所述图像库中的图像的纹理特征;24. The server according to claim 20, wherein when the matching type of the image to be matched is a location matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the location matching type, so The acquisition module is specifically used for: according to the matching type of the image to be matched and the identification of the matching algorithm, using an algorithm corresponding to the matching type of the location to extract the texture feature of the image in the image library; 所述匹配模块具体用于:将所述待匹配图像的纹理特征与所述图像库中的图像的纹理特征进行匹配,将匹配成功的图像作为所述目标图像。The matching module is specifically configured to: match the texture features of the image to be matched with the texture features of the images in the image library, and use the successfully matched image as the target image. 25.根据权利要求20所述的服务器,其特征在于,当所述待匹配图像的匹配类型为地点匹配类型时,所述匹配算法的标识为所述地点匹配类型对应的匹配算法的标识,所述获取模块具体用于:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述地点匹配类型对应的算法提取所述图像库中的图像的纹理特征,并从所述图像库中的图像的文件头信息中获取所述图像库中的图像的拍摄地点信息;25. The server according to claim 20, wherein when the matching type of the image to be matched is a location matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the location matching type, so The acquisition module is specifically used for: according to the matching type of the image to be matched and the identification of the matching algorithm, use the algorithm corresponding to the matching type of the location to extract the texture feature of the image in the image library, and extract the texture features of the image from the image Obtain the shooting location information of the image in the image library from the file header information of the image in the library; 所述匹配模块具体用于:将所述待匹配图像中的纹理特征和拍摄地点信息,与所述图像库中的图像的纹理特征和拍摄地点信息进行匹配,将匹配成功的图像作为所述目标图像。The matching module is specifically configured to: match the texture feature and shooting location information in the image to be matched with the texture feature and shooting location information of the image in the image library, and use the successfully matched image as the target image. 26.根据权利要求20所述的服务器,其特征在于,当所述待匹配图像的匹配类型为作者匹配类型时,所述匹配算法的标识为所述作者匹配类型对应的匹配算法的标识,所述获取模块具体用于:根据所述待匹配图像的匹配类型和所述匹配算法的标识,采用所述作者匹配类型对应的算法,从所述图像库中的图像的文件头信息中获取所述图像库中的图像的拍摄作者的信息;26. The server according to claim 20, wherein when the matching type of the image to be matched is the author matching type, the identification of the matching algorithm is the identification of the matching algorithm corresponding to the author matching type, so The acquiring module is specifically used for: according to the matching type of the image to be matched and the identification of the matching algorithm, adopt the algorithm corresponding to the matching type of the author, and acquire the described information about the author of the images in the image library; 所述匹配模块具体用于:将所述待匹配图像的拍摄作者的信息与所述图像库中的图像的拍摄作者的信息进行匹配,将匹配成功的图像作为所述目标图像。The matching module is specifically configured to: match the information of the photographer of the image to be matched with the information of the photographer of the image in the image library, and use the successfully matched image as the target image.
CN201510090499.4A 2015-02-28 2015-02-28 Method and device for discovering friends by image matching Pending CN105989345A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201510090499.4A CN105989345A (en) 2015-02-28 2015-02-28 Method and device for discovering friends by image matching
PCT/CN2016/074650 WO2016134666A1 (en) 2015-02-28 2016-02-26 Method and device for discovering friend through image matching

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510090499.4A CN105989345A (en) 2015-02-28 2015-02-28 Method and device for discovering friends by image matching

Publications (1)

Publication Number Publication Date
CN105989345A true CN105989345A (en) 2016-10-05

Family

ID=56787879

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510090499.4A Pending CN105989345A (en) 2015-02-28 2015-02-28 Method and device for discovering friends by image matching

Country Status (2)

Country Link
CN (1) CN105989345A (en)
WO (1) WO2016134666A1 (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106980688A (en) * 2017-03-31 2017-07-25 上海掌门科技有限公司 A kind of method, equipment and system for being used to provide friend-making object
CN108334522A (en) * 2017-01-20 2018-07-27 阿里巴巴集团控股有限公司 The method for determining customs's coding, and determine the method and system of type information
CN110139025A (en) * 2018-09-29 2019-08-16 广东小天才科技有限公司 Social user recommendation method based on photographing behavior and wearable device
CN110955841A (en) * 2019-11-28 2020-04-03 维沃移动通信有限公司 Social relationship establishing method and electronic equipment
CN112163168A (en) * 2020-09-15 2021-01-01 济南雪景网络技术有限公司 Matching friend-making method based on computer vision
WO2023206576A1 (en) * 2022-04-29 2023-11-02 北京小米移动软件有限公司 Image processing method and apparatus

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111723767B (en) * 2020-06-29 2023-08-08 杭州海康威视数字技术股份有限公司 Image processing method, device and computer storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102831176A (en) * 2012-07-30 2012-12-19 东莞宇龙通信科技有限公司 Method and server for recommending friends
CN103514286A (en) * 2013-09-30 2014-01-15 鸿富锦精密工业(深圳)有限公司 Friend recommending system and method
US20140081960A1 (en) * 2006-09-22 2014-03-20 John Nicholas Gross Friend & Group Recommendations for Social Networks
CN104102656A (en) * 2013-04-09 2014-10-15 腾讯科技(深圳)有限公司 Friend recommending method, device, system and server
US20140365484A1 (en) * 2013-03-15 2014-12-11 Daniel Freeman Comprehensive user/event matching or recommendations based on awareness of entities, activities, interests, desires, location
CN104317932A (en) * 2014-10-31 2015-01-28 小米科技有限责任公司 Photo sharing method and device
CN104333506A (en) * 2014-10-24 2015-02-04 北京兴远永网络科技有限公司 Communication terminal contact method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103327163B (en) * 2012-03-22 2015-11-25 宇龙计算机通信科技(深圳)有限公司 Search method and the communication terminal thereof of associated person information
US8843518B2 (en) * 2012-07-17 2014-09-23 Verizon Patent And Licensing Inc. Method and apparatus for establishing a connection with known individuals
CN103024118A (en) * 2012-11-23 2013-04-03 东莞宇龙通信科技有限公司 Contact search method and communication terminal
CN103116751B (en) * 2013-01-24 2016-07-06 河海大学 A kind of Method of Automatic Recognition for Character of Lcecse Plate
CN103970771B (en) * 2013-01-29 2016-12-28 中国科学院计算技术研究所 The search method of a kind of human body and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140081960A1 (en) * 2006-09-22 2014-03-20 John Nicholas Gross Friend & Group Recommendations for Social Networks
CN102831176A (en) * 2012-07-30 2012-12-19 东莞宇龙通信科技有限公司 Method and server for recommending friends
US20140365484A1 (en) * 2013-03-15 2014-12-11 Daniel Freeman Comprehensive user/event matching or recommendations based on awareness of entities, activities, interests, desires, location
CN104102656A (en) * 2013-04-09 2014-10-15 腾讯科技(深圳)有限公司 Friend recommending method, device, system and server
CN103514286A (en) * 2013-09-30 2014-01-15 鸿富锦精密工业(深圳)有限公司 Friend recommending system and method
CN104333506A (en) * 2014-10-24 2015-02-04 北京兴远永网络科技有限公司 Communication terminal contact method and device
CN104317932A (en) * 2014-10-31 2015-01-28 小米科技有限责任公司 Photo sharing method and device

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108334522A (en) * 2017-01-20 2018-07-27 阿里巴巴集团控股有限公司 The method for determining customs's coding, and determine the method and system of type information
CN108334522B (en) * 2017-01-20 2021-12-14 阿里巴巴集团控股有限公司 Method for determining customs code, and method and system for determining type information
CN106980688A (en) * 2017-03-31 2017-07-25 上海掌门科技有限公司 A kind of method, equipment and system for being used to provide friend-making object
WO2018176954A1 (en) * 2017-03-31 2018-10-04 上海掌门科技有限公司 Method, device and system for providing friend-making objects
CN110139025A (en) * 2018-09-29 2019-08-16 广东小天才科技有限公司 Social user recommendation method based on photographing behavior and wearable device
CN110955841A (en) * 2019-11-28 2020-04-03 维沃移动通信有限公司 Social relationship establishing method and electronic equipment
CN112163168A (en) * 2020-09-15 2021-01-01 济南雪景网络技术有限公司 Matching friend-making method based on computer vision
WO2023206576A1 (en) * 2022-04-29 2023-11-02 北京小米移动软件有限公司 Image processing method and apparatus

Also Published As

Publication number Publication date
WO2016134666A1 (en) 2016-09-01

Similar Documents

Publication Publication Date Title
CN105989345A (en) Method and device for discovering friends by image matching
US9996735B2 (en) Facial recognition
US8810684B2 (en) Tagging images in a mobile communications device using a contacts list
TW201516939A (en) Method and device for inquiring user identity, method and device for acquiring user identity, and method and device for adding friend in instant messaging
WO2017020484A1 (en) Photo sharing method and apparatus
CN105684038A (en) Image cache for parts that replace images
CN108198177A (en) Image acquisition method, device, terminal and storage medium
WO2016146060A1 (en) Sharing method and device for picture
CN109117778B (en) Information processing method, information processing apparatus, server, and storage medium
WO2019153504A1 (en) Group creation method and terminal thereof
KR20140026512A (en) Automatically optimizing capture of images of one or more subjects
CN108174097A (en) Method and device for taking pictures and providing shooting parameters
CN103823858A (en) Information processing method and information processing device
EP3839768A1 (en) Mediating apparatus and method, and computer-readable recording medium thereof
TWI518602B (en) Image recognizing method, apparatus, terminal apparatus and server
KR101715708B1 (en) Automated System for Providing Relation Related Tag Using Image Analysis and Method Using Same
WO2018133354A1 (en) Information acquisition method and acquisition device
CN106777030B (en) Information pushing method and device
CN116804916A (en) Information processing apparatus, information processing method, and recording medium
US20120179676A1 (en) Method and apparatus for annotating image in digital camera
CA2827639C (en) Facial recognition
CN103207891B (en) multimedia information display method and device
CN112055847B (en) Methods and systems for processing images
EP2905969A1 (en) Method and apparatus for determining data enabling generation of a user profile
CN105516607A (en) Recommendation method and device for shooting parameters and equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20161005

RJ01 Rejection of invention patent application after publication