Image color matching comparison method and device

Through image segmentation and clustering algorithms, the similarity of image color matching is calculated, which solves the problem that ordinary users have difficulty in judging whether the outfit conforms to the fashion style, realizes automatic color matching between images, and provides convenient outfit guidance.

CN118570513APending Publication Date: 2024-08-30GUANGDONG HENGQIN SHUSHUSHUO STORY INFORMATION TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410818551.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

Ordinary users lack automated color matching tools when choosing fashionable outfits, making it difficult to judge whether their outfits are in line with popular trends. Moreover, the existing market lacks convenient automatic judgment solutions, resulting in a high threshold for obtaining opinions on popular outfits.

Method used

Obtain the superpixel set of the image through the preset image segmentation algorithm, calculate the similarity between superpixels, perform clustering, match the superpixel clusters, calculate the color difference matching similarity, and finally calculate the color matching comparison similarity of the image. Achieve automatic color matching comparison between two images.

Benefits of technology

It realizes the automatic comparison of color matching between images, helps users judge whether the outfit conforms to the fashion style, lowers the threshold for obtaining opinions on popular outfits, and provides effective outfit guidance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118570513A
    Figure CN118570513A
Patent Text Reader

Abstract

The invention discloses an image color matching comparison method and device. The method comprises the following steps: respectively acquiring a first superpixel set of a first image and a second superpixel set of a second image through an image segmentation algorithm; respectively calculating the similarity between superpixels in the first superpixel set and the second superpixel set, and carrying out clustering; calculating and acquiring a second super-pixel cluster with the highest number matching degree and the highest position matching degree of each first super-pixel cluster in a second super-pixel cluster set; according to the color difference between each first super-pixel cluster and the corresponding two second super-pixel clusters with the highest matching degree, the color difference matching similarity between each first super-pixel cluster and the corresponding cluster of the second image is obtained through calculation; and according to the color difference matching similarity of each first super-pixel cluster and the corresponding cluster of the second image, calculating to obtain the color matching comparison similarity of the first image and the second image. According to the method, image color matching can be summarized, and wearing and building guidance can be provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to an image color matching method and device. Background Art

[0002] In the fashion field, summarizing popular dressing trends through color combinations and further providing dressing guidance is a common process in the fashion field. However, many fashion color combinations rely on experienced fashion professionals to summarize and then guide users to wear corresponding colors.

[0003] For ordinary users, they can learn about some popular clothing color combinations through trendy pictures obtained from the Internet and videos of model catwalks. However, ordinary users lack knowledge and experience related to trends, and are less sensitive to color matching and comparison. They often cannot judge whether the color matching of their clothing is in line with the popular fashion trends based on their own experience. The current market lacks a convenient solution that can automatically help ordinary users judge color matching and comparison. The threshold for ordinary users to obtain popular clothing opinions is high. Summary of the invention

[0004] In order to overcome the problems existing in the related art, the present invention provides an image color matching method and device to solve the problems of the prior art.

[0005] According to a first aspect of the present invention, there is provided an image color matching method, the method comprising:

[0006] Acquire a first superpixel set of the first image and a second superpixel set of the second image respectively by using a preset image segmentation algorithm;

[0007] Calculating the similarity between each superpixel in the first superpixel set and the similarity between each superpixel in the second superpixel set respectively by a preset similarity calculation algorithm, and constructing a first similarity matrix of the first superpixel set and a second similarity matrix of the second superpixel set;

[0008] According to the first similarity matrix and the second similarity matrix, the first superpixel set and the second superpixel set are clustered respectively by a preset clustering algorithm to obtain a first superpixel cluster set corresponding to the first image and a second superpixel cluster set corresponding to the second image;

[0009] Calculate and obtain the second superpixel cluster with the highest number matching and the second superpixel cluster with the highest position matching of each first superpixel cluster in the first superpixel cluster set in the second superpixel cluster set; wherein the second superpixel cluster with the highest number matching is the second superpixel cluster in the second superpixel cluster set that is closest to the first superpixel cluster in terms of the number of superpixels included; the second superpixel cluster with the highest position matching is the second superpixel cluster in the second superpixel cluster set that is closest to the first superpixel cluster in terms of relative position in the image;

[0010] Calculating the color difference matching similarity between each of the first superpixel clusters and the second superpixel cluster corresponding to the second image according to the color difference between each of the first superpixel clusters and the corresponding second superpixel cluster with the highest quantity matching degree and the second superpixel cluster with the highest position matching degree;

[0011] The color matching similarity between the first image and the second image is calculated based on the color difference matching similarity between each of the first superpixel clusters in the first superpixel cluster set and the second superpixel cluster corresponding to the second image.

[0012] Preferably, the calculating the similarity between each superpixel in the first superpixel set and the similarity between each superpixel in the second superpixel set respectively by using a preset similarity calculation algorithm includes:

[0013] According to the superpixel Sp in the first superpixel set or the second superpixel set i and superpixel Sp j The color similarity h and connectivity L of the superpixel Sp are calculated by the following formula i and the superpixel Sp j The similarity s between:

[0014] s=αh+βL

[0015] Wherein, α and β are the contribution weights of the color similarity h and the connectivity L to the similarity s respectively;

[0016] The connectivity L in the superpixel Sp i With the super pixel Sp j The value is 1 when adjacent, and 0 when not adjacent.

[0017] Preferably, the super pixel Sp i and the superpixel Sp j The color similarity h is obtained by:

[0018] The super pixel Sp i and the superpixel Sp j The image is converted into HSV color space, and the superpixels Sp are obtained respectively. i and the superpixel Sp j H channel value and S channel value;

[0019] The superpixel Sp is calculated by the following formulas: i and the superpixel Sp j The difference d between the H channel and the S channel h and d s :

[0020] d h =min(|h i -h j |,|360+h i -h j |) / 180

[0021]

[0022] According to the super pixel Sp i and the superpixel Sp j The difference d between the H channel and the S channel h and d s Calculate and obtain the super pixel Sp i and the superpixel Sp j The color difference d:

[0023] d=(d h +d s ) / 2

[0024] According to the super pixel Sp i and the superpixel Sp j The super pixel Sp is obtained by calculating the color difference d i and the superpixel Sp j The color similarity h:

[0025] h=1-d.

[0026] Preferably, when calculating the superpixel Sp i and the superpixel Sp j After the color similarity h is obtained, the method further comprises:

[0027] The color similarity h is amplified using the following piecewise function:

[0028]

[0029] h=h 2 ,h<0.5.

[0030] Preferably, the calculating and obtaining the second superpixel cluster with the highest number matching degree and the second superpixel cluster with the highest position matching degree of each first superpixel cluster in the first superpixel cluster set in the second superpixel cluster set includes:

[0031] Calculate the number of superpixels c contained in the first superpixel cluster and the number of superpixels c contained in each second superpixel cluster in the second superpixel cluster set i The absolute value difference of the number of i -c|, determining the second superpixel cluster with the smallest absolute value difference in quantity as the second superpixel cluster with the highest quantity matching degree;

[0032] Calculate the distance z from the first superpixel cluster to the lower left corner of the first image and the distance z from each second superpixel cluster in the second superpixel cluster set to the lower left corner of the second image. i The absolute value difference of the distance |z i -z|, determine the second superpixel cluster with the smallest absolute distance difference as the second superpixel cluster with the highest distance matching degree.

[0033] Preferably, the color matching similarity between the first image and the second image is calculated based on the color difference matching similarity between each of the first superpixel clusters in the first superpixel cluster set and the second superpixel cluster corresponding to the second image, including:

[0034] Setting corresponding distance weights according to the distance between each of the first superpixel clusters in the first superpixel cluster set and the center of the first image;

[0035] The average value of the product of the color difference matching similarity between all the first superpixel clusters and the second superpixel clusters corresponding to the second image and the corresponding distance weight is calculated to obtain the color matching similarity between the first image and the second image.

[0036] Preferably, the second image is a video frame extracted from a specified video;

[0037] The method further comprises:

[0038] Extracting a number of video frames from the designated video to form a candidate second image set;

[0039] For each candidate second image in the candidate second image set, respectively obtain a corresponding second superpixel set and a second superpixel cluster set;

[0040] For each of the candidate second images, according to the number of superpixels contained in each cluster in the first superpixel cluster set and the second superpixel cluster set corresponding to the candidate second image, calculate the matching degree of the number of clusters between the first image and the candidate second image;

[0041] And / or, calculating the cluster distance matching degree between the first image and the candidate second image according to the distance from each cluster in the first superpixel cluster set and the second superpixel cluster set corresponding to the candidate second image to the center of the image;

[0042] According to the cluster quantity matching degree and / or the cluster distance matching degree, a plurality of the candidate second images with the highest matching degree with the first image in the candidate second image set are screened to form a second image set;

[0043] The color matching similarity between the first image and each second image in the second image set is calculated respectively, and the color matching similarity between the first image and the designated video is determined according to the color matching similarity with the smallest value.

[0044] Preferably, the calculating the degree of matching of the number of clusters between the first image and the candidate second image according to the number of superpixels contained in each cluster in the first superpixel cluster set and the second superpixel cluster set corresponding to the candidate second image comprises:

[0045] The first superpixel cluster set and the second superpixel cluster set are sorted according to the number of superpixels contained in each superpixel cluster to obtain a sorted first superpixel cluster set C u ={C u1 ,C u2 ,...,C um} and the second superpixel cluster set C = {C 1 ,C 2 ,...,C n}; wherein m is the number of first superpixel clusters included in the first superpixel cluster set, and n is the number of second superpixel clusters included in the second superpixel cluster set;

[0046] According to the first superpixel cluster set C u The sum of the differences between the number of superpixels contained in each cluster with the corresponding serial number in the second superpixel cluster set C is used to calculate the matching degree N of the number of clusters between the first image and the candidate second image:

[0047]

[0048] Among them, c ui is the first superpixel cluster set C u The first superpixel cluster C in the i-th ui The number of superpixels included, c i is the i-th second superpixel cluster C in the second superpixel cluster set C i The number of superpixels included.

[0049] Preferably, the calculating of the cluster distance matching degree between the first image and the candidate second image according to the distance from each cluster in the first superpixel cluster set and the second superpixel cluster set corresponding to the candidate second image to the center of the image includes:

[0050] The first superpixel cluster set and the second superpixel cluster set are sorted according to the distance from each superpixel cluster to the center of the image to obtain a sorted first superpixel cluster set R u = {R u1 ,R u2 ,...,R um} and the second superpixel cluster set R = {R 1 ,R 2 ,...,R n};

[0051] According to the first superpixel clustering cluster set R u The sum of the differences between the distances of each cluster with the corresponding serial number in the second superpixel cluster set R and the center of the image is calculated to obtain the cluster distance matching degree S between the first image and the candidate second image:

[0052]

[0053] Among them, r ui is the first superpixel cluster set R u The first superpixel cluster R in the i-th ui The distance to the center of the first image, r i is the i-th second superpixel cluster R in the second superpixel cluster set R i The distance to the center of the second image.

[0054] According to a second aspect of the present invention, there is provided an image color matching device, the device comprising:

[0055] A superpixel segmentation module, used to obtain a first superpixel set of the first image and a second superpixel set of the second image respectively by using a preset image segmentation algorithm;

[0056] a superpixel similarity calculation module, configured to calculate the similarity between each superpixel in the first superpixel set and the similarity between each superpixel in the second superpixel set respectively by using a preset similarity calculation algorithm, and construct a first similarity matrix of the first superpixel set and a second similarity matrix of the second superpixel set;

[0057] a superpixel clustering module, configured to cluster the first superpixel set and the second superpixel set respectively according to the first similarity matrix and the second similarity matrix by a preset clustering algorithm to obtain a first superpixel cluster set corresponding to the first image and a second superpixel cluster set corresponding to the second image;

[0058] A cluster matching module, used for calculating and obtaining the second superpixel cluster with the highest number matching degree and the second superpixel cluster with the highest position matching degree of each first superpixel cluster in the first superpixel cluster set in the second superpixel cluster set; wherein the second superpixel cluster with the highest number matching degree is the second superpixel cluster in the second superpixel cluster set that is closest to the first superpixel cluster in terms of the number of superpixels included; the second superpixel cluster with the highest position matching degree is the second superpixel cluster in the second superpixel cluster set that is closest to the first superpixel cluster in terms of relative position in the image;

