Image detection method and device and electronic equipment

By comparing the similarity of contents on both sides of the image stitching, the detection problem of dislocation problems during image stitching is solved, and the quality of the image after stitching is ensured.

CN119850540APending Publication Date: 2025-04-18GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411907148.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-23
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

The prior art cannot effectively detect misalignment problems during image stitching, resulting in inconsistency and mismatch of images after stitching, affecting image quality and effect.

Method used

By acquiring image contents on one side and the other side of the stitching from the first image, comparing the similarity of these contents, if the similarity conditions are not met, it is determined that there is a stitching misalignment in the first image.

Benefits of technology

Effective detection of misalignment problems during image stitching is realized to ensure the continuity and quality of the image after stitching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119850540A_ABST
    Figure CN119850540A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an image detection method and device and electronic equipment. The method comprises the steps that first content and second content are obtained from a first image, the first image is obtained by splicing a second image and a third image, the first content comprises image content located on one side of the splicing position and adjacent to the splicing position, and the second content comprises image content located on the other side of the splicing position and adjacent to the splicing position; if the first content and the second content do not meet the similar condition, it is determined that splicing dislocation exists in the first image. In this way, whether splicing dislocation occurs or not can be determined by comparing the similarity of the image contents (the first content and the second content) on the two sides of the splicing position in the spliced image, and therefore the dislocation problem occurring in the image splicing process can be effectively detected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and more specifically, to an image detection method, device and electronic device. Background Art

[0002] When multiple images are obtained, the multiple images can be stitched together to obtain a larger image. For example, when an electronic device is taking a long screenshot, the images obtained by multiple screenshots can be stitched together to obtain a new image. However, in the related method, it is still impossible to detect the misalignment problem that occurs during the image stitching process. Summary of the invention

[0003] In view of the above problems, the present application proposes an image detection method, device and electronic device to improve the above problems.

[0004] In a first aspect, the present application provides an image detection method, the method comprising: obtaining a first content and a second content from a first image, the first image being obtained by splicing a second image and a third image, the first content comprising image content located on one side of a splicing point and adjacent to the splicing point, the second content comprising image content located on the other side of the splicing point and adjacent to the splicing point; if the first content and the second content do not meet a similarity condition, it is determined that there is a splicing misalignment in the first image.

[0005] In a second aspect, the present application provides an image detection device, comprising: a content acquisition unit, used to obtain first content and second content from a first image, wherein the first image is obtained by splicing a second image and a third image, the first content includes image content located on one side of the splicing and adjacent to the splicing, and the second content includes image content located on the other side of the splicing and adjacent to the splicing; and a misalignment detection unit, used to determine that there is a splicing misalignment in the first image if the first content and the second content do not meet a similarity condition.

[0006] In a third aspect, the present application provides an electronic device comprising one or more processors and a memory; one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the above-mentioned method.

[0007] In a fourth aspect, the present application provides a computer-readable storage medium storing a program code executable by a processor, wherein the computer-readable storage medium includes the stored program code, wherein the above method is executed when the program code is run.

[0008] The present application provides an image detection method, device and electronic device, in which after the first image is obtained by splicing the second image and the third image, the first content and the second content can be obtained from the first image, wherein the first content includes image content located on one side of the splicing and adjacent to the splicing, and the second content includes image content located on the other side of the splicing and adjacent to the splicing, and then the similarity between the first content and the second content is detected, and if the first content and the second content do not meet the similarity condition, it is determined that there is a splicing misalignment in the first image. Thus, through the above method, it is possible to determine whether there is a splicing misalignment by comparing the similarity of the image content (first content and second content) on both sides of the splicing in the spliced ​​image, thereby achieving effective detection of the misalignment problem that occurs during the image splicing process. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0010] Figure 1 A schematic diagram of a splicing misalignment is shown;

[0011] Figure 2 A schematic diagram showing another type of splicing misalignment is shown;

[0012] Figure 3 A schematic diagram showing an application scenario of the image detection method proposed in an embodiment of the present application;

[0013] Figure 4 A schematic diagram showing another application scenario of the image detection method proposed in an embodiment of the present application;

[0014] Figure 5 A flow chart of an image detection method proposed in an embodiment of the present application is shown;

[0015] Figure 6 A schematic diagram of determining a first content and a second content in an embodiment of the present application is shown;

[0016] Figure 7 A schematic diagram of determining a first content and a second content in an embodiment of the present application is shown;

[0017] Figure 8 A schematic diagram of determining a first content and a second content in an embodiment of the present application is shown;

[0018] Fig. 9A flow chart of an image detection method proposed in an embodiment of the present application is shown;

[0019] Fig.10 A schematic diagram of determining first input data in an embodiment of the present application is shown;

[0020] Fig.11 A schematic diagram of determining second input data in an embodiment of the present application is shown;

[0021] Fig.12 A flowchart of an image detection method proposed in another embodiment of the present application is shown;

[0022] Fig.13 A flowchart of an image detection method proposed in another embodiment of the present application is shown;

[0023] Fig.14 A structural block diagram of an image detection device proposed in an embodiment of the present application is shown;

[0024] Fig.15 A structural block diagram of an electronic device for executing an image detection method according to an embodiment of the present application is shown;

[0025] Fig.16 It is a storage unit of an embodiment of the present application for storing or carrying program codes for implementing the image detection method according to an embodiment of the present application. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0027] After the electronic device obtains multiple images, the multiple images can be stitched together to form an image of a larger size. For example, when the electronic device performs a long screenshot operation, the images obtained by multiple screenshots can be stitched together to generate a new image. However, there is still a shortcoming in the related methods, that is, it is impossible to effectively detect the misalignment problem that may occur in the image stitching process. This misalignment problem may cause the spliced ​​image to be incoherent and mismatched, thereby affecting the quality and effect of the final image. Exemplary, possible splicing misalignment problems may include: floating icon truncation, unloaded image truncation, partial video playback misalignment, all video playback misalignment, sidebar text truncation, and text misalignment splicing and other misalignment problems.

