Image offset identification method and device and related equipment
By comparing the image segmentation and attitude difference between the first image and the second image, the offset recognition results are generated, and the problem of low accuracy of image offset recognition in the prior art is solved, and more efficient and accurate offset recognition is achieved.
Patent Information
- Application Number
- CN202411835727.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-01
AI Technical Summary
In the prior art, the accuracy of image offset recognition results is low and are easily disturbed by human factors, resulting in missed or missed detection.
By performing image segmentation on the first image and the second image, comparing the posture difference of each object, and generating offset recognition results to determine whether the first image has an offset relative to the second image.
It improves the accuracy of image offset recognition, avoids interference from human factors, and can generate offset recognition results more quickly, which is suitable for batch automatic image offset recognition.
Smart Images

Figure CN119741493A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of big data analysis, and in particular to an image offset recognition method, apparatus and related equipment. Background Art
[0002] Currently, there are a large number of objects in the images in the display areas of various software applications. Due to the influence of factors such as human layout settings, there is a difference between the actual posture of the object in the display area and the expected posture of the object in the design draft.
[0003] In the related art, manual recognition is often used to detect whether the actual posture of an object in a display area deviates from the expected posture of the object. This method is greatly interfered by human factors and is prone to missed detection or wrong detection.
[0004] That is to say, the accuracy of the image offset recognition result obtained based on the relevant technology is low. Summary of the invention
[0005] The purpose of the present disclosure is to provide an image offset recognition method, apparatus and related equipment to solve the technical problem of low accuracy of image offset recognition results output by related technologies.
[0006] In a first aspect, the present application provides an image offset recognition method, the method comprising:
[0007] Performing image segmentation on the first image and the second image respectively to obtain at least one first object in the first image and at least one second object in the second image, wherein the second image is a design draft image of the first image, and the at least one first object corresponds to the at least one second object in one-to-one correspondence;
[0008] Among the at least one first object, comparing the difference between the posture of each first object and the posture of the second object corresponding to each first object to obtain posture difference data of each first object;
[0009] An offset recognition result is generated according to the posture difference data of each of the first objects, where the offset recognition result is used to indicate whether the first image is offset relative to the second image.
[0010] In a second aspect, the present application further provides an image offset recognition device, the device comprising:
[0011] an image segmentation module, configured to perform image segmentation on the first image and the second image respectively, to obtain at least one first object in the first image and at least one second object in the second image, wherein the second image is a design draft image of the first image, and the at least one first object corresponds to the at least one second object in one-to-one correspondence;
[0012] A comparison module, used for comparing the difference between the posture of each of the at least one first object and the posture of the second object corresponding to each of the first objects, to obtain posture difference data of each of the first objects;
[0013] The offset recognition module is used to generate an offset recognition result according to the posture difference data of each of the first objects, wherein the offset recognition result is used to indicate whether the first image is offset relative to the second image.
[0014] In a third aspect, the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the method described in the first aspect.
[0015] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.
[0016] In a fifth aspect, the present application provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0017] In the present application, by comparing the posture differences of corresponding different objects in the first image and the second image, it is determined whether the first image is offset relative to the second image, thereby replacing the solution of manually detecting image offset, avoiding the interference of human factors and obtaining a more accurate offset recognition result. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flowchart of an image offset recognition method provided in an embodiment of the present application;
[0019] Figure 2 is a schematic diagram of the difference in postures of different objects provided in an embodiment of the present application;
[0020] Figure 3 is a schematic diagram of another difference in the postures of different objects provided in an embodiment of the present application;
[0021] Figure 4It is a flowchart of another image offset recognition method provided in an embodiment of the present application;
[0022] Figure 5 is a structural schematic diagram of an image deviation recognition device provided in an embodiment of the present application;
[0023] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0024] The following will be combined with the drawings in the embodiments of the present disclosure to clearly and completely describe the technical solutions in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0025] The present disclosure provides an image offset recognition method. Figure 1 As shown, the image offset recognition method includes:
[0026] Step 101: perform image segmentation on a first image and a second image respectively to obtain at least one first object in the first image and at least one second object in the second image.
[0027] The second image is a design draft image of the first image, and the at least one first object corresponds to the at least one second object in a one-to-one manner.
[0028] Exemplarily, the first image may be generated by performing operations such as adding or subtracting elements and adjusting the color tone on the second image.
[0029] The first image may be understood as any image displayed in the display area of the target application. The target application may be any software application having a display area for conveying image information to the user, such as a game application, a video application, a shopping application, etc.
[0030] For example: the first image can be a game poster, promotional picture, etc. displayed in the main interface of a game application; it can also be a poster of a popular drama displayed in the main interface / startup interface of a video application; it can also be a product promotional picture displayed in the main interface / startup interface of a shopping application.
[0031] The first object is a key object preset in the first image, such as one or more of a person, an animal, a building, and a landscape.
[0032] In the present application, the one-to-one correspondence between the at least one first object and the at least one second object should be understood as: in the at least one first object, each first object corresponds to a second object, and the second objects corresponding to different first objects are different.
[0033] Step 102: among the at least one first object, compare the difference between the posture of each first object and the posture of the second object corresponding to each first object to obtain posture difference data of each first object.
[0034] The above difference can be understood as the posture angle difference between the corresponding first object and the second object, that is, the angle between the reference line (such as the lower edge line, upper edge line, left edge line, right edge line, diagonal line, etc.) of the rectangular convex hull corresponding to the first object and the reference horizontal line (or reference horizontal plane) and the angle between the reference line of the rectangular convex hull corresponding to the second object and the reference horizontal line (or reference horizontal plane). The posture angle difference of 0 can be expressed as follows Figure 2 As shown, Figure 2 The irregular area surrounded by the middle dotted line represents the first object. Figure 2 The irregular area surrounded by the solid line represents the second object. In this case, the corresponding first object and the second object can be completely overlapped only by translation;
[0035] When the posture angle difference is 10 degrees, Figure 3 As shown, Figure 3 The irregular area surrounded by the middle dotted line represents the first object. Figure 3 The irregular area surrounded by the solid line represents the second object. In this case, the corresponding first object and second object cannot be completely overlapped only by translation.
[0036] Without loss of generality, the posture angle difference between the corresponding first object and the second object can be determined by obtaining the circumscribed rectangular convex hull of each first object and the circumscribed rectangular convex hull of the second object corresponding to each first object, and calculating the angle between the rectangular sides at the same position of the two circumscribed rectangular convex hulls of the corresponding first object and the second object (such as the rectangular side of the lower boundary of the circumscribed rectangular convex hull) and the reference line or reference plane.
[0037] It should be noted that the posture angle difference can be directly determined as the above difference, or the trigonometric function value corresponding to the posture angle difference can be determined as the above difference, for example: the sine value, cosine value, tangent value, etc. of the posture angle difference.
[0038] Step 103: Generate an offset recognition result according to the posture difference data of each of the first objects.
[0039] The offset identification result is used to indicate whether the first image is offset relative to the second image.
[0040] In the present application, by comparing the posture differences of corresponding different objects in the first image and the second image, it is determined whether the first image is offset relative to the second image, thereby replacing the solution of manually detecting image offset and avoiding the interference of human factors. This can not only obtain more accurate offset recognition results, but also significantly improve the efficiency of generating offset recognition results. The solution of batch automatic image offset recognition can quickly respond to design changes and UI adjustments, ensuring consistency and high-quality output within the product iteration cycle.
[0041] In the application, when the first image is offset relative to the second image, the above-mentioned offset recognition result can also be used to indicate the offset direction and offset angle of the first image relative to the second image. Subsequently, the center of the first object in the first image is used as the rotation center, and the first object is rotated at the angle indicated by the offset angle in the opposite direction of the offset direction. This can achieve automatic straightening of the first image. The posture of the first image and the second image after straightening is consistent, which can effectively improve the presentation effect and aesthetics of the first image, bring better perceptual experience to users, and ensure that users can focus on important information, reduce interference from irrelevant information on the display interface, and improve the information communication efficiency of the first image.
[0042] In one embodiment, generating an offset recognition result according to the posture difference data of each of the first objects includes:
[0043] When the posture difference data of each of the first objects is less than or equal to a preset difference threshold, generating a shift identification result indicating that the first image is not shifted relative to the second image;
[0044] In a case where the posture difference data of each of the first objects includes posture difference data greater than the difference threshold, a shift recognition result indicating that the first image is shifted relative to the second image is generated.
[0045] In this embodiment, it is set that the offset recognition result indicating that the first image is not offset relative to the second image is generated only when the posture difference data of each of the first objects is less than or equal to a preset difference threshold; otherwise, the offset recognition result indicating that the first image is offset relative to the second image is generated, so as to reduce the influence of external interference on the offset recognition result and make the generated offset recognition result more accurate.
[0046] In one embodiment, comparing the posture difference between each of the first objects and the second object corresponding to each of the first objects to obtain the posture difference data of each of the first objects includes:
[0047] Comparing first orientation data of a target first object and second orientation data of a target second object to obtain first sub-difference data of the target first object, wherein the target first object is any one of the at least one first object, and the target second object is a second object of the at least one second object corresponding to the target first object, the first orientation data is used to represent an angle between a straight line connected by a lower left endpoint and an upper right endpoint of a rectangular convex hull corresponding to the target first object and a preset reference line, and the second orientation data is used to represent an angle between a straight line connected by a lower left endpoint and an upper right endpoint of a rectangular convex hull corresponding to the target second object and the reference line;
[0048] and / or,
[0049] Comparing the third orientation data of the first target object and the fourth orientation data of the second target object to obtain second sub-difference data of the first target object, wherein the third orientation data is used to represent the angle between the reference line and a straight line connected by the upper left endpoint and the lower right endpoint of the rectangular convex hull corresponding to the first target object, and the fourth orientation data is used to represent the angle between the reference line and a straight line connected by the upper left endpoint and the lower right endpoint of the rectangular convex hull corresponding to the second target object;
[0050] The posture difference data includes the first sub-difference data and / or the second sub-difference data.
[0051] In this embodiment, by respectively determining the upper left, lower left, upper right, and lower right endpoints of the first object and the second object, the calculation of the first sub-difference data and / or the second sub-difference data can be conveniently completed, thereby improving the generation rate of the offset identification result.
[0052] Exemplarily, the coordinates of each pixel point forming the first target object and the coordinates of each pixel point forming the second target object can be determined in a set rectangular coordinate system, wherein the first target object and the second target object are both located in the first quadrant of the rectangular coordinate system, and the upper left endpoint coordinates, upper right endpoint coordinates, lower left endpoint coordinates, and lower right endpoint coordinates of the first target object, as well as the upper left endpoint coordinates, upper right endpoint coordinates, lower left endpoint coordinates, and lower right endpoint coordinates of the second target object can be determined by traversing the coordinates of each pixel point of the first target object and the coordinates of each pixel point of the second target object respectively. At this time, the baseline can be understood as the horizontal axis straight line or the vertical axis straight line of the rectangular coordinate system.
[0053] In an application, the posture difference data of the target first object may also include a trigonometric function value corresponding to the first sub-difference data and / or a trigonometric function value corresponding to the second sub-difference data.
[0054] In some implementations, when the posture difference data includes a trigonometric function value corresponding to the first sub-difference data and a trigonometric function value corresponding to the second sub-difference data, it may be set as follows:
[0055] When the first sub-difference data and the second sub-difference data included in the posture difference data of each of the first objects are both less than or equal to a preset difference threshold, an offset recognition result indicating that the first image is not offset relative to the second image is generated; otherwise, an offset recognition result indicating that the first image is offset relative to the second image is generated, so that the generated offset recognition result is more accurate.
[0056] In one embodiment, when the posture difference data includes the first sub-difference data and the second sub-difference data, generating an offset recognition result according to the posture difference data of each of the first objects includes:
[0057] In each of the posture difference data of the first object, abnormal posture difference data is filtered out to obtain a difference data set, wherein the abnormal posture difference data is posture difference data including a difference between the first sub-difference data and the second sub-difference data that is greater than or equal to a preset fluctuation threshold;
[0058] The offset identification result is generated according to the difference data set.
[0059] In this embodiment, the posture difference data whose difference between the first sub-difference data and the second sub-difference data is greater than or equal to the preset fluctuation threshold is filtered out to reduce the influence of external interference and ensure the accuracy of the offset recognition result finally generated.
[0060] In one embodiment, performing image segmentation on the first image and the second image respectively to obtain at least one first object in the first image and at least one second object in the second image includes:
[0061] Splitting the first image according to a target splitting rule to obtain at least one first image block, and segmenting the second image according to the target splitting rule to obtain at least one second image block, wherein the at least one first image block corresponds to the at least one first object in one-to-one correspondence, and the at least one second image block corresponds to the at least one second object in one-to-one correspondence;
[0062] Among the preset multiple semantic segmentation models, determining the semantic segmentation model that matches the target segmentation rule as the target segmentation model;
[0063] Image segmentation is performed on the at least one first image block and the at least one second image block respectively according to the target segmentation model to obtain the at least one first object and the at least one second object.
[0064] In this embodiment, multiple semantic segmentation models are set to flexibly adapt to different image segmentation rules to ensure the accuracy of the first object and the second object obtained by segmentation.
[0065] The first image block may be understood as an image block in the first image including image content of a first object, and similarly, the second image block may be understood as an image block in the second image including image content of a second object.
[0066] Exemplarily, the target splitting rule may indicate uniform splitting of the first image, such as uniformly splitting the first image into 2 / 4 / 9 first image blocks of equal area; or it may indicate irregular splitting of the first image, such as determining the image content including the first object in the first image through image detection measures, and marking it in the form of anchor box rows, and then splitting the first image based on the anchor box position to form the first image blocks.
[0067] The splitting process of the second image is the same as that of the first image, and will not be described again to avoid repetition.
[0068] Among them, the semantic segmentation model matching the target splitting rule can be understood as: the training data used in the model training process is a semantic segmentation module of the image blocks split based on the target splitting rule.
[0069] In some embodiments, during the process of training the multiple semantic segmentation models, the data diversity of the training data set can be increased, such as through data enhancement (such as rotation, flipping, scaling, cropping, adding noise, etc.) technology, to collect training data of different scenes, different lighting conditions, different resolutions and different noise conditions, so as to improve the robustness and generalization ability of the semantic segmentation model finally trained, so that the first object and the second object obtained by segmentation can be more accurate.
[0070] In some embodiments, in the process of constructing the multiple semantic segmentation models, the number of model parameters and the amount of calculation can be reduced through operations such as model compression, model pruning, model quantization, and combination with hardware acceleration technologies such as graphics processing unit (GPU), tensor processing unit (TPU), and field programmable gate array (FPGA), thereby improving the reasoning efficiency and memory throughput efficiency of the final semantic segmentation model, and thus improving the segmentation efficiency of the first object and the second object.
[0071] In some implementations, the multiple semantic segmentation models can all be set to be models built based on deep learning algorithms, so as to improve the accuracy of segmentation results of the multiple semantic segmentation models.
[0072] In one embodiment, performing image segmentation on the at least one first image block and the at least one second image block according to the target segmentation model to obtain the at least one first object and the at least one second object includes:
[0073] Performing feature encoding on a target image block according to an encoder included in the target segmentation model to obtain a first feature map, wherein the target image block is the first image block or the second image block, and the first feature map is used to represent an image feature of each pixel in the target image block;
[0074] Performing feature decoding on the first feature map according to the decoder included in the target segmentation model to obtain a second feature map, wherein the second feature map is used to represent the semantic features reflected by the image features of each pixel in the target image block;
[0075] Upsampling the second feature map according to the upsampling component included in the target segmentation model to obtain a result map, where the result map is used to represent the classification result of each pixel in the target image block;
[0076] A target object is extracted from the target image block according to the result image, wherein the target object is the first object or the second object.
[0077] Exemplarily, the target segmentation model can be a fully convolutional network (FCN) model, a DeepLab series model (such as DeepLabv3, DeepLabv3+), or a pyramid scene parsing network (PSPNet) model.
[0078] The image features may be understood as features such as color, texture, and edge of the image.
[0079] For ease of understanding, the following examples are provided:
[0080] like Figure 4 As shown, the image to be identified (ie, the first image) is input into a trained semantic segmentation model (eg, DeepLabV3+ semantic segmentation model) to obtain the segmented object (ie, the first object) of the image to be identified.
[0081] The OpenCV algorithm is used to obtain the coordinates of the upper left, lower left, upper right, and lower right endpoints of the segmented object in the image to be identified.
[0082] Calculate the tan value of the angle between the straight line connected by the upper left endpoint and the lower right endpoint of the segmented object of the image to be identified and the baseline (referred to as the first value, that is, the aforementioned third orientation data), and compare the calculated first value with the second value recorded in the database (that is, the aforementioned fourth orientation data) to obtain a first error value (that is, the aforementioned second sub-difference data), wherein the second value can be understood as performing image segmentation on the design draft image corresponding to the image to be identified (that is, the second image) according to the aforementioned trained semantic segmentation model to obtain the segmented object of the design draft image (that is, the second object), and calculating the tan value of the angle between the straight line connected by the upper left endpoint and the lower right endpoint of the segmented object of the design draft image and the baseline.
[0083] Similarly, the tan value of the angle between the straight line connecting the lower left endpoint and the upper right endpoint of the segmented object in the image to be identified and the baseline is calculated (referred to as the third value, i.e. the aforementioned first orientation data), and the calculated third value is compared with the fourth value recorded in the database (i.e. the aforementioned second orientation data) to obtain the second error value (i.e. the aforementioned first sub-difference data), wherein the fourth value can be understood as the tan value of the angle between the straight line connecting the lower left endpoint and the upper right endpoint of the segmented object in the design draft image and the baseline.
[0084] Comparing the first error value with the corresponding threshold value (i.e., the aforementioned difference threshold value) to determine whether the first error value exceeds the threshold value, and comparing the second error value with the corresponding threshold value to determine whether the second error value exceeds the threshold value;
[0085] If both the first error value and the second error value are less than or equal to the corresponding threshold values, then the offset detection of the image to be identified is judged to be qualified, that is, it is judged that the image to be identified has not been offset relative to the design draft image; otherwise, the offset detection of the image to be identified is judged to be unqualified, that is, it is judged that the image to be identified has been offset relative to the design draft image.
[0086] Figure 4The solution shown can quickly detect whether the image to be identified is offset, improve the aesthetics and consistency of the image to be identified on the display interface, and improve the user's visual experience.
[0087] See also Figure 5 , Figure 5 is an image offset recognition device provided by an embodiment of the present disclosure, such as Figure 5 As shown, the image offset recognition device 500 includes:
[0088] An image segmentation module 501 is used to perform image segmentation on a first image and a second image respectively to obtain at least one first object in the first image and at least one second object in the second image, wherein the second image is a design draft image of the first image, and the at least one first object corresponds to the at least one second object in one-to-one correspondence;
[0089] A comparison module 502, configured to compare the difference between the posture of each of the at least one first object and the posture of the second object corresponding to each of the first objects, to obtain posture difference data of each of the first objects;
[0090] The offset recognition module 503 is used to generate an offset recognition result according to the posture difference data of each of the first objects, wherein the offset recognition result is used to indicate whether the first image is offset relative to the second image.
[0091] In one embodiment, the comparison module 502 is specifically used for:
[0092] The comparing the posture difference between each of the first objects and the second object corresponding to each of the first objects to obtain posture difference data of each of the first objects includes:
[0093] Comparing first orientation data of a target first object and second orientation data of a target second object to obtain first sub-difference data of the target first object, wherein the target first object is any one of the at least one first object, and the target second object is a second object of the at least one second object corresponding to the target first object, the first orientation data is used to represent an angle between a straight line connected by a lower left endpoint and an upper right endpoint of a rectangular convex hull corresponding to the target first object and a preset reference line, and the second orientation data is used to represent an angle between a straight line connected by a lower left endpoint and an upper right endpoint of a rectangular convex hull corresponding to the target second object and the reference line;
[0094] and / or,
[0095] Comparing the third orientation data of the first target object and the fourth orientation data of the second target object to obtain second sub-difference data of the first target object, wherein the third orientation data is used to represent the angle between the reference line and a straight line connected by the upper left endpoint and the lower right endpoint of the rectangular convex hull corresponding to the first target object, and the fourth orientation data is used to represent the angle between the reference line and a straight line connected by the upper left endpoint and the lower right endpoint of the rectangular convex hull corresponding to the second target object;
[0096] The posture difference data includes the first sub-difference data and / or the second sub-difference data.
[0097] In one embodiment, when the posture difference data includes the first sub-difference data and the second sub-difference data, the offset identification module 503 includes:
[0098] A data filtering unit, configured to filter out abnormal posture difference data from the posture difference data of each of the first objects to obtain a difference data set, wherein the abnormal posture difference data is posture difference data including a difference between the first sub-difference data and the second sub-difference data that is greater than or equal to a preset fluctuation threshold;
[0099] A result generating unit is used to generate the offset recognition result according to the difference data set.
[0100] In one embodiment, the image segmentation module 501 includes:
[0101] an image splitting unit, configured to split the first image according to a target splitting rule to obtain at least one first image block, and to split the second image according to the target splitting rule to obtain at least one second image block, wherein the at least one first image block corresponds to the at least one first object in one-to-one correspondence, and the at least one second image block corresponds to the at least one second object in one-to-one correspondence;
[0102] A model determination unit, configured to determine, from among a plurality of preset semantic segmentation models, a semantic segmentation model that matches the target segmentation rule as a target segmentation model;
[0103] An image segmentation unit is used to perform image segmentation on the at least one first image block and the at least one second image block respectively according to the target segmentation model to obtain the at least one first object and the at least one second object.
[0104] In one embodiment, the image segmentation unit is specifically used to:
[0105] Performing feature encoding on a target image block according to an encoder included in the target segmentation model to obtain a first feature map, wherein the target image block is the first image block or the second image block, and the first feature map is used to represent an image feature of each pixel in the target image block;
[0106] Performing feature decoding on the first feature map according to the decoder included in the target segmentation model to obtain a second feature map, wherein the second feature map is used to represent the semantic features reflected by the image features of each pixel in the target image block;
[0107] Upsampling the second feature map according to the upsampling component included in the target segmentation model to obtain a result map, where the result map is used to represent the classification result of each pixel in the target image block;
[0108] A target object is extracted from the target image block according to the result image, wherein the target object is the first object or the second object.
[0109] In one embodiment, the offset identification module 503 is specifically configured to:
[0110] When the posture difference data of each of the first objects is less than or equal to a preset difference threshold, generating a shift identification result indicating that the first image is not shifted relative to the second image;
[0111] In a case where the posture difference data of each of the first objects includes posture difference data greater than the difference threshold, a shift recognition result indicating that the first image is shifted relative to the second image is generated.
[0112] The image shift identification device 500 provided in the embodiment of the present disclosure can implement each process in the above-mentioned image shift identification method embodiment, and will not be described again here to avoid repetition.
[0113] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
[0114] Figure 6A schematic block diagram of an example electronic device 600 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0115] like Figure 6 As shown, the device 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 to a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The computing unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0116] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0117] The computing unit 601 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSP), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 601 performs the various methods and processes described above, such as the image shift recognition method. For example, in some embodiments, the image shift recognition method may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the image shift recognition method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to execute the image shift identification method in any other appropriate manner (eg, by means of firmware).
[0118] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0119] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0120] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0121] As used herein, the term "machine-readable medium" refers to any computer program product, apparatus, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0122] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0123] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0124] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0125] The present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the above Figure 1 or Figure 4 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.
[0126] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0127] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for identifying image offset, characterized in that: The method comprises: Performing image segmentation on the first image and the second image respectively to obtain at least one first object in the first image and at least one second object in the second image, wherein the second image is a design draft image of the first image, and the at least one first object corresponds to the at least one second object in one-to-one correspondence; Among the at least one first object, comparing the difference between the posture of each first object and the posture of the second object corresponding to each first object to obtain posture difference data of each first object; An offset recognition result is generated according to the posture difference data of each of the first objects, where the offset recognition result is used to indicate whether the first image is offset relative to the second image.
2. The method according to claim 1, characterized in that The comparing the posture difference between each of the first objects and the second object corresponding to each of the first objects to obtain posture difference data of each of the first objects includes: Comparing first orientation data of a target first object and second orientation data of a target second object to obtain first sub-difference data of the target first object, wherein the target first object is any one of the at least one first object, and the target second object is a second object of the at least one second object corresponding to the target first object, the first orientation data is used to represent an angle between a straight line connected by a lower left endpoint and an upper right endpoint of a rectangular convex hull corresponding to the target first object and a preset reference line, and the second orientation data is used to represent an angle between a straight line connected by a lower left endpoint and an upper right endpoint of a rectangular convex hull corresponding to the target second object and the reference line; and / or, Comparing the third orientation data of the first target object and the fourth orientation data of the second target object to obtain second sub-difference data of the first target object, wherein the third orientation data is used to represent the angle between the reference line and a straight line connected by the upper left endpoint and the lower right endpoint of the rectangular convex hull corresponding to the first target object, and the fourth orientation data is used to represent the angle between the reference line and a straight line connected by the upper left endpoint and the lower right endpoint of the rectangular convex hull corresponding to the second target object; The posture difference data includes the first sub-difference data and / or the second sub-difference data.
3. The method according to claim 2, characterized in that In a case where the posture difference data includes the first sub-difference data and the second sub-difference data, generating an offset recognition result according to the posture difference data of each of the first objects includes: In each of the posture difference data of the first object, abnormal posture difference data is filtered out to obtain a difference data set, wherein the abnormal posture difference data is posture difference data including a difference between the first sub-difference data and the second sub-difference data that is greater than or equal to a preset fluctuation threshold; The offset identification result is generated according to the difference data set.
4. The method according to claim 1, characterized in that The performing image segmentation on the first image and the second image respectively to obtain at least one first object in the first image and at least one second object in the second image includes: Splitting the first image according to a target splitting rule to obtain at least one first image block, and segmenting the second image according to the target splitting rule to obtain at least one second image block, wherein the at least one first image block corresponds to the at least one first object in one-to-one correspondence, and the at least one second image block corresponds to the at least one second object in one-to-one correspondence; Among the preset multiple semantic segmentation models, determining the semantic segmentation model that matches the target segmentation rule as the target segmentation model; Image segmentation is performed on the at least one first image block and the at least one second image block respectively according to the target segmentation model to obtain the at least one first object and the at least one second object.
5. The method according to claim 4, characterized in that The performing image segmentation on the at least one first image block and the at least one second image block respectively according to the target segmentation model to obtain the at least one first object and the at least one second object comprises: Performing feature encoding on a target image block according to an encoder included in the target segmentation model to obtain a first feature map, wherein the target image block is the first image block or the second image block, and the first feature map is used to represent an image feature of each pixel in the target image block; Performing feature decoding on the first feature map according to the decoder included in the target segmentation model to obtain a second feature map, wherein the second feature map is used to represent the semantic features reflected by the image features of each pixel in the target image block; Upsampling the second feature map according to the upsampling component included in the target segmentation model to obtain a result map, where the result map is used to represent the classification result of each pixel in the target image block; A target object is extracted from the target image block according to the result image, wherein the target object is the first object or the second object.
6. The method according to claim 1, characterized in that The step of generating an offset recognition result according to the posture difference data of each of the first objects includes: When the posture difference data of each of the first objects is less than or equal to a preset difference threshold, generating a shift identification result indicating that the first image is not shifted relative to the second image; In a case where the posture difference data of each of the first objects includes posture difference data greater than the difference threshold, a shift recognition result indicating that the first image is shifted relative to the second image is generated.
7. An image offset recognition device, characterized in that: The device comprises: an image segmentation module, configured to perform image segmentation on the first image and the second image respectively, to obtain at least one first object in the first image and at least one second object in the second image, wherein the second image is a design draft image of the first image, and the at least one first object corresponds to the at least one second object in one-to-one correspondence; A comparison module, used for comparing the difference between the posture of each of the at least one first object and the posture of the second object corresponding to each of the first objects, to obtain posture difference data of each of the first objects; The offset recognition module is used to generate an offset recognition result according to the posture difference data of each of the first objects, wherein the offset recognition result is used to indicate whether the first image is offset relative to the second image.
8. An electronic device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the method according to any one of claims 1 to 6 when executed by the processor.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 6.