Method, device, electronic equipment and storage medium for image processing

By acquiring a set of image regions and adjusting the position and angle of these regions to generate new images, and then calculating similarity to determine image similarity, this approach solves the problem of low accuracy in image similarity comparison in existing technologies and achieves higher accuracy.

CN117253058BActive Publication Date: 2026-04-14CHINA CONSTRUCTION BANK +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-20
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

In existing technologies, image similarity comparison mainly relies on threshold determination, which makes it easy to misjudge images with small quantization differences, resulting in low accuracy.

Method used

By acquiring a set of image regions, adjusting the corresponding positions and angles of the image regions, generating new images, calculating similarity, and selecting the minimum similarity to determine the processing result.

Benefits of technology

It improves the accuracy of image similarity comparison, especially for images with small quantization differences, and can more accurately determine similarity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117253058B_ABST
    Figure CN117253058B_ABST
Patent Text Reader

Abstract

The application discloses an image processing method and device, electronic equipment and storage medium, and relates to the technical field of computers. A specific embodiment of the method comprises: acquiring a corresponding first image and a second image, and determining an image region set according to a pixel value of the first image; combining image regions in the image region set two by two to obtain a region combination; for each region combination, intercepting a corresponding first region and a second region from the first image, and intercepting a third region and a fourth region from the second image; generating a third image according to the adjusted first region and the second region, generating a fourth image according to the adjusted third region and the fourth region, and calculating the similarity of the third image and the fourth image; and determining a processing result based on the similarity. The embodiment can solve the problem that the similarity is determined only according to a threshold, misjudgment is prone to occur, and the accuracy of image similarity comparison is low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and more particularly to an image processing method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the rapid development of multimedia network technology, many platforms offer the function of uploading images into cyberspace via terminals. In some scenarios, to determine whether an uploaded image is duplicated or already exists, it is usually necessary to perform a fast and accurate similarity comparison of multiple images. In existing technologies, image similarity comparison usually involves quantifying the differences between images and then using a threshold to determine similarity. However, this method only relies on the threshold for judgment, and for images with small quantized differences, it is easy to make false judgments, resulting in low accuracy of image similarity comparison. Summary of the Invention

[0003] In view of this, embodiments of the present invention provide an image processing method, apparatus, electronic device, and storage medium that can solve the problem that judging similarity solely based on thresholds is prone to misjudgment, resulting in low accuracy of image similarity comparison.

[0004] To achieve the above objectives, according to one aspect of the present invention, an image processing method is provided.

[0005] An image processing method according to an embodiment of the present invention includes: in response to an image processing instruction, acquiring a corresponding first image and a second image, and determining an image region set based on the pixel values ​​of the first image and / or the second image, wherein the image region set includes at least two image regions;

[0006] The image regions in the image region set are combined in pairs to obtain region combinations;

[0007] For each region combination, the corresponding first region and second region are extracted from the first image, and the third region corresponding to the first region and the fourth region corresponding to the second region are extracted from the second image; the first region and the third region are adjusted, as are the second region and the fourth region; a third image is generated based on the adjusted first region and the second region, and a fourth image is generated based on the adjusted third region and the fourth region; and the similarity between the third image and the fourth image is calculated.

[0008] The processing results of the first image and the second image are determined based on the similarity.

[0009] In one embodiment, generating a third image based on the adjusted first and second regions, and generating a fourth image based on the adjusted third and fourth regions, includes:

[0010] Obtain the relative positions of the first region and the second region in the first image;

[0011] A third image is generated based on the adjusted first region, the second region, and the relative position; a fourth image is generated based on the adjusted third region, the fourth region, and the relative position.

[0012] In yet another embodiment, adjusting the first region and the third region, and adjusting the second region and the fourth region, generating a third image based on the adjusted first and second regions, and generating a fourth image based on the adjusted third and fourth regions, includes:

[0013] The first region and the third region are rotated based on a first rotation method, and the second region and the fourth region are rotated based on a second rotation method;

[0014] A third image is generated based on the rotated first region and the rotated second region, and a fourth image is generated based on the rotated third region and the rotated fourth region.

[0015] In yet another embodiment, rotating the first region and the third region based on a first rotation method, and rotating the second region and the fourth region based on a second rotation method, includes:

[0016] Rotate the first region and the third region by a preset angle while maintaining the current state of the second region and the fourth region.

[0017] In yet another embodiment, determining the processing result of the first image and the second image based on the similarity includes:

[0018] The similarity scores corresponding to each region combination are sorted, and the target similarity score with the smallest value is selected to determine the processing results of the first image and the second image based on the target similarity score.

[0019] In yet another embodiment, determining an image region set based on the pixel values ​​of the first image and / or the second image includes:

[0020] Based on a preset segmentation strategy, the first image and / or the second image are segmented to obtain multiple grid regions;

[0021] Calculate the difference in pixel values ​​in each of the grid regions to determine the set of image regions.

[0022] In yet another embodiment, prior to the response to the image processing instruction, the method further includes:

[0023] A preset calculation model is invoked to calculate the initial similarity between the first image and the second image;

[0024] In response to the initial similarity falling within a preset range, image processing instructions corresponding to the first image and the second image are triggered.

[0025] To achieve the above objectives, according to another aspect of the present invention, an image processing apparatus is provided.

[0026] An image processing apparatus according to an embodiment of the present invention includes: a determining unit, configured to, in response to an image processing instruction, acquire a corresponding first image and a second image, and determine an image region set based on the pixel values ​​of the first image and / or the second image, wherein the image region set includes at least two image regions;

[0027] A combination unit is used to combine image regions in the image region set in pairs to obtain region combinations;

[0028] The calculation unit is configured to combine each region, extract the corresponding first region and second region from the first image, extract the third region corresponding to the first region and the fourth region corresponding to the second region from the second image; adjust the first region and the third region, and adjust the second region and the fourth region; generate a third image based on the adjusted first region and the second region, generate a fourth image based on the adjusted third region and the fourth region, and calculate the similarity between the third image and the fourth image.

[0029] The determining unit is further configured to determine the processing result of the first image and the second image based on the similarity.

[0030] In one embodiment, the computing unit is specifically used for:

[0031] Obtain the relative positions of the first region and the second region in the first image;

[0032] A third image is generated based on the adjusted first region, the second region, and the relative position; a fourth image is generated based on the adjusted third region, the fourth region, and the relative position.

[0033] In yet another embodiment, the computing unit is specifically used for:

[0034] The first region and the third region are rotated based on a first rotation method, and the second region and the fourth region are rotated based on a second rotation method;

[0035] A third image is generated based on the rotated first region and the rotated second region, and a fourth image is generated based on the rotated third region and the rotated fourth region.

[0036] In another embodiment, the calculation unit is specifically used to rotate the first region and the third region by a preset angle while maintaining the current state of the second region and the fourth region.

[0037] In yet another embodiment, the determining unit is specifically used for:

[0038] The similarity scores corresponding to each region combination are sorted, and the target similarity score with the smallest value is selected to determine the processing results of the first image and the second image based on the target similarity score.

[0039] In yet another embodiment, the determining unit is specifically used for:

[0040] Based on a preset segmentation strategy, the first image and / or the second image are segmented to obtain multiple grid regions;

[0041] Calculate the difference in pixel values ​​in each of the grid regions to determine the set of image regions.

[0042] In another embodiment, the computing unit is specifically used to invoke a preset computing model to calculate the initial similarity between the first image and the second image;

[0043] The device includes:

[0044] A triggering unit is used to trigger image processing instructions corresponding to the first image and the second image in response to the initial similarity belonging to a preset range.

[0045] To achieve the above objectives, according to another aspect of the present invention, an electronic device is provided.

[0046] An electronic device according to an embodiment of the present invention includes: one or more processors; and a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the image processing method provided in the embodiment of the present invention.

[0047] To achieve the above objectives, according to another aspect of the present invention, a computer-readable medium is provided.

[0048] An embodiment of the present invention provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the image processing method provided in the embodiment of the present invention.

[0049] To achieve the above objectives, according to another aspect of the present invention, a computer program product is provided.

[0050] A computer program product according to an embodiment of the present invention includes a computer program that, when executed by a processor, implements the image processing method provided in an embodiment of the present invention.