[0028] For example, Figure 1 A splicing misalignment is shown in Figure 1 The sidebar text is cut off in the splicing misalignment shown. Figure 2 As shown, in Figure 2 In the splicing misalignment shown, there is a situation where text is misaligned.

[0029] The inventor further discovered in the study that in a normally spliced ​​image (an image without splicing dislocation), the image content near the splicing point should be continuous and have a high similarity, while in a dislocated spliced ​​image, the image content near the splicing point has a low similarity. Based on this discovery, the inventor proposed an image detection method in the present application, in which after the first image is obtained by splicing the second image and the third image, the first content and the second content can be obtained from the first image, wherein the first content includes image content located on one side of the splicing point and adjacent to the splicing point, and the second content includes image content located on the other side of the splicing point and adjacent to the splicing point. Then, the similarity between the first content and the second content is detected. If the first content and the second content do not meet the similarity condition, it is determined that the first image has a splicing dislocation. Thus, through the above method, it is possible to determine whether a splicing dislocation occurs by comparing the similarity of the image content (the first content and the second content) on both sides of the splicing point in the spliced ​​image, thereby effectively detecting the dislocation problem that occurs during the image splicing process.

[0030] Next, pass Figure 3 , 4 The application scenarios involved in the embodiments of the present application are introduced.

[0031] In the embodiment of the present application, the image detection method provided can be performed by an electronic device. In this way, all steps in the image detection method provided by the embodiment of the present application can be performed by the electronic device. For example, Figure 3 As shown, all steps in the image detection method provided in the embodiment of the present application can be executed by an application for executing long screenshots in the electronic device 100. In the process of executing by the application for executing long screenshots, the application for executing long screenshots can synchronously execute the operation of long screenshots, as well as the image detection method involved in the embodiment of the present application.

[0032] Alternatively, the image detection method provided in the embodiment of the present application may also be executed by a server. Correspondingly, in this mode of execution by the server, the server may start executing the steps in the image detection method provided in the embodiment of the present application in response to a trigger instruction. The trigger instruction may be sent by an electronic device used by the user, or may be triggered locally by the server in response to some automation events.

[0033] In addition, the image detection method provided in the embodiment of the present application can also be executed by the electronic device and the server in collaboration. In this way, some steps of the image detection method provided in the embodiment of the present application are executed by the electronic device, while other steps are executed by the server. For example, Figure 4 As shown, the electronic device 100 can perform the image detection method including: stitching the second image and the third image to obtain the first image. Afterwards, the electronic device 100 transmits the first image to the server 200. After receiving the first image, the server 200 can perform subsequent steps to obtain a detection result of whether there is a stitching misalignment in the first image. After obtaining the detection result, the server 200 can return the detection result to the electronic device 100 so that the electronic device 100 can re-stitch the second image and the third image based on the corrected stitching position.

[0034] It should be noted that in this method of collaborative execution by the electronic device and the server, the steps respectively executed by the electronic device and the server are not limited to the methods introduced in the above examples. In actual applications, the steps respectively executed by the electronic device and the server can be dynamically adjusted according to actual conditions.

[0035] It should be noted that the electronic device 100 is Figure 3 and Figure 4 In addition to the smartphone shown in the figure, it can also be a tablet computer, a folding screen mobile phone and other devices. The server 200 can be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers.

[0036] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0037] See also Figure 5 , the present application provides an image detection method, the method comprising:

[0038] S110: Obtaining first content and second content from a first image, where the first image is obtained by splicing the second image and the third image, the first content includes image content located on one side of the splicing and adjacent to the splicing, and the second content includes image content located on the other side of the splicing and adjacent to the splicing.

[0039] In the embodiment of the present application, the second image and the third image are images for stitching. After the second image and the third image are obtained, the second image and the third image can be stitched to obtain the first image. When the method provided in the embodiment of the present application is applied to different scenes, the meanings of the second image and the third image can be different.

[0040] As a method, the second image and the third image can be images obtained by taking screenshots of the screen. It should be noted that in a long screenshot scenario, the electronic device can take screenshots of multiple screens multiple times, and then stitch the images obtained by the multiple screenshots to obtain a long screenshot image. Then in the long screenshot scenario, the second image and the third image can both be understood as images obtained by taking a screenshot once.

[0041] Optionally, in a long screenshot scenario, the electronic device can stitch the images obtained by screenshot in real time. In this case, the second image can be understood as the image obtained by the current screenshot, and the third image can be understood as the image stitched by stitching the screenshots obtained before the current screenshot (the images obtained by the screenshots).

[0042] As another way, the second image and the third image may be images acquired by a camera. In the process of panoramic shooting of the electronic device, the images acquired by the camera may be spliced ​​to obtain a panoramic image. In this way, the second image and the third image may be understood as images acquired by the camera of the electronic device twice in a row.

[0043] Optionally, during the process of shooting the panoramic image, the electronic device can stitch the images acquired by the camera in real time. In this case, the second image can be understood as the image acquired at the time, and the third image can be understood as the image acquired by stitching the images acquired before the current acquisition.

[0044] After obtaining the first image, the image contents on both sides of the joint can be obtained from the first image for similarity comparison. The joint can be understood as the location where the second image and the third image are joined. The image contents on one side of the joint originally belong to the second image, and the image contents on the other side of the joint originally belong to the third image. The first content can be obtained from one side of the joint, and the second content can be obtained from the other side of the joint for similarity comparison, wherein the first content includes the image contents located on one side of the joint and adjacent to the joint, and the second content includes the image contents located on the other side of the joint and adjacent to the joint.

[0045] Optionally, adjacent to a joint may be understood as content that is in direct contact with the joint.

[0046] In one embodiment, the first content may include pixels located on one side of the joint and in direct contact with the joint, and the second content may include pixels located on the other side of the joint and in direct contact with the joint. Wherein, the first content includes pixels located on one side of the joint and in direct contact with the joint, which can be understood as the first content is composed of pixels located on one side of the joint and in direct contact with the joint. Similarly, the second content includes pixels located on the other side of the joint and in direct contact with the joint, which can be understood as the second content is composed of pixels located on the other side of the joint and in direct contact with the joint. In addition, the first content includes pixels located on one side of the joint and in direct contact with the joint, which can also be understood as a row of pixels located on one side of the joint that is closest to the joint. Correspondingly, the second content includes pixels located on the other side of the joint and in direct contact with the joint, which can be understood as a row of pixels located on the other side of the joint that is closest to the joint.