[0059] A cluster similarity calculation module, used to calculate the color difference matching similarity between each of the first superpixel clusters and the second superpixel cluster corresponding to the second image according to the color difference between each of the first superpixel clusters and the corresponding second superpixel cluster with the highest quantity matching and the second superpixel cluster with the highest position matching;

[0060] The image color matching module is used to calculate the color matching similarity between the first image and the second image based on the color difference matching similarity between each of the first superpixel clusters in the first superpixel cluster set and the second superpixel cluster corresponding to the second image.

[0061] The present invention discloses an image color matching method and device, which combines the existing image segmentation and color space technology, divides the image into multiple superpixels and clusters them according to the similarity between the superpixels, describes the color distribution in an image from the dimension of the superpixel clustering cluster, and matches the superpixel clustering clusters of two different images, the first image and the second image, according to the number and position relationship of the superpixel clustering clusters, so as to calculate the color difference matching similarity between the images according to the color difference between the superpixel clustering clusters matched respectively, and then calculates the color matching similarity of the two images. The present invention realizes a complete automatic color matching method between two images, which can provide effective assistance to users who need to compare the color matching between images. Furthermore, users can also use the image color matching method proposed by the present invention to automatically summarize the color matching of fashion wear reflected in images with high fashion such as model catwalk videos, and make the summarized color matching be used to compare the color matching difference between the user and the model catwalk video, so as to achieve the role of guiding the wear.

[0062] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 The figure is a flow chart of an image color matching method according to an embodiment of the present invention.

[0064] Figure 2 The figure is a schematic diagram of the structure of an image color matching and comparison device according to an embodiment of the present invention.

[0065] Figure 3 It is a schematic diagram of the structure of a computing device hardware according to an embodiment of the present invention. DETAILED DESCRIPTION

[0066] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the present invention as detailed in the appended claims.

[0067] The terms used in the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The singular forms "a", "the" and "the" used in the present invention and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0068] It should be understood that although the terms first, second, third, etc. may be used in the present invention to describe various information, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0069] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0070] like Figure 1 As shown, Figure 1 The present invention is a flowchart of an image color matching method according to an embodiment of the present invention, comprising the following steps:

[0071] Step S101, respectively obtaining a first superpixel set of a first image and a second superpixel set of a second image by using a preset image segmentation algorithm;

[0072] Step S102, calculating the similarity between each superpixel in the first superpixel set and the similarity between each superpixel in the second superpixel set respectively by a preset similarity calculation algorithm, and constructing a first similarity matrix of the first superpixel set and a second similarity matrix of the second superpixel set;

[0073] Step S103, clustering the first superpixel set and the second superpixel set respectively by a preset clustering algorithm according to the first similarity matrix and the second similarity matrix, to obtain a first superpixel cluster set corresponding to the first image and a second superpixel cluster set corresponding to the second image;

[0074] Step S104, calculating and obtaining the second superpixel cluster with the highest number matching degree and the second superpixel cluster with the highest position matching degree of each first superpixel cluster in the first superpixel cluster set in the second superpixel cluster set;

[0075] Step S105, calculating the color difference matching similarity between each first superpixel cluster and the second superpixel cluster corresponding to the second image according to the color difference between each first superpixel cluster and the corresponding second superpixel cluster with the highest quantity matching degree and the second superpixel cluster with the highest position matching degree;

[0076] Step S106, calculating the color matching similarity between the first image and the second image according to the color difference matching similarity between each first superpixel cluster in the first superpixel cluster set and the second superpixel cluster corresponding to the second image.

[0077] Specifically, in step S101, a superpixel segmentation algorithm in an image segmentation algorithm may be used to segment an image (including a first image and a second image), thereby obtaining a set of superpixel sets {Sp = Sp 1 ,Sp 2 ,...,Sp n}, where Sp refers to a superpixel, and n is the number of superpixels segmented. In the present invention, the number of superpixels segmented from each image can be specified by a preset number n, and the specific value of the number n can be set according to actual needs, and the present invention does not limit this.

[0078] Specifically, in some embodiments, the image segmentation algorithm used in the present invention may be the SLIC algorithm, which can achieve excellent segmentation effect in segmenting superpixels. In other embodiments, the image segmentation algorithm used in the present invention may also be any one of other image segmentation algorithms such as the SEEDS algorithm and the LCS algorithm, and the present invention is not limited thereto.

[0079] Specifically, in step S102, a preset similarity calculation algorithm may be used to calculate the similarity between any two superpixels in each superpixel set, thereby constructing a similarity matrix for each superpixel set.

[0080] Specifically, in some embodiments, a similarity calculation algorithm that gives equal weight to color and connectivity may be used to calculate the similarity between superpixels.

[0081] Specifically, in step S102, the present invention can be based on each superpixel set, such as the first superpixel set or the second superpixel set, in which the superpixel Sp i and superpixel Sp j The color similarity h and connectivity L of , and the superpixel Sp is calculated by the following formula i and superpixel Sp j The similarity s between:

[0082] s=αh+βL

[0083] Among them, α and β are the contribution weights of color similarity h and connectivity L to similarity s, that is, they are used to control the contribution of the two features of color similarity h and connectivity L to the final similarity s. For example, in some embodiments, α and β can be set to 0.5, indicating that color similarity h and connectivity L contribute the same to similarity s; in other embodiments, the values ​​of α and β can also be adjusted according to the clustering effect of subsequent steps, so that the adjusted similarity can achieve the desired clustering effect; specifically, the specific values ​​of α and β in the present invention can be set according to actual needs, and the present invention is not limited to this.

[0084] Specifically, the connectivity between superpixels can use whether the superpixels are adjacent as a criterion, that is, the connectivity L can be calculated in the superpixel Sp i With super pixel Sp j When adjacent, the value is 1 to indicate a superpixel Sp i With super pixel Sp j Connected, on the contrary, in the superpixel Sp i With super pixel Sp j When not adjacent, the connectivity L can be taken as 0 to represent the superpixel Sp i With super pixel Sp j There are no shared edges between them.

[0085] Specifically, when calculating the similarity between superpixels, the average value of the colors of each pixel inside the superpixel can be used to represent the color inside the superpixel.

[0086] Specifically, the superpixel Sp i and superpixel Sp j The color similarity h can be calculated as follows:

[0087] The super pixel Sp i and superpixel Sp j The image is converted from the original input RGB image to the HSV color space. Since the H and S channels in the HSV color space represent hue and saturation, and the brightness represented by the V channel is not the focus of color clustering, only the H and S channels in the HSV color space can be considered, that is, the superpixels Sp are obtained respectively. i and superpixel Sp j H channel value and S channel value;

[0088] Then, based on the characteristics of the H channel and the S channel in the HSV color space, the angle difference can be used to measure the difference between the color averages of the two superpixels in the H channel, and the Euclidean distance can be used to measure the difference between the color averages of the two superpixels in the S channel. Specifically, the superpixel Sp can be calculated by the following formulas: iand superpixel Sp j The difference d between the H channel and the S channel h and d s :

[0089] d h =min(|h i -h j |,|360+h i -h j |) / 180

[0090]

[0091] For convenience of representation, we can assume that h i <h j ;

[0092] According to the super pixel Sp i and superpixel Sp j The difference d between the H channel and the S channel h and d s Calculate the superpixel Sp i and superpixel Sp j The color difference d:

[0093] d=(d h +d s ) / 2

[0094] The color difference d represents the color distance between two superpixels, that is, the distance of the color characteristics between superpixels.

[0095] According to the super pixel Sp i and superpixel Sp j The color difference d is calculated to obtain the super pixel Sp i and superpixel Sp j The color similarity h:

[0096] h=1-d.

[0097] Specifically, in some embodiments, when calculating the super pixel Sp i and superpixel Sp j After calculating the color similarity h, in order to make similar colors in the image more prominent and dissimilar colors less prominent, the following piecewise function can be used to further amplify the color similarity h:

[0098]

[0099] h=h 2 ,h<0.5.

[0100] Specifically, in other embodiments, other methods may be used to calculate the color similarity between superpixels, and other methods may be used to calculate the overall similarity between superpixels. The specific configurations may be made according to actual needs, and the present invention does not impose any limitation on this.

[0101] Specifically, in step S103, each superpixel set, including the first superpixel set and the second superpixel set, can be clustered by a preset clustering algorithm according to the similarity matrix constructed in step S102, so as to obtain superpixel cluster sets corresponding to each image, such as the first superpixel cluster set corresponding to the first image and the second superpixel cluster set corresponding to the second image.

[0102] Specifically, in some embodiments, the clustering algorithm used in step S103 may be an Affinitypropagation clustering algorithm, in which no outliers are set, and all superpixels are involved in clustering, and there is no need to preset the number of clusters.

[0103] Specifically, in other embodiments, other clustering algorithms may also be used in step S103, which may be specifically configured according to actual needs, and the present invention does not limit this.

[0104] Specifically, in step S104, the second superpixel cluster with the highest quantity matching and the second superpixel cluster with the highest position matching of each first superpixel cluster in the first superpixel cluster set can be calculated and obtained; wherein, the second superpixel cluster with the highest quantity matching is the second superpixel cluster in the second superpixel cluster set that is closest to the first superpixel cluster in terms of the number of superpixels included; the second superpixel cluster with the highest position matching is the second superpixel cluster in the second superpixel cluster set that is closest to the first superpixel cluster in terms of relative position in the image.

[0105] Specifically, in step S104, for the second superpixel cluster with the highest number matching, the number of superpixels c included in the first superpixel cluster and the number of superpixels c included in each second superpixel cluster in the second superpixel cluster set can be calculated. i The absolute value difference of the number of i -c|, thereby determining the second superpixel cluster with the smallest absolute value difference in quantity as the second superpixel cluster with the highest quantity matching degree.

[0106] For the second superpixel cluster with the highest distance matching, the distance z from the first superpixel cluster to the lower left corner of the first image and the distance z from each second superpixel cluster in the second superpixel cluster set to the lower left corner of the second image can be calculated. iThe absolute value difference of the distance |z i -z|, thereby determining the second superpixel cluster with the smallest absolute distance difference as the second superpixel cluster with the highest distance matching degree.

[0107] Specifically, in some embodiments, in order to eliminate the interference caused by the background and avoid the image color matching results being affected by the image background and ignoring the color matching between the main contents of the image, after performing the superpixel cluster matching in step S104, the superpixel cluster in the first image and the second image that is farthest from the image center can be marked as shielded and not participate in the subsequent matching calculation in step S105.

[0108] Specifically, in step S105, the color difference matching similarity between each first superpixel cluster and the second superpixel cluster corresponding to the second image can be calculated based on the color difference between each first superpixel cluster and the corresponding second superpixel cluster with the highest quantity matching and the second superpixel cluster with the highest position matching.

[0109] Specifically, the color of each superpixel cluster can be obtained by the average value of the color of each superpixel in the superpixel cluster, and the color similarity between each first superpixel cluster and its two matched second superpixel clusters can be calculated in a manner similar to calculating the color similarity h between superpixels in step S102.

[0110] Specifically, after obtaining the color similarity between each first superpixel cluster and the two matched second superpixel clusters, the two color similarities can be added to obtain the color difference matching similarity between the first superpixel cluster and the second superpixel cluster corresponding to the second image. Specifically, when the second superpixel cluster with the highest quantity matching degree and the second superpixel cluster with the highest position matching degree matched by the first superpixel cluster are the same second superpixel cluster, the color similarity between the first superpixel cluster and the second superpixel cluster can be doubled to obtain the color difference matching similarity between the first superpixel cluster and the second superpixel cluster corresponding to the second image.

[0111] By performing color difference matching on each superpixel cluster of the first image, the color difference matching similarity of all superpixel clusters of the first image to the second superpixel cluster corresponding to the same second image can be obtained.

[0112] Specifically, in step S106, the color matching similarity between the first image and the second image can be calculated based on the color difference matching similarity between each first superpixel cluster in the first superpixel cluster set and the second superpixel cluster corresponding to the second image.

[0113] Specifically, in step S106, the specific method of calculating the color matching similarity between the first image and the second image can be: setting corresponding distance weights according to the distance from each first superpixel cluster in the first superpixel cluster set to the center of the first image; then calculating the average value of the product of the color difference matching similarity of all first superpixel clusters and the second superpixel cluster corresponding to the second image and the corresponding distance weight, to obtain the color matching similarity between the first image and the second image.

[0114] Specifically, when setting the distance weight, the distance weight between the upper right corner and the center can be set to 0, the distance weight between the center point and the center point can be set to γ, and the distance weights of the remaining positions can be set according to this distance ratio. Specifically, γ is a standard weight parameter set manually, and its specific value can be set and adjusted according to actual needs and effects, and the present invention does not limit this.

[0115] Preferably, in some embodiments, the second image of the present invention may also be a video frame extracted from a specified video. For example, when providing clothing color matching suggestions by the method of the present invention, the specified video may be a model catwalk video, and the second image is a number of video frames extracted from the model catwalk video, because in these catwalk videos, the characters are most likely located at the center of the image, so the second images extracted from these catwalk videos are more similar in image content layout structure, and the color matching results will be more accurate. Therefore, in some embodiments, when extracting the second image from the specified video, the specified video may be a single scene video with a relatively stable shooting angle, so as to reduce the impact of the background differences of the multiple second images, and refer to the multiple second images to enhance the detection effect of the color matching similarity, and multiple video frames with different image proportions occupied by the main body of the character can be extracted as the second image for calculation to adapt to the first image with different main body proportions. Specifically, the method of extracting the video frame from the specified video may be random extraction, or the video frame may be extracted by using equal time intervals and other methods to avoid excessive similarity between the extracted video frames. In the present invention, the method of extracting video frames can be set according to actual needs, and the present invention does not limit this.

[0116] Specifically, when a designated video is used as a comparison object, the method of the present invention may further include:

[0117] Extracting a number of video frames from a specified video to form a candidate second image set;

[0118] For each candidate second image in the candidate second image set, respectively obtain a corresponding second superpixel set and a second superpixel cluster set;

[0119] For each candidate second image, according to the number of superpixels contained in each cluster in the first superpixel cluster set and the second superpixel cluster set corresponding to the candidate second image, calculate the matching degree of the number of clusters between the first image and the candidate second image;

[0120] And / or, calculating the cluster distance matching degree between the first image and the candidate second image according to the distance from each cluster in the first superpixel cluster set and the second superpixel cluster set corresponding to the candidate second image to the center of the image;

[0121] According to the cluster quantity matching degree and / or the cluster distance matching degree, a plurality of candidate second images with the highest matching degree with the first image in the candidate second image set are screened to form a second image set;

[0122] The color matching similarity between the first image and each second image in the second image set is calculated respectively, and the color matching similarity between the first image and the specified video is determined according to the color matching similarity with the smallest value.

[0123] Specifically, the number of video frames extracted from a specified video can be set according to actual needs, and the present invention does not impose any limitation on this.

[0124] Specifically, in some embodiments, according to the number of superpixels contained in each cluster in the first superpixel cluster set and the second superpixel cluster set corresponding to the candidate second image, calculating the matching degree of the number of clusters of the first image and the candidate second image may include:

[0125] The first superpixel cluster set and the second superpixel cluster set are sorted according to the number of superpixels contained in each superpixel cluster, and the sorted first superpixel cluster set C is obtained. u ={C u1 ,C u2 ,...,C um} and the second superpixel cluster set C = {C 1 ,C 2 ,...,C n}; wherein m is the number of first superpixel clusters included in the first superpixel cluster set, and n is the number of second superpixel clusters included in the second superpixel cluster set;

[0126] According to the first superpixel cluster set C u The sum of the differences in the number of superpixels contained in each cluster with the corresponding serial number in the second superpixel cluster set C is used to calculate the matching degree N of the number of clusters between the first image and the candidate second image:

[0127]

[0128] Among them, c ui is the first superpixel cluster set C u The first superpixel cluster C in ui The number of superpixels included, c i is the i-th second superpixel cluster C in the second superpixel cluster set C i The number of superpixels included.

[0129] Specifically, in some embodiments, according to the distance from each cluster in the first superpixel cluster set and the second superpixel cluster set corresponding to the candidate second image to the center of the image, calculating the cluster distance matching degree between the first image and the candidate second image may include:

[0130] The first superpixel cluster set and the second superpixel cluster set are sorted according to the distance from each superpixel cluster to the center of the image to obtain the sorted first superpixel cluster set R u = {R u1 ,R u2 ,...,R um} and the second superpixel cluster set R = {R 1 ,R 2 ,...,R n};

[0131] According to the first superpixel clustering cluster set R u The sum of the differences between the distances of each cluster with the corresponding serial number in the second superpixel cluster set R and the center of the image is used to calculate the cluster distance matching degree S between the first image and the candidate second image:

[0132]

[0133] Among them, r ui is the first superpixel cluster set R u The first superpixel cluster R in ui Distance to the center of the first image, r i is the i-th second superpixel cluster R in the second superpixel cluster set R i Distance to the center of the second image.

[0134] Specifically, when performing cluster number matching and cluster distance matching on the first image and the candidate second image, only one of the matching methods or both of the two matching methods may be performed, and the execution order of the two matching methods may also be set according to requirements, which is not limited in the present invention. After each matching method is performed, only the specified number of candidate second images with the smallest cluster number matching degree or cluster distance matching degree in the candidate second image set are retained, and other candidate second images in the candidate second image set are eliminated. The specified number of retentions may be set to different values ​​each time, and the specific values ​​are set according to actual requirements, which is not limited in the present invention.

[0135] Corresponding to the above-mentioned image color matching method embodiment, the present invention also provides an image color matching device.

[0136] like Figure 2 As shown, Figure 2 1 is a schematic diagram of the structure of an image color matching device according to an embodiment of the present invention, comprising the following modules:

[0137] The superpixel segmentation module 210 is used to obtain a first superpixel set of the first image and a second superpixel set of the second image respectively by using a preset image segmentation algorithm;

[0138] The superpixel similarity calculation module 220 is used to calculate the similarity between each superpixel in the first superpixel set and the similarity between each superpixel in the second superpixel set by using a preset similarity calculation algorithm, and construct a first similarity matrix of the first superpixel set and a second similarity matrix of the second superpixel set;

[0139] The superpixel clustering module 230 is used to cluster the first superpixel set and the second superpixel set respectively according to the first similarity matrix and the second similarity matrix by a preset clustering algorithm to obtain a first superpixel cluster set corresponding to the first image and a second superpixel cluster set corresponding to the second image;

[0140] The cluster matching module 240 is used to calculate and obtain the second superpixel cluster with the highest number matching degree and the second superpixel cluster with the highest position matching degree of each first superpixel cluster in the first superpixel cluster set; wherein the second superpixel cluster with the highest number matching degree is the second superpixel cluster in the second superpixel cluster set that is closest to the first superpixel cluster in terms of the number of superpixels included; the second superpixel cluster with the highest position matching degree is the second superpixel cluster in the second superpixel cluster set that is closest to the first superpixel cluster in terms of relative position in the image;

[0141] The cluster similarity calculation module 250 is used to calculate the color difference matching similarity between each first superpixel cluster and the second superpixel cluster corresponding to the second image according to the color difference between each first superpixel cluster and the corresponding second superpixel cluster with the highest quantity matching and the second superpixel cluster with the highest position matching;

[0142] The image color matching module 260 is used to calculate the color matching similarity between the first image and the second image according to the color difference matching similarity between each first superpixel cluster in the first superpixel cluster set and the second superpixel cluster corresponding to the second image.

[0143] Specifically, the superpixel similarity calculation module 220 can be used for:

[0144] According to the superpixel Sp in the first superpixel set or the second superpixel set i and superpixel Sp j The color similarity h and connectivity L of the superpixel Sp are calculated by the following formula i and superpixel Sp j The similarity s between:

[0145] s=αh+βL

[0146] Among them, α and β are the contribution weights of color similarity h and connectivity L to similarity s respectively;

[0147] Connectivity L in superpixel Sp i With super pixel Sp j The value is 1 when adjacent, and 0 when not adjacent.

[0148] Specifically, the super pixel Sp i and superpixel Sp j The color similarity h can be obtained as follows:

[0149] The super pixel Sp i and superpixel Sp j The image is converted into HSV color space, and superpixels Sp are obtained respectively. i and superpixel Sp j H channel value and S channel value;

[0150] The superpixel Sp is calculated by the following formulas: i and superpixel Sp j The difference d between the H channel and the S channel h and d s :

[0151] d h =min(|h i -h j|,|360+h i -h j |) / 180

[0152]

[0153] According to the super pixel Sp i and superpixel Sp j The difference d between the H channel and the S channel h and d s Calculate the superpixel Sp i and superpixel Sp j The color difference d:

[0154] d=(d h +d s ) / 2

[0155] According to the super pixel Sp i and superpixel Sp j The color difference d is calculated to obtain the super pixel Sp i and superpixel Sp j The color similarity h:

[0156] h=1-d.

[0157] Specifically, the above calculation obtains the super pixel Sp i and superpixel Sp j After the color similarity h, it can also include:

[0158] The color similarity h is amplified using the following piecewise function:

[0159]

[0160] h=h 2 ,h<0.5.

[0161] Specifically, the cluster matching module 240 can be used to:

[0162] Calculate the number of superpixels c contained in the first superpixel cluster and the number of superpixels c contained in each second superpixel cluster in the second superpixel cluster set i The absolute value difference of the number of i -c|, determine the second superpixel cluster with the smallest absolute value difference in quantity as the second superpixel cluster with the highest quantity matching degree;

[0163] Calculate the distance z from the first superpixel cluster to the lower left corner of the first image and the distance z from each second superpixel cluster in the second superpixel cluster set to the lower left corner of the second image i The absolute value difference of the distance |z i-z|, the second superpixel cluster with the smallest absolute distance difference is determined as the second superpixel cluster with the highest distance matching degree.

[0164] Specifically, the image color matching module 260 can be used for:

[0165] Setting corresponding distance weights according to the distance between each first superpixel cluster in the first superpixel cluster set and the center of the first image;

[0166] The average value of the product of the color difference matching similarity between all the first superpixel clusters and the second superpixel clusters corresponding to the second image and the corresponding distance weight is calculated to obtain the color matching similarity between the first image and the second image.

[0167] Specifically, the second image may also be a video frame extracted from a specified video;

[0168] The above-mentioned image color matching device can also be used for:

[0169] Extracting a number of video frames from a specified video to form a candidate second image set;

[0170] For each candidate second image in the candidate second image set, respectively obtain a corresponding second superpixel set and a second superpixel cluster set;

[0171] For each candidate second image, according to the number of superpixels contained in each cluster in the first superpixel cluster set and the second superpixel cluster set corresponding to the candidate second image, calculate the matching degree of the number of clusters between the first image and the candidate second image;

[0172] And / or, calculating the cluster distance matching degree between the first image and the candidate second image according to the distance from each cluster in the first superpixel cluster set and the second superpixel cluster set corresponding to the candidate second image to the center of the image;

[0173] According to the cluster quantity matching degree and / or the cluster distance matching degree, a plurality of candidate second images with the highest matching degree with the first image in the candidate second image set are screened to form a second image set;

[0174] The color matching similarity between the first image and each second image in the second image set is calculated respectively, and the color matching similarity between the first image and the specified video is determined according to the color matching similarity with the smallest value.

[0175] Specifically, the above-mentioned calculation of the number of superpixels contained in each cluster in the first superpixel cluster set and the second superpixel cluster set corresponding to the candidate second image to obtain the matching degree of the number of clusters between the first image and the candidate second image may specifically include:

[0176] The first superpixel cluster set and the second superpixel cluster set are sorted according to the number of superpixels contained in each superpixel cluster, and the sorted first superpixel cluster set C is obtained. u ={C u1 ,C u2 ,...,C um} and the second superpixel cluster set C = {C 1 ,C 2 ,...,C n}; wherein m is the number of first superpixel clusters included in the first superpixel cluster set, and n is the number of second superpixel clusters included in the second superpixel cluster set;

[0177] According to the first superpixel cluster set C u The sum of the differences in the number of superpixels contained in each cluster with the corresponding serial number in the second superpixel cluster set C is used to calculate the matching degree N of the number of clusters between the first image and the candidate second image:

[0178]

[0179] Among them, c ui is the first superpixel cluster set C u The first superpixel cluster C in ui The number of superpixels included, c i is the i-th second superpixel cluster C in the second superpixel cluster set C i The number of superpixels included.

[0180] Specifically, the above-mentioned calculation of the distance between each cluster in the first superpixel cluster set and the second superpixel cluster set corresponding to the candidate second image and the center of the image to obtain the cluster distance matching degree between the first image and the candidate second image may specifically include:

[0181] The first superpixel cluster set and the second superpixel cluster set are sorted according to the distance from each superpixel cluster to the center of the image to obtain the sorted first superpixel cluster set R u = {R u1 ,R u2 ,...,R um} and the second superpixel cluster set R = {R 1 ,R 2 ,...,R n};

