CN110084298B - Method and device for detecting image similarity - Google Patents

Method and device for detecting image similarity Download PDF

Info

Publication number
CN110084298B
CN110084298B CN201910327769.7A CN201910327769A CN110084298B CN 110084298 B CN110084298 B CN 110084298B CN 201910327769 A CN201910327769 A CN 201910327769A CN 110084298 B CN110084298 B CN 110084298B
Authority
CN
China
Prior art keywords
image
processed
similarity
information
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910327769.7A
Other languages
Chinese (zh)
Other versions
CN110084298A (en
Inventor
李兴波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910327769.7A priority Critical patent/CN110084298B/en
Publication of CN110084298A publication Critical patent/CN110084298A/en
Application granted granted Critical
Publication of CN110084298B publication Critical patent/CN110084298B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the disclosure discloses a method and a device for detecting image similarity. One embodiment of the method comprises: acquiring an image to be processed and a reference image corresponding to the image to be processed; analyzing the image to be processed and the reference image under different sizes respectively, and calculating the similarity information between the image to be processed and the reference image; and outputting the detection result information of the application to be tested according to the similarity information. The method and the device improve the accuracy and efficiency of the detection result information of the application to be tested.

Description

Method and device for detecting image similarity
Technical Field
The embodiment of the disclosure relates to the technical field of image processing, in particular to a method and a device for detecting image similarity.
Background
With the development of science and technology, the data processing capability of the intelligent device is also stronger and stronger. The user can perform map query, information search and other operations through various applications installed on the intelligent device, and the working efficiency and the living informatization level of the user are improved. Technicians can update the application according to actual needs to improve the data processing efficiency of the application.
Disclosure of Invention
The embodiment of the disclosure provides a method and a device for detecting image similarity.
In a first aspect, an embodiment of the present disclosure provides a method for detecting image similarity, including: acquiring an image to be processed and a reference image corresponding to the image to be processed; analyzing the image to be processed and the reference image under different sizes respectively, and calculating similarity information between the image to be processed and the reference image; and outputting the detection result information of the application to be tested according to the similarity information.
In some embodiments, the analyzing the to-be-processed image and the reference image at different sizes respectively to calculate similarity information between the to-be-processed image and the reference image includes: acquiring a first to-be-processed area image of at least one first designated position of the to-be-processed image according to a first set size, wherein the first to-be-processed area image comprises a number corresponding to the first designated position; acquiring a first reference area image of at least one first designated position of the reference image according to the first set size, wherein the first reference area image comprises a number corresponding to the first designated position; and determining the similarity between the first to-be-processed area image and the first reference area image corresponding to the first to-be-processed area image.
In some embodiments, the determining the similarity between the first to-be-processed region image and the first reference region image includes: respectively acquiring first to-be-processed image fingerprint information of the first to-be-processed area image and first reference image fingerprint information of the first reference area image; and determining that the first to-be-processed area image and the first reference area image have similarity in response to a first hamming distance between the first to-be-processed image fingerprint information and the first reference image fingerprint information being smaller than a first set threshold.
In some embodiments, the analyzing the to-be-processed image and the reference image at different sizes respectively to calculate similarity information between the to-be-processed image and the reference image includes: in response to the similarity between the first to-be-processed area image and the corresponding first reference area image, acquiring a second to-be-processed area image of at least one second designated position of the first to-be-processed area image according to a second set size, and acquiring a second reference area image of at least one second designated position of the first reference area image according to the second set size, wherein the second to-be-processed area image includes a number corresponding to the second designated position, the second set size is smaller than the first set size, and the second reference area image includes a number corresponding to the second designated position; and determining the similarity information of the first to-be-processed area image according to the similarity between the second to-be-processed area image and the corresponding second reference area image.
In some embodiments, the determining the similarity information of the first to-be-processed region image according to the similarity between the second to-be-processed region image and the corresponding second reference region image includes: respectively acquiring second to-be-processed image fingerprint information of the second to-be-processed area image and second reference image fingerprint information of the second reference area image; determining that the second to-be-processed area image and the second reference area image have similarity in response to a second hamming distance between the second to-be-processed image fingerprint information and the second reference image fingerprint information being smaller than a second set threshold; setting the ratio of the number of the second to-be-processed area images having the similarity to the total number of the second to-be-processed area images as the similarity information of the first to-be-processed area image.
In some embodiments, the analyzing the to-be-processed image and the reference image at different sizes respectively to calculate similarity information between the to-be-processed image and the reference image includes: determining the number of first to-be-processed area images with similarity according to the similarity information of the first to-be-processed area images; setting the ratio between the number of the first to-be-processed area images having similarity and the total number of the first to-be-processed area images as the similarity information between the above-mentioned to-be-processed image and the reference image.
In a second aspect, an embodiment of the present disclosure provides an apparatus for detecting image similarity, the apparatus including: an image acquisition unit configured to acquire an image to be processed and a reference image corresponding to the image to be processed; a similarity information calculation unit configured to analyze the image to be processed and the reference image in different sizes, and calculate similarity information between the image to be processed and the reference image; and the detection result information output unit is configured to output the detection result information of the application to be tested according to the similarity information.
In some embodiments, the similarity information calculating unit includes: a to-be-processed region image dividing unit configured to acquire a first to-be-processed region image of at least one first designated position of the to-be-processed image according to a first set size, wherein the first to-be-processed region image includes a number corresponding to the first designated position; a reference area image dividing unit configured to acquire a first reference area image of at least one first designated position of the reference image according to the first set size, wherein the first reference area image includes a number corresponding to the first designated position; a similarity determination subunit configured to determine, for the first to-be-processed region image and a first reference region image corresponding to the first to-be-processed region image, a similarity between the first to-be-processed region image and the first reference region image.
In some embodiments, the similarity determination subunit includes: the first image fingerprint information acquisition module is configured to acquire first to-be-processed image fingerprint information of the first to-be-processed area image and first reference image fingerprint information of the first reference area image respectively; the first similarity determination module, in response to a first hamming distance between the first to-be-processed image fingerprint information and the first reference image fingerprint information being smaller than a first set threshold, is configured to determine that the first to-be-processed area image and the first reference area image have a similarity therebetween.
In some embodiments, the similarity information calculating unit includes: an area image dividing subunit, configured to, in response to a similarity between the first to-be-processed area image and a corresponding first reference area image, acquire a second to-be-processed area image of at least one second designated position of the first to-be-processed area image according to a second set size, and acquire a second reference area image of at least one second designated position of the first reference area image according to the second set size, where the second to-be-processed area image includes a number corresponding to the second designated position, the second set size is smaller than the first set size, and the second reference area image includes a number corresponding to the second designated position; and the similarity information determining subunit is configured to determine the similarity information of the first to-be-processed area image according to the similarity between the second to-be-processed area image and the corresponding second reference area image.
In some embodiments, the similarity information determining subunit includes: a second image fingerprint information acquiring module configured to acquire second to-be-processed image fingerprint information of the second to-be-processed area image and second reference image fingerprint information of the second reference area image, respectively; a second similarity determination module, configured to determine that the second to-be-processed area image and the second reference area image have similarity in response to a second hamming distance between the second to-be-processed image fingerprint information and the second reference image fingerprint information being smaller than a second set threshold; and the second similarity information setting module is configured to set the ratio of the number of the second to-be-processed area images with similarity to the total number of the second to-be-processed area images as the similarity information of the first to-be-processed area image.
In some embodiments, the similarity information calculating unit includes: a similar image quantity acquiring subunit configured to determine the quantity of the first to-be-processed area images having similarity according to the similarity information of the first to-be-processed area images; and an image similarity information determination subunit configured to set a ratio between the number of the first to-be-processed area images having similarity and the total number of the first to-be-processed area images as the similarity information between the above-described to-be-processed image and the reference image.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; a memory on which one or more programs are stored, which, when executed by the one or more processors, cause the one or more processors to perform the method for detecting image similarity of the first aspect.
In a fourth aspect, an embodiment of the present disclosure provides a computer-readable medium, on which a computer program is stored, where the program is executed by a processor to implement the method for detecting image similarity of the first aspect.
The method and the device for detecting the image similarity provided by the embodiment of the disclosure firstly acquire an image to be processed and a reference image corresponding to the image to be processed; then, the image to be processed and the reference image are respectively analyzed under different sizes, and the similarity information between the image to be processed and the reference image is calculated; and finally, outputting the detection result information of the application to be tested according to the similarity information. According to the technical scheme, the similarity information of the image to be processed can be obtained, and the accuracy and the efficiency of the detection result information of the application to be tested are improved.
Drawings
Other features, objects and advantages of the disclosure will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is an exemplary system architecture diagram in which one embodiment of the present disclosure may be applied;
FIG. 2 is a flow diagram of one embodiment of a method for detecting image similarity according to the present disclosure;
FIG. 3 is a schematic diagram of an application scenario of a method for detecting image similarity according to the present disclosure;
FIG. 4 is a flow diagram of one embodiment of a method of calculating image similarity information according to the present disclosure;
FIG. 5 is a schematic diagram illustrating an embodiment of an apparatus for detecting image similarity according to the present disclosure;
FIG. 6 is a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that, in the present disclosure, the embodiments and features of the embodiments may be combined with each other without conflict. The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 illustrates an exemplary system architecture 100 of a method for detecting image similarity or an apparatus for detecting image similarity to which embodiments of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have various applications installed thereon, such as a screen capture application, an image editing application, a web browser application, a shopping-like application, a search-like application, an instant messaging tool, a mailbox client, social platform software, and the like.
The terminal apparatuses 101, 102, and 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various electronic devices having a display screen and supporting image processing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented as a plurality of software or software modules (for example, for providing distributed services), or as a single software or software module, which is not specifically limited herein.
The server 105 may be a server that provides various services, such as a server that processes a to-be-processed image of an application to be tested transmitted from the terminal devices 101, 102, 103. The server may perform processing such as analysis on the received data such as the image to be processed, and feed back a processing result (e.g., detection result information) to the terminal device.
It should be noted that the method for detecting image similarity provided by the embodiments of the present disclosure may be executed by the terminal devices 101, 102, and 103 individually, or may also be executed by the terminal devices 101, 102, and 103 and the server 105 together. Accordingly, the means for detecting image similarity may be provided in the terminal devices 101, 102, 103, or may be provided in the server 105.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as a plurality of software or software modules (for example, to provide distributed services), or may be implemented as a single software or software module, and is not limited specifically herein.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a method for detecting image similarity according to the present disclosure is shown. The method for detecting the image similarity comprises the following steps:
step 201, acquiring an image to be processed and a reference image corresponding to the image to be processed.
In this embodiment, an executing subject of the method for detecting image similarity (e.g., the terminal devices 101, 102, 103 and/or the server 105 shown in fig. 1) may acquire the image to be processed of the application to be tested by a wired connection manner or a wireless connection manner. The image to be processed may be an application setting image of the application to be tested, which can reflect the difference between the application to be tested and other applications. For example, the application to be tested is developed based on a template that should not change during the version update of the application, otherwise the application may fail significantly. Then, the image where the template is located may be the image to be processed in the present application. It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, a uwb (ultra wideband) connection, and other wireless connection means now known or developed in the future.
In the prior art, technicians need to update versions of applications according to actual needs. When the version is updated, the key content of the updated application needs to be compared with the key content of the application before updating, so as to ensure that the updated version can be sequentially run. In practice, the key content of an application is usually a fixed template, which may have relevance to a plurality of function-specific images of the application. For this reason, the technician of the application needs to compare the specific function images before and after the update, and judge that the updated application can normally operate according to the similarity of the specific function images. However, technicians usually judge the similarity of the images with specific functions in a manual manner, which results in low accuracy and efficiency in judging the similarity of the images with specific functions, and further, accurate detection result information of the updated version cannot be acquired.
To compare the similarity of the corresponding images. The execution main body of the application can firstly acquire the image to be processed and a reference image corresponding to the image to be processed. The image to be processed and the reference image can be obtained by means of screen capture and the like.
Step 202, analyzing the image to be processed and the reference image respectively under different sizes, and calculating similarity information between the image to be processed and the reference image.
After the image to be processed and the reference image are acquired, the execution subject can judge whether the image to be processed and the reference image are similar or not through the modes of image color, different sizes, lines, content and the like, and corresponding similarity information is obtained. For example: the similarity information may be: the number of the area images of which the images to be processed are similar to the reference image is X, and the total number of the area images is Y, and the like. Therefore, the accuracy and the efficiency of judging the similarity of the images to be processed are improved. According to actual needs, the similarity information may also be in other expression modes, which are not described in detail herein.
And 203, outputting the detection result information of the application to be tested according to the similarity information.
After the similarity information is obtained, the execution main body can output the detection result information of the application to be tested according to the similarity information. For example, the detection result information may be: the number of the images to be processed of the application to be tested is X, wherein Y images with the similarity of 100% exist; z sheets with the similarity of 80% exist, and the failure rate of the application to be tested is 90%. The detection result information may also be other types of information, which is not described in detail herein. As can be seen from the above description, the method of the present embodiment is first characterized
The accuracy and the efficiency of the detection result information of the application to be tested can be improved.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for detecting image similarity according to the present embodiment. In the application scenario of fig. 3, a user may send a pending image "a" of a certain application to be tested to a server through the terminal device 102. After the server 105 finds the reference image corresponding to the image to be processed "a", the server 105 may first determine the similarity between the image to be processed "a" and the reference image through a low-dimensional large size by using various methods (such as a hash algorithm), and then calculate the similarity information between the image to be processed "a" and the reference image through a high-dimensional small size. Finally, the server 105 outputs the detection result information corresponding to the application to be tested.
The method provided by the embodiment of the disclosure firstly acquires an image to be processed and a reference image corresponding to the image to be processed; then, the image to be processed and the reference image are respectively analyzed under different sizes, and the similarity information between the image to be processed and the reference image is calculated; and finally, outputting the detection result information of the application to be tested according to the similarity information. According to the technical scheme, the similarity information of the image to be processed can be obtained, and the accuracy and the efficiency of the detection result information of the application to be tested are improved.
With further reference to fig. 4, a flow 400 of yet another embodiment of a method of analyzing an image to be processed and a reference image, respectively, at different sizes to compute similarity information between the image to be processed and the reference image is illustrated. The process 400 of the method for calculating image similarity information includes the following steps:
step 401, obtaining a first to-be-processed area image of at least one first designated position of the to-be-processed image according to a first set size.
In the present embodiment, the method for calculating image similarity information may be implemented by a subject (e.g., the terminal devices 101, 102, 103 and/or the server 105 shown in fig. 1) receiving the image to be processed and the reference image through a wired connection or a wireless connection.
In order to compare the similarity between the image to be processed and the reference image, the execution subject may first obtain a first image of the area to be processed at least at one first designated position, and obtain a first image of the area to be processed corresponding to the at least one first designated position of the image to be processed. The first designated position of the embodiment is a position where a key image feature on a setting image and the like capable of representing the uniqueness of the image to be processed is located. The first to-be-processed region image may include a number corresponding to the first designated position. For example, the image to be processed is rectangular, and the content is a certain person. The first designated location may be a region within a certain range of 4 corners of the image to be processed. The pattern with specific pattern structure should be in the area.
Step 402, obtaining a first reference area image of at least one first designated position of the reference image according to the first set size.
The first reference area image comprises a number corresponding to the first designated position. The processing procedure of the reference image is the same as that of the image to be processed, and is not described in detail here.
In step 403, for the first to-be-processed region image and the first reference region image corresponding to the first to-be-processed region image, the similarity between the first to-be-processed region image and the first reference region image is determined.
After the first to-be-processed region image and the first reference region image are obtained, the execution subject may compare the first to-be-processed region image with the first reference region image corresponding to the first to-be-processed region image, and determine a similarity therebetween. In the present application, similarity is used to qualitatively describe the similarity relationship between images. Therefore, the accuracy and the efficiency of judging the similarity of the images to be processed are improved.
In some optional implementations of the embodiment, the determining the similarity between the first to-be-processed region image and the first reference region image may include:
first, first to-be-processed image fingerprint information of the first to-be-processed area image and first reference image fingerprint information of the first reference area image are respectively acquired.
In order to accurately compare the first to-be-processed area image with the first reference area image, the execution subject may acquire first to-be-processed image fingerprint information and first reference image fingerprint information corresponding to the first to-be-processed area image and the first reference area image, respectively. The data length of the first to-be-processed image fingerprint information is the same as that of the first reference image fingerprint information. The image fingerprint information may characterize the uniqueness of the corresponding image. The image fingerprint information can be obtained by a hash algorithm and the like.
And secondly, determining that the first to-be-processed area image and the first reference area image have similarity in response to the fact that a first Hamming distance between the first to-be-processed image fingerprint information and the first reference image fingerprint information is smaller than a first set threshold.
After the first to-be-processed image fingerprint information and the first reference image fingerprint information are obtained, the executing main body can calculate the hamming distance between the first to-be-processed image fingerprint information and the first reference image fingerprint information. The hamming distance represents the different number of corresponding bits of two (same length) words. When the first hamming distance is smaller than the first set threshold, it is indicated that the difference between the first to-be-processed area image and the first reference area image is small. Considering various possible interferences, the difference is negligible, and the executing subject may consider that the first to-be-processed region image and the first reference region image have a similarity therebetween. At this time, the execution subject may set an image similarity flag for the corresponding first area-to-be-processed image. For example, the image similarity flag "1" may indicate that the first to-be-processed region image is similar to the first reference region image; the image similarity flag "0" may indicate that the first to-be-processed area image is not similar to the first reference area image. The executing main body may also identify the similarity between the first to-be-processed region image and the first reference region image in other manners, which is not described herein any more.
In some optional implementation manners of this embodiment, the method of this embodiment may include the following steps:
the method comprises the steps of firstly, responding to the similarity between the first to-be-processed area image and the corresponding first reference area image, acquiring a second to-be-processed area image of at least one second appointed position of the first to-be-processed area image according to a second set size, and acquiring a second reference area image of at least one second appointed position of the first reference area image according to the second set size.
After determining that the first to-be-processed region image and the corresponding first reference region image have similarity, the execution subject may further determine the magnitude of the similarity. The execution main body can acquire a second to-be-processed area image of at least one second appointed position of the first to-be-processed area image according to a second set size; and acquiring a second reference area image of at least one second appointed position of the first reference area image according to the second set size. The second to-be-processed area image may include a number corresponding to a second designated position, and the second designated size is smaller than the first designated size. For example, the second set size may be a size obtained by dividing the first set size into N equal parts. The second reference area image may include a number corresponding to the second designated position.
And secondly, determining the similarity information of the first to-be-processed area image according to the similarity between the second to-be-processed area image and the corresponding second reference area image.
After obtaining the second to-be-processed region image and the second reference region image, the execution subject may determine similarity information between the second to-be-processed region image and the corresponding second reference region image. In the present application, the similarity information is used to quantitatively describe the similarity relationship between images.
In some optional implementation manners of this embodiment, the determining the similarity information of the first to-be-processed region image according to the similarity between the second to-be-processed region image and the corresponding second reference region image may include the following steps:
and step one, respectively acquiring second to-be-processed image fingerprint information of the second to-be-processed area image and second reference image fingerprint information of the second reference area image.
Similar to the above process, the executing entity may respectively obtain second to-be-processed image fingerprint information of the second to-be-processed area image and second reference image fingerprint information of a corresponding second reference area image.
And secondly, determining that the second to-be-processed area image and the second reference area image have similarity in response to the fact that a second Hamming distance between the second to-be-processed image fingerprint information and the second reference image fingerprint information is smaller than a second set threshold.
And when the second Hamming distance between the second to-be-processed image fingerprint information and the second reference image fingerprint information is smaller than a second set threshold, the similarity between the second to-be-processed area image and the corresponding second reference area image is proved to be present. At this time, the execution subject may set an image similarity flag for the corresponding first area-to-be-processed image. The process of image similarity marking here may be similar to the process of image similarity marking described above, and is not described in detail here.
And thirdly, setting the ratio of the number of the second to-be-processed area images with similarity to the total number of the second to-be-processed area images as the similarity information of the first to-be-processed area images.
The execution subject may count the number of second to-be-processed region images having similarity, and set a ratio between the number of second to-be-processed region images and the total number of second to-be-processed region images in the second to-be-processed region image set as the similarity information of the first to-be-processed region images.
In some optional implementation manners of this embodiment, the method of this embodiment may include the following steps:
and step one, determining the number of the first to-be-processed area images with similarity according to the similarity information of the first to-be-processed area images.
The above describes the process of determining the similarity information of each first to-be-processed region image. Thereafter, the execution subject may determine the number of first to-be-processed region images having similarity.
And a second step of setting a ratio between the number of the first to-be-processed area images having similarity and the total number of the first to-be-processed area images as the similarity information between the to-be-processed image and the reference image.
The execution subject may set a ratio between the number of the first to-be-processed region images and the total number of the first to-be-processed region images as the above-described similarity information between the to-be-processed image and the reference image. The similarity information at this time is the overall similarity information corresponding to the image to be processed. For example, the similarity information between the image to be processed and the reference image is 90%, where 90% of the total number of the first image to be processed that can represent the image to be processed is similar to the first reference image of the reference image. The execution main body can also determine information such as a first to-be-processed area image and a first reference area image which are different between the to-be-processed image and the reference image according to the number of the first designated position and/or the number of the second designated position.
With further reference to fig. 5, as an implementation of the methods shown in the above-mentioned figures, the present disclosure provides an embodiment of an apparatus for detecting image similarity, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable to various electronic devices.
As shown in fig. 5, the apparatus 500 for detecting image similarity according to the present embodiment may include: an image acquisition unit 501, a similarity information calculation unit 502, and a detection result information output unit 503. The image acquiring unit 501 is configured to acquire an image to be processed and a reference image corresponding to the image to be processed; the similarity information calculation unit 502 is configured to analyze the to-be-processed image and the reference image in different sizes, and calculate similarity information between the to-be-processed image and the reference image; the detection result information output unit 503 is configured to output the detection result information of the application to be tested according to the similarity information.
In some optional implementations of the present embodiment, the similarity information calculating unit 502 may include: a to-be-processed region image dividing subunit (not shown in the figure), a reference region image dividing subunit (not shown in the figure), and a similarity determining subunit (not shown in the figure). The image dividing subunit of the area to be processed is configured to acquire a first image of the area to be processed of at least one first designated position of the image to be processed according to a first set size, wherein the first image of the area to be processed includes a number corresponding to the first designated position; the reference area image dividing subunit is configured to acquire a first reference area image of at least one first designated position of the reference image according to the first set size, wherein the first reference area image includes a number corresponding to the first designated position; a similarity determination subunit configured to determine, for the first to-be-processed region image and a first reference region image corresponding to the first to-be-processed region image, a similarity between the first to-be-processed region image and the first reference region image.
In some optional implementations of this embodiment, the similarity determining subunit may include: a first image fingerprint information acquisition module (not shown in the figure) and a first similarity determination module (not shown in the figure). The first image fingerprint information acquisition module is configured to acquire first to-be-processed image fingerprint information of the first to-be-processed area image and first reference image fingerprint information of the first reference area image respectively; the first similarity determination module, in response to a first hamming distance between the first to-be-processed image fingerprint information and the first reference image fingerprint information being smaller than a first set threshold, is configured to determine that the first to-be-processed area image and the first reference area image have a similarity therebetween.
In some optional implementations of the present embodiment, the similarity information calculating unit 502 may include: an area image dividing subunit (not shown in the figure) and a similarity information determining subunit (not shown in the figure). The area image dividing unit is configured to acquire a second to-be-processed area image of at least one second designated position of the first to-be-processed area image according to a second set size in response to similarity between the first to-be-processed area image and a corresponding first reference area image, and acquire a second reference area image of at least one second designated position of the first reference area image according to the second set size, wherein the second to-be-processed area image comprises a number corresponding to the second designated position, the second set size is smaller than the first set size, and the second reference area image comprises a number corresponding to the second designated position; and the similarity information determining subunit is configured to determine the similarity information of the first to-be-processed area image according to the similarity between the second to-be-processed area image and the corresponding second reference area image.
In some optional implementation manners of this embodiment, the similarity information determining subunit may include: a second image fingerprint information acquisition module (not shown in the figure), a second similarity determination module (not shown in the figure) and a second similarity information setting module (not shown in the figure). The second image fingerprint information acquisition module is configured to acquire second to-be-processed image fingerprint information of the second to-be-processed area image and second reference image fingerprint information of the second reference area image respectively; a second similarity determination module, configured to determine that the second to-be-processed area image and the second reference area image have similarity in response to a second hamming distance between the second to-be-processed image fingerprint information and the second reference image fingerprint information being smaller than a second set threshold; the second similarity information setting module is configured to set a ratio between the number of second to-be-processed area images having similarity and the total number of the second to-be-processed area images as the similarity information of the first to-be-processed area image.
In some optional implementations of the present embodiment, the similarity information calculating unit 502 may include: a similar image number acquisition sub-unit (not shown in the figure) and an image similarity information determination sub-unit (not shown in the figure). The similar image quantity obtaining subunit is configured to determine the quantity of the first to-be-processed area images with similarity according to the similarity information of the first to-be-processed area images; the image similarity information determination subunit is configured to set a ratio between the number of the first to-be-processed region images having a similarity and the total number of the first to-be-processed region images as the similarity information between the above-described to-be-processed image and the reference image.
The present embodiment also provides an electronic device, including: one or more processors; a memory having one or more programs stored thereon, which when executed by the one or more processors, cause the one or more processors to perform the above-described method for detecting image similarity.
The present embodiment also provides a computer-readable medium, on which a computer program is stored, which when executed by a processor implements the above-described method for detecting image similarity.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use with an electronic device (e.g., server 105 of FIG. 1) to implement an embodiment of the present disclosure. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 6, electronic device 600 may include a processing means (e.g., central processing unit, graphics processor, etc.) 601 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data necessary for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
Generally, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 illustrates an electronic device 600 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 6 may represent one device or may represent multiple devices as desired.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 609, or may be installed from the storage means 608, or may be installed from the ROM 602. The computer program, when executed by the processing device 601, performs the above-described functions defined in the methods of embodiments of the present disclosure.
It should be noted that the computer readable medium mentioned above in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring an image to be processed and a reference image corresponding to the image to be processed; analyzing the image to be processed and the reference image under different sizes respectively, and calculating the similarity information between the image to be processed and the reference image; and outputting the detection result information of the application to be tested according to the similarity information.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an image acquisition unit, a similarity information calculation unit, and a detection result information output unit. Here, the names of these units do not constitute a limitation to the unit itself in some cases, and for example, the similarity information calculation unit may also be described as a "unit for calculating similarity".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is possible without departing from the inventive concept as defined above. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.

Claims (12)

1. A method for detecting image similarity, comprising:
acquiring an image to be processed and a reference image corresponding to the image to be processed;
analyzing the image to be processed and the reference image under different sizes respectively, and calculating similarity information between the image to be processed and the reference image;
outputting detection result information of the application to be tested according to the similarity information;
wherein the analyzing the image to be processed and the reference image respectively under different sizes, and calculating similarity information between the image to be processed and the reference image comprises:
in response to the similarity between the first to-be-processed area image and the corresponding first reference area image, acquiring a second to-be-processed area image of at least one second designated position of the first to-be-processed area image according to a second set size, and acquiring a second reference area image of at least one second designated position of the first reference area image according to the second set size, wherein the second to-be-processed area image comprises a number corresponding to the second designated position, the second set size is smaller than the first set size, and the second reference area image comprises a number corresponding to the second designated position;
and determining the similarity information of the first to-be-processed area image according to the similarity between the fingerprint information of the second to-be-processed area image and the fingerprint information of the corresponding second reference area image.
2. The method according to claim 1, wherein the analyzing the image to be processed and the reference image at different sizes, respectively, and calculating similarity information between the image to be processed and the reference image comprises:
acquiring a first to-be-processed area image of at least one first designated position of the to-be-processed image according to a first set size, wherein the first to-be-processed area image comprises a number corresponding to the first designated position;
acquiring a first reference area image of at least one first designated position of the reference image according to the first set size, wherein the first reference area image comprises a number corresponding to the first designated position;
and for the first to-be-processed area image and a first reference area image corresponding to the first to-be-processed area image, determining the similarity between the first to-be-processed area image and the first reference area image.
3. The method according to claim 2, wherein the determining the similarity between the first to-be-processed region image and the first reference region image comprises:
respectively acquiring first to-be-processed image fingerprint information of the first to-be-processed area image and first reference image fingerprint information of the first reference area image;
determining that the first to-be-processed area image and the first reference area image have similarity in response to a first hamming distance between the first to-be-processed image fingerprint information and the first reference image fingerprint information being less than a first set threshold.
4. The method according to claim 3, wherein the determining the similarity information of the first to-be-processed region image according to the similarity between the second to-be-processed region image and the corresponding second reference region image comprises:
respectively acquiring second to-be-processed image fingerprint information of the second to-be-processed area image and second reference image fingerprint information of the second reference area image;
determining that the second to-be-processed area image and the second reference area image have similarity in response to a second hamming distance between the second to-be-processed image fingerprint information and second reference image fingerprint information being less than a second set threshold;
setting the ratio of the number of the second to-be-processed area images having the similarity to the total number of the second to-be-processed area images as the similarity information of the first to-be-processed area image.
5. The method according to claim 4, wherein the analyzing the image to be processed and the reference image at different sizes, respectively, and calculating similarity information between the image to be processed and the reference image comprises:
determining the number of first to-be-processed area images with similarity according to the similarity information of the first to-be-processed area images;
setting the ratio of the number of the first to-be-processed area images with similarity to the total number of the first to-be-processed area images as similarity information between the to-be-processed image and the reference image.
6. An apparatus for detecting image similarity, comprising:
an image acquisition unit configured to acquire an image to be processed and a reference image corresponding to the image to be processed;
a similarity information calculation unit configured to analyze the image to be processed and the reference image respectively at different sizes and calculate similarity information between the image to be processed and the reference image;
a detection result information output unit configured to output detection result information of an application to be tested according to the similarity information;
wherein the similarity information calculation unit includes:
the area image dividing subunit is configured to, in response to similarity between a first to-be-processed area image and a corresponding first reference area image, acquire a second to-be-processed area image of at least one second designated position of the first to-be-processed area image according to a second set size, and acquire a second reference area image of at least one second designated position of the first reference area image according to the second set size, wherein the second to-be-processed area image comprises a number corresponding to the second designated position, the second set size is smaller than the first set size, and the second reference area image comprises a number corresponding to the second designated position;
and the similarity information determining subunit is configured to determine the similarity information of the first to-be-processed area image according to the similarity between the fingerprint information of the second to-be-processed area image and the fingerprint information of the corresponding second reference area image.
7. The apparatus according to claim 6, wherein the similarity information calculating unit includes:
the image dividing unit of the area to be processed is configured to obtain a first image of the area to be processed of at least one first designated position of the image to be processed according to a first set size, wherein the first image of the area to be processed comprises a number corresponding to the first designated position;
a reference area image dividing unit configured to acquire a first reference area image of at least one first designated position of the reference image according to the first set size, wherein the first reference area image includes a number corresponding to the first designated position;
a similarity determination subunit configured to determine, for the first to-be-processed region image and a first reference region image corresponding to the first to-be-processed region image, a similarity between the first to-be-processed region image and the first reference region image.
8. The apparatus of claim 7, wherein the similarity determination subunit comprises:
a first image fingerprint information acquiring module configured to acquire first to-be-processed image fingerprint information of the first to-be-processed area image and first reference image fingerprint information of the first reference area image, respectively;
a first similarity determination module, responsive to a first hamming distance between the first to-be-processed image fingerprint information and the first reference image fingerprint information being less than a first set threshold, configured to determine that there is similarity between the first to-be-processed area image and the first reference area image.
9. The apparatus of claim 8, wherein the similarity information determining subunit comprises:
the second image fingerprint information acquisition module is configured to acquire second to-be-processed image fingerprint information of the second to-be-processed area image and second reference image fingerprint information of the second reference area image respectively;
a second similarity determination module, configured to determine that there is similarity between the second to-be-processed area image and a second reference area image in response to a second hamming distance between the second to-be-processed image fingerprint information and second reference image fingerprint information being less than a second set threshold;
and the second similarity information setting module is configured to set the ratio of the number of the second to-be-processed area images with similarity to the total number of the second to-be-processed area images as the similarity information of the first to-be-processed area image.
10. The apparatus according to claim 9, wherein the similarity information calculating unit includes:
a similar image quantity acquiring subunit configured to determine the quantity of the first to-be-processed area images having similarity according to the similarity information of the first to-be-processed area images;
an image similarity information determination subunit configured to set a ratio between the number of first to-be-processed region images having a similarity and the total number of first to-be-processed region images as similarity information between the to-be-processed image and a reference image.
11. An electronic device, comprising:
one or more processors;
a memory having one or more programs stored thereon,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-5.
12. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 5.
CN201910327769.7A 2019-04-23 2019-04-23 Method and device for detecting image similarity Active CN110084298B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910327769.7A CN110084298B (en) 2019-04-23 2019-04-23 Method and device for detecting image similarity

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910327769.7A CN110084298B (en) 2019-04-23 2019-04-23 Method and device for detecting image similarity

Publications (2)

Publication Number Publication Date
CN110084298A CN110084298A (en) 2019-08-02
CN110084298B true CN110084298B (en) 2021-09-28

Family

ID=67416252

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910327769.7A Active CN110084298B (en) 2019-04-23 2019-04-23 Method and device for detecting image similarity

Country Status (1)

Country Link
CN (1) CN110084298B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111325712B (en) * 2020-01-20 2024-01-23 北京百度网讯科技有限公司 Method and device for detecting image validity
CN113554050A (en) * 2020-04-26 2021-10-26 阿里巴巴集团控股有限公司 Image information analysis method and device, electronic equipment and computer storage medium
CN113313125B (en) * 2021-06-15 2024-09-27 北京百度网讯科技有限公司 Image processing method and device, electronic equipment and computer readable medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103699691A (en) * 2014-01-10 2014-04-02 五八同城信息技术有限公司 Method for generating image fingerprint and method for searching similar image based on same
CN105069426A (en) * 2015-07-31 2015-11-18 小米科技有限责任公司 Similar picture determining method and apparatus
CN106126572A (en) * 2016-06-17 2016-11-16 中国科学院自动化研究所 Image search method based on area validation
CN107480704A (en) * 2017-07-24 2017-12-15 南开大学 It is a kind of that there is the real-time vision method for tracking target for blocking perception mechanism
CN107729820A (en) * 2017-09-27 2018-02-23 五邑大学 A kind of finger vein identification method based on multiple dimensioned HOG

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013108554A1 (en) * 2012-01-17 2013-07-25 コニカミノルタ株式会社 Image processing apparatus, image processing method, and image processing program
CN103324650A (en) * 2012-10-23 2013-09-25 深圳市宜搜科技发展有限公司 Image retrieval method and system
CN104349021A (en) * 2013-07-24 2015-02-11 腾讯科技(深圳)有限公司 Image acquisition method, device and terminal
EP2924648A1 (en) * 2014-03-26 2015-09-30 Thomson Licensing Method and an apparatus for generating an Approximate Nearest Neighbor Field (ANNF) for images and video sequences
US9558427B2 (en) * 2014-06-20 2017-01-31 Varian Medical Systems International Ag Shape similarity measure for body tissue
CN106203461B (en) * 2015-05-07 2020-02-25 中国移动通信集团公司 Image processing method and device
CN105025392B (en) * 2015-06-25 2017-12-19 西北工业大学 Key frame for video summary extracting method based on digest space feature learning
CN105550381B (en) * 2016-03-17 2019-04-05 北京工业大学 A kind of efficient image search method based on improvement SIFT feature
CN107622193B (en) * 2016-05-27 2019-12-06 Oppo广东移动通信有限公司 fingerprint unlocking method and related product
CN107067389B (en) * 2017-01-05 2019-09-17 佛山科学技术学院 A kind of blind evidence collecting method of distorted image
CN108876756B (en) * 2017-05-09 2020-08-28 普天信息技术有限公司 Image similarity measurement method and device
CN107705286A (en) * 2017-08-23 2018-02-16 南京航空航天大学 A kind of color image quality integrated evaluating method
CN107632773A (en) * 2017-10-17 2018-01-26 北京百度网讯科技有限公司 For obtaining the method and device of information
CN108845998B (en) * 2018-04-03 2022-04-29 南昌奇眸科技有限公司 Trademark image retrieval and matching method
CN108694411B (en) * 2018-04-03 2022-02-25 南昌奇眸科技有限公司 Method for identifying similar images
CN109325518B (en) * 2018-08-20 2021-03-30 Oppo广东移动通信有限公司 Image classification method and device, electronic equipment and computer-readable storage medium
CN109376277B (en) * 2018-11-23 2020-11-20 京东数字科技控股有限公司 Method and device for determining equipment fingerprint homology

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103699691A (en) * 2014-01-10 2014-04-02 五八同城信息技术有限公司 Method for generating image fingerprint and method for searching similar image based on same
CN105069426A (en) * 2015-07-31 2015-11-18 小米科技有限责任公司 Similar picture determining method and apparatus
CN106126572A (en) * 2016-06-17 2016-11-16 中国科学院自动化研究所 Image search method based on area validation
CN107480704A (en) * 2017-07-24 2017-12-15 南开大学 It is a kind of that there is the real-time vision method for tracking target for blocking perception mechanism
CN107729820A (en) * 2017-09-27 2018-02-23 五邑大学 A kind of finger vein identification method based on multiple dimensioned HOG

Also Published As

Publication number Publication date
CN110084298A (en) 2019-08-02

Similar Documents

Publication Publication Date Title
CN110084298B (en) Method and device for detecting image similarity
CN109684188B (en) Test method and device
CN111402220B (en) Method and device for acquiring information
US20210264198A1 (en) Positioning method and apparatus
CN110908922A (en) Application program testing method and device
US11474856B2 (en) Method and apparatus for generating information
CN112464039B (en) Tree-structured data display method and device, electronic equipment and medium
CN112954056B (en) Method and device for processing monitoring data, electronic equipment and storage medium
CN112084114B (en) Method and apparatus for testing interfaces
CN109144864B (en) Method and device for testing window
CN116662193A (en) Page testing method and device
CN113626301B (en) Method and device for generating test script
CN112379967B (en) Simulator detection method, device, equipment and medium
CN113407229B (en) Method and device for generating offline scripts
CN111488928B (en) Method and device for acquiring samples
CN109960659B (en) Method and device for detecting application program
CN113849416A (en) Test method, test device, storage medium and electronic equipment
CN113034580A (en) Image information detection method and device and electronic equipment
CN113835996A (en) Method and device for generating test script
CN110020906B (en) Order information detection method and device
CN111625692A (en) Feature extraction method, device, electronic equipment and computer readable medium
CN111310858A (en) Method and apparatus for generating information
CN111125015A (en) Method, apparatus, terminal and medium for dump file classification
CN110619537A (en) Method and apparatus for generating information
CN112328341B (en) Model display method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant