Image detection method, device, equipment and medium

CN117409081BActive Publication Date: 2026-10-09BEIJING CENTURY TAL EDUCATION TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202311510209.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-13
Publication Date
2026-10-09
Estimated Expiration
2043-11-13

AI Technical Summary

Technical Problem

相关技术中可以通过检测算法来判断图像中是否存在拼接结果,但是存在成本和误检率较高、算法收敛困难以及扩展性较低的问题

Benefits of technology

[0019] The image detection method and apparatus provided in this embodiment acquire a test image comprising multiple square units; perform lateral correction processing on the multiple square units in the test image based on a correction model to obtain a corrected image; determine the center point coordinates and border angles of the multiple square units in the corrected image based on a position detection model; determine the vertex coordinate sequence of the multiple square units based on the center point coordinates and border angles of the multiple square units; and perform target rectangle unit splicing detection on the corrected image based on the vertex coordinate sequence of the multiple square units and splicing judgment data to determine the unit splicing result. By employing the above technical solution, position detection is performed on the corrected image after lateral correction processing of the test image to determine the center point coordinates and border angles of each square unit, thereby determining the vertex coordinate sequence of each square unit. Using this vertex coordinate sequence and splicing judgment data, target rectangle unit splicing detection can be achieved in the test image. Compared to related technologies, this method does not require a large amount of prior data, saving costs. Furthermore, it adapts to splicing judgments of various combination styles, avoiding convergence difficulties and improving scalability, thus effectively improving the accuracy and reliability of unit splicing judgments for fixed styles.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117409081B_ABST
    Figure CN117409081B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image detection method, device, equipment and medium, wherein the image detection method comprises: acquiring a to-be-detected image comprising a plurality of square units; performing side correction processing on the plurality of square units in the to-be-detected image based on a correction model to obtain a corrected image; determining the center point coordinates and the frame angle of the plurality of square units in the corrected image based on a position detection model; determining the vertex coordinate sequence of the plurality of square units based on the center point coordinates and the frame angle of the plurality of square units; and performing unit splicing detection of a target rectangle on the corrected image based on the vertex coordinate sequence of the plurality of square units and splicing judgment data to determine a unit splicing result. The present disclosure does not require a large amount of prior data, saves costs, and is suitable for splicing judgment of various combination styles, avoids the problem of convergence difficulty, improves scalability, and thus effectively improves the accuracy and reliability of unit splicing judgment of fixed styles.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image processing technology, and in particular to an image detection method, apparatus, device and medium. Background Technology

[0002] With the continuous development of computer technology, more and more puzzle games are combining interactive processes with computer technology, greatly enhancing the fun and technological feel of the games.

[0003] In many interactive game scenarios, real-time detection of interactive images is required to inform subsequent game outcomes. Examples include Rubik's Cube games, jigsaw puzzles, and building block games. These games need to determine if a completed puzzle exists in real-time to verify its correctness. While detection algorithms can be used to determine the presence of puzzle pieces in images, these methods suffer from high costs, high false positive rates, difficulty in algorithm convergence, and limited scalability. Summary of the Invention

[0004] To solve the above-mentioned technical problems, or at least partially solve them, this disclosure provides an image detection method, apparatus, device, and medium.

[0005] According to one aspect of this disclosure, an image detection method is provided, comprising:

[0006] Acquire the image to be tested, which includes multiple square units;

[0007] Based on the correction model, the side correction processing is performed on multiple square units in the image under test to obtain the corrected image;

[0008] Based on the position detection model, the center point coordinates and border angles of multiple square units in the corrected image are determined;

[0009] Based on the center point coordinates and border angles of the multiple square units, the vertex coordinate sequence of the multiple square units is determined;

[0010] Based on the vertex coordinate sequence of the multiple square units and the splicing judgment data, the corrected image is subjected to unit splicing detection of the target rectangle to determine the unit splicing result.

[0011] According to another aspect of this disclosure, an image detection apparatus is provided, comprising:

[0012] The acquisition module is used to acquire the image to be tested, which includes multiple square units;

[0013] The correction module is used to perform lateral correction processing on multiple square units in the image under test based on the correction model to obtain a corrected image;

[0014] The position module is used to determine the center point coordinates and border angles of multiple square units in the corrected image based on the position detection model.

[0015] A sequence module is used to determine the vertex coordinate sequence of the multiple square units by using the center point coordinates and border angles of the multiple square units.

[0016] The stitching detection module is used to perform target rectangle unit stitching detection on the corrected image based on the vertex coordinate sequence of the multiple square units and stitching judgment data, and to determine the unit stitching result.

[0017] According to another aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory storing a program, wherein the program includes instructions that, when executed by the processor, cause the processor to perform the image detection method described above.

[0018] According to another aspect of this disclosure, a computer-readable storage medium is provided, the storage medium storing a computer program for performing the above-described image detection method.

[0019] The image detection method and apparatus provided in this embodiment acquire a test image comprising multiple square units; perform lateral correction processing on the multiple square units in the test image based on a correction model to obtain a corrected image; determine the center point coordinates and border angles of the multiple square units in the corrected image based on a position detection model; determine the vertex coordinate sequence of the multiple square units based on the center point coordinates and border angles of the multiple square units; and perform target rectangle unit splicing detection on the corrected image based on the vertex coordinate sequence of the multiple square units and splicing judgment data to determine the unit splicing result. By employing the above technical solution, position detection is performed on the corrected image after lateral correction processing of the test image to determine the center point coordinates and border angles of each square unit, thereby determining the vertex coordinate sequence of each square unit. Using this vertex coordinate sequence and splicing judgment data, target rectangle unit splicing detection can be achieved in the test image. Compared to related technologies, this method does not require a large amount of prior data, saving costs. Furthermore, it adapts to splicing judgments of various combination styles, avoiding convergence difficulties and improving scalability, thus effectively improving the accuracy and reliability of unit splicing judgments for fixed styles.