[0182] According to the first superpixel clustering cluster set R uThe sum of the differences between the distances of each cluster with the corresponding serial number in the second superpixel cluster set R and the center of the image is used to calculate the cluster distance matching degree S between the first image and the candidate second image:

[0183]

[0184] Among them, r ui is the first superpixel cluster set R u The first superpixel cluster R in ui Distance to the center of the first image, r i is the i-th second superpixel cluster R in the second superpixel cluster set R i Distance to the center of the second image.

[0185] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0186] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present invention. Those of ordinary skill in the art can understand and implement it without paying creative labor.

[0187] The present invention also provides a computer device, which at least includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the image color matching method described in any of the aforementioned embodiments is implemented.

[0188] Figure 3 A more specific hardware structure diagram of a computing device provided by the present invention is shown, and the device may include: a processor 301, a memory 302, an input / output interface 303, a communication interface 304, and a bus 305. The processor 301, the memory 302, the input / output interface 303, and the communication interface 304 are connected to each other through the bus 305 in the device.

[0189] The processor 301 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., for executing relevant programs to implement the technical solution provided by the present invention. The processor 301 can also include a graphics card, which can be a Nvidia titan X graphics card or a 1080Ti graphics card, etc.

[0190] The memory 302 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 302 can store an operating system and other application programs. When the technical solution provided by the present invention is implemented by software or firmware, the relevant program code is stored in the memory 302 and called and executed by the processor 301.

[0191] The input / output interface 303 is used to connect the input / output module to realize information input and output. The input / output module can be configured in the device as a component (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device can include a display, a speaker, a vibrator, an indicator light, etc.

[0192] The communication interface 304 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0193] The bus 305 comprises a pathway for transmitting information between the various components of the device (eg, the processor 301 , the memory 302 , the input / output interface 303 , and the communication interface 304 ).

[0194] It should be noted that, although the above device only shows the processor 301, the memory 302, the input / output interface 303, the communication interface 304 and the bus 305, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the solution of the present invention, and does not necessarily include all the components shown in the figure.

[0195] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the image color matching and comparison method described in any of the above embodiments is implemented.

[0196] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0197] It can be known from the description of the above implementation methods that those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present invention or certain parts of the embodiments.

[0198] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.

[0199] Each embodiment of the present invention is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiment described above is merely illustrative, wherein the modules described as separate components may or may not be physically separated, and the functions of each module may be implemented in the same or more software and / or hardware when implementing the scheme of the present invention. It is also possible to select some or all of the modules according to actual needs to achieve the purpose of the scheme of this embodiment. A person of ordinary skill in the art can understand and implement it without paying creative labor.

[0200] Obviously, the above embodiments of the present invention are only examples for clearly explaining the present invention, and are not intended to limit the implementation methods of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention shall be included in the protection scope of the claims of the present invention.

Claims

1. An image color matching method, characterized in that: The method comprises: Acquire a first superpixel set of the first image and a second superpixel set of the second image respectively by using a preset image segmentation algorithm; Calculating the similarity between each superpixel in the first superpixel set and the similarity between each superpixel in the second superpixel set respectively by a preset similarity calculation algorithm, and constructing a first similarity matrix of the first superpixel set and a second similarity matrix of the second superpixel set; According to the first similarity matrix and the second similarity matrix, the first superpixel set and the second superpixel set are clustered respectively by a preset clustering algorithm to obtain a first superpixel cluster set corresponding to the first image and a second superpixel cluster set corresponding to the second image; Calculate and obtain the second superpixel cluster with the highest number matching degree and the second superpixel cluster with the highest position matching degree in the second superpixel cluster set for each first superpixel cluster in the first superpixel cluster set; wherein the second superpixel cluster with the highest number matching degree is the second superpixel cluster in the second superpixel cluster set that is closest to the first superpixel cluster in terms of the number of superpixels included; the second superpixel cluster with the highest position matching degree is the second superpixel cluster in the second superpixel cluster set that is closest to the first superpixel cluster in terms of relative position in the image; Calculating the color difference matching similarity between each of the first superpixel clusters and the second superpixel cluster corresponding to the second image according to the color difference between each of the first superpixel clusters and the corresponding second superpixel cluster with the highest quantity matching degree and the second superpixel cluster with the highest position matching degree; The color matching similarity between the first image and the second image is calculated based on the color difference matching similarity between each of the first superpixel clusters in the first superpixel cluster set and the second superpixel cluster corresponding to the second image.

2. The method according to claim 1, characterized in that The similarity calculation method of calculating the similarity between each superpixel in the first superpixel set and the similarity between each superpixel in the second superpixel set by using a preset similarity calculation algorithm includes: According to the superpixel Sp in the first superpixel set or the second superpixel set i and superpixel Sp j The color similarity h and connectivity L of the superpixel Sp are calculated by the following formula i and the superpixel Sp j The similarity s between: s=αh+βL Wherein, α and β are the contribution weights of the color similarity h and the connectivity L to the similarity s respectively; The connectivity L in the superpixel Sp i With the super pixel Sp j The value is 1 when adjacent, and 0 when not adjacent.

3. The method according to claim 2, characterized in that The super pixel Sp i and the superpixel Sp j The color similarity h is obtained by: The super pixel Sp i and the superpixel Sp j The image is converted into HSV color space, and the superpixels Sp are obtained respectively. i and the superpixel Sp j H channel value and S channel value; The superpixel Sp is calculated by the following formulas: i and the superpixel Sp j The difference d between the H channel and the S channel h and d s : d h =min(|h i -h j |,|360+h i -h j |) / 180 According to the super pixel Sp i and the superpixel Sp j The difference d between the H channel and the S channel h and d s Calculate and obtain the super pixel Sp i and the superpixel Sp j The color difference d: d=(d h +d s ) / 2 According to the super pixel Sp i and the superpixel Sp j The super pixel Sp is obtained by calculating the color difference d i and the superpixel Sp j The color similarity h: h=1-d.