[0047] It should be noted that when the second image and the third image are spliced, the second image and the third image may be spliced ​​from different directions.

[0048] Optionally, in the case where the second image and the third image are spliced ​​along the first direction of the electronic device, the first content may include a row of pixels located on one side of the splicing and closest to the splicing, and the second content may include a row of pixels located on the other side of the splicing and closest to the splicing. Optionally, in the case where the second image and the third image are spliced ​​along the second direction of the electronic device, the first content may include a column of pixels located on one side of the splicing and closest to the splicing, and the second content may include a column of pixels located on the other side of the splicing and closest to the splicing.

[0049] The first direction of the electronic device can be understood as the vertical direction of the electronic device, which is the direction extending from the top to the bottom of the electronic device, or the vertical direction extending from the bottom to the top of the electronic device. The second direction of the electronic device can be understood as the direction perpendicular to the first direction.

[0050] For example, Figure 6 As shown, in Figure 6The dotted line in the first image shown in the figure represents the joint in the first image. In the content on one side of the joint, the row of pixels closest to the joint includes: pixel P10, pixel P11, pixel P12, pixel P13 and pixel P14, and in the content on the other side of the joint, the row of pixels closest to the joint includes: pixel P20, pixel P21, pixel P22, pixel P23 and pixel P24. In one embodiment, the obtained first content may include pixel P10, pixel P11, pixel P12, pixel P13 and pixel P14, and the obtained second content may include pixel P20, pixel P21, pixel P22, pixel P23 and pixel P24.

[0051] Among them, based on Figure 6 In the example of , the second image and the third image may be the first image obtained by splicing along the first direction. The second image and the third image may be spliced ​​along the second direction as shown in 7. Wherein, Figure 7 The second direction shown is Figure 6 The first direction in the example is a mutually perpendicular direction. Figure 7 In the content shown in , in the content on one side of the splicing, the row of pixels closest to the splicing includes: pixel P10, pixel P11, pixel P12, pixel P13 and pixel P14, and in the content on the other side of the splicing, the row of pixels closest to the splicing includes: pixel P20, pixel P21, pixel P22, pixel P23 and pixel P24. Therefore, the first content obtained can also include pixel P10, pixel P11, pixel P12, pixel P13 and pixel P14, and the second content obtained can include pixel P20, pixel P21, pixel P22, pixel P23 and pixel P24.

[0052] It should be noted that in Figure 6 , 7 In addition to the pixels shown, the first image also includes other pixels that are not shown in Figure 6 , 7 Shown in.

[0053] Optionally, being adjacent to the joint may be understood as being spaced less than the second distance threshold from the joint. It should be noted that for two images, the joint may be a straight line, for example, Figure 7 Therefore, the spacing from the joint can be understood as the vertical distance from the joint.

[0054] Among them, the unit of the second distance threshold is not specifically limited in the embodiment of the present application. Optionally, the second distance threshold can be the number of pixels. For example, in one embodiment, the second distance threshold can be N pixels, where N≥1. For example, in the case of N=1, the first content and the second content are characterized by pixels that are in direct contact with the joint, or are characterized by a row of pixels closest to the joint. For example, in the case of N=2, the first content includes pixels that are located on one side of the joint and in direct contact with the joint, and pixels that are one pixel apart from the joint. The second content includes pixels that are located on the other side of the joint and in direct contact with the joint, and pixels that are one pixel apart from the joint.

[0055] For example, Figure 8 As shown, in the case of N=2, it can be understood that the pixels whose vertical distance from the splicing point is less than 2 are used as pixels in the first content or the second content. Figure 8 In the case shown, the first content may include pixel P10, pixel P11, pixel P12, pixel P13, pixel P14, pixel P15, pixel P16, pixel P17, pixel P18, and pixel P19. Correspondingly, the second content may include pixel P20, pixel P21, pixel P22, pixel P23, pixel P24, pixel P25, pixel P26, pixel P27, pixel P28, and pixel P29. Based on this example, the first content may include: the N rows of pixels closest to the splicing in the content on one side of the splicing, and the second content may include: the N rows of pixels closest to the splicing in the content on the other side of the splicing, where N may be a positive integer greater than 1. For example, N may be 1, 2, etc.

[0056] It should be noted that Figure 8 An example of splicing the second image and the third image along the first direction is shown. For an example of splicing along the second direction, reference can be made to the aforementioned Figure 7 The situation shown.

[0057] S120: If the first content and the second content do not satisfy the similarity condition, determine that there is a splicing misalignment in the first image.

[0058] After obtaining the first content and the second content, a similarity comparison can be performed on the first content and the second content. Among them, the similarity condition is a condition that characterizes the similarity between the first content and the second content. When the first content is similar to the second content (satisfies the similarity condition), it means that when the second image and the third image are spliced, the selection of the splicing position is correct, and then it means that there is no splicing misalignment in the first image. Correspondingly, when the first content and the second content are not similar (does not meet the similarity condition), it means that when the second image and the third image are spliced, the selection of the splicing position is incorrect, and then it means that there is splicing misalignment in the first image.

[0059] In the embodiments of the present application, there are multiple ways to perform similarity comparison.

[0060] As a method, the first content and the second content can be input into a neural network model to obtain content features of the first content and content features of the second content. The content features of the first content can be features in the form of vectors, and the content features of the second content can be features in the form of vectors, that is, the content features of the first content can be understood as feature vectors of the first content. The content features of the second content can be understood as feature vectors of the second content.

[0061] Then, the similarity between the first content and the second content is determined by calculating the characteristic distance between the content features of the first content and the second content. For example, if the characteristic distance between the content features of the first content and the second content is less than the first distance threshold, it is determined that the first content and the second content meet the similarity condition. Correspondingly, if the characteristic distance between the content features of the first content and the second content is greater than or equal to the first distance threshold, it is determined that the similarity condition is not met.

[0062] Optionally, the feature distance between content features may be calculated in a variety of ways. For example, the feature distance between content features may be calculated using Euclidean distance. For another example, the feature distance between content features may also be calculated using cosine distance.

[0063] As one way, the grayscale average value of the first content and the grayscale average value of the second content may be calculated, and then the similarity between the first content and the second content may be measured by comparing the Hamming distance of the hash values ​​of the first content and the second content.

[0064] As a method, the general appearance and quality of an image can be described by counting the number of pixels of different gray levels in the image. Specifically, the grayscale histogram counts all pixels in a digital image according to the size of the grayscale value and expresses it as a function of the number of pixels and the grayscale value, that is, a histogram. In this case, the histogram of the first content and the histogram of the second content can be obtained, and then the overlap between the histogram of the first content and the histogram of the second content is compared, and the overlap is used as the similarity.

[0065] The present embodiment provides an image detection method, which makes it possible to determine whether a splicing misalignment occurs by comparing the similarity of the image contents (first content and second content) on both sides of the splicing point in the spliced ​​image in the above manner, thereby achieving effective detection of the misalignment problem that occurs in the image splicing process.

[0066] See also Fig. 9, the present application provides an image detection method, the method comprising:

[0067] S210: Obtaining first content and second content from a first image, where the first image is obtained by splicing the second image and the third image, the first content includes image content located on one side of the splicing and adjacent to the splicing, and the second content includes image content located on the other side of the splicing and adjacent to the splicing.

[0068] S220: If the first content and the second content do not satisfy a similarity condition, determining that there is a splicing misalignment in the first image, wherein the similarity condition includes: a feature distance between a content feature of the first content and a content feature of the second content is less than a first distance threshold.

[0069] In this embodiment, after obtaining the first content and the second content, the respective content features can be obtained through a neural network, and then the feature distance is calculated through the respective content features. Optionally, the first content can be input into a first neural network to obtain the content features of the first content through the first neural network, and the second content can be input into a second neural network to obtain the content features of the second content through the second neural network. The network structures and network parameters of the first neural network and the second neural network can be the same, so that the first neural network and the second neural network can extract features based on the same method.

[0070] It should be noted that for some neural networks (for example, convolutional neural networks), there are size requirements for the input image in order to reduce the feature loss that occurs during the feature extraction process of the neural network and to extract features more comprehensively. One of the reasons is that when the neural network is designed, its internal convolutional layer, pooling layer and other structures are configured based on fixed size and step size. If the input image size does not meet the requirements, these layers may have size mismatch problems when processing the image, resulting in information loss or processing errors.

[0071] As a method, the first input data can be obtained through pixels in the first content, and the second input data can be obtained through pixels in the second content, wherein the obtained first input data can include all pixels in the first content, and the obtained second input data can include all pixels in the second content.

[0072] Correspondingly, the content features of the first content can be obtained through the first neural network and the first input data, and the content features of the second content can be obtained through the second neural network and the second input data. The first input data matches the input requirements of the first neural network, and the second input data matches the input requirements of the second neural network. The first input data matches the input requirements of the first neural network, which can be understood as the first input data enabling the first neural network to better perform feature extraction, and correspondingly, the second input data matches the input requirements of the second neural network, which can be understood as the second input data enabling the second neural network to better perform feature extraction.

[0073] Optionally, the first input data includes a matrix of a first shape, and the second input data includes a matrix of a second shape, wherein the matrix of the first shape includes all pixels in the first content, and the matrix of the second shape includes all pixels in the second content. The first shape matches the input requirements of the first neural network, and the second shape matches the input requirements of the second neural network. In one embodiment, both the first shape and the second shape are square.

[0074] Among them, obtaining the first input data (for example, a matrix of a first shape) through the pixels in the first content can be understood as rearranging the pixels included in the first content to obtain the first input data. Correspondingly, obtaining the second input data (for example, a matrix of a second shape) through the pixels in the second content can be understood as rearranging the pixels included in the second content to obtain the second input data. Among them, the reason for rearranging the pixels in the first content and the second content is that the original shapes of the first content and the second content do not match the input requirements of the neural network used, which is not conducive to the neural network to perform more comprehensive feature extraction. For example, when the first content and the second content are both a row of pixels closest to the joint, the shapes of the first content and the second content can both be understood as rectangles, and for the neural network, when extracting features from the rectangular input data, feature omissions may occur.

[0075] Optionally, both the first shape and the second shape are squares, a size of the matrix of the first shape is determined by the number of pixels in the first content, and a size of the matrix of the second shape is determined by the number of pixels in the first content.

[0076] In one approach, when the matrix included in the first input data is a square, optionally, the corresponding minimum area square can be first determined based on the number of pixels included in the first content, wherein the area of ​​the first content itself can be used as a reference area, and the determined minimum area square is: a square whose area is not less than the reference area and is closest to the reference area. In other words, the square matrix included in the first input data finally obtained is the minimum area square matrix, and the minimum area square matrix can be correspondingly understood as a matrix whose shape is the minimum area square. Then, when both the first shape and the second shape are squares, the side length of the matrix of the first shape is the side length of the minimum area square determined by the number of pixels in the first content, and the side length of the matrix of the second shape is the side length of the minimum area square determined by the number of pixels in the second content.

[0077] After determining the minimum square matrix, the minimum square matrix may be filled to obtain first input data, wherein the pixels included in the first content may be filled into the minimum square matrix, and the filled pixel minimum square matrix is ​​used as the first input data.

[0078] Optionally, the first input data can be obtained through multiple filling operations. The length value of the side length of the aforementioned minimum area square can be used as a reference value. In each filling operation, a reference value of pixels can be selected from the pixels included in the first content and placed in a row of the minimum area square matrix, wherein the number of rows placed in the next filling operation is the next row of the number of rows placed in the previous filling operation, thereby obtaining the first input data after multiple filling operations. Each time a pixel is selected from the first content, it can be selected from the pixels arranged after the pixels selected in the previous time. If the pixels in the first content cannot completely fill the minimum area square matrix, the pixels of the preset pixel value can be filled in the empty position (i.e., the position of the unfilled pixels), thereby obtaining the first input data. If the number of pixels remaining in the first content that have not been selected is less than the reference value, the remaining pixels that have not been selected can be directly selected for one filling.