[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0021] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0022] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a schematic flowchart of an image detection method provided in an embodiment of the present disclosure;

[0024] Figure 2 A schematic diagram of a target rectangle provided in an embodiment of this disclosure;

[0025] Figure 3 A schematic diagram of another target rectangle provided in an embodiment of this disclosure;

[0026] Figure 4 A schematic diagram of yet another target rectangle provided in an embodiment of this disclosure;

[0027] Figure 5 A schematic diagram of yet another target rectangle provided in an embodiment of this disclosure;

[0028] Figure 6 A schematic flowchart of another image detection method provided in an embodiment of this disclosure;

[0029] Figure 7 A schematic diagram of an image to be tested provided in an embodiment of this disclosure;

[0030] Figure 8 A schematic diagram illustrating the position information of a square unit provided in an embodiment of this disclosure;

[0031] Figure 9 This is a schematic diagram of the structure of an image detection device provided in an embodiment of the present disclosure;

[0032] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0033] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0034] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0035] The term "comprising" and its variations as used in this disclosure are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc., mentioned in this disclosure are used only to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.

[0036] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0037] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0038] Combining educational games with computer-based smart hardware defines a new experience for early childhood education toys. Compared to traditional educational games, these toys are not only more technologically advanced but also more fun. In many interactive game scenarios, real-time detection of interactive images is required to provide feedback on the game's outcome. Examples include Rubik's Cube games, jigsaw puzzles, and building block games, where real-time image analysis is needed to determine if a complete puzzle has been created, in order to verify the correctness of the final result. In related technologies, the position of the final stitched result in an image can be directly detected using detection algorithms. However, this method is prone to false detections when there are many units in the game and their positions are very close. Furthermore, these false detections are difficult to resolve by debugging the algorithm code and require the collection of a large amount of negative sample data, which is costly. The stitching process involves diverse combinations. For example, if four squares are selected and used to form a 2*2 square combination, there are 216 possible patterns. Considering that there are more than four styles of squares, the number of combinations will be even greater. Therefore, the algorithm for directly detecting the result will have difficulty converging. Moreover, when the combination patterns are expanded, data needs to be collected again to retrain the algorithm. For example, even if the model converges for 2*2 square combinations, when it is expanded to 3*3 square combinations, data needs to be collected again and the model needs to be retrained, resulting in low scalability.

[0039] To improve at least one of the above problems, this disclosure provides an image detection method, apparatus, device, and medium, which are described below for ease of understanding.

[0040] Figure 1 This is a flowchart illustrating an image detection method provided in an embodiment of the present disclosure. The method can be executed by an image detection device, which can be implemented in software and / or hardware, and is generally integrated into an electronic device. Figure 1 As shown, the method includes:

[0041] Step 101: Obtain the image to be tested, which includes multiple square units.

[0042] The image to be tested can be any image comprising multiple identical square units that requires a determination of whether there is a splicing result. A square unit can be understood as a cube-shaped unit that can be spliced ​​together. The specific physical object of the square unit is not limited; for example, a square unit can be a square puzzle piece, a Rubik's Cube, or a building block. Furthermore, the source of the image to be tested is not limited; for example, the image to be tested can be an image captured in real-time from the game interface using an image acquisition device, or a game image downloaded from the internet.

[0043] The image under test in this embodiment of the disclosure is illustrated by taking an image taken from a top-down angle as an example, where only one side of each square unit is displayed in the image. Even if other sides of the square units in the image under test are partially displayed, this embodiment of the disclosure only focuses on the side with the largest area of ​​the square unit, and subsequently, the side with the largest area of ​​the square unit will be the surface to be tested.

[0044] Step 102: Perform lateral correction processing on multiple square units in the image under test based on the correction model to obtain the corrected image.

[0045] The correction model can be a pre-built model or algorithm used to convert an image into a top-down view. This model performs lateral correction on each square unit in the image, ensuring that only the side with the largest area is retained. The corrected image is the image obtained after lateral correction of the image under test.

[0046] The image detection device can input the image to be tested into a correction model. This model then performs lateral correction processing on each square unit in the image, essentially retaining only the side with the largest area of ​​each square unit and deleting portions of the other sides to obtain a corrected image. By adding this correction processing to the image to be tested, the accuracy of subsequent stitching judgments is effectively improved.

[0047] Step 103: Based on the position detection model, determine the center point coordinates and border angles of multiple square units in the corrected image.

[0048] The center point coordinates can be the coordinates of the center point of the square unit in the image to be tested, and the border angle can be the angle at which a certain edge of the square unit first coincides with the horizontal coordinate axis when the tested surface of the square unit in the image to be tested is rotated clockwise. The position detection model can be a pre-trained deep learning model used to detect the position of the square unit in the image. The specific model used is not limited. For example, in this embodiment, the position detection model can be a CenterNet or YOLOv7 model.

[0049] The image detection device can input the corrected image into the position detection model, detect square units in the corrected image, and determine the corresponding center point coordinates and border angle for each detected square unit.

[0050] Step 104: Determine the vertex coordinate sequence of multiple square units based on the center point coordinates and border angles of the multiple square units.

[0051] The vertex coordinate sequence includes four vertex coordinates. The vertex coordinate sequence corresponding to a square unit can be a sequence composed of the four vertex coordinates of the square unit's surface to be measured.

[0052] In some embodiments, determining the vertex coordinate sequence of multiple square units based on the center point coordinates and border angles of multiple square units may include: determining the side length of each square unit in the corrected image; for each square unit, determining the coordinates of the four vertices of the square unit based on the center point coordinates of the square unit, half the side length of the square unit, and the sine and cosine functions of the border angle of the square unit, thereby obtaining the vertex coordinate sequence of the square unit.

[0053] The side length can be the side length of each face of the square unit. Since the square unit is a cube, the side length of each face is the same. In some embodiments, determining the side length of each square unit in the corrected image may include: obtaining the side length of each square unit in the corrected image based on the ruler tool of the image editing tool; or, determining the side length of each square unit based on the width of the corrected image and a predetermined ratio.

[0054] The image editing tool can be any tool capable of editing images, and is not specifically limited thereto. The ruler tool can be any tool within the image editing tool used for measuring within the image. The image detection device can input the corrected image into the image editing tool and measure the side length of each square unit using the ruler tool. In this embodiment, the side length of each square unit in the corrected image is the same. This method requires re-measuring the side length when the size of the corrected image changes due to changes in the lens height of the image acquisition device. Alternatively, the image detection device can pre-determine the proportion of the side length of the square unit to the width of the image to be measured through statistical analysis of multiple acquired images. Then, the width of the corrected image can be obtained through the image editing tool, and the product of the width of the corrected image and this proportion can be used to determine the side length of the square unit. This method is also effective when the size of the image to be measured changes.

[0055] In related technologies, when two square units of the same color are adjacent, the detection model has difficulty in defining the specific selection range of the top face of each square unit when inferring the side length of the square unit by using detection algorithms. Furthermore, since the colors of each face in the same square unit are the same and a small part of the side may still be exposed after correction, it is easy to cause inaccurate selection, resulting in inaccurate position of the determined square unit.

[0056] In this embodiment, since the pattern printed on the square unit can be used as an effective feature for center point detection, the center point of the square unit on the side with the largest area in the image is a highly discriminative target. This embodiment does not directly detect the position of the square unit, but detects the coordinates of the center point, and determines the side length of the square unit in a simple way, which effectively improves the accuracy of position determination.

[0057] For each square cell, the image detection device calculates the coordinates of its four vertices based on the coordinates of its center point, half its side length, and the sine and cosine functions of its border angle, thus obtaining the vertex coordinate sequence of the square cell. Assuming the side length of the nth square cell to be measured is h, its center point coordinates are (xc, yc), and its border angle is θ, the coordinates of the four vertices of this square cell's surface to be measured are calculated using the following formula:

[0058]

[0059]

[0060]

[0061]

[0062] Then the vertex coordinate sequence of the nth square unit is represented as Pn, then Pn = (pn1, pn2, pn3, pn4).

[0063] Step 105: Based on the vertex coordinate sequence of multiple square units and the splicing judgment data, perform unit splicing detection of the target rectangle on the corrected image to determine the unit splicing result.

[0064] The target rectangle can be the result of the rectangle style to be judged by the splicing judgment, that is, it is necessary to judge whether there is a unit splicing result of the target rectangle style obtained by splicing or combining multiple square units mentioned above in the image to be tested.

[0065] For example, Figure 2 A schematic diagram of a target rectangle provided in an embodiment of this disclosure, as shown below. Figure 2 As shown in the image, a target rectangle is formed by piecing together two square units. This target rectangle is linear, with its width significantly greater than its height. It's important to understand that the number of square units in the image is merely an example; regardless of the number of square units, this type of rectangle can be obtained by piecing them together. For instance, piecing together four square units in a row will result in a linear target rectangle. This is an example. Figure 3 A schematic diagram of another target rectangle provided in this disclosure embodiment, as shown below. Figure 3 As shown in the figure, a target rectangle is formed by piecing together four square units. The target rectangle is a square with a width equal to its height. It should be understood that the number of square units in the figure is just an example. For example, nine square units can also be pieced together to form a target rectangle with a width equal to its height.

[0066] For example, Figure 4 This is a schematic diagram of yet another target rectangle provided in an embodiment of this disclosure. Figure 5This is a schematic diagram of another target rectangle provided in an embodiment of the present disclosure. Figure 4 and Figure 5 The images show two target rectangles formed by assembling six square units. Figure 4 The target rectangle in the image has a width smaller than its height. Figure 5 The target rectangle in the image is wider than its height. This is understandable because the number of square units in the image is just an example; for instance, 8 square units could also be pieced together to create a similar rectangle. Figure 4 Target rectangles with width less than height and similar Figure 5 The target rectangle has a width greater than its height. This is understandable. Figures 2-5 The style of the target rectangle shown is for illustrative purposes only. The style of the spliced ​​target rectangle can be different when the number of square units is different.

[0067] The splicing judgment data can be related data used to determine whether there is a fixed pattern in the image under test that is spliced ​​by different square units. In this embodiment of the present disclosure, the splicing judgment data can include a splicing distance threshold and target parameters. The splicing distance threshold can be the maximum distance between two square units to determine whether they can splice some vertices. The threshold can be set according to the actual situation. The target parameters can be the parameters of the target rectangle, specifically including the target number of multiple square units included in the target rectangle and the target aspect ratio of the target rectangle.

[0068] For example, Figure 6 This is a flowchart illustrating another image detection method provided in an embodiment of the present disclosure. In one feasible implementation, step 105 may include the following steps:

[0069] Step 601: Determine the initial coordinate set based on the multiple vertex coordinate sequences corresponding to multiple square units.

[0070] The image detection device can combine multiple vertex coordinate sequences of multiple square units to obtain an initial coordinate set.

[0071] Step 602: Perform splicing processing on the initial coordinate set based on the splicing distance threshold to obtain the target coordinate set.