[0051] One embodiment of the above invention has the following advantages or beneficial effects: In this embodiment, for the first image and the second image, a set of image regions in the image can be determined first, i.e., regions that have a greater impact on similarity. Then, each region in the set of image regions can be combined pairwise to calculate the similarity separately. For each region combination, the corresponding region can be extracted from the first image and the second image respectively, and the extracted region can be adjusted to generate a new image again using the adjusted region to calculate the similarity, thereby determining the processing results of the first image and the second image. Thus, in this embodiment of the invention, for two images, regions that have a greater impact on similarity in the images can be selected first, and then the similarity can be calculated separately by combining these regions pairwise, thereby determining the overall similarity of the images. For images with small quantitative differences, the similarity can be judged more accurately, improving the accuracy of image similarity comparison.

[0052] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0053] The accompanying drawings are provided to better understand the invention and are not intended to unduly limit the scope of the invention. Wherein:

[0054] Figure 1 This is a schematic diagram of a main flow of an image processing method according to an embodiment of the present invention;

[0055] Figure 2 This is a schematic diagram of another main flow of an image processing method according to an embodiment of the present invention;

[0056] Figure 3 This is a schematic diagram of another main flow of an image processing method according to an embodiment of the present invention;

[0057] Figure 4 This is a schematic diagram of the main units of an image processing apparatus according to an embodiment of the present invention;

[0058] Figure 5 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;

[0059] Figure 6 This is a schematic diagram of the structure of a computer system suitable for implementing embodiments of the present invention. Detailed Implementation

[0060] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0061] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The acquisition, storage, use, and processing of data in the technical solutions of this application all comply with the relevant provisions of national laws and regulations.

[0062] This invention provides an image processing system that can be used in scenarios involving processing the similarity between images, specifically determining the similarity between images.

[0063] This invention provides an image processing method, which can be executed by an image processing system, such as... Figure 1 As shown, the method includes:

[0064] S101: In response to the image processing instruction, acquire the corresponding first image and second image, and determine an image region set based on the pixel values ​​of the first image and / or the second image, wherein the image region set includes at least two image regions.

[0065] The image processing instruction refers to the instruction for processing the similarity of images. It can include information about the image to be processed, thereby obtaining the corresponding first image and second image. The first image and second image represent the images that need to be processed for similarity.

[0066] Since regions with significantly different pixel values ​​in an image typically have a greater impact on similarity, this step can determine the image region set based on the pixel values ​​of the first and / or second images. To more accurately determine similarity, the image region set includes at least two image regions. The image region set can include information about each image region, specifically its location and size.

[0067] Specifically, when determining the similarity of images, one image is usually used as the reference image and the other as the comparison image. Then, the set of image regions is determined from the comparison image. Taking the first image as the comparison image as an example, the pixel value of each pixel in the first image can be calculated, and then the difference in pixel value between adjacent pixels corresponding to each speed limit point can be calculated. The region with the larger difference is determined as the image region.

[0068] In one embodiment, this step involves dividing the first image into multiple corresponding grid regions based on a preset partitioning strategy. The difference in pixel values ​​within each grid region is then calculated to determine an image region set. The preset partitioning strategy can be set based on requirements; for example, it can be set to M rows and N columns, thus dividing the first image into an M row and N column grid, where M and N are integers greater than 0. This step can calculate the average, maximum, or minimum difference in pixel values ​​within each grid to determine if it exceeds a preset difference threshold. If it does, the region is identified as an image region and added to the image region set; otherwise, it is not identified as an image region.

[0069] It should be noted that the above method for determining the set of image regions for the first image can also be performed on the second image, or on both the first and second images simultaneously, to obtain the desired set of image regions.

[0070] In one implementation, to improve the accuracy of image similarity processing, an initial similarity between the first image and the second image can be calculated using a preset calculation model. If the initial similarity is greater than a preset maximum threshold, it indicates that the first image and the second image are highly similar and can be directly determined to be similar; if the initial similarity is less than a minimum threshold, it indicates that the first image and the second image are less similar and can be directly determined to be dissimilar. However, when the similarity is between the preset minimum threshold and the preset maximum threshold, it is impossible to accurately determine whether the first image and the second image are similar. In this case, the image processing instructions corresponding to the first image and the second image can be triggered to execute this step, thereby processing the similarity according to the embodiments of the present invention. The preset minimum threshold can be 0.9, and the preset maximum threshold can be 0.95.