[0079] For example, Fig.10As shown, the determined first content can be a row of pixels closest to the splicing point in the content on one side of the splicing point. The pixels in the first content include pixel P30, pixel P31, pixel P32, pixel P33, pixel P34, pixel P35, pixel P36, pixel P37, pixel P38, and pixel P39. Based on the 10 pixels included in the first content, the area of ​​the minimum area square determined is 16, that is, the minimum area square is a 4×4 square. The reference value determined is 4, and then 4 pixels can be selected from the first content each time to fill the minimum area square matrix. For example, the first time, 4 pixels such as P30, pixel P31, pixel P32 and pixel P33 can be selected to fill the first row of the minimum area square matrix. The second time, 4 pixels such as pixel P34, pixel P35, pixel P36 and pixel P37 can be selected to fill the second row of the minimum area square matrix. The third time, two pixels such as pixel P38 and pixel P39 can be selected to fill the third row of the minimum area square matrix. For the empty position, the pixel P90 may be used for filling. Optionally, the pixel P90 is a pixel with a color value of 255.

[0080] The method for obtaining the second input data may be the same as the method for obtaining the first input data. For example, the second input data may be obtained through multiple filling operations. In each filling operation, a reference value of pixels may be selected from the pixels included in the second content and placed in a row of the minimum area square matrix, wherein the number of rows placed in the subsequent filling operation is the next row of the number of rows placed in the previous filling operation, thereby obtaining the second input data after multiple filling operations. If the pixels in the second content cannot completely fill the determined minimum area square, pixels of a preset pixel value may be filled in the vacant positions (i.e., the positions where the pixels in the second content are not filled), thereby obtaining the second input data.