[0072] The splicing distance threshold can be the maximum distance between the vertices of two square units that can be spliced ​​together. This splicing distance threshold can be adjusted according to the actual situation, and strict or lenient splicing judgment can be achieved by adjustment. The target coordinate set can be the final position sequence obtained after splicing the vertex coordinates of the square units in the initial coordinate set. The vertex coordinates of the square units included in the target coordinate set cannot be spliced ​​again.

[0073] In some embodiments, performing splicing processing on the initial coordinate set based on a splicing distance threshold to obtain a target coordinate set may include: determining the initial coordinate set as a set to be processed; for any vertex coordinate sequence in the set to be processed, if it is determined according to the splicing distance threshold that there exists a coordinate sequence to be spliced ​​in the set that satisfies the splicing condition with the vertex coordinate sequence, then splicing the vertex coordinate sequence with the coordinate sequence to be spliced ​​to obtain a new vertex coordinate sequence, and replacing the vertex coordinate sequence and the coordinate sequence to be spliced ​​in the set to be processed with the new vertex coordinate sequence; if it is determined according to the splicing distance threshold that there is no coordinate sequence to be spliced ​​in the set that satisfies the splicing condition with the vertex coordinate sequence, adding the vertex coordinate sequence to the target coordinate set; updating the target coordinate set to the new set to be processed and returning to continue judging the splicing condition for any vertex coordinate sequence therein, until the different vertex coordinate sequences included in the target coordinate set no longer satisfy the splicing condition.

[0074] Suppose the set to be processed is represented as [P1, P2, ..., PN], where Pi represents the vertex coordinate sequence of the i-th square unit, i = 1, 2, 3, ..., k, k represents the total number of units in multiple directions, and Pi = (i1, i2, i3, i4), where i1, i2, i3, i4 represent the coordinates of the four vertices of a square unit; for any vertex coordinate sequence Pm = (m1, m2, m3, m4) (i = m) in the set to be processed, determine whether there exists a vertex coordinate sequence in the set to be processed that satisfies the splicing condition with Pm based on the splicing distance threshold. If Pn = (n1, n2, n3...) If the vertex coordinate sequence Pn satisfies the concatenation condition with Pm (i=n), then Pn is the coordinate sequence to be concatenated. Then, this vertex coordinate sequence Pm can be concatenated with the coordinate sequence to be concatenated Pn to obtain a new vertex coordinate sequence Pmn = (ma, mb, nc, nd), where ma and mb are the coordinates of the two remaining vertices from m1, m2, m3, m4 after concatenation, and nc and nd are the coordinates of the two remaining vertices from n1, n2, n3, n4 after concatenation. Then, this vertex coordinate sequence Pm and the coordinate sequence to be concatenated Pn can be deleted from the set to be processed, and a new vertex coordinate sequence Pmn can be added to achieve replacement. If, based on the concatenation distance threshold, it is determined that there is no coordinate sequence to be concatenated Pn in the set to be processed that satisfies the concatenation condition with this vertex coordinate sequence Pm, then this vertex coordinate sequence Pm is added to the target coordinate set. The target coordinate set is updated to the new set to be processed, and the process is repeated for each vertex coordinate sequence until the concatenation condition is no longer satisfied between different vertex coordinate sequences included in the target coordinate set.

[0075] The aforementioned splicing conditions can be specific conditions used to determine that there are two adjacent vertices in the coordinate sequences of two square units, requiring splicing. Optionally, determining whether there exists a coordinate sequence to be spliced ​​in the set of to be processed that satisfies the splicing conditions based on the splicing distance threshold can include: extracting multiple pairs of vertices to be calculated from the vertex coordinate sequence and each remaining coordinate sequence in the set of to be processed, wherein each pair of vertices to be calculated includes a vertex coordinate from the vertex coordinate sequence and a vertex coordinate from the remaining coordinate sequence; determining the distance between the two vertex coordinates of each pair of vertices to be calculated, and identifying the pair of vertices to be calculated with a distance less than the splicing distance threshold as the target vertex pair; if there exists a remaining coordinate sequence that includes two target vertex pairs with the vertex coordinate sequence, then the remaining coordinate sequence is determined as a coordinate sequence to be spliced ​​that satisfies the splicing conditions with the vertex coordinate sequence.

[0076] When the image detection device determines whether there exists a coordinate sequence in the set to be processed that satisfies the splicing condition, it can extract a vertex coordinate from the coordinate sequence to be processed and extract another vertex coordinate from a remaining coordinate sequence in the set other than the coordinate sequence to be processed, combining them to obtain a vertex pair to be calculated. The coordinate sequence to be processed and a remaining coordinate sequence can extract 16 vertex pairs to be calculated. The number of remaining coordinate sequences can be one or more, thus obtaining multiple vertex pairs to be calculated. For each vertex pair to be calculated, the distance between the two vertex coordinates included is determined. This distance is the Euclidean distance, and the distance is compared with the splicing distance threshold. If the distance is less than the splicing distance threshold, the current vertex pair to be calculated is the target vertex pair. If the coordinate sequence to be processed and a remaining coordinate sequence include two of the above-mentioned target vertex pairs, that is, there are two adjacent vertices between the square unit corresponding to the coordinate sequence to be processed and the square unit corresponding to the current remaining coordinate sequence, then the current remaining coordinate sequence is a coordinate sequence to be spliced ​​that satisfies the splicing condition with the coordinate sequence to be processed. Then, the coordinate sequence to be processed and the coordinate sequence to be spliced ​​can be spliced ​​together. Specifically, the splicing process can be done by removing the coordinates of two adjacent vertices in the coordinate sequence to be processed and the coordinate sequence to be spliced, and then removing the coordinates of two adjacent vertices in the coordinate sequence to be spliced ​​and the coordinate sequence to be processed. The new vertex coordinate sequence is obtained by combining the remaining vertex coordinates in the coordinate sequence to be processed and the coordinate sequence to be spliced ​​after the removal.

[0077] For example, assuming the above coordinate sequence P1 to be processed and a remaining coordinate sequence Pr, for the 16 vertex pairs to be calculated extracted from P1 and Pr, the distance between the coordinates of the two vertices in each vertex pair to be calculated is determined using the following formula: d = distance((x1,y1),(xr,yr)) = sqrt((x1-xr)^2+(y1-yr)^2), where d represents the Euclidean distance between the coordinates of the two vertices, (x1,y1) represents the vertex coordinates of a vertex in P1, (xr,yr) represents the vertex coordinates of a vertex in Pr, and distance(*) represents the specific calculation formula for the Euclidean distance; The above formula can calculate the distance between the two vertex coordinates corresponding to the 16 vertex pairs to be calculated between P1 and Pr. By comparing the distance with the splicing distance threshold, the target vertex pairs among the 16 vertex pairs to be calculated are determined. If two target vertex pairs are included, then Pr and P1 satisfy the splicing condition, and Pr is the coordinate sequence to be spliced ​​of P1. Then P1 and Pr are spliced. The specific splicing process can be to remove the two vertex coordinates adjacent to the coordinate sequence to be spliced ​​of Pr in the coordinate sequence to be processed P1, and remove the two vertex coordinates adjacent to the coordinate sequence to be processed of Pr in the coordinate sequence to be spliced ​​of Pr. The remaining vertex coordinates in P1 and Pr after removal are combined to obtain a new vertex coordinate sequence.

[0078] In the above scheme, when judging whether the vertex coordinates of multiple square units meet the splicing conditions, a splicing distance threshold is introduced, which makes the judgment more adjustable. By adjusting the threshold, strict or lenient judgments can be achieved, thereby making the judgment results more flexible and accurate.

[0079] Step 603: Based on the target coordinate set and target parameters, perform target rectangle unit stitching detection on the corrected image to determine the unit stitching result.

[0080] The target parameters can be parameters of the target rectangle, specifically including the number of square units included in the target rectangle and the target aspect ratio of the target rectangle. For example, if the target rectangle is a square formed by splicing together 4 square units, then the number of targets is 4 and the target aspect ratio is 1.

[0081] In some embodiments, the unit stitching detection of the target rectangle in the corrected image based on the target coordinate set and target parameters, and the determination of the unit stitching result, may include: if there is a vertex coordinate sequence in the target coordinate set with a number of units equal to the number of targets and an aspect ratio equal to the aspect ratio of the targets, then the unit stitching result of the corrected image is determined to have a target rectangle.

[0082] The image detection device merges the vertex coordinates of multiple square units based on the initial position sequence and the stitching distance threshold to obtain the target coordinate set. Since the target coordinate set may include at least one vertex coordinate sequence, the number of units included in the rectangle corresponding to each vertex coordinate sequence can be determined first. This number of units can be determined based on the number of times the vertex coordinate sequence is merged in the above merging process. Adding one to the number of merges gives the number of units corresponding to a vertex coordinate sequence. Vertex coordinate sequences with a number of units equal to the target number are then extracted. If no vertex coordinate sequence with a number of units equal to the target number exists, the unit stitching result of the corrected image is determined to be a target rectangle without a target rectangle. If at least one vertex coordinate sequence has the same number of units as the target number, then at least one vertex coordinate sequence with the same number of units as the target number is determined as at least one candidate. Coordinate sequence; determine the aspect ratio corresponding to each candidate coordinate sequence. Specifically, this determination method may include: determining the distance between each pair of vertices in the four vertex coordinates of each candidate coordinate sequence, obtaining 12 distance values; determining the minimum of these 12 distance values ​​as the height; determining the median of these 12 distance values ​​as the width; calculating the ratio of width to height and rounding the result to determine the aspect ratio corresponding to the current candidate coordinate sequence; comparing the aspect ratio of each candidate coordinate sequence with the target aspect ratio; if there is a candidate coordinate sequence with an aspect ratio equal to the target aspect ratio, then the unit stitching result of the corrected image is determined to have a target rectangle, and the candidate coordinate sequence with the same aspect ratio as the target aspect ratio is determined to be the unit stitching result of the target rectangle; if there is no candidate coordinate sequence with an aspect ratio equal to the target aspect ratio, then the unit stitching result of the corrected image is determined to have no target rectangle.

[0083] Optionally, when there are at least two candidate coordinate sequences with the same aspect ratio as the target aspect ratio, the image detection device can further determine the center point coordinates of each of the at least two candidate coordinate sequences with the same aspect ratio as the target aspect ratio, and determine the candidate coordinate sequence with the smallest distance between its center point coordinates and the center point coordinates of the corrected image as the final unit stitching result of the target rectangle. When there are at least two candidate coordinate sequences with the same aspect ratio as the target aspect ratio, there are at least two unit stitching results of the target rectangle in the corrected image. At this time, the unit stitching results of the current at least two target rectangles can be filtered, and the rectangle corresponding to the candidate coordinate sequence closest to the center point of the corrected image is selected as the result that best meets the user's attention and actual needs, which helps in the subsequent determination of whether the stitching result is correct.

[0084] Optionally, when the splicing judgment data does not include the target parameter, it is also possible to determine whether the corrected image includes the unit splicing result based on the target coordinate set. In this case, the splicing style is not restricted, and only the splicing result is judged. Specifically, when the target coordinate set includes at least one vertex coordinate sequence with a merging count greater than or equal to 1, it can be determined that the corrected image includes the unit splicing result. Whether the style corresponding to the unit splicing result is the target rectangle and whether the result is correct can be judged in subsequent steps.

[0085] In summary, the image detection method provided in this disclosure involves: acquiring a test image comprising multiple square units; performing lateral correction processing on the multiple square units in the test image based on a correction model to obtain a corrected image; determining the center point coordinates and border angles of the multiple square units in the corrected image based on a position detection model; determining the vertex coordinate sequence of the multiple square units based on the center point coordinates and border angles of the multiple square units; and performing target rectangle unit splicing detection on the corrected image based on the vertex coordinate sequence of the multiple square units and splicing judgment data to determine the unit splicing result. By employing the above technical solution, position detection is performed on the corrected image after lateral correction processing of the test image to determine the center point coordinates and border angles of each square unit, thereby determining the vertex coordinate sequence of each square unit. Using this vertex coordinate sequence and splicing judgment data, target rectangle unit splicing detection can be achieved in the test image. Compared to related technologies, this method does not require a large amount of prior data, saving costs. Furthermore, it adapts to splicing judgments of various combination styles, avoiding convergence difficulties and improving scalability, thus effectively improving the accuracy and reliability of unit splicing judgments for fixed styles.

[0086] The image detection method of this disclosure embodiment will be further illustrated by a specific example below. For example, Figure 7 This is a schematic diagram of an image to be tested provided in an embodiment of the present disclosure, such as... Figure 7 As shown in the figure, the physical object of the square unit is a Rubik's Cube block, which is a test image 700. This test image 700 includes 14 Rubik's Cube blocks, each with a corresponding Rubik's Cube image. The figure is only an example. Figure 8 This is a schematic diagram of a corrected image provided in an embodiment of the present disclosure, such as... Figure 8 As shown in the figure, the figure illustrates the... Figure 7The corrected image 800 is obtained after the side correction processing of the image to be tested. This corrected image 800 can be detected using a position detection model. In this image 800, each square unit is selected using a black rectangle, and the center coordinates and border angles of each square unit are known. Assuming the target rectangle has 4 targets with an aspect ratio of 1, and the stitching distance threshold is set relatively small, then after the judgment in step 103 above, it is determined that the unit stitching result of the image to be tested 700 contains only one target rectangle. See [link to relevant documentation]. Figure 8 Rectangle 801 in the middle.

[0087] The image detection scheme provided in this disclosure performs lateral correction processing on the image under test. It then uses a deep learning detection algorithm to detect the center point coordinates and border angles of individual square units, thereby determining the corresponding vertex coordinate sequence. Based on the vertex coordinate sequence of individual square units and splicing judgment data, it determines whether a target rectangular unit splicing result exists in the image under test. This scheme can determine whether a fixed rectangular pattern of spliced ​​units exists in the image based on the detection algorithm and corresponding discrimination strategy. This greatly avoids false detections and improves the accuracy of splicing judgment results. This helps in subsequent judgment of the accuracy of splicing results and determination of the cause of splicing errors, etc., and allows for real-time feedback based on these judgment results, improving the experience of splicing games. Furthermore, a threshold is introduced in the discrimination process, making the discrimination more adjustable. By adjusting the threshold, strict or lenient discrimination can be achieved, making the discrimination results more flexible and accurate. Simultaneously, this scheme uses the position information of the smallest unit, i.e., a single square unit, for discrimination, facilitating the subsequent expansion of splicing multiple square units.

[0088] Corresponding to the aforementioned image detection method, this disclosure also provides an image detection apparatus. Figure 9 This is a schematic diagram of the structure of an image detection device provided in an embodiment of this disclosure. The device can be implemented by software and / or hardware, and is generally integrated into an electronic device. Figure 9 As shown, the image detection device 900 includes:

[0089] The acquisition module 901 is used to acquire the image to be tested, which includes multiple square units;

[0090] The correction module 902 is used to perform lateral correction processing on multiple square units in the image to be tested based on the correction model to obtain a corrected image;

[0091] The position module 903 is used to determine the center point coordinates and border angles of multiple square units in the corrected image based on the position detection model.

[0092] Sequence module 904 is used to determine the vertex coordinate sequence of the multiple square units by using the center point coordinates and border angles of the multiple square units.

[0093] The stitching detection module 905 is used to perform target rectangle unit stitching detection on the corrected image based on the vertex coordinate sequence of the multiple square units and stitching judgment data, and determine the unit stitching result.

[0094] In the aforementioned apparatus, a test image comprising multiple square units is acquired; a corrected image is obtained by performing lateral correction processing on the multiple square units in the test image based on a correction model; the center point coordinates and border angles of the multiple square units in the corrected image are determined based on a position detection model; the vertex coordinate sequence of the multiple square units is determined based on the center point coordinates and border angles of the multiple square units; and the unit splicing detection of the target rectangle is performed on the corrected image based on the vertex coordinate sequence of the multiple square units and splicing judgment data to determine the unit splicing result. By employing the above technical solution, position detection is performed on the corrected image after lateral correction processing of the test image to determine the center point coordinates and border angles of each square unit, thereby determining the vertex coordinate sequence of each square unit. Using this vertex coordinate sequence and splicing judgment data, the unit splicing detection of the target rectangle in the test image can be achieved. Compared to related technologies, this method does not require a large amount of prior data, saving costs, and is adaptable to splicing judgments of various combination styles, avoiding convergence difficulties and improving scalability. This effectively improves the accuracy and reliability of unit splicing judgments for fixed styles.

[0095] In some implementations, the sequence module 904 is used for:

[0096] Determine the side length of each square unit in the corrected image;