[0071] Specifically, the preset calculation model can be any model for calculating image similarity. For example, the calculation model could scale the first and second images to 9*8 size, convert them to grayscale, calculate the difference between adjacent pixels in each row, and then calculate the corresponding Hamming distance after hashing to determine the similarity between the first and second images.

[0072] S102: Combine the image regions in the image region set in pairs to obtain region combinations.

[0073] In this process, each image region in the image region set is combined in pairs, and each combination is determined as a region combination. The similarity of each region combination is calculated separately, thereby determining the similarity between the first image and the second image.

[0074] S103: For each region combination, extract the corresponding first region and second region from the first image, and extract the third region corresponding to the first region and the fourth region corresponding to the second region from the second image; adjust the first region and the third region, and adjust the second region and the fourth region; generate a third image based on the adjusted first region and the second region, generate a fourth image based on the adjusted third region and the fourth region, and calculate the similarity between the third image and the fourth image.

[0075] In this context, any combination of regions includes two image regions. The corresponding regions can be determined from the first image and the second image, respectively. Therefore, the corresponding first region and second region can be cropped from the first image, and the third region corresponding to the first region and the fourth region corresponding to the second region can be cropped from the second image. The first region and the third region have the same position and size in the image, and the second region and the fourth region have the same position and size in the image.

[0076] In this embodiment of the invention, adjustment rules can be preset to adjust the first region and the second region, as well as the third region and the fourth region. The adjustment methods for the first region and the third region are the same, and the adjustment methods for the second region and the fourth region are the same.

[0077] After the adjustment is completed, a third image can be generated based on the adjusted first and second regions, and a fourth image can be generated based on the adjusted third and fourth regions. In other words, new images are generated through adjustment, and then the similarity between the new images is calculated.

[0078] To ensure accurate calculation results, this step can record the relative positions of the first and second regions in the first image when cropping the region. Then, a third image is generated based on the adjusted first and second regions and their relative positions, and a fourth image is generated based on the adjusted third and fourth regions and their relative positions, so that the generated new image is closer to the original image.

[0079] It should be noted that since the relative positions of the first and second regions in the first image are the same as the relative positions of the third and fourth regions in the second image, this step can also record the relative positions of the third and fourth regions in the second image to generate a new image.

[0080] In one implementation, the preset adjustment rule can be specifically a rotation rule, which can include a first rotation method and a second rotation method. The first rotation method is used to rotate the first region and the third region, and the second rotation method is used to rotate the second region and the fourth region.

[0081] Specifically, the first rotation method can be rotating by a preset angle, and the second rotation method can be not rotating. Therefore, in this step, the first and third regions can be rotated by a preset angle while maintaining the current state of the second and fourth regions. The preset rotation angle can be less than 15 degrees to avoid the newly generated graphic being too different from the original image, thus reducing the accuracy of similarity processing.

[0082] It should be noted that the calculation of the third and fourth images in this step can use a preset calculation model. In this embodiment of the invention, by performing this step on each pair of region combinations, the similarity can be calculated, that is, the similarity corresponding to each region combination can be determined, and thus the processing result can be determined.

[0083] S104: Determine the processing results of the first and second images based on similarity.

[0084] In step S103, after calculating the similarity corresponding to each region combination, the similarity corresponding to each region combination can be sorted to select the target similarity with the smallest value. Then, the processing result of the first image and the second image is determined based on the target similarity. Specifically, the target similarity can be compared with a preset similarity threshold. If the target similarity is greater than the preset similarity threshold, the first image and the second image are determined to be similar, i.e., the processing result is that the first image and the second image are similar; if the target similarity is not greater than the preset similarity threshold, the first image and the second image are determined to be dissimilar, i.e., the processing result is that the first image and the second image are dissimilar.

[0085] In this embodiment of the invention, for two images, regions that have a greater impact on similarity can be selected first, and then the similarity can be calculated separately by combining these regions in pairs, thereby determining the overall similarity of the images. For images with small quantitative differences, the similarity can be judged more accurately, improving the accuracy of image similarity comparison.

[0086] The following is combined Figure 1 The illustrated embodiments provide a detailed description of the data processing methods in the embodiments of the present invention, such as... Figure 2 As shown, the method includes:

[0087] S201: Obtain the first image and the second image, and call the preset calculation model to calculate the initial similarity between the first image and the second image.

[0088] S202: In response to the initial similarity falling within a preset range, trigger the image processing instructions corresponding to the first and second images.

[0089] S203: In response to the image processing instruction, acquire the corresponding first image and second image, and determine the image region set based on the pixel values ​​of the first image.

[0090] The image region set includes at least two image regions.

[0091] S204: Combine the image regions in the image region set in pairs to obtain region combinations.

[0092] S205: For each region combination, extract the corresponding first region and second region from the first image, and extract the third region corresponding to the first region and the fourth region corresponding to the second region from the second image; adjust the first region and the third region, and adjust the second region and the fourth region; generate a third image based on the adjusted first region and the second region, generate a fourth image based on the adjusted third region and the fourth region, and calculate the similarity between the third image and the fourth image.

[0093] S206: Sort the similarity scores corresponding to each region combination, filter out the target similarity scores with the smallest scores, and determine the processing results of the first and second images based on the target similarity scores.

[0094] It should be noted that the data processing principle in the embodiments of the present invention is the same as... Figure 1 The data processing principles in the illustrated embodiments are the same and will not be repeated here.

[0095] The following is combined Figure 1 The illustrated embodiment provides a detailed description of the data processing method in step S103 of this invention. Figure 3 As shown, the method includes:

[0096] S301: Extract the corresponding first region and second region from the first image, and extract the third region corresponding to the first region and the fourth region corresponding to the second region from the second image.

[0097] S302: Record the relative positions of the first region and the second region in the first image.

[0098] S303: Rotate the first and third regions by a preset angle while maintaining the current state of the second and fourth regions.

[0099] S304: Generate a third image based on the rotated first region, the rotated second region, and their relative positions; generate a fourth image based on the rotated third region, the rotated fourth region, and their relative positions.

[0100] S305: Call the preset calculation model to calculate the similarity between the third and fourth images.

[0101] It should be noted that the data processing principle in the embodiments of the present invention is the same as... Figure 1 The data processing principles in the illustrated embodiments are the same and will not be repeated here.

[0102] To address the problems existing in the prior art, embodiments of the present invention provide an image processing apparatus 400, such as... Figure 4 As shown, the device 400 includes:

[0103] The determining unit 401 is configured to, in response to an image processing instruction, acquire a corresponding first image and a second image, and determine an image region set based on the pixel values ​​of the first image and / or the second image, wherein the image region set includes at least two image regions;

[0104] Combination unit 402 is used to combine image regions in the image region set in pairs to obtain region combinations;

[0105] The calculation unit 403 is configured to combine each region, extract the corresponding first region and second region from the first image, extract the third region corresponding to the first region and the fourth region corresponding to the second region from the second image; adjust the first region and the third region, and adjust the second region and the fourth region; generate a third image based on the adjusted first region and the second region, generate a fourth image based on the adjusted third region and the fourth region, and calculate the similarity between the third image and the fourth image.

[0106] The determining unit 401 is further configured to determine the processing result of the first image and the second image based on the similarity.

[0107] It should be understood that the manner in which embodiments of the present invention are implemented is different from the implementation method. Figure 1 The embodiments shown are the same and will not be described again here.

[0108] In one embodiment, the computing unit 403 is specifically used for:

[0109] Obtain the relative positions of the first region and the second region in the first image;

[0110] A third image is generated based on the adjusted first region, the second region, and the relative position; a fourth image is generated based on the adjusted third region, the fourth region, and the relative position.

[0111] In yet another embodiment, the computing unit 403 is specifically used for:

[0112] The first region and the third region are rotated based on a first rotation method, and the second region and the fourth region are rotated based on a second rotation method;

[0113] A third image is generated based on the rotated first region and the rotated second region, and a fourth image is generated based on the rotated third region and the rotated fourth region.