[0081] For example, Fig.11 As shown, the determined second content may be the other side of the splicing (relative to Fig.10The pixel in the second content includes pixel P40, pixel P41, pixel P42, pixel P43, pixel P44, pixel P45, pixel P46, pixel P47, pixel P48, and pixel P49. Based on the 10 pixels included in the second content, the area of ​​the minimum area square determined is 16, that is, the minimum area square is a 4×4 square. The reference value determined is 4, and then 4 pixels can be selected from the second content each time to fill the minimum area square matrix. For example, the first time, 4 pixels such as P40, pixel P41, pixel P42 and pixel P43 can be selected to fill the first row of the minimum area square matrix. The second time, 4 pixels such as pixel P44, pixel P45, pixel P46 and pixel P47 can be selected to fill the second row of the minimum area square matrix. The third time, two pixels such as pixel P48 and pixel P49 can be selected to fill the third row of the minimum area square matrix. For the empty position, the pixel P90 may be used for filling. Optionally, the pixel P90 is a pixel with a color value of 255.

[0082] based on Fig.10 and Fig.11 In the example shown, in the embodiment of the present application, the method for determining the first input data and the second input data is the same, and the sizes and areas of the determined first input data and the second input data may be the same.

[0083] Exemplarily, the first content includes a row of pixels closest to the splicing at one side of the splicing, and the second content includes a row of pixels closest to the splicing at the other side of the splicing. Wherein, the first content and the second content each include 1080 pixels, that is, the width of the first content and the second content are both 1080, and the height is 1, then the reference area is 1080. Then, a minimum area square can be calculated based on 1080. Wherein, 1080 corresponds to a square with a minimum area square of 33×33. In the case where the first input data is a minimum area square matrix, in the process of obtaining the first input data, the pixels in the first content can be obtained from left to right, wherein 33 pixels are obtained each time to write a row of the minimum area square matrix. Wherein, because the value of 33×33 is greater than 1080, after all pixels of the first content are selected, there will still be vacant positions in the minimum area square matrix, so the vacant positions can be filled with pure white pixels (pixels with a pixel value of 22). Wherein, the process of obtaining the second input data is the same as the process of obtaining the first input data, which will not be repeated here.

[0084] It should be noted that, in the embodiment of the present application, the aforementioned matrix can be understood as a data form that accommodates pixels, and the first input data can be a matrix or an image of a first shape. For example, the first input data can be the aforementioned image of the smallest square area, and the image can include all pixels in the first content. Correspondingly, the second input data can be the aforementioned image of the smallest square area, and the image can include all pixels in the second content.

[0085] Optionally, the first neural network and the second neural network belong to two subnetworks in the twin neural network, and the structures of the first neural network and the second neural network are the same. In an embodiment of the present application, a twin neural network can be constructed based on a lightweight MobileNetV2 model. In an embodiment of the present application, the model (for example, the constructed twin neural network) can be customized trained using an image data set containing different scenes to enhance the accuracy of the model for misaligned splicing detection. Ultimately, the model can be ported to the NCNN framework and combined with INT8 quantization and OpenMP parallelization technology to achieve inference acceleration on the end side. For example, in the case where the method provided in an embodiment of the present application is used for a long screenshot scenario, a long screenshot data set can be used for customized training to enhance the accuracy of the model for misaligned splicing detection during the long screenshot process.

[0086] Among them, INT8 quantization is a technology that converts floating-point numbers in neural networks into 8-bit integers to reduce model size and inference calculations. OpenMP is an open source interface that supports multi-threaded parallel programming and is used to accelerate calculations on multi-core processors.

[0087] In one example, in the dataset used for model training, the training data and test data cover long screenshot splicing images in different scenarios, where the dataset comes from manual collection and division, including 9214 pairs of normal samples (samples without splicing misalignment), 9578 pairs of misaligned samples, and the ratio of training set to test set is 80% and 20%. By using specific long screenshot image data for training, the model's detection accuracy for long screenshot misalignment splicing is improved.

[0088] As a method, after obtaining the first input data and the second input data, the first input data and the second input data can be preprocessed first, and then the content characteristics of the first content are obtained through the preprocessed first input data, and the content characteristics of the second content are obtained through the preprocessed second input data.

[0089] Optionally, the first input data is preprocessed to obtain preprocessed first input data, and the second input data is preprocessed to obtain preprocessed second input data; in this case, obtaining content characteristics of the first content through the first neural network and the first input data, and obtaining content characteristics of the second content through the second neural network and the second input data may include: obtaining content characteristics of the first content through the first neural network and the preprocessed first input data, and obtaining content characteristics of the second content through the second neural network and the preprocessed second input data.

[0090] Optionally, the preprocessing includes one or more of the following processing methods, wherein the multiple processing methods include: upscaling sampling processing; de-meaning processing; and de-variance processing.

[0091] Among them, the image scale can be expanded through scale upsampling processing to prevent feature downsampling loss in the deep stage of the network.

[0092] Among them, the resolution of the image can be increased by upsampling, that is, the number of pixels in the image can be increased. Exemplarily, the upsampling of the image can be achieved by an interpolation algorithm, such as nearest neighbor interpolation, bilinear interpolation, bicubic interpolation, etc. Among them, upsampling can make the image larger, although it cannot increase the detailed information of the image (because the new pixels are estimated by the existing pixels), but it can improve the image quality to a certain extent and provide more space for subsequent processing. For example, through upsampling, the scale of the image can be expanded, so that even if downsampling is performed in the deep stage of the network, more image information can be retained. In this way, subsequent image processing tasks can make decisions more accurately based on the information in the input image.

[0093] Among them, the de-meaning process can be understood as subtracting the mean value from the image data so that the image data is centered on zero. For example, in the process of performing de-meaning processing on the first content, it can be understood as subtracting an average value from each pixel in the first content. Correspondingly, in the process of performing de-meaning processing on the second content, it can be understood as subtracting an average value from each pixel in the second content. Among them, pixel subtraction of the average value can be understood as subtracting an average value from the pixel value of the pixel. Among them, the subtracted average value can be the average value of the pixel values ​​of all pixels in the image (for example, the first content or the second content), or it can be the average value of the pixel values ​​of some pixels in the image.

[0094] Among them, the following beneficial effects can be achieved through the removal of the mean value:

[0095] Reduce data offset: The original image data (first content or second content) may have a fixed offset. This offset can be eliminated by removing the mean, making the data closer to zero, which is convenient for subsequent processing. Improve algorithm efficiency: In machine learning algorithms, especially those involving image processing, if the average value of the input data is close to zero, the convergence speed of the algorithm can be accelerated and the learning efficiency can be improved. Avoid gradient problems: In neural network training, if the distribution range of the input data is large, it may cause gradient vanishing or explosion problems. De-meaning can reduce the distribution range of the data, help stabilize the training process, and avoid these problems. Highlight individual differences: For images, de-meaning can remove the average brightness value of the image and highlight individual differences in the image. For example, in object recognition tasks, the overall brightness of the image does not affect the objects present in the image. After de-meaning, more attention can be paid to the content of the image.

[0096] The larger the image variance, the higher the texture complexity of the image. Removing the variance can make the pixel values ​​of the image closer to their mean, thereby reducing the complexity of the texture. The image after the variance removal process may present a smoother appearance, reducing the original details and texture features.

[0097] As a method, the first content may be first upsampled, and then the first content after upsampling may be subjected to mean removal and variance removal in sequence to obtain the first input data. Correspondingly, the second content may be first upsampled, and then the first content after upsampling may be subjected to mean removal and variance removal in sequence to obtain the second input data.

[0098] The present embodiment provides an image detection method, so that through the above-mentioned method, it is possible to determine whether there is a splicing misalignment by comparing the similarity of the image content (first content and second content) on both sides of the splicing in the spliced ​​image, thereby effectively detecting the misalignment problem that occurs in the image splicing process. In addition, in the present embodiment, the first input data can be obtained through the pixels in the first content, and the second input data can be obtained through the pixels in the second content, so that the obtained first input data and the second input data can better meet the input requirements of the first neural network and the second neural network, which is beneficial to avoid the loss of features in the processing of the first neural network and the second neural network, and is beneficial to improve the accuracy of the final content features.

[0099] See also Fig.12 , the present application provides an image detection method, the method comprising:

[0100] S310: Obtaining first content and second content from a first image, where the first image is obtained by splicing the second image and the third image, the first content includes image content located on one side of the splicing portion and adjacent to the splicing portion, and the second content includes image content located on the other side of the splicing portion and adjacent to the splicing portion;

[0101] S320: If the first content and the second content do not satisfy the similarity condition, determine that there is a splicing misalignment in the first image.

[0102] S330: Re-stitching the second image and the third image based on the corrected stitching position.

[0103] It should be noted that when a stitching error is detected in the first image, it means that the stitching position previously used is incorrect. The previous stitching position can be corrected, and then the second image and the third image can be re-stitched based on the corrected stitching position to obtain a first image without stitching errors.

[0104] The present embodiment provides an image detection method, so that through the above method, it is possible to determine whether there is a splicing misalignment by comparing the similarity of the image content (first content and second content) on both sides of the splicing position in the spliced ​​image, thereby effectively detecting the misalignment problem that occurs during the image splicing process. In addition, in the present embodiment, when it is determined that there is a splicing misalignment in the first image, the splicing position can be corrected, so that the second image and the third image can be re-spliced ​​based on the corrected splicing position.

[0105] Next, pass Fig.13 The content shown illustrates the process of an image detection method involved in an embodiment of the present application.

[0106] exist Fig.13 In the process shown, the upper row of pixels of the splicing edge (i.e., the splicing in the embodiment of the present application) in the first image can be obtained as the first content, and the next row of pixels of the splicing edge (i.e., the splicing in the embodiment of the present application) in the first image can be obtained as the second content. Then, the corresponding minimum square matrix of area can be determined according to the number of pixels in the first content and the second content. Then, the scale up sampling process, the mean removal and the variance removal process are successively carried out, and then the minimum square matrix of area obtained after the variance removal process is input into the lightweight network for feature extraction, thereby obtaining the content features of the first content and the content features of the second content. Then, the characteristic distance between the content features of the first content and the content features of the second content is calculated by the Euclidean distance. If the characteristic distance is greater than the first distance threshold, it is determined that there is a splicing dislocation in the first image, and if the characteristic distance is less than or equal to the first distance threshold, it is determined that the splicing is normal.

[0107] See also Fig.14 The present application provides an image detection device 400, the device 400 comprising:

[0108] The content acquisition unit 410 is used to obtain first content and second content from the first image, where the first image is obtained by splicing the second image and the third image, the first content includes image content located on one side of the splicing and adjacent to the splicing, and the second content includes image content located on the other side of the splicing and adjacent to the splicing.

[0109] The misalignment detection unit 420 is configured to determine that there is a splicing misalignment in the first image if the first content and the second content do not satisfy a similarity condition.

[0110] As a method, the misalignment detection unit 420 is also used to obtain first input data through pixels in the first content, and to obtain second input data through pixels in the second content; to obtain content features of the first content through the first neural network and the first input data, and to obtain content features of the second content through the second neural network and the second input data, wherein the first input data matches the input requirements of the first neural network, and the second input data matches the input requirements of the second neural network.

[0111] Optionally, the first input data includes a matrix of a first shape, and the second input data includes a matrix of a second shape, wherein the first shape matches the input requirement of the first neural network, and the second shape matches the input requirement of the second neural network. Optionally, both the first shape and the second shape are square, and the size of the matrix of the first shape is determined by the number of pixels in the first content, and the size of the matrix of the second shape is determined by the number of pixels in the first content.

[0112] Optionally, the misalignment detection unit 420 is further used to preprocess the first input data to obtain preprocessed first input data, and to preprocess the second input data to obtain preprocessed second input data. Correspondingly, the misalignment detection unit 420 is specifically used to obtain content features of the first content through the first neural network and the preprocessed first input data, and to obtain content features of the second content through the second neural network and the preprocessed second input data.

[0113] As a method, the misalignment detection unit 420 is further configured to re-stitch the second image and the third image based on the corrected stitching position after determining that there is a stitching misalignment in the first image.

[0114] The present embodiment provides an image detection device, through which the above-mentioned image detection device makes it possible to determine whether splicing misalignment occurs by comparing the similarity of image contents (first content and second content) on both sides of the splicing point in the spliced ​​image, thereby achieving effective detection of misalignment problems occurring in the image splicing process.

[0115] It should be noted that the device embodiments in the present application correspond to the aforementioned method embodiments, and the specific implementation principles of each unit in the device embodiments are similar to the principles in the aforementioned method embodiments. The specific contents in the device embodiments can be found in the method embodiments, and will not be repeated in the device embodiments.

[0116] The following will be combined Fig.15 An electronic device provided by the present application is described.

[0117] See also Fig.15 Based on the above-mentioned image detection method and device, the embodiment of the present application also provides an electronic device 1000 that can execute the above-mentioned image detection method. The electronic device 1000 includes one or more (only one is shown in the figure) processors 105, a memory 104, an audio playback module 106 and an audio acquisition device 108 that are coupled to each other. Among them, the memory 104 stores a program that can execute the content of the above-mentioned embodiment, and the processor 105 can execute the program stored in the memory 104.

[0118] Among them, the processor 105 may include one or more processing cores. The processor 105 uses various interfaces and lines to connect various parts of the entire electronic device 1000, and executes various functions and processes data of the electronic device 1000 by running or executing instructions, programs, code sets or instruction sets stored in the memory 104, and calling data stored in the memory 104. Optionally, the processor 105 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 105 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 105, but may be implemented separately through a communication chip.

[0119] The memory 104 may include a random access memory (RAM) or a read-only memory (ROM). The memory 104 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 104 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc.

[0120] Furthermore, in addition to the aforementioned components, the electronic device 1000 may further include a network module 110 and a sensor module 112 .

[0121] The network module 110 is used to realize information interaction between the electronic device 1000 and other devices. For example, a connection can be established with other audio playback devices or other electronic devices, and information interaction is performed based on the established connection. As a way, the network module 110 of the electronic device 1000 is a radio frequency module, which is used to receive and send electromagnetic waves, realize the mutual conversion of electromagnetic waves and electrical signals, and thus communicate with a communication network or other devices. The radio frequency module may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity modules (SIM) cards, memories, etc. For example, the radio frequency module can interact with external devices through electromagnetic waves sent or received.

[0122] The sensor module 112 may include at least one sensor. Specifically, the sensor module 112 may include but is not limited to: a pressure sensor, a motion sensor, an acceleration sensor, and other sensors.

[0123] Among them, the pressure sensor may be a sensor that detects the pressure generated by pressing on the electronic device 1000. That is, the pressure sensor detects the pressure generated by contact or pressing between the user and the electronic device 1000, for example, the pressure generated by contact or pressing between the user's ear and the electronic device 1000. Therefore, the pressure sensor can be used to determine whether contact or pressing occurs between the user and the electronic device 1000, and the magnitude of the pressure.

[0124] Among them, the acceleration sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary, and can be used for applications that recognize the posture of the electronic device 1000 (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc. In addition, the electronic device 1000 can also be equipped with other sensors such as gyroscopes, barometers, hygrometers, thermometers, etc., which will not be repeated here.

[0125] The audio collection device 108 is used to collect audio signals. Optionally, the audio collection device 108 includes a plurality of audio collection devices, which may be microphones.

[0126] Please refer to Fig.16 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 1100 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0127] The computer readable storage medium 1100 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 1100 includes a non-transitory computer-readable storage medium. The computer readable storage medium 1100 has storage space for program code 1110 that executes any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 1110 can be compressed, for example, in an appropriate form.

[0128] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0129] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0130] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0131] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, which can be embodied in any computer-readable medium for use by an instruction execution system, apparatus or device (such as a computer-based system, a system including a processor or other system that can fetch instructions from an instruction execution system, apparatus or device and execute instructions), or used in combination with these instruction execution systems, apparatuses or devices.