[0097] For each square cell, based on the coordinates of the center point of the square cell, half the side length of the square cell, and the sine and cosine functions of the border angle of the square cell, the coordinates of the four vertices of the square cell are determined, and the vertex coordinate sequence of the square cell is obtained.

[0098] In some implementations, the splicing judgment data includes a splicing distance threshold and target parameters, and the splicing detection module 905 includes:

[0099] A set unit is used to determine an initial coordinate set based on the multiple vertex coordinate sequences corresponding to the multiple square units;

[0100] A splicing unit is used to splice the initial coordinate set based on the splicing distance threshold to obtain a target coordinate set;

[0101] The detection unit is used to perform target rectangle unit stitching detection on the corrected image based on the target coordinate set and the target parameters, and to determine the unit stitching result.

[0102] In some implementations, the splicing unit is used for:

[0103] The initial set of coordinates is determined as the set to be processed;

[0104] For any vertex coordinate sequence in the set to be processed, if it is determined according to the splicing distance threshold that there exists a coordinate sequence to be spliced ​​in the set that satisfies the splicing condition with the vertex coordinate sequence, then the vertex coordinate sequence is spliced ​​with the coordinate sequence to be spliced ​​to obtain a new vertex coordinate sequence, and the vertex coordinate sequence and the coordinate sequence to be spliced ​​in the set to be processed are replaced with the new vertex coordinate sequence.

[0105] If it is determined, based on the splicing distance threshold, that there is no vertex coordinate sequence in the set to be processed that satisfies the splicing condition, then the vertex coordinate sequence is added to the target coordinate set.

[0106] The target coordinate set is updated to a new set to be processed, and the process continues to judge the splicing condition for any vertex coordinate sequence in the set until the splicing condition is no longer satisfied among the different vertex coordinate sequences included in the target coordinate set.

[0107] In some implementations, the splicing unit is specifically used for:

[0108] Extract multiple pairs of vertices to be calculated from the vertex coordinate sequence and each of the remaining coordinate sequences in the set to be processed, wherein each pair of vertices to be calculated includes a vertex coordinate from the vertex coordinate sequence and a vertex coordinate from the remaining coordinate sequences;

[0109] Determine the distance between the coordinates of the two vertices of each vertex pair to be calculated, and identify vertex pairs to be calculated whose distance is less than the splicing distance threshold as target vertex pairs;

[0110] If there exists a remaining coordinate sequence that includes two target vertex pairs with the vertex coordinate sequence, then the remaining coordinate sequence is determined to be a coordinate sequence to be spliced ​​that satisfies the splicing condition with the vertex coordinate sequence.

[0111] In some embodiments, the target parameters include the target number of the plurality of square units included in the target rectangle and the target aspect ratio of the target rectangle, and the detection unit is used for:

[0112] If there exists a vertex coordinate sequence in the target coordinate set whose number of units is equal to the number of targets and whose aspect ratio is equal to the aspect ratio of the targets, then the unit stitching result of the corrected image is determined to contain the target rectangle.

[0113] The image detection apparatus provided in this disclosure can execute the image detection method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the method.

[0114] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device embodiments can be referred to the corresponding process in the method embodiments, and will not be repeated here.

[0115] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0116] Exemplary embodiments of this disclosure also provide an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to cause the electronic device to perform a method according to an embodiment of this disclosure.

[0117] Exemplary embodiments of this disclosure also provide a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a computer's processor, is used to cause the computer to perform a method according to embodiments of this disclosure.

[0118] Exemplary embodiments of this disclosure also provide a computer program product, including a computer program, wherein, when executed by a processor of a computer, the computer program is used to cause the computer to perform a method according to an embodiment of this disclosure.

[0119] The computer program product can be written in any combination of one or more programming languages ​​to perform the operations of the embodiments of this disclosure. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0120] Furthermore, embodiments of this disclosure can also be computer-readable storage media storing computer program instructions that, when executed by a processor, cause the processor to perform the XYZ method provided in embodiments of this disclosure. The computer-readable storage medium can be any combination of one or more readable media. A readable medium can be a readable signal medium or a readable storage medium. A readable storage medium can be, for example, including but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0121] refer to Figure 10 , Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. A structural block diagram of an electronic device 1000 that can serve as a server or client of the present disclosure is now described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, 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 processors, cellular phones, smartphones, 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 claimed herein.

[0122] like Figure 10 As shown, the electronic device 1000 includes a computing unit 1001, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1002 or a computer program loaded from a storage unit 1008 into a random access memory (RAM) 1003. The RAM 1003 may also store various programs and data required for the operation of the device 1000. The computing unit 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.

[0123] Multiple components in electronic device 1000 are connected to I / O interface 1005, including: input unit 1006, output unit 1007, storage unit 1008, and communication unit 1009. Input unit 1006 can be any type of device capable of inputting information to electronic device 1000. Input unit 1006 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device. Output unit 1007 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 1008 may include, but is not limited to, disk and optical disk. Communication unit 1009 allows electronic device 1000 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth™ devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.

[0124] The computing unit 1001 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1001 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1001 performs the various methods and processes described above. For example, in some embodiments, the image detection methods can be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 1008. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 1000 via ROM 1002 and / or communication unit 1009. In some embodiments, the computing unit 1001 can be configured to perform the image detection methods by any other suitable means (e.g., by means of firmware).

[0125] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0126] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0127] As used in this disclosure, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0128] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, 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 sound input, voice input, or tactile input).

[0129] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0130] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other.