[0114] In another embodiment, the calculation unit 403 is specifically used to rotate the first region and the third region by a preset angle to maintain the current state of the second region and the fourth region.

[0115] In yet another embodiment, the determining unit 401 is specifically used for:

[0116] The similarity scores corresponding to each region combination are sorted, and the target similarity score with the smallest value is selected to determine the processing results of the first image and the second image based on the target similarity score.

[0117] In yet another embodiment, the determining unit 401 is specifically used for:

[0118] Based on a preset segmentation strategy, the first image and / or the second image are segmented to obtain multiple grid regions;

[0119] Calculate the difference in pixel values ​​in each of the grid regions to determine the set of image regions.

[0120] In another embodiment, the calculation unit 403 is specifically used to invoke a preset calculation model to calculate the initial similarity between the first image and the second image;

[0121] The device 400 includes:

[0122] A triggering unit is used to trigger image processing instructions corresponding to the first image and the second image in response to the initial similarity belonging to a preset range.

[0123] It should be understood that the manner in which embodiments of the present invention are implemented is different from the implementation method. Figure 1 , 2 The same method is used in the embodiments shown in 1 and 3, and will not be described again here.

[0124] In this embodiment of the invention, for two images, regions that have a greater impact on similarity can be selected first, and then the similarity can be calculated separately by combining these regions in pairs, thereby determining the overall similarity of the images. For images with small quantitative differences, the similarity can be judged more accurately, improving the accuracy of image similarity comparison.

[0125] According to embodiments of the present invention, an electronic device and a readable storage medium are also provided.

[0126] An electronic device according to an embodiment of the present invention includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to cause the at least one processor to perform the image processing method provided in the embodiment of the present invention.

[0127] Figure 5 An exemplary system architecture 500 is shown for an image processing method or an image processing apparatus to which embodiments of the present invention can be applied.

[0128] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, and 503, a network 504, and a server 505. Network 504 serves as the medium for providing communication links between terminal devices 501, 502, and 503 and server 505. Network 504 may include various connection types, such as wired or wireless communication links, or fiber optic cables, etc.

[0129] Users can use terminal devices 501, 502, and 503 to interact with server 505 via network 504 to receive or send messages, etc. Various client applications can be installed on terminal devices 501, 502, and 503.

[0130] Terminal devices 501, 502, and 503 can be, but are not limited to, smartphones, tablets, laptops, and desktop computers, etc.

[0131] Server 505 can be a server that provides various services. The server can analyze and process data such as received product information query requests, and feed back the processing results (such as product information - just an example) to the terminal device.

[0132] It should be noted that the image processing method provided in the embodiments of the present invention is generally executed by server 505, and correspondingly, the image processing device is generally disposed in server 505.

[0133] It should be understood that Figure 5 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0134] The following is for reference. Figure 6 It shows a schematic diagram of the structure of a computer system 600 suitable for implementing embodiments of the present invention. Figure 6 The computer system shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0135] like Figure 6As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 602 or programs loaded from storage section 608 into random access memory (RAM) 603. The RAM 603 also stores various programs and data required for the operation of the system 600. The CPU 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0136] The following components are connected to I / O interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to I / O interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 610 as needed so that computer programs read from it can be installed into storage section 608 as needed.

[0137] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 609, and / or installed from removable medium 611. When the computer program is executed by central processing unit (CPU) 601, it performs the functions defined above in the system of this invention.

[0138] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0139] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a unit, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0140] The units described in the embodiments of the present invention can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor can be described as including a receiving unit, a determining unit, and a processing unit. The names of these units do not necessarily limit the specific unit; for example, a receiving unit can also be described as a "unit with receiving functions."

[0141] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs that, when executed by the device, cause the device to perform the image processing method provided by the present invention.

[0142] In another aspect, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the image processing method provided in the embodiments of the present invention.