4. The method according to claim 3, characterized in that In calculating the super pixel Sp i and the superpixel Sp j After the color similarity h is obtained, the method further comprises: The color similarity h is amplified using the following piecewise function: h=h 2 ,h<0.5。 5. The method according to claim 1, characterized in that The calculating and obtaining the second superpixel cluster with the highest number matching degree and the second superpixel cluster with the highest position matching degree of each first superpixel cluster in the first superpixel cluster set in the second superpixel cluster set includes: Calculate the number of superpixels c contained in the first superpixel cluster and the number of superpixels c contained in each second superpixel cluster in the second superpixel cluster set i The absolute value difference of the number of i -c|, determining the second superpixel cluster with the smallest absolute value difference in quantity as the second superpixel cluster with the highest quantity matching degree; Calculate the distance z from the first superpixel cluster to the lower left corner of the first image and the distance z from each second superpixel cluster in the second superpixel cluster set to the lower left corner of the second image. i The absolute value difference of the distance |z i -z|, determine the second superpixel cluster with the smallest absolute distance difference as the second superpixel cluster with the highest distance matching degree.

6. The method according to claim 1, characterized in that The color matching similarity between the first image and the second image is calculated based on the color difference matching similarity between each of the first superpixel clusters in the first superpixel cluster set and the second superpixel cluster corresponding to the second image, including: Setting corresponding distance weights according to the distance between each of the first superpixel clusters in the first superpixel cluster set and the center of the first image; The average value of the product of the color difference matching similarity between all the first superpixel clusters and the second superpixel clusters corresponding to the second image and the corresponding distance weight is calculated to obtain the color matching similarity between the first image and the second image.

7. The method according to claim 1, characterized in that The second image is a video frame extracted from a specified video; The method further comprises: Extracting a number of video frames from the designated video to form a candidate second image set; For each candidate second image in the candidate second image set, respectively obtain a corresponding second superpixel set and a second superpixel cluster set; For each of the candidate second images, according to the number of superpixels contained in each cluster in the first superpixel cluster set and the second superpixel cluster set corresponding to the candidate second image, calculate the matching degree of the number of clusters between the first image and the candidate second image; And / or, calculating the cluster distance matching degree between the first image and the candidate second image according to the distance from each cluster in the first superpixel cluster set and the second superpixel cluster set corresponding to the candidate second image to the center of the image; According to the cluster quantity matching degree and / or the cluster distance matching degree, a plurality of the candidate second images with the highest matching degree with the first image in the candidate second image set are screened to form a second image set; The color matching similarity between the first image and each second image in the second image set is calculated respectively, and the color matching similarity between the first image and the designated video is determined according to the color matching similarity with the smallest value.

8. The method according to claim 7, characterized in that The calculating, according to the number of superpixels contained in each cluster in the first superpixel cluster set and the second superpixel cluster set corresponding to the candidate second image, to obtain a matching degree of the number of clusters between the first image and the candidate second image, comprises: The first superpixel cluster set and the second superpixel cluster set are sorted according to the number of superpixels contained in each superpixel cluster to obtain a sorted first superpixel cluster set C u ={C u1 ,C u2 ,...,C um } and the second superpixel cluster set C = {C1, C2, ..., C n }; wherein m is the number of first superpixel clusters included in the first superpixel cluster set, and n is the number of second superpixel clusters included in the second superpixel cluster set; According to the first superpixel cluster set C u The sum of the differences between the number of superpixels contained in each cluster with the corresponding serial number in the second superpixel cluster set C is used to calculate the matching degree N of the number of clusters between the first image and the candidate second image: Among them, c ui is the first superpixel cluster set C u The first superpixel cluster C in the i-th ui The number of superpixels included, c i is the i-th second superpixel cluster C in the second superpixel cluster set C i The number of superpixels included.

9. The method according to claim 7, characterized in that: The calculating of the cluster distance matching degree between the first image and the candidate second image according to the distance from each cluster in the second superpixel cluster set corresponding to the first superpixel cluster set and the center of the image includes: The first superpixel cluster set and the second superpixel cluster set are sorted according to the distance from each superpixel cluster to the center of the image to obtain a sorted first superpixel cluster set R u = {R u1 ,R u2 ,...,R um } and the second superpixel cluster set R = {R1, R2, ..., R n }; According to the first superpixel clustering cluster set R u The sum of the differences between the distances of each cluster with the corresponding serial number in the second superpixel cluster set R and the center of the image is calculated to obtain the cluster distance matching degree S between the first image and the candidate second image: Among them, r ui is the first superpixel cluster set R u The first superpixel cluster R in the i-th ui The distance to the center of the first image, r i is the i-th second superpixel cluster R in the second superpixel cluster set R i The distance to the center of the second image.

10. An image color matching device, characterized in that: The device comprises: A superpixel segmentation module, used to obtain a first superpixel set of the first image and a second superpixel set of the second image respectively by using a preset image segmentation algorithm; a superpixel similarity calculation module, configured to calculate the similarity between each superpixel in the first superpixel set and the similarity between each superpixel in the second superpixel set respectively by using a preset similarity calculation algorithm, and construct a first similarity matrix of the first superpixel set and a second similarity matrix of the second superpixel set; a superpixel clustering module, configured to cluster the first superpixel set and the second superpixel set respectively according to the first similarity matrix and the second similarity matrix by a preset clustering algorithm to obtain a first superpixel cluster set corresponding to the first image and a second superpixel cluster set corresponding to the second image; A cluster matching module, used for calculating and obtaining the second superpixel cluster with the highest number matching degree and the second superpixel cluster with the highest position matching degree of each first superpixel cluster in the first superpixel cluster set in the second superpixel cluster set; wherein the second superpixel cluster with the highest number matching degree is the second superpixel cluster in the second superpixel cluster set that is closest to the first superpixel cluster in terms of the number of superpixels included; the second superpixel cluster with the highest position matching degree is the second superpixel cluster in the second superpixel cluster set that is closest to the first superpixel cluster in terms of relative position in the image; A cluster similarity calculation module, used to calculate the color difference matching similarity between each of the first superpixel clusters and the second superpixel cluster corresponding to the second image according to the color difference between each of the first superpixel clusters and the corresponding second superpixel cluster with the highest quantity matching and the second superpixel cluster with the highest position matching; The image color matching module is used to calculate the color matching similarity between the first image and the second image based on the color difference matching similarity between each of the first superpixel clusters in the first superpixel cluster set and the second superpixel cluster corresponding to the second image.

Citation Information

Cited By

  • Lamp effect configuration method and device, equipment and medium

    CN119383807A