[0131] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0132] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. An image detection method, comprising: Acquire a test image comprising multiple square units, wherein the square units are cube-shaped units that can be spliced ​​and combined with each other; Based on the correction model, the side correction processing is performed on multiple square units in the image under test to obtain the corrected image; Based on the position detection model, the center point coordinates and border angles of multiple square units in the corrected image are determined; Based on the center point coordinates and border angles of the multiple square units, the vertex coordinate sequence of the multiple square units is determined; Based on the vertex coordinate sequence of the multiple square units and the splicing judgment data, the corrected image is subjected to unit splicing detection of the target rectangle to determine the unit splicing result. The splicing judgment data includes a splicing distance threshold and target parameters. The splicing distance threshold is used to determine whether two square units can splice some vertices. The target parameters are the parameters of the target rectangle.

2. The image detection method as described in claim 1, wherein, Based on the center point coordinates and border angles of the plurality of square units, the vertex coordinate sequence of the plurality of square units is determined, including: Determine the side length of each square unit in the corrected image; For each square cell, based on the coordinates of the center point of the square cell, half the side length of the square cell, and the sine and cosine functions of the border angle of the square cell, the coordinates of the four vertices of the square cell are determined, and the vertex coordinate sequence of the square cell is obtained.

3. The image detection method as described in claim 1, wherein, Based on the vertex coordinate sequence of the multiple square units and the splicing judgment data, the corrected image is subjected to target rectangle unit splicing detection to determine the unit splicing result, including: Based on the multiple vertex coordinate sequences corresponding to the multiple square units, an initial coordinate set is determined; Based on the splicing distance threshold, the initial coordinate set is spliced ​​to obtain the target coordinate set; Based on the target coordinate set and the target parameters, the corrected image is subjected to unit stitching detection of target rectangles to determine the unit stitching result.

4. The image detection method as described in claim 3, wherein, Based on the splicing distance threshold, the initial coordinate set is spliced ​​to obtain the target coordinate set, including: The initial set of coordinates is determined as the set to be processed; For any vertex coordinate sequence in the set to be processed, if it is determined according to the splicing distance threshold that there exists a coordinate sequence to be spliced ​​in the set that satisfies the splicing condition with the vertex coordinate sequence, then the vertex coordinate sequence is spliced ​​with the coordinate sequence to be spliced ​​to obtain a new vertex coordinate sequence, and the vertex coordinate sequence and the coordinate sequence to be spliced ​​in the set to be processed are replaced with the new vertex coordinate sequence. If it is determined, based on the splicing distance threshold, that there is no vertex coordinate sequence in the set to be processed that satisfies the splicing condition, then the vertex coordinate sequence is added to the target coordinate set. The target coordinate set is updated to a new set to be processed, and the process continues to judge the splicing condition for any vertex coordinate sequence in the set until the splicing condition is no longer satisfied among the different vertex coordinate sequences included in the target coordinate set.

5. The image detection method as described in claim 4, wherein, Based on the splicing distance threshold, a coordinate sequence to be spliced ​​that satisfies the splicing condition with the vertex coordinate sequence exists in the set to be processed, including: Extract multiple pairs of vertices to be calculated from the vertex coordinate sequence and each of the remaining coordinate sequences in the set to be processed, wherein each pair of vertices to be calculated includes a vertex coordinate from the vertex coordinate sequence and a vertex coordinate from the remaining coordinate sequences; Determine the distance between the coordinates of the two vertices of each vertex pair to be calculated, and identify vertex pairs to be calculated whose distance is less than the splicing distance threshold as target vertex pairs; If there exists a remaining coordinate sequence that includes two target vertex pairs with the vertex coordinate sequence, then the remaining coordinate sequence is determined to be a coordinate sequence to be spliced ​​that satisfies the splicing condition with the vertex coordinate sequence.

6. The image detection method as described in claim 4, wherein, The target parameters include the target number of the multiple square units included in the target rectangle and the target aspect ratio of the target rectangle. Based on the target coordinate set and the target parameters, the corrected image is subjected to unit stitching detection of the target rectangle to determine the unit stitching result, including: If there exists a vertex coordinate sequence in the target coordinate set whose number of units is equal to the number of targets and whose aspect ratio is equal to the aspect ratio of the targets, then the unit stitching result of the corrected image is determined to contain the target rectangle.

7. An image detection device, characterized in that, include: The acquisition module is used to acquire a test image comprising multiple square units, wherein the square units are cube-shaped units that can be spliced ​​and combined with each other; The correction module is used to perform lateral correction processing on multiple square units in the image under test based on the correction model to obtain a corrected image; The position module is used to determine the center point coordinates and border angles of multiple square units in the corrected image based on the position detection model. A sequence module is used to determine the vertex coordinate sequence of the multiple square units by using the center point coordinates and border angles of the multiple square units. The stitching detection module is used to perform target rectangle unit stitching detection on the corrected image based on the vertex coordinate sequence of the multiple square units and stitching judgment data, and determine the unit stitching result. The stitching judgment data includes a stitching distance threshold and target parameters. The stitching distance threshold is used to determine whether two square units can stitch together some vertices. The target parameters are the parameters of the target rectangle.

8. The image detection apparatus as described in claim 7, wherein, The sequence module is used for: Determine the side length of each square unit in the corrected image; For each square cell, based on the coordinates of the center point of the square cell, half the side length of the square cell, and the sine and cosine functions of the border angle of the square cell, the coordinates of the four vertices of the square cell are determined, and the vertex coordinate sequence of the square cell is obtained.

9. An electronic device, comprising: processor; as well as Stored program memory, The program includes instructions that, when executed by the processor, cause the processor to perform the image detection method according to any one of claims 1-6.

10. A computer-readable storage medium storing a computer program for performing the image detection method according to any one of claims 1-6.

Citation Information

Patent Citations

  • Image splicing method and device, electronic equipment and storage medium

    CN115439328A

  • Container number identification method, system and device and storage medium

    CN116994262A

  • Method and System for Real-Time Square Expression

    KR1020110034502A