[0132] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0133] In summary, the present application provides an image detection method, device, and electronic device. In the method, after obtaining a first image by splicing a second image and a third image, a first content and a second content can be obtained from the first image, wherein the first content includes image content located on one side of the splicing and adjacent to the splicing, and the second content includes image content located on the other side of the splicing and adjacent to the splicing. Then, the similarity between the first content and the second content is detected. If the first content and the second content do not meet the similarity condition, it is determined that there is a splicing misalignment in the first image. Thus, through the above method, it is possible to determine whether a splicing misalignment occurs by comparing the similarity of the image content (the first content and the second content) on both sides of the splicing in the spliced ​​image, thereby achieving effective detection of the misalignment problem that occurs during the image splicing process.

[0134] When the image detection method provided in this application is applied to the long screenshot scene, it can accurately identify the misalignment caused by the long screenshot splicing process, wherein the single recognition time can be only 30-60ms, and the splicing result can be detected while the long screenshot is being spliced. The specific beneficial effects are as follows: it can comprehensively count the market data of long screenshot splicing anomalies, rather than relying solely on trial feedback to judge the impact of the problem;

[0135] In addition, data on abnormal splicing scenes can be effectively collected to provide a basis for the optimization of subsequent long screenshot splicing algorithms; furthermore, the accuracy of subsequent long screenshot splicing algorithms can be reversely verified.

