Scatter density image comparison method and device, equipment and storage medium
By preprocessing and contour fitting the image, the similarity of the feature values is calculated and weighted to calculate, the problem of low accuracy of the scatter density image similarity comparison method is solved, and the reliability of image similarity comparison is improved.
Patent Information
- Application Number
- CN202411546927.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-02-11
AI Technical Summary
In the prior art, the similarity comparison method of scatter density images is not very accurate, especially when the data distribution is irregular or there are extreme outliers, it is difficult to understand or explain, which affects the correct interpretation of the data by users.
The first image and the second image are obtained through preprocessing, and color labels and cluster labels are added to their colors and scatter density clusters to determine whether the number of scatter density clusters is the same, and preliminary screening is performed. Then, the profile fit is performed, the similarity of the eigenvalues in the profile is calculated, and the weight is calculated based on the weight of the color label to obtain the final image similarity.
The reliability of image similarity comparison is improved, the shortcomings of the scatter density image similarity comparison method in the prior art are made up for, and the accuracy and reliability of image similarity judgment are ensured.
Smart Images

Figure CN119418075A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition and processing technology, and in particular to a scattered point density image comparison method, device, equipment and storage medium. Background Art
[0002] In the field of image recognition and processing technology, a common method for achieving image similarity comparison is the color histogram method. This method separates the colors of all pixels in the image using the RGB three channels, counts the number of times pixels appear in different channel intervals, and then converts them into histogram data using the hist algorithm. The number of pixels that are the same in the image data is compared using the algorithm in comparehist. This method is simple to calculate and easy to implement, but only considers the color information of the image. Therefore, for two pictures with similar colors but different contents, the comparison effect of this method is not very ideal.
[0003] Therefore, a new method was adopted to compare some images that did not have ideal contrast effects after using the above method. The scatter density plot is a visual image used to display the distribution of two-dimensional data. Usually, the effect of the scatter density plot mostly depends on the distribution of the data. If the data distribution is very irregular or there are extreme outliers, the generated scatter density plot may become difficult to understand or explain, which will not be accurate in judging the similarity on the scatter density image, thereby affecting the user's correct interpretation of the data and resulting in unreliable image similarity judgment. Summary of the invention
[0004] The present application provides a scatter point density image comparison method, device, equipment and storage medium, which can improve the reliability of image similarity comparison and make up for the shortcomings of the similarity comparison method on scatter point density images in the prior art.
[0005] In order to achieve the above objectives, this application adopts the following technical solutions: In a first aspect, the present application provides a scattered point density image comparison method, the method comprising: Acquire a first image and a second image for comparison; Obtaining color values of all pixels of the first image and the second image; Add color labels to the color values of all pixels according to the color range; Determine whether the number of scattered point density clusters of the first image and the second image is the same, and obtain a first determination result; If the first judgment result indicates that the number of scattered point density clusters of the first image and the second image is the same, automatically clustering the position coordinates of the pixel points of the first image and the second image in the image according to the number of scattered point density clusters and adding cluster labels; Extracting feature points from the pixels of each cluster, performing contour fitting based on the feature points, and obtaining feature values after contour fitting; Calculating similarity between characteristic values of the first image after pixel point contour fitting and characteristic values of the second image after pixel point contour fitting to obtain a first similarity; A weighted calculation is performed on the first similarity to obtain an image similarity between the first image and the second image.
[0006] In some possible implementations, the method further includes: The calculation formula of the first similarity is as follows:
[0007] in, is the similarity of the nth color label, is the similarity of the center point coordinates of the pixel density cluster, is the similarity of the tilt angles of the contours, is the similarity of the shape of the contour, n is the color label, is a red color label, is a green color label, A blue color label. .
[0008] In some possible implementations, the image similarity calculation formula between the first image and the second image is as follows:
[0009] in, is the image similarity between the first image and the second image, 0.5 is the weight of the red color label, 0.3 is the weight of the green color label, and 0.2 is the weight of the blue color label. is the first similarity of the red color label, is the first similarity of the green color label, The first similarity is the blue color label.
[0010] In some possible implementations, the color labels include a red-like color label, a green-like color label, and a blue-like color label.
[0011] In some possible implementations, the method further includes: If the first judgment result indicates that the number of scatter point density clusters of the first image and the second image are different, similarity calculation is not performed.
[0012] In some possible implementations, extracting feature points from pixel points of each cluster, performing contour fitting according to the feature points, and obtaining feature values after contour fitting include: The characteristic values are the coordinates of the center point of the density cluster, the position coordinates of the four vertices of the contour, the fitting shape of the contour, and the inclination angle of the contour. The contour shape is an ellipse.
[0013] In a second aspect, the present application provides a scattered point density image comparison device, the device comprising: An acquisition module, used to acquire a first image and a second image for comparison; and to acquire color values of all pixels of the first image and the second image; The label module is used to add color labels to the color values of all pixels according to the color range; A judgment module, used to judge whether the number of scatter point density clusters of the first image and the second image is the same, and obtain a first judgment result; if the first judgment result indicates that the number of scatter point density clusters of the first image and the second image is the same, clustering the position coordinates of the pixel points of the first image and the second image in the image according to the number of scatter point density clusters and adding cluster labels; An extraction module is used to extract feature points from pixel points of each cluster, perform contour fitting based on the feature points, and obtain feature values after contour fitting; The calculation module is used to perform similarity calculation on the characteristic values of the first image after the pixel point contour is fitted and the characteristic values of the second image after the pixel point contour is fitted to obtain a first similarity; and perform weighted calculation on the first similarity to obtain image similarity between the first image and the second image.
[0014] In a third aspect, the present application provides a computing device, including a memory and a processor; One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the computing device executes the method as described in any one of the first aspects.
[0015] In a fourth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method as described in any one of the first aspects.
[0016] It can be seen from the above technical solution that the present application has at least the following beneficial effects: In the present application, a first image and a second image are obtained by preprocessing, and color labels and cluster labels are added to the colors and scatter density clusters in the first image and the second image. By judging whether the number of scatter density clusters in the first image and the second image is the same, a preliminary screening is performed, and images with the same number of scatter density clusters in the first image and the second image are retained. Contour fitting is performed, and the similarity of each characteristic value in the contour is calculated, and a weighted calculation is performed to obtain the image similarity of the final first image and the second image. In the traditional scheme, the method for realizing the similarity comparison of images is to convert the image into a scatter density map for comparison, and by combining the distribution of points in the scatter map with the smoothed density estimate in the density map, more abundant information about the data distribution is provided. However, the effect of the scatter density map mostly depends on the distribution of the data. If the data distribution is very irregular or there are extreme outliers, the generated scatter density map may become difficult to understand or explain, which is not accurate when judging the similarity on the scatter density image, thereby affecting the user's correct interpretation of the data, resulting in unreliable image similarity judgment. It can be seen that, based on the scatter density map, the present application further performs contour fitting to obtain the eigenvalue of the contour, calculates the similarity based on the eigenvalue and performs weighted calculation based on the weight of the color label to obtain the final image similarity. It can be seen that the present application can improve the reliability of image similarity comparison and make up for the shortcomings of the similarity comparison method on the scatter density image in the prior art.
[0017] It should be understood that the description of technical features, technical solutions, beneficial effects or similar language in this application does not imply that all features and advantages can be realized in any single embodiment. On the contrary, it is understood that the description of features or beneficial effects means that specific technical features, technical solutions or beneficial effects are included in at least one embodiment. Therefore, the description of technical features, technical solutions or beneficial effects in this specification does not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions and beneficial effects described in the present embodiment can also be combined in any appropriate manner. Those skilled in the art will understand that the embodiment can be realized without one or more specific technical features, technical solutions or beneficial effects of a specific embodiment. In other embodiments, additional technical features and beneficial effects can also be identified in a specific embodiment that does not embody all embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 A flow chart of a scattered point density image comparison method provided in an embodiment of the present application; Figure 2 Schematic diagram of two scattered point density images provided in the embodiments of the present application; Figure 3 A schematic diagram of the position coordinates of pixel points after color classification provided in an embodiment of the present application; Figure 4 A schematic diagram of clustering of a first image provided in an embodiment of the present application; Figure 5 A schematic diagram of a contour fitting provided in an embodiment of the present application; Figure 6 A schematic diagram of a scattered point density image comparison device provided in an embodiment of the present application; Figure 7 A schematic diagram of a scattered point density image generation system provided in an embodiment of the present application; Figure 8 A schematic diagram of a computing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0019] The terms "first", "second", "third", etc. in the specification of this application and the accompanying drawings are used to distinguish different objects rather than to limit a specific order.
[0020] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0021] Currently, the method for achieving image similarity comparison is to convert the image into a scatter density map for comparison. By combining the distribution of points in the scatter map with the smoothed density estimate in the density map, richer information about the data distribution is provided.
[0022] However, the effectiveness of scatter density maps mostly depends on the distribution of data. If the data distribution is very irregular or there are extreme outliers, the generated scatter density map may become difficult to understand or interpret, which will not be accurate when judging the similarity on the scatter density image, thus affecting the user's correct interpretation of the data and making the image similarity judgment unreliable.
[0023] In view of this, an embodiment of the present application provides a scatter density image comparison method, in which a first image and a second image are obtained by preprocessing, color labels and cluster labels are added to the colors and scatter density clusters in the first image and the second image, and a preliminary screening is performed by judging whether the number of scatter density clusters in the first image and the second image is the same, and images with the same number of scatter density clusters in the first image and the second image are retained, and contour fitting is performed and the similarity of each eigenvalue in the contour is calculated, and then a weighted calculation is performed to obtain the final image similarity of the first image and the second image. It can be seen that the present application further performs contour fitting on the basis of the scatter density map to obtain the eigenvalue of the contour, calculates the similarity based on the eigenvalue and performs a weighted calculation based on the weight of the color label to obtain the final image similarity. It can be seen that the present application can improve the reliability of image similarity comparison and make up for the deficiencies of the similarity comparison method on scatter density images in the prior art.
[0024] In order to make the technical solution of the present application clearer and easier to understand, a scatter density image comparison method provided by an embodiment of the present application is introduced below in conjunction with the accompanying drawings. Figure 1 As shown, this figure is a flow chart of a scattered point density image comparison method provided in an embodiment of the present application.
[0025] In an embodiment of the present application, it is applied to a processing device, which can be a terminal or a server. Terminals include but are not limited to smartphones, tablet computers, laptops, personal digital assistants, or smart wearable devices. The server can be a cloud server, such as a central server in a central cloud computing cluster, or an edge server in an edge cloud computing cluster. Of course, the server can also be a server in a local data center. A local data center refers to a data center directly controlled by a user. In the present application, a first image and a second image are set as application objects, and the similarity between the first image and the second image is obtained through the following series of steps. The scatter density image comparison method includes: S101: A processing device obtains a first image and a second image for comparison.
[0026] The processing device selects a set of first images and second images from different experimental groups and places them in a designated path. In the embodiment of the present application, the designated path may be a storage location in a laptop computer.
[0027] Perform image preprocessing on the first image and the second image to obtain basic image properties such as image size, number of channels, data type, color values (RGB mode) contained in the two images, and then determine whether the sizes of the first image and the second image are the specified sizes. If not, normalize the sizes of the first image and the second image.
[0028] S102: The processing device obtains color values of all pixels of the first image and the second image.
[0029] The image color values obtained after preprocessing the first image and the second image are used to remove the two background colors of black and white. Formula (1) is used to remove the background color of black, as shown below: (1) Among them, blankbrightness is the calculated value of color brightness, R is the red color value, G is the green color value, and B is the blue color value.
[0030] By setting the blankbrightness threshold, the color values with brightness less than the threshold are removed, that is, the black noise color. The white background color can be removed by the processing device. After the above operation, the remaining color information is the color value of the pixel point. The position coordinates of all the pixel points corresponding to each color in the image can be obtained according to the argwhere command, such as Figure 2 As shown, the figure is a schematic diagram of two scattered point density images provided in an embodiment of the present application, 201 is the first image, and 202 is the second image.
[0031] S103: The processing device adds color labels to the color values of all pixels according to a color range.
[0032] The position coordinates of the pixel points obtained in step S102 can be screened and classified one by one according to formula (2), and all pixel coordinates can be divided into three categories: red (S_R), green (S_G) and blue (S_B), but not limited to these three categories:
[0033] According to the above color range, the position coordinates of the obtained pixel points are divided into three categories and color labels are added. The weights used to calculate the similarity are different according to the categories to which the position coordinates of the pixel points belong. The specific classification scatter point coordinate effects are as follows: Figure 3 As shown, the figure is a schematic diagram of the position coordinates of pixel points after color classification provided in an embodiment of the present application. In the figure, it can be seen that Figure a is a schematic diagram of the position coordinates of red (S_R) pixel points after classification, Figure b is a schematic diagram of the position coordinates of green (S_G) pixel points after classification, and Figure c is a schematic diagram of the position coordinates of blue (S_B) pixel points after classification.
[0034] S104: The processing device determines whether the number of scattered point density clusters in the first image and the second image is the same.
[0035] By determining whether the number of scatter point density clusters of the first image and the second image is the same, a first judgment result can be obtained. If the first judgment result indicates that the number of scatter point density clusters of the first image and the second image is the same, S105 is executed. If the first judgment result indicates that the number of scatter point density clusters of the first image and the second image is different, S106 is executed.
[0036] S105: The processing device clusters the position coordinates of the pixels of the first image and the second image in the images according to the number of scattered point density clusters and adds cluster labels.
[0037] Usually, there are multiple scattered density clusters distributed on an image. Clustering is performed according to the position coordinates of the pixel points in the image, and cluster labels are added. The coordinates can be automatically clustered according to the k-means clustering algorithm. The specific method is shown in formula (3): (3) in, represents the sum of squared errors within the cluster, C i represents the i-th cluster, C i Contains the center point All pixels closest to each other, k represents the total number of clusters, ,||x- ||^2 represents the pixel point x and the cluster center point The square of the Euclidean distance between them.
[0038] Randomly select k pixels as the initial cluster centers. For each pixel x, calculate the distance between the pixel x and all cluster centers. , assign it to the cluster to which the nearest cluster center belongs. Calculate the average value of all data points inside it, repeat the data point assignment and center point update until the cluster center no longer changes significantly, and label each cluster. The label order is sorted from small to large according to the x-coordinate and y-coordinate of the cluster center.
[0039] Since the computer cannot intuitively see how many scatter point clusters there are on an unfamiliar image like we do, there is an iterative idea here. By iteratively calculating the above pixel scatter point coordinates, we can finally determine how many scatter point density clusters there are and the coordinates of the center point of each scatter point density cluster. At the same time, after determining how many scatter point density clusters there are in the image, we use the center position coordinates of each scatter point density map as the reference and number the scatter point density clusters according to the size of the coordinates, such as scatter point density cluster No. 1, scatter point density map No. 2, etc.
[0040] The pixel coordinates belonging to each of the three color categories are divided into k clusters through a clustering algorithm, and the coordinate position set and cluster label of each cluster are returned, as shown in formula (4).
[0041]
[0042] in, is the coordinate position set of the red pixel points of the kth cluster, is the coordinate position set of the green pixel points of the kth cluster, is the coordinate position set of the blue pixel points of the k-th cluster, k is an integer, , , , is the coordinate position of the red pixel of the kth cluster, is the coordinate position of the green pixel of the kth cluster, is the coordinate position of the blue pixel of the kth cluster.
[0043] In the embodiment of the present application, it is assumed that the first image and the second image contain two scatter density maps, and the two scatter density maps of the first image are divided into a first cluster and a second cluster, such as Figure 4 As shown, this figure is a schematic diagram of clustering of a first image provided in an embodiment of the present application.
[0044] S106: The processing device does not perform similarity calculation.
[0045] If the first judgment result indicates that the numbers of scattered point density clusters of the first image and the second image are different, the processing device will no longer continue to calculate the similarity between the first image and the second image.
[0046] S107: The processing device extracts feature points from the pixels of each cluster and performs contour fitting based on the feature points.
[0047] According to formula (5), the Euclidean distance between any two points in each cluster coordinate set is calculated:
[0048] Among them, x i is the x-axis coordinate of the pixel point of the kth cluster, y i is the y-axis coordinate of the pixel point of the k-th cluster, is the Euclidean distance between two points.
[0049] In order to improve the calculation speed, the traditional traversal loop calculation method is not used. Instead, the distance between every two points in each cluster is calculated according to the distance matrix, and the two points a and b with the farthest distance in the single cluster pixel coordinate set are quickly screened out and the distance between them is obtained.
[0050] Set the coordinates of a to , the coordinates of b are , by calculating the straight line equation Ax+By+C=0 between points a and b, and then traversing the coordinate set to find the point c farthest from the straight line, and then calculating formula (6):
[0051] Among them, point is the coordinate of the pixel point c to be found. Repeat the single cluster scattered point coordinate set to find the point c with the farthest vertical distance from the line Ax+By+C=0, and obtain the coordinate of point c and the farthest distance far_distance between point c and the line.
[0052] It should be noted here that the boundary shapes of different density areas of most scattered point density images are generally quasi-circular or quasi-elliptical. Therefore, the present invention adopts an ellipse fitting algorithm to approximately fit the boundary shape of the scattered point cluster, which is not only simple to calculate but also highly accurate.
[0053] For the kth cluster pixel coordinates, point a, b coordinates, distance distance, point c coordinates and distance far_distance, calculate the kth cluster pixel center coordinates, the major semi-axis major_axis_length, the minor semi-axis minor_axis_length length and the tilt angle angle of the fitted equivalent ellipse outline according to formulas (7), (8), (9), and (10). The formulas are as follows:
[0054] in, is the number of points in the kth cluster, is the center point of the kth cluster The x-coordinate of is the center point of the kth cluster The y coordinate of (x, y) is the coordinate of a point in the k-th cluster; center is the coordinate of the center point of the k-th cluster, is the major semi-axis length of the contour of the kth cluster, is the minor semi-axis length of the contour of the k-th cluster, and angle is the inclination angle of the contour of the k-th cluster.
[0055] Thus, the characteristic values of the required fitting contour are obtained.
[0056] According to the center, major_axis_length, minor_axis_length, angel and other result values obtained from the kth cluster of scattered point density, the equivalent ellipse contour is fitted through the ellipse command. The specific effect is as follows Figure 5 As shown, this figure is a schematic diagram of a contour fitting provided in an embodiment of the present application.
[0057] S108: The processing device calculates the similarity between the feature values of the first image after the pixel point contour is fitted and the feature values of the second image after the pixel point contour is fitted.
[0058] A first similarity is obtained, where the first similarity includes similarity of center points of pixel density clusters between the first image and the second image, similarity of contour shapes between the first image and the second image, and similarity of tilt angles between the first image and the second image.
[0059] First, the similarity between the center points center1 and center2 of the kth cluster in the three color coordinate sets in the first image and the second image is calculated. Center1 is the center point coordinate of the kth cluster in the first image, and center2 is the center point coordinate of the kth cluster in the second image. The distance center_distance between the two center points is calculated for center1 and center2. The similarity (similar_center) of the center points of the kth cluster of the first image and the second image is calculated according to formula (11). Finally, the mean similarity of the center points of each cluster of the first image and the second image of different color classes is calculated according to formula (12), as follows:
[0060] in, is the similarity between the center points of the kth cluster of the first image and the second image of different class colors, is the mean similarity of the center points of each cluster of the first image and the second image of different class colors, is the distance between the center points of the kth cluster of the first image and the second image in the same coordinate system. The threshold value comes from the image pixel size. .
[0061] Then calculate the similarity of the tilt angle of the fitted contour. Since the contour shape of the scattered point cluster in the scattered point density map has different angles of inclination, it is not accurate enough to only calculate the similarity of the coordinates of the center point of the density cluster of the first image and the second image. Similarly, the similarity of the tilt angle of the fitted contour is calculated by formula (13) (14), and finally the mean similarity of the tilt angle of each cluster of the first image and the second image of different color classes is calculated by formula (15), as follows:
[0062] in, is the normalized value of the angle difference, angle1 is the tilt angle of the contour of the kth cluster of the first image, angle2 is the tilt angle of the contour of the kth cluster of the second image, is the similarity of the tilt angles of the contours of the kth cluster of the first image and the second image of different class colors, is the mean similarity of the tilt angles of the contours of each cluster of the first image and the second image of different class colors.
[0063] Finally, the similarity of the shape and size of the fitted contour is calculated. For the contour of the same cluster of scattered point density groups in the first image and the second image, the similarity of the shape and size of the fitted contour is calculated according to the obtained major semi-axis major_axis_length and minor semi-axis minor_axis_length through formulas (16)-(21). Finally, the mean similarity of the shape and size of each cluster of the first image and the second image of different color classes is calculated through formula (22), as follows:
[0064] in, is the calculation formula for the eccentricity of an ellipse, , Fit the major and minor semi-axes of the ellipse of the k-th cluster of different color classes of the first image, , Fit the major and minor semi-axes of the ellipse of the k-th cluster of different color classes of the second image, , is the similarity of the contour shape size of the kth cluster of the first image and the second image of different color classes after normalization. The closer its value is to 0, the more similar the two ellipse contours are; the closer it is to 1, the greater the difference is. is the mean of the similarity of the contours of each cluster of the first image and the second image of different class colors.
[0065] S109: The processing device performs weighted calculation on the first similarity to obtain image similarity between the first image and the second image.
[0066] Combined with the center point distance, tilt angle, and similarity calculation results of the contour shape and size after fitting of the first image and the second image, the similarity of the three regions of red (S_R), green (S_G), and blue (S_B) of the first image and the second image is calculated by formula (23). Then, a weight of 0.5 is applied to the red (S_R) color region, a weight of 0.3 is applied to the green (S_G) color region, and a weight of 0.2 is applied to the green (S_B) color region by formula (24), and the image similarity of the first image and the second image is calculated as follows:
[0067] in, is the similarity between the first image and the second image of different color classes, is the image similarity between the first image and the second image.
[0068] Thus, the image similarity between the first image and the second image is obtained.
[0069] Based on the above content, the first image and the second image are obtained through preprocessing, and color labels and cluster labels are added to the colors and scatter density clusters in the first image and the second image. By judging whether the number of scatter density clusters in the first image and the second image is the same, a preliminary screening is performed, and images with the same number of scatter density clusters in the first image and the second image are retained. Contour fitting is performed, and the similarity of each eigenvalue in the contour is calculated, and a weighted calculation is performed to obtain the final image similarity of the first image and the second image. It can be seen that the present application further performs contour fitting on the basis of the scatter density map to obtain the eigenvalue of the contour, calculates the similarity based on the eigenvalue, and performs a weighted calculation based on the weight of the color label to obtain the final image similarity. It can be seen that the present application can improve the reliability of image similarity comparison and make up for the shortcomings of the similarity comparison method on the scatter density image in the prior art.
[0070] The present application also provides a scattered point density image comparison device, such as Figure 6 As shown, this figure is a schematic diagram of a scatter density image comparison device provided in an embodiment of the present application, and the device includes: an acquisition module 601, a label module 602, a judgment module 603, an extraction module 604 and a calculation module 605; Acquire the first image and the second image compared by module 601; acquire the color values of all pixels of the first image and the second image; The label module 602 adds color labels to the color values of all pixels according to the color range interval; The judgment module 603 judges whether the number of scatter point density clusters of the first image and the second image is the same, and obtains a first judgment result; if the first judgment result indicates that the number of scatter point density clusters of the first image and the second image is the same, the position coordinates of the pixel points of the first image and the second image in the image are clustered according to the number of scatter point density clusters and cluster labels are added; The extraction module 604 extracts feature points from the pixels of each cluster, performs contour fitting based on the feature points, and obtains feature values after contour fitting; The calculation module 605 performs similarity calculation on the eigenvalues of the first image after the pixel point contour is fitted and the eigenvalues of the second image after the pixel point contour is fitted to obtain a first similarity; and performs weighted calculation on the first similarity to obtain image similarity between the first image and the second image.
[0071] In some possible implementations, the calculation module is specifically used to calculate the first similarity; The calculation formula of the first similarity is as follows:
[0072] in, is the similarity of the nth color label, is the similarity of the center point coordinates of the pixel density cluster, is the similarity of the tilt angles of the contours, is the similarity of the shape of the contour, n is the color label, is a red color label, is a green color label, A blue color label. .
[0073] In some possible implementations, the image similarity calculation formula between the first image and the second image is as follows:
[0074] in, is the image similarity between the first image and the second image, 0.5 is the weight of the red color label, 0.3 is the weight of the green color label, and 0.2 is the weight of the blue color label. is the first similarity of the red color label, is the first similarity of the green color label, The first similarity is the blue color label.
[0075] In some possible implementations, the color labels include a red-like color label, a green-like color label, and a blue-like color label.
[0076] In some possible implementations, the judgment module is specifically configured to not perform similarity calculation if the first judgment result indicates that the numbers of scattered point density clusters of the first image and the second image are different.
[0077] In some possible implementations, extracting feature points from pixel points of each cluster, performing contour fitting according to the feature points, and obtaining feature values after contour fitting include: The characteristic values are the coordinates of the center point of the density cluster, the position coordinates of the four vertices of the contour, the fitting shape of the contour, and the inclination angle of the contour. The contour shape is an ellipse.
[0078] The present application also provides a scattered point density image generation system for generating a density image in a detection system, such as Figure 7As shown, the figure is a schematic diagram of a scattered point density image generation system provided in an embodiment of the present application, the system comprising: a current differential amplifier 701, a seven-ITO electrode microfluidic detection chip 702, a Zurich impedance spectrometer 703 and a pressure pump 704.
[0079] The present application also provides a computing device. Figure 8 As shown, this figure is a schematic diagram of a computing device provided in an embodiment of the present application, and the computing device 800 includes a bus 801, a processor 802, a communication interface 803 and a memory 804. The processor 802, the memory 804 and the communication interface 803 communicate with each other through the bus 801.
[0080] The bus 801 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0081] The processor 802 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0082] The communication interface 803 is used for external communication. For example, when the computing device is a first switch, the communication interface 803 can be used for the first switch to communicate with the first user terminal, or for the first switch to communicate with the second switch.
[0083] The memory 804 may include a volatile memory, such as a random access memory (RAM). The memory 804 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD).
[0084] The memory 804 stores executable codes, and the processor 802 executes the executable codes to perform the aforementioned scatter density image comparison method.
[0085] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (such as a floppy disk, a hard disk, a tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state hard disk). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned scatter density image comparison method.
[0086] The embodiment of the present application further provides a computer program product, which includes one or more computer instructions. When the computer instructions are loaded and executed on a computing device, the process or function described in the embodiment of the present application is generated in whole or in part.
[0087] The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer or data center to another website, computer or data center via wired (e.g., coaxial cable, optical fiber) or wireless (e.g., infrared, wireless, microwave, etc.) means.
[0088] When the computer program product is executed by a computer, the computer executes any of the aforementioned scatter density image comparison methods. The computer program product may be a software installation package, and when any of the aforementioned scatter density image comparison methods is needed, the computer program product may be downloaded and executed on a computer.
[0089] The descriptions of the processes or structures corresponding to the above-mentioned figures have different emphases. For parts that are not described in detail in a certain process or structure, please refer to the relevant descriptions of other processes or structures.
[0090] The above description is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application.
Claims
1. A scattered point density image comparison method, characterized in that: The method comprises: Acquire a first image and a second image for comparison; Acquire color values of all pixels of the first image and the second image; Add color labels to the color values of all pixels according to the color range; Determine whether the number of scattered point density clusters of the first image and the second image is the same, and obtain a first determination result; If the first judgment result indicates that the number of scattered point density clusters of the first image and the second image is the same, automatically clustering the position coordinates of the pixel points of the first image and the second image in the image according to the number of scattered point density clusters and adding cluster labels; Extracting feature points from the pixels of each cluster, performing contour fitting based on the feature points, and obtaining feature values after contour fitting; Calculating similarity between characteristic values of the first image after pixel point contour fitting and characteristic values of the second image after pixel point contour fitting to obtain a first similarity; A weighted calculation is performed on the first similarity to obtain an image similarity between the first image and the second image.
2. The method according to claim 1, characterized in that The method further comprises: The calculation formula of the first similarity is as follows: in, is the similarity of the nth color label, is the similarity of the center point coordinates of the pixel density cluster, is the similarity of the tilt angles of the contours, is the similarity of the shape of the contour, n is the color label, is a red color label, is a green color label, A blue color label. .
3. The method according to claim 1, characterized in that The image similarity calculation formula between the first image and the second image is as follows: in, is the image similarity between the first image and the second image, 0.5 is the weight of the red color label, 0.3 is the weight of the green color label, and 0.2 is the weight of the blue color label. is the first similarity of the red color label, is the first similarity of the green color label, The first similarity is the blue color label.
4. The method according to claim 1, characterized in that The color labels include a red-like color label, a green-like color label, and a blue-like color label.
5. The method according to claim 1, characterized in that The method further comprises: If the first judgment result indicates that the numbers of scattered point density clusters of the first image and the second image are different, similarity calculation is not performed.
6. The method according to claim 1, characterized in that The extracting feature points of the pixels of each cluster, performing contour fitting according to the feature points, and obtaining feature values after contour fitting include: The characteristic values are the coordinates of the center point of the density cluster, the position coordinates of the four vertices of the contour, the fitting shape of the contour, and the inclination angle of the contour. The contour shape is an ellipse.
7. A scattered point density image comparison device, characterized in that: The device comprises: An acquisition module, used to acquire a first image and a second image for comparison; and to acquire color values of all pixels of the first image and the second image; The label module is used to add color labels to the color values of all pixels according to the color range; A judgment module, used to judge whether the number of scatter point density clusters of the first image and the second image is the same, and obtain a first judgment result; if the first judgment result indicates that the number of scatter point density clusters of the first image and the second image is the same, clustering the position coordinates of the pixel points of the first image and the second image in the image according to the number of scatter point density clusters and adding cluster labels; An extraction module is used to extract feature points from pixel points of each cluster, perform contour fitting based on the feature points, and obtain feature values after contour fitting; The calculation module is used to perform similarity calculation on the characteristic values of the first image after the pixel point contour is fitted and the characteristic values of the second image after the pixel point contour is fitted to obtain a first similarity; and perform weighted calculation on the first similarity to obtain image similarity between the first image and the second image.
8. The device according to claim 1, characterized in that The judgment module is specifically configured to not perform similarity calculation if the first judgment result indicates that the numbers of scattered point density clusters of the first image and the second image are different.
9. A computing device, characterized in that including memory and processor; One or more computer programs are stored in the memory, and the one or more computer programs include instructions; when the instructions are executed by the processor, the computing device executes the method as claimed in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 6.