[0143] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. An image processing method, characterized in that, include: In response to an image processing instruction, a corresponding first image and a second image are acquired, and an image region set is determined based on the pixel values ​​of the first image and / or the second image, wherein the image region set includes at least two image regions; The step of determining the image region set based on the pixel values ​​of the first image and / or the second image includes: dividing the first image and / or the second image into multiple grid regions based on a preset partitioning strategy; calculating the average, maximum, or minimum value of the difference between pixel values ​​in each grid to determine whether it is greater than a preset difference threshold; if it is greater, it is determined as an image region and added to the image region set. The image regions in the image region set are combined in pairs to obtain region combinations; For each region combination, a first region and a second region are cropped from the first image, and a third region corresponding to the first region and a fourth region corresponding to the second region are cropped from the second image, wherein the first region and the third region have the same position and size in the image, and the second region and the fourth region have the same position and size in the image. Adjust the first region and the third region, and adjust the second region and the fourth region; generate a third image based on the adjusted first region and the second region, and generate a fourth image based on the adjusted third region and the fourth region. And calculate the similarity between the third image and the fourth image; The processing results of the first image and the second image are determined based on the similarity. The step of adjusting the second region and the fourth region, generating a third image based on the adjusted first region and the second region, and generating a fourth image based on the adjusted third region and the fourth region includes: rotating the first region and the third region based on a first rotation method, rotating the second region and the fourth region based on a second rotation method, generating a third image based on the rotated first region and the rotated second region, and generating a fourth image based on the rotated third region and the rotated fourth region.

2. The method according to claim 1, characterized in that, The step of generating a third image based on the adjusted first and second regions, and generating a fourth image based on the adjusted third and fourth regions, includes: Obtain the relative positions of the first region and the second region in the first image; A third image is generated based on the adjusted first region, the second region, and the relative position; a fourth image is generated based on the adjusted third region, the fourth region, and the relative position.

3. The method according to claim 1, characterized in that, Determining the processing results of the first image and the second image based on the similarity includes: The similarity scores corresponding to each region combination are sorted, and the target similarity score with the smallest value is selected to determine the processing results of the first image and the second image based on the target similarity score.

4. The method according to claim 1, characterized in that, Prior to responding to the image processing instructions, the method further includes: A preset calculation model is invoked to calculate the initial similarity between the first image and the second image; In response to the initial similarity falling within a preset range, image processing instructions corresponding to the first image and the second image are triggered.

5. An image processing apparatus, characterized in that, include: A determining unit is configured to, in response to an image processing instruction, acquire a corresponding first image and a second image, and determine an image region set based on the pixel values ​​of the first image and / or the second image, wherein the image region set includes at least two image regions; A combination unit is used to combine image regions in the image region set in pairs to obtain region combinations; The calculation unit is configured to combine each region, extract a first region and a second region from the first image, extract a third region corresponding to the first region and a fourth region corresponding to the second region from the second image, wherein the first region and the third region have the same position and size in the image, and the second region and the fourth region have the same position and size in the image; adjust the first region and the third region, and adjust the second region and the fourth region, generate a third image based on the adjusted first region and the second region, generate a fourth image based on the adjusted third region and the fourth region, and calculate the similarity between the third image and the fourth image; The determining unit is further configured to determine the processing result of the first image and the second image based on the similarity. The determining unit is further configured to divide the first image and / or the second image based on a preset division strategy to obtain multiple grid regions; calculate the average, maximum or minimum value of the difference between pixel values ​​in each grid to determine whether it is greater than a preset difference threshold; if it is greater, it is determined as an image region and added to the image region set. The computing unit is specifically used to: rotate the first region and the third region based on a first rotation method, rotate the second region and the fourth region based on a second rotation method; generate a third image based on the rotated first region and the rotated second region, and generate a fourth image based on the rotated third region and the rotated fourth region.

6. The apparatus according to claim 5, characterized in that, The computing unit is specifically used for: Obtain the relative positions of the first region and the second region in the first image; A third image is generated based on the adjusted first region, the second region, and the relative position; a fourth image is generated based on the adjusted third region, the fourth region, and the relative position.

7. The apparatus according to claim 5, characterized in that, The determining unit is specifically used for: The similarity scores corresponding to each region combination are sorted, and the target similarity score with the smallest value is selected to determine the processing results of the first image and the second image based on the target similarity score.

8. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-4.

9. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-4.

10. A computer program product, comprising a computer program, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Image processing method and device and electronic equipment

    CN112329889A

  • Facial form comparison method and device, equipment and storage medium

    CN115147885A

  • Image processing method, device and equipment

    CN115705366A