[0136] The core points of this application can be as follows:

[0137] One of the core points is to transform the problem of detecting misaligned splicing of images into the problem of judging the similarity of the contents of the upper and lower lines at the splicing point. The convolutional neural network in deep learning is used to construct a twin neural network to calculate the similarity distance, which is used to judge the similarity of the upper and lower lines, thereby improving the accuracy of misaligned splicing detection. In addition, the network parameters of the constructed twin neural network can be customized based on long screenshot data, and the division threshold of the similarity distance has the ability to be adaptively adjusted.

[0138] Another key point is that the upper and lower 1×N pixel matrices at the joint are not directly input into the network (e.g., the first neural network and the second neural network mentioned above), but are arranged into a minimum area square matrix by row, where the insufficient part is filled with pure white (value 255). Since the input size of the feature extraction network (e.g., the first neural network and the second neural network mentioned above) can be 224×224, this minimum area square can effectively reduce feature loss in the resampling stage.

[0139] Another key point is that the lightweight feature extraction network is used, combined with the INT8 quantization of the model, OpenMP parallel acceleration and NCNN end-side inference framework transplantation, so that the long screenshot misaligned splicing detection algorithm can be deployed in real time on the mobile phone.

[0140] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical feature diagrams therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. An image detection method, characterized in that: The method comprises: Obtaining first content and second content from a first image, wherein the first image is obtained by splicing the second image and the third image, the first content includes image content located on one side of and adjacent to the splicing portion, and the second content includes image content located on the other side of and adjacent to the splicing portion; If the first content and the second content do not satisfy the similarity condition, it is determined that there is a splicing misalignment in the first image.

2. The method according to claim 1, characterized in that The similar conditions include: A feature distance between a content feature of the first content and a content feature of the second content is less than a first distance threshold.

3. The method according to claim 2, characterized in that The method further includes: obtaining first input data through pixels in the first content, and obtaining second input data through pixels in the second content; The content characteristics of the first content are obtained through a first neural network and the first input data, and the content characteristics of the second content are obtained through a second neural network and the second input data, wherein the first input data matches the input requirements of the first neural network, and the second input data matches the input requirements of the second neural network.

4. The method according to claim 3, characterized in that The first input data includes a matrix of a first shape, and the second input data includes a matrix of a second shape, wherein the first shape matches the input requirement of the first neural network, and the second shape matches the input requirement of the second neural network.

5. The method according to claim 4, characterized in that The first shape and the second shape are both squares, a size of a matrix of the first shape is determined by the number of pixels in the first content, and a size of a matrix of the second shape is determined by the number of pixels in the first content.

6. The method according to claim 3, characterized in that The method further comprises: Preprocessing the first input data to obtain preprocessed first input data, and preprocessing the second input data to obtain preprocessed second input data; The obtaining of the content feature of the first content through the first neural network and the first input data, and the obtaining of the content feature of the second content through the second neural network and the second input data, include: The content characteristics of the first content are obtained through a first neural network and the preprocessed first input data, and the content characteristics of the second content are obtained through a second neural network and the preprocessed second input data.

7. The method according to claim 6, characterized in that The preprocessing includes one or more of the following processing methods, wherein the multiple processing methods include: upscaling sampling processing; de-meaning processing; and de-variance processing.

8. The method according to claim 3, characterized in that The first neural network and the second neural network are two sub-networks in a twin neural network, and the first neural network and the second neural network have the same structure.

9. The method according to any one of claims 1 to 8, characterized in that: The obtaining the first content and the second content from the first image includes: In the process of long screenshot, the first content and the second content are obtained from the first image, wherein the second image and the third image are images obtained by screenshotting the screen in the process of long screenshot.

10. The method according to any one of claims 1 to 8, characterized in that: The image content located on one side of the splicing and adjacent to the splicing includes: a row of pixels located on one side of the splicing and closest to the splicing, and the image content located on the other side of the splicing and adjacent to the splicing includes: a row of pixels located on the other side of the splicing and closest to the splicing.

11. An image detection device, characterized in that: The device comprises: a content acquisition unit, configured to obtain first content and second content from a first image, wherein the first image is obtained by splicing the second image and the third image, the first content includes image content located on one side of and adjacent to the splicing portion, and the second content includes image content located on the other side of and adjacent to the splicing portion; The misalignment detection unit is configured to determine that there is a splicing misalignment in the first image if the first content and the second content do not satisfy a similarity condition.

12. An electronic device, characterized in that: comprising one or more processors and memory; One or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 10.

13. A computer-readable storage medium storing a program code executable by a processor, characterized in that: The computer-readable storage medium includes stored program code, wherein when the program code is executed, the method according to any one of claims 1 to 10 is executed.