Object placement neatness detection method, device, equipment and storage medium
After identification and block clustering, linear and direction vector judgments are performed on each block, which solves the problem of low manual inspection detection efficiency, realizes automated detection, and improves efficiency and accuracy.
Patent Information
- Application Number
- CN202411955066.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-08
AI Technical Summary
In the prior art, the neat placement of objects is detected by manual inspection, resulting in low detection efficiency.
By identifying the objects in the object placement area, clustering the blocks, and making two-level judgments through the straight lines of each block and the direction vector of the object, the neatness of each block is determined.
Automatic detection is realized, which improves detection efficiency and accuracy, reduces human resource waste, and avoids the impact of neat blocks but untidy areas.
Smart Images

Figure CN119785105A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, device, equipment and storage medium for detecting the neatness of object placement. Background Art
[0002] In areas such as office parks or residential communities, there are usually areas where bicycles, electric bicycles or motor vehicles are parked, or items are placed. Due to the complexity of personnel, the quality of placement or parking cannot be guaranteed, and it is easy to park in a disorderly manner and have poor orderliness. Usually, the relevant management personnel of the park or community need to check / test the orderliness of the vehicles or items parked in these areas, and tidy them up if they are not in order.
[0003] In the related art, when checking or detecting the neatness of vehicles or objects parked or placed in an area, most of the methods are to manually patrol and observe the placement or parking situation of the entire area, and determine whether the placement or parking is neatly based on the observed situation.
[0004] However, the above technology has the problem of low detection efficiency. Summary of the invention
[0005] The present invention provides a method, device, equipment and storage medium for detecting the neatness of object placement, so as to solve the defect of low detection efficiency caused by manually patrolling and observing the placement or parking conditions of the entire area to determine whether the objects are neatly placed in the prior art. The method realizes that objects in the object placement area are identified and clustered into blocks, and then the final neatness of each block is determined after two-level judgment through the straight line of each block and the direction vector of the object, so that the neatness detection of each block can be automatically realized, thereby improving the detection efficiency and detection accuracy.
[0006] The present invention provides a method for detecting the neatness of object placement, comprising: Acquire the image to be tested corresponding to the object placement area, and perform recognition processing on the object in the image to be tested to determine multiple objects included in the image to be tested and position information corresponding to each object; Perform block clustering processing on each object according to the location information of each object, and determine a plurality of clustered blocks; each block includes one or more objects; According to the position information of the object in each block, two fitting lines corresponding to each block are determined, and according to the relevant parameters of the two fitting lines of each block, the initial neatness corresponding to each block is determined; the above initial neatness is used to characterize whether the block is neat.
[0007] According to a method for detecting the neatness of object placement provided by the present invention, the position information of the above-mentioned object includes the coordinates of a first key point and a second key point located at both ends of the object. The above-mentioned block clustering processing is performed on each object according to the position information of each object to determine a plurality of clustered blocks, including: Determine the coordinates of the center point of each object according to the coordinates of the first key point and the second key point of each object, and form the coordinates of each center point into a set to obtain a first center point coordinate set; Executing a straight line determination operation, the straight line determination operation comprising: determining two target center points in the first center point coordinate set, and determining a first straight line corresponding to the two target center points according to the coordinates of the two target center points; A clustering operation is performed, wherein the clustering operation includes: performing block clustering processing on each object according to the first center point coordinate set and the first straight line, and determining a plurality of clustered blocks.
[0008] According to a method for detecting the neatness of object placement provided by the present invention, the block clustering process is performed on each object according to the first center point coordinate set and the first straight line to determine a plurality of clustered blocks, including: For each center point in the first center point coordinate set, a first distance between the center point and the first straight line is calculated, and if the first distance of the center point is less than a first threshold, the center point is classified into a first block of the current iteration round; the first block is related to the first straight line of the current iteration round; Calculate a second distance between the center point and a previous center point adjacent to the center point. If the second distance is greater than a second threshold, determine that the center point is out of the first block corresponding to the previous center point, and delete the center point and its coordinates included in the first block corresponding to the previous center point from the first center point coordinate set to obtain a second center point coordinate set. The second center point coordinate set is determined as a new first center point coordinate set, and the straight line determination operation and clustering operation are iteratively executed again until a preset iteration cutoff condition is satisfied, and each first block is determined as a plurality of clustered blocks.
[0009] According to a method for detecting the neatness of object placement provided by the present invention, the position information of the object includes the coordinates of a first key point and a second key point located at both ends of the object. The method determines two fitting lines corresponding to each block according to the position information of the object in each block, and determines the initial neatness corresponding to each block according to the relevant parameters of the two fitting lines of each block, including: Determine a second straight line corresponding to each block according to the coordinates of the first key point and the coordinates of the second key point of the object in each block; Determine two point sets corresponding to each block according to the coordinates of the first key point and the second key point of the object in each block; the two point sets of each block respectively include a coordinate set of the key point located on the first side of the second straight line and a coordinate set of the key point located on the second side of the second straight line; Perform linear regression fitting on the two point sets of each block to determine the two fitting lines corresponding to each block and their related parameters; the related parameters of each block include the fitting quantization value and slope of the two fitting lines; According to the two fitted quantization values and two slopes of each block, the initial uniformity corresponding to each block is determined.
[0010] According to a method for detecting the neatness of object placement provided by the present invention, the initial neatness corresponding to each block is determined according to the two fitting quantization values and two slopes of each block, including: The parallelism of each block is calculated according to the two slopes of each block, and the dispersion of each block in the vertical direction is calculated according to the two fitted quantization values of each block; According to the parallelism and the vertical dispersion of each block, the maximum value corresponding to each block is determined; the maximum value of the above block is the maximum value between the parallelism and the vertical dispersion corresponding to the block; According to the maximum value corresponding to each block, the initial neatness corresponding to each block is determined.
[0011] According to a method for detecting the neatness of an object provided by the present invention, the position information of the object includes the coordinates of a first key point and a second key point located at both ends of the object, and the method further includes: If the initial neatness of any block is neat, then the direction vector of the line segment corresponding to each object is calculated according to the coordinates of the first key point and the second key point of each object in any block; Calculate the third distance between any two objects in any block according to the direction vector of each object in any block to obtain multiple third distances; The standard deviation corresponding to each third distance is calculated, and the target neatness corresponding to any block is determined according to the standard deviation; the target neatness is used to characterize whether any block is neat.
[0012] According to a method for detecting the neatness of object placement provided by the present invention, the third distance between any two objects in any block is calculated according to the direction vector of each object in any block, including: Normalize the direction vector of each object in any block to obtain the normalized direction vector of each object; The third distance between any two objects in any block is calculated according to the normalized direction vector of each object in any block.
[0013] The present invention also provides an object placement neatness detection device, comprising the following modules: The object recognition module is used to obtain the image to be tested corresponding to the object placement area, and to recognize the object in the image to be tested, and to determine the multiple objects included in the image to be tested and the position information corresponding to each object; The block clustering module is used to perform block clustering processing on each object according to the location information of each object, and determine a plurality of clustered blocks; each block includes one or more objects; The initial neatness determination module is used to determine the two fitting straight lines corresponding to each block according to the position information of the objects in each block, and to determine the initial neatness corresponding to each block according to the relevant parameters of the two fitting straight lines of each block; the above initial neatness is used to characterize whether the block is neat.
[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, any of the above-mentioned object placement neatness detection methods is implemented.
[0015] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the object placement neatness detection method described in any one of the above is implemented.
[0016] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any of the above-mentioned object placement neatness detection methods.
[0017] The object placement neatness detection method, device, equipment and storage medium provided by the present invention obtain the image to be tested corresponding to the object placement area, and identify the object in the image to be tested, determine the multiple objects included in the object to be tested and the position information corresponding to each object, then perform block clustering processing on each object according to the position information of each object, determine the multiple blocks after clustering, and then determine the two fitting straight lines corresponding to each block according to the position information of the object in each block, and determine the initial neatness corresponding to each block according to the relevant parameters of the two fitting straight lines of each block, and the initial neatness is used to characterize whether the block is neat, and each block includes one or more objects. In this method, since the objects in the entire area can be identified and then divided into blocks for neatness detection, the neatness detection of each block can be automatically realized, thereby reducing the waste of human resources caused by personnel inspections, improving detection efficiency, and at the same time avoiding the influence of different blocks being neat but the entire area being uneven on the detection results, that is, the accuracy of neatness detection in the area can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 This is one of the flow charts of the object placement neatness detection method provided by an embodiment of the present invention.
[0020] Figure 2 It is a schematic diagram of an image to be measured of an object placement area provided by an embodiment of the present invention.
[0021] Figure 3 This is the second flow chart of the object placement neatness detection method provided by the embodiment of the present invention.
[0022] Figure 4 It is a schematic diagram of an object placement area before being divided into blocks provided by an embodiment of the present invention.
[0023] Figure 5 It is a schematic diagram of dividing the object placement area into blocks according to an embodiment of the present invention.
[0024] Figure 6 This is the third flow chart of the object placement neatness detection method provided in the embodiment of the present invention.
[0025] Figure 7 It is one of the schematic diagrams of two fitting straight lines provided in the embodiment of the present invention.
[0026] Figure 8 This is the fourth flow chart of the object placement neatness detection method provided by the embodiment of the present invention.
[0027] Fig. 9 This is the second schematic diagram of two fitting straight lines provided in an embodiment of the present invention.
[0028] Fig.10 It is a schematic diagram of the overall process of the object placement neatness detection method provided by an embodiment of the present invention.
[0029] Fig.11 It is a structural schematic diagram of an object placement neatness detection device provided by an embodiment of the present invention.
[0030] Fig.12 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0031] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0032] At present, when checking or detecting the neatness of vehicles or objects parked or placed in an area, most of them are done by manually patrolling and observing the placement or parking situation of the entire area, and determining whether they are placed or parked neatly based on the observation situation. However, this will lead to low detection efficiency. With the continuous development of image recognition technology, there are also some technologies that capture images of set positions or set areas, and perform straight line fitting on the set positions or set areas in the image as a whole, and determine whether the entire set position or set area is neat by the parallelism of the fitted straight line. However, the placement of objects such as objects or vehicles in public areas has random aggregation, and the aggregation is divided into regions, while this technology is for a single set position / set area rather than an aggregation area. The different directivities of different areas may cause misjudgment of the judgment, that is, this technology may lead to the problem of low detection accuracy. Based on this, the embodiments of the present invention provide a method, device, equipment and storage medium for detecting the neatness of object placement, which can solve the above technical problems.
[0033] Combine the following Figure 1-Figure 10 A method for detecting the neatness of object placement according to an embodiment of the present invention is described.
[0034] It should be noted that the execution subject of the embodiments of the present invention can be an object placement neatness detection device, or an electronic device, or other devices or apparatuses, which are not specifically limited here. The following embodiments will be described using an electronic device as the execution subject.
[0035] Figure 1 FIG. 1 is a flow chart of a method for detecting the neatness of object placement provided by an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps: Step 102, obtaining an image to be tested corresponding to the object placement area, and performing recognition processing on the object in the image to be tested, to determine multiple objects included in the image to be tested and position information corresponding to each object.
[0036] Among them, the object placement area refers to the entire area where objects are placed, which is a larger area. Multiple objects are placed or parked in the object placement area. The objects can be vehicles, items, etc. There is no specific limitation on the type of vehicle, for example, it can be a bicycle, a motor vehicle, an electric vehicle, etc. There is no specific limitation on the type of item.
[0037] Specifically, an image acquisition device such as a camera in the object placement area can be used to acquire images of the object placement area to obtain an image of the object placement area, which is recorded as the image to be tested. Figure 2 A schematic diagram of the image to be tested of the object placement area shown. Then, a network model such as a convolutional neural network and a deep learning network can be used to identify and process each object in the image to be tested, and obtain each object in the image to be tested and the position information of each object. It should be noted that the network models such as convolutional neural networks and deep learning networks can be trained with sample objects and their position information during training, so that when the trained network model is used to identify the object in the image to be tested, the identified object and its position information can be obtained.
[0038] The position information of each object may be the coordinates of each point on the object contour, the coordinates of key points at both ends of the object, or the coordinates of the center point of the object, etc., which is not specifically limited here.
[0039] Step 104 , performing block clustering processing on each object according to the position information of each object, and determining a plurality of clustered blocks; each block includes one or more objects.
[0040] Among them, this embodiment mainly detects the placement orderliness of objects in the clustering area, and the clustering area generally refers to a small area where objects are clustered and placed, so that the detection of orderliness is more accurate. Based on this, this embodiment needs to adaptively cluster the entire large area where the objects are placed to obtain each clustering area or each block.
[0041] Specifically, after obtaining the position information of each object in the entire area, one or more objects with relatively close positions or similar placement patterns can be clustered into the same block according to the position information of each object, so that multiple clustered blocks can be obtained, that is, the entire large area where the objects are placed is divided into multiple blocks. In addition, after dividing the blocks here, a different identifier can be set for each block to distinguish and quickly locate.
[0042] Step 106, based on the position information of the object in each block, determine the two fitting lines corresponding to each block, and based on the relevant parameters of the two fitting lines of each block, determine the initial neatness corresponding to each block; the above initial neatness is used to characterize whether the block is neat.
[0043] In this step, after obtaining multiple blocks after clustering, each block can generally include multiple objects, and then it can be determined whether each block can fit a straight line. Specifically, the straight line can be fitted according to the position information of the objects in each block. If a straight line covering more objects can be fitted, it means that the block can fit a straight line, otherwise it cannot fit a straight line.
[0044] For the block that can fit a straight line, a straight line fitting can be performed based on the position information of each object in the block to obtain two fitted straight lines. Here, the two fitted straight lines can be, for example, a fitted straight line fitted by the key points at both ends of each object, or a fitted straight line fitted by the center point of each object and a fitted straight line fitted by any end point of each object, or other situations. In short, two fitted straight lines for the objects in the block can be fitted. It should be noted that the two fitted straight lines here are not the same straight line, but two straight lines fitted for points at different positions in each object. The parameters such as the discreteness or parallelism of the distribution of objects in the block can be calculated through the relevant parameters of the two fitted straight lines (such as the slope), and then the parameters such as the discreteness or parallelism can be used to preliminarily reflect the neatness of the block, that is, to determine the initial neatness of the block, which includes whether the objects in the block are neatly or irregularly arranged.
[0045] In addition, for a block that cannot be fitted with a straight line, for example, all objects in the block are placed in a disorderly manner, then the initial neatness of the block can be directly determined as the objects in the block are placed in a disorderly manner, that is, not neat.
[0046] The above method can be used to obtain the initial neatness of each block, that is, to obtain whether the objects in each block are neatly placed. After obtaining the initial neatness corresponding to each block, the initial neatness of each block can be directly used as the final neatness of the corresponding block, or the position information of each object in each block and other direction parameters can be combined to further determine the final neatness of the block, or other methods can be used, which are not specifically limited here. In short, the neatness of each block can be finally determined.
[0047] In this embodiment, by acquiring the image to be tested corresponding to the object placement area, and identifying the object in the image to be tested, the multiple objects included in the object to be tested and the position information corresponding to each object are determined, and then the objects are clustered into blocks according to the position information of each object to determine the multiple blocks after clustering, and then the two fitting straight lines corresponding to each block are determined according to the position information of the object in each block, and the initial neatness corresponding to each block is determined according to the relevant parameters of the two fitting straight lines of each block. The initial neatness is used to characterize whether the block is neat, and each block includes one or more objects. In this method, since the objects in the entire area can be identified and then divided into blocks for neatness detection, the neatness detection of each block can be automatically realized, thereby reducing the waste of human resources caused by personnel inspections and improving detection efficiency. At the same time, it can avoid the influence of the neatness of different blocks but the unevenness of the entire area on the detection results, that is, the accuracy of the neatness detection in the area can be improved.
[0048] The following embodiment describes the process of dividing the entire large area where objects are placed into multiple blocks.
[0049] Figure 3 This is a second flow chart of the object placement neatness detection method provided by an embodiment of the present invention, see Figure 3 As shown, the position information of the object includes the coordinates of a first key point and a second key point located at two ends of the object. The step 104 may include the following steps: Step 202, according to the coordinates of the first key point and the second key point of each object, the coordinates of the center point of each object are determined, and the coordinates of each center point are grouped into a set to obtain a first center point coordinate set.
[0050] When identifying each object in the image to be tested, the position information of each object can be obtained, for example, the coordinates of the first key point and the second key point located at both ends of each object (such as the front coordinates and the rear coordinates of a vehicle) can be directly obtained, or the coordinates of the contour points of each object can be obtained by identification, and then the key points located at both ends of each object are modeled to obtain the coordinates of the first key point and the second key point located at both ends of each object. It can be understood that the coordinates of the two key points of each object are mainly used here to characterize the object. For example, see Figure 4 The schematic diagram shown is before the object placement area is divided into blocks, wherein each line segment represents an object, and the two points at both ends of each line segment represent the first key point and the second key point of the object respectively.
[0051] After obtaining the coordinates of the key points at the two endpoints of each object, the coordinates of the two key points of each object can be formed into a key point coordinate set, such as: A1{(x min ,y min ), (x max ,y max )},A2{(x min ,y min ), (x max ,y max )}, ..., A n {(x min ,y min ), (x max ,y max )}. A1 represents the key point coordinate set of the first object, A2 represents the key point coordinate set of the second object, and so on. n Represents the set of key point coordinates of the nth object, where n represents the total number of objects in the object placement area.
[0052] It should be noted that the coordinates of the key points of each object in the above key point coordinate set can be stored in a certain order. The order here can be, for example, starting from the first object in the upper left corner of the image to be tested, and identifying from left to right and from top to bottom (that is, first identify the first row from left to right, then obtain the second row from top to bottom, continue to identify from left to right, and so on for subsequent rows). Each time an object is identified, it can be numbered in the order of identification, for example, it can be numbered according to A1, A2, A3...
[0053] Afterwards, for each object, the coordinates of the center point corresponding to the object can be calculated through its key point coordinate set, denoted as (x center ,y center ), the calculation formula is as follows: .
[0054] The coordinates of the center point of each object can be calculated by the above calculation formula, which are recorded as: C1=(x center ,y center ), C2=(x center ,y center ), ..., C n =(x center ,y center ), and then combine the coordinates of these n center points to form the first center point coordinate set C n .
[0055] It should be noted that the order of the coordinates of the central points in the first central point coordinate set is the same as the order of the coordinates in the key point coordinate set.
[0056] Step 204, executing a straight line determination operation, the straight line determination operation includes: determining two target center points in the first center point coordinate set, and determining a first straight line corresponding to the two target center points according to the coordinates of the two target center points.
[0057] In this step, after obtaining the first center point coordinate set, a straight line determination operation can be performed, which includes: first, selecting two center points with the closest distance from the first center point coordinate set as target center points (also called seeds), that is, obtaining two target center points. The specific selection method can be to calculate the distance between the center points in the first center point coordinate set, and select the two center points corresponding to the minimum distance as the target center points.
[0058] Secondly, suppose the two target center points are selected as C1(x center ,y center )、C2(x center ,y center ), then the slope m and the intercept b in the straight line equation can be calculated through the two target center points and the straight line equation f(x)=mx+b, and then the straight line equation is constructed. The straight line represented by the straight line equation is recorded as the first straight line. It can be understood that the first straight line can be the first straight line corresponding to the current iteration round.
[0059] Step 206 , executing a clustering operation, the clustering operation comprising: performing block clustering processing on each object according to the first center point coordinate set and the first straight line, and determining a plurality of clustered blocks.
[0060] In this step, after obtaining the first center point coordinate set and the first straight line, a clustering operation can be performed. The clustering operation includes: performing block clustering processing on each object based on the first center point coordinate set and the first straight line to determine multiple blocks. Here, when clustering, objects that are closer to the first straight line can be clustered in the same block, and objects that are farther away can be clustered into other blocks, so that multiple blocks can be obtained.
[0061] As an option, during clustering, the following steps may be used for clustering: For each center point in the first center point coordinate set, calculate the first distance between the center point and the first straight line. If the first distance of the center point is less than the first threshold, classify the center point into the first block of the current iteration round; the first block is related to the first straight line of the current iteration round; calculate the second distance between the center point and the previous center point adjacent to the center point. If the second distance is greater than the second threshold, determine that the center point is out of the first block corresponding to the previous center point, and delete the center point and its coordinates included in the first block corresponding to the previous center point in the first center point coordinate set to obtain the second center point coordinate set; determine the second center point coordinate set as the new first center point coordinate set, return to iteratively execute the above-mentioned straight line determination operation and clustering operation until the preset iteration cutoff condition is met, and determine each first block as a plurality of clustered blocks.
[0062] Specifically, for each center point in the first center point coordinate set, the vertical distance d1 from the center point to the first straight line may be calculated, for example, using the following formula: .
[0063] Among them, the numerator is the distance from the center point to the first straight line, and the denominator is the normalization of the slope of the first straight line and the unit, (x i ,y i ) represents any center point C i The coordinates of (i is greater than or equal to 1).
[0064] The vertical distance from the center point to the first straight line calculated above can be recorded as the first distance, which indicates how far the object corresponding to the center point is from the first straight line of the current iteration round. After obtaining the first distance, the first distance can also be compared with the preset first threshold. If the first distance is less than the first threshold, it means that the object corresponding to the first distance is closer to the first straight line of the current iteration round, and the object can be divided into the block related to the first straight line of the current iteration round, which is recorded as the first block. It can be understood that after iteratively calculating the first distance between each center point in the first center point set and the first straight line, all objects corresponding to the center points in the first center point set of this round whose first distance is less than the first threshold can be classified into the same first block, and objects corresponding to center points greater than the first threshold continue to participate in the next round of block division.
[0065] At the same time, when calculating the first distance between each center point and the first straight line of the current iteration round, the distance between each center point and its adjacent previous center point can also be calculated, which is recorded as the second distance d2. Then it can be determined whether the second distance of the center point is greater than the preset second threshold. If the second distance of a center point is greater than the second threshold, it means that the center point is far away from its adjacent previous center point, that is, the center point has left the first block to which the previous center point belongs. Then the first block to which the previous center point belongs can be regarded as a complete block, and the center point coordinates included in the first block to which the previous center point belongs are removed from the first center point coordinate set of the current iteration round, and the remaining center point coordinate set is recorded as the second center point coordinate set. For the above-mentioned first threshold and second threshold, both can be set according to actual conditions, and no specific limitation is made here.
[0066] Afterwards, the second center point coordinate set can be used as a new first center point coordinate set, and the straight line determination operation of step 204 and the clustering operation of step 206 are iteratively executed, that is, two new target center points are selected from the new first center point coordinate set, a new first straight line is calculated, and a new first block is determined, and this iteration is continued until the remaining center points cannot form a first straight line regularly, at which point the objects corresponding to the remaining center points can be directly used as a new first block. In this way, multiple first blocks can be finally obtained, and then these first blocks can be used as multiple blocks after division. It should be noted that in each round of iteration, an identifier can be set for the first block of the current iteration round, and the identifier set for the first block in each round of iteration is different, so that the first blocks of different iteration rounds can be distinguished.
[0067] For example, see Figure 5The diagram shows the block division of the object placement area, where there are 7 first blocks, marked as A, B, C, D, E, F, and G. Taking the object as a vehicle, it can be seen from the figure that the vehicles in each block are relatively concentrated, that is, each block is a small concentrated area. At the same time, it can be seen that area A and area B form two blocks because the distance between the two vehicles is too large, and area E forms a messy area because there is no regular straight line (that is, no straight line can represent the block). For E, there is no need to make the next step to determine that its final target neatness is messy placement / untidy placement.
[0068] In addition, in the above clustering process, it is also possible to determine whether the two key points of each object are above or below the first straight line. If the two key points of multiple consecutive objects are on the same side of the first straight line (for example, both below), then it can be determined whether these multiple objects can form a straight line alone (that is, construct a close straight line equation alone). If a straight line can be formed, then they will be separated from the first block in the current iteration round and form a new independent first block, that is, block G in the figure. This can more accurately determine the neatness of blocks with different placement patterns.
[0069] In this embodiment, the center point of each object is calculated by the key point coordinates at both ends of each object, and the initial straight line is determined based on each center point, and then each object is clustered into blocks based on each center point and the initial straight line. This process is simple and intuitive, so the accuracy and efficiency of block clustering can be improved. In addition, when each object is clustered into blocks by each center point and the initial straight line, the block division is performed by the distance between each object and the straight line and the distance between each object and its adjacent previous object. In this way, the block division can be achieved more accurately. At the same time, the objects of the blocks divided in the last division are deleted by each iteration, so that the blocks can be divided step by step, making the block division process more efficient.
[0070] The following embodiment describes the process of determining the initial uniformity of each block.
[0071] Figure 6 This is a flow chart of the third method for detecting the neatness of object placement provided by an embodiment of the present invention, see Figure 6 As shown, the position information of the object includes the coordinates of a first key point and a second key point located at two ends of the object. The step 106 may include the following steps: Step 302 : determining a second straight line corresponding to each block according to the coordinates of the first key point and the coordinates of the second key point of the object in each block.
[0072] In this step, for each block, the coordinates of the center point of each object can be calculated based on the coordinates of the first key point and the second key point of each object, and then two center points with the smallest distance between each other are selected from the center points, and a straight line equation is constructed based on the coordinates of these two center points. The straight line corresponding to the constructed straight line equation can be recorded as the second straight line corresponding to the block, and the constructed straight line equation is assumed to be recorded as f(x)=mx+b.
[0073] Step 304, determining two point sets corresponding to each block based on the coordinates of the first key point and the second key point of the second straight line of each block and the object within each block; the two point sets of each block respectively include a coordinate set of the key point located on the first side of the second straight line and a coordinate set of the key point located on the second side of the second straight line.
[0074] In this step, after obtaining the linear equation of the second straight line corresponding to the block, the linear equation of the second straight line can be used to calculate the first key points and the second key points of each object in the block that are located on the same side of the second straight line (including above and below), and then the key points belonging to the same side are grouped into a point set, so that two point sets can be obtained.
[0075] For example, PA={p a1 , p a2 , p a3 , ..., p an}, represents the point set consisting of key points located above the second straight line, PB={p c1 , p c2 , p c3 , ..., p cn}, which represents the point set consisting of key points located below the second straight line.
[0076] Step 306 , linear regression fitting is performed on the two point sets of each block to determine two fitting lines corresponding to each block and their related parameters; the related parameters of each block include the fitting quantization value and slope of the two fitting lines.
[0077] In this step, after obtaining two point sets of a certain block, linear regression fitting can be performed on the two point sets respectively to obtain a fitting straight line for each. Figure 7 One of the schematic diagrams of the two fitted straight lines shown in FIG. 1 , wherein the upper and lower straight lines are the two fitted straight lines fitted to the two point sets of a certain block.
[0078] When two fitting lines are obtained by fitting, relevant parameters of the two fitting lines can also be obtained. The relevant parameters can include a fitting quantization value and a slope, wherein the fitting quantization value can be a fitting score, which represents the quality score of the fitted line.
[0079] Step 308: Determine the initial uniformity corresponding to each block according to the two fitting quantization values and the two slopes of each block.
[0080] In this step, after obtaining the fitting quantization values and slopes of the two fitting straight lines of a certain block, the initial uniformity of the block can be determined based on these four parameters.
[0081] As an optional embodiment, the parallelism of each block can be calculated based on the two slopes of each block, and the discreteness of each block in the vertical direction can be calculated based on the two fitted quantization values of each block; the maximum value corresponding to each block is determined based on the parallelism and the discreteness in the vertical direction of each block; the maximum value of the above block is the maximum value between the parallelism corresponding to the block and the discreteness in the vertical direction; based on the maximum value corresponding to each block, the initial neatness corresponding to each block is determined.
[0082] Assume that the two fitting quantization values of the two fitting lines of a block are recorded as score A 、score B The two slopes of the two fitting lines are denoted as k A , k B , then the parallelism angle of the block can be calculated by the following formula: .
[0083] The value of the parallelism angle is between 0 and 1. The smaller the value of the parallelism angle calculated above is, the more consistent the absolute value of the inclination angle of the block in the x-axis direction is, indicating that the objects in the block are more neatly arranged in the x-axis direction.
[0084] At the same time, the vertical dispersion arg of the block can be calculated by the following formula: .
[0085] The value of the discreteness arg in the vertical direction is between 0 and 1. The smaller the value of the discreteness arg in the vertical direction calculated above is, the smaller the discreteness of the block in the y-axis / vertical direction is, which means that the objects in the block are arranged more neatly in the y-axis direction.
[0086] After calculating the parallelism angle and the vertical dispersion arg of the block, the maximum value of the two values can be taken, and then the maximum value is compared with the set threshold. If the maximum value is less than the set threshold, it means that the block is arranged neatly as a whole, that is, the initial neatness of the block is neatly arranged, otherwise it means that the initial neatness of the block is not neatly arranged. The preset threshold here ranges from 0 to 1, and its specific size can be set according to actual conditions.
[0087] Although the above embodiment is described with reference to a certain block, any block can be calculated in the above manner to determine the initial uniformity of each block.
[0088] In this embodiment, two fitting lines are fitted by two point sets with key points at both ends of the object in the block located on the same side, and then the initial neatness of the block can be calculated by the fitting quantization values and slopes of the two fitting lines, so that the initial neatness of the block can be determined more accurately and quickly, improving the efficiency and accuracy of detection. In addition, the discreteness in the vertical direction is measured by the two fitting quantization values of the two fitting lines, and the parallelism is measured by the two slopes, and the initial neatness of the block is determined by combining the discreteness and the parallelism. In this way, the parameters of multiple dimensions are combined to determine the neatness, so that the final determined initial neatness can be more accurate.
[0089] The following embodiment describes the process of determining the target uniformity of a block.
[0090] Figure 8 This is a fourth flow chart of the object placement neatness detection method provided by an embodiment of the present invention, see Figure 8 As shown, the position information of the above object includes the coordinates of a first key point and a second key point located at two ends of the object. The above method may further include the following steps: Step 402 : If the initial neatness of any block is neat, then the direction vector of the line segment corresponding to each object is calculated according to the coordinates of the first key point and the second key point of each object in any block.
[0091] In this step, as mentioned above, it is possible to preliminarily determine whether the objects in each block are neatly placed. If the initial neatness of any block (referred to as any block) indicates that the objects in the block are neatly placed, then in order to more accurately determine whether the block is really neatly placed, the direction vector of the object, that is, the direction in which the object is placed, can be calculated based on the position information of the object in any block, and then combined with the position information of the object, a further comprehensive judgment can be made as to whether the objects in the block are neatly placed.
[0092] See also Fig. 9 The second schematic diagram of the two fitting straight lines shown is for Fig. 9The placement of objects in this type of block may be determined by the above embodiment to be neat in the initial neatness of the block, but in fact, the objects in the block are not very neatly placed. In order to solve this problem, in this embodiment, after obtaining the initial neatness of each block, for any block with an initial neatness of neatly placed objects, the coordinates of the two key points at both ends of each object in the block can be obtained, and then the direction vector of the line segment corresponding to each object can be calculated, for example, by the following formula: .
[0093] Among them, (x1, y1) and (x2, y2) represent the coordinates of the two key points of the object, and v(X, Y) represents the direction vector of the line segment corresponding to the object. According to the above formula, the direction vector of the line segment corresponding to each object in any block can be calculated.
[0094] Step 404 , calculating a third distance between any two objects in any block according to the direction vector of each object in any block, and obtaining a plurality of third distances.
[0095] In this step, after obtaining the direction vector of the line segment corresponding to each object in any block, as an optional embodiment, the direction vector of each object in any block can be normalized to obtain the normalized direction vector of each object; based on the normalized direction vector of each object in any block, the third distance between any two objects in any block is calculated.
[0096] Among them, the direction vector of each object can be normalized using the following formula: .
[0097] Among them, v norm (X,Y) represents the normalized direction vector of the direction vector v(X,Y). After normalization, the direction vectors of each object can be adjusted to the same range, which can eliminate the problem that the different lengths of different objects affect the final neatness judgment result.
[0098] After that, the third distance between any two objects can be calculated using the normalized direction vectors of any two objects using the following formula: .
[0099] Among them, (X1, Y1) and (X2, Y2) represent the two normalized direction vectors v1 and v2 respectively, d v1,v2 represents the Euclidean distance between the two normalized direction vectors v1 and v2, i.e., the third distance. The third distance can be used to measure the direction difference between the two objects.
[0100] Step 406, calculate the standard deviation corresponding to each third distance, and determine the target neatness corresponding to any block according to the standard deviation; the target neatness is used to indicate whether any block is neat.
[0101] In this step, after obtaining the third distance between the normalized direction vectors of any two objects in any block, the average distance value of all third distances can be calculated, and the square of the difference between each third distance and the average distance value can be calculated, and then all the squares of the differences are added, and then divided by the number of third distances minus one or divided by the total number of third distances to obtain the variance, and then the variance is squared to obtain the standard deviation of each third distance. The standard deviation ranges from 0 to 1. In addition, when calculating the standard deviation, the projection of the direction vector can also be used to calculate the standard deviation.
[0102] After obtaining the standard deviation corresponding to the third distance of all objects in any block, the standard deviation can be compared with the preset standard deviation threshold. If the standard deviation is less than the preset standard deviation threshold, it means that the target neatness of the block is that the objects are placed neatly; otherwise, it is determined that the target neatness of the block is that the objects are placed untidy / messy.
[0103] In addition, for the block whose initial neatness is that the objects are not neatly placed, there is no need to judge the direction vector, and it can be directly determined that the target neatness of the block is also that the objects are not neatly placed.
[0104] In this embodiment, the direction vectors of the objects in the block whose initial neatness is neatly placed are calculated, and the distance and standard deviation are calculated by the direction vectors of each object to further determine whether the block is neat. In this way, the secondary judgment method using the direction vector and the standard deviation is relatively simple and accurate, so the efficiency and accuracy of the final determined block neatness can be improved. At the same time, since the final neatness of each block can be determined after two-level neatness judgments are made by the fitting straight line of each block and the direction vector of the object therein, the detection accuracy of the block finally obtained is higher, so the accuracy of block neatness detection can be further improved. In addition, when calculating the distance by the direction vector of the object, the direction vector is first normalized, so that the difference in length of different objects can be eliminated, and the accuracy of the final determined block neatness can be further improved.
[0105] In order to better understand the technical solution of the embodiment of the present invention, a complete embodiment is given below, taking a vehicle as an example. Fig.10 The overall process diagram of the object placement neatness detection method shown in the figure may include the following steps: 1. Obtaining vehicle coordinate data, specifically including: identifying and processing the image corresponding to the vehicle placement area, determining the coordinates of multiple vehicles and two key points of each vehicle included therein; 2. Divide the blocks by the straight line distance, specifically including: clustering the vehicles into blocks by calculating the distance from each vehicle to the straight line and the distance between the center point of each vehicle and its adjacent previous center point; 3. Determine whether the above vehicles can form a block, specifically, whether there is a straight line that can represent the block; 4. If no blocks can be formed, it is directly judged as a messy arrangement; 5. If a block can be formed, the initial integrity of the vehicle is determined using the two fitted straight lines of the block; 6. Calculate whether the maximum value of the parallelism and vertical dispersion of the two fitted straight lines is less than the set threshold; 7. If the maximum value is greater than or equal to the set threshold, the initial overall degree is directly judged as messy placement; 8. If the maximum value is less than the set threshold, the direction vector of the vehicle in the block is calculated; 9. Calculate the distance between any two vehicles in the block according to the direction vector of each vehicle in the block, calculate the standard deviation corresponding to each distance, and determine whether the calculated standard deviation is less than the set standard deviation threshold; 10. If the calculated standard deviation is less than the set standard deviation threshold, the target neatness is judged to be neatly arranged, otherwise the target neatness is judged to be messily arranged.
[0106] The object placement neatness detection device provided by the present invention is described below. The object placement neatness detection device described below and the object placement neatness detection method described above can be referenced to each other.
[0107] Fig.11 is a schematic diagram of the structure of the object placement neatness detection device provided by an embodiment of the present invention, see Fig.11 As shown, the device may include: The object recognition module 510 is used to obtain the image to be tested corresponding to the object placement area, and to perform recognition processing on the object in the image to be tested, and to determine the multiple objects included in the image to be tested and the position information corresponding to each object; The block clustering module 520 is used to perform block clustering processing on each object according to the location information of each object, and determine a plurality of clustered blocks; each block includes one or more objects; The initial neatness determination module 530 is used to determine the two fitting straight lines corresponding to each block according to the position information of the objects in each block, and to determine the initial neatness corresponding to each block according to the relevant parameters of the two fitting straight lines of each block; the above initial neatness is used to characterize whether the block is neat.
[0108] In some embodiments, the position information of the above-mentioned object includes the coordinates of the first key point and the coordinates of the second key point located at both ends of the object. The above-mentioned clustering module 520 is specifically used to determine the coordinates of the center point of each object according to the coordinates of the first key point and the second key point of each object, and group the coordinates of each center point into a set to obtain a first center point coordinate set; perform a straight line determination operation, and the above-mentioned straight line determination operation includes: determining two target center points in the first center point coordinate set, and determining the first straight line corresponding to the two target center points according to the coordinates of the two target center points; perform a clustering operation, and the above-mentioned clustering operation includes: performing block clustering processing on each object according to the first center point coordinate set and the first straight line, and determining multiple blocks after clustering.
[0109] Optionally, the above-mentioned clustering module 520 is specifically used to calculate, for each center point in the first center point coordinate set, a first distance between the center point and the first straight line. If the first distance of the center point is less than a first threshold value, the center point is classified into the first block of the current iteration round; the first block is related to the first straight line of the current iteration round; the second distance between the center point and the previous center point adjacent to the center point is calculated. If the second distance is greater than a second threshold value, it is determined that the center point is separated from the first block corresponding to the previous center point, and the center point and its coordinates included in the first block corresponding to the previous center point are deleted from the first center point coordinate set to obtain a second center point coordinate set; the second center point coordinate set is determined as a new first center point coordinate set, and the above-mentioned straight line determination operation and clustering operation are returned to iteratively execute until a preset iteration cutoff condition is met, and each first block is determined as a plurality of clustered blocks.
[0110] In some embodiments, the position information of the above-mentioned object includes the coordinates of the first key point and the coordinates of the second key point located at both ends of the object. The above-mentioned initial neatness determination module 530 is specifically used to determine the second straight line corresponding to each block according to the coordinates of the first key point and the second key point of the object in each block; determine the two point sets corresponding to each block according to the second straight line of each block and the coordinates of the first key point and the second key point of the object in each block; the two point sets of each block respectively include the coordinate set of the key point located on the first side of the second straight line and the coordinate set of the key point located on the second side of the second straight line; perform linear regression fitting processing on the two point sets of each block to determine the two fitting straight lines corresponding to each block and their related parameters; the related parameters of each block include the fitting quantization value and slope of each of the two fitting straight lines; determine the initial neatness corresponding to each block according to the two fitting quantization values and two slopes of each block.
[0111] Optionally, the above-mentioned initial uniformity determination module 530 is specifically used to calculate the parallelism of each block according to the two slopes of each block, and calculate the discreteness of each block in the vertical direction according to the two fitted quantization values of each block; determine the maximum value corresponding to each block according to the parallelism of each block and the discreteness in the vertical direction; the maximum value of the above-mentioned block is the maximum value between the parallelism corresponding to the block and the discreteness in the vertical direction; determine the initial uniformity corresponding to each block according to the maximum value corresponding to each block.
[0112] In some embodiments, the position information of the object includes coordinates of a first key point and a second key point located at two ends of the object, and the apparatus further includes: The target neatness determination module is used to calculate the direction vector of the line segment corresponding to each object according to the coordinates of the first key point and the second key point of each object in any block if the initial neatness of any block is neat; calculate the third distance between any two objects in any block according to the direction vector of each object in any block to obtain multiple third distances; calculate the standard deviation corresponding to each third distance, and determine the target neatness corresponding to any block according to the standard deviation.
[0113] Optionally, the above-mentioned target neatness determination module is specifically used to normalize the direction vector of each object in any block to obtain a normalized direction vector of each object; and calculate the third distance between any two objects in any block based on the normalized direction vector of each object in any block.
[0114] It should be noted here that the above-mentioned device provided in the embodiment of the present invention can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects that are the same as the method embodiment in this embodiment will not be described in detail here.
[0115] Fig.12 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.12 As shown, the electronic device may include: a processor 610, a communication interface 620, a memory 630 and a communication bus 640, wherein the processor 610, the communication interface 620 and the memory 630 communicate with each other through the communication bus 640. The processor 610 may call the logic instructions in the memory 630 to execute the object placement neatness detection method, which includes: obtaining the image to be tested corresponding to the object placement area, and performing recognition processing on the object in the image to be tested, determining multiple objects included in the image to be tested and the position information corresponding to each object; performing block clustering processing on each object according to the position information of each object, and determining multiple clustered blocks; each block includes one or more objects; according to the position information of the object in each block, determining two fitting lines corresponding to each block, and according to the relevant parameters of the two fitting lines of each block, determining the initial neatness corresponding to each block; the above initial neatness is used to characterize whether the block is neat.
[0116] In addition, the logic instructions in the above-mentioned memory 630 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0117] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the object placement neatness detection method provided by the above methods, which includes: obtaining an image to be tested corresponding to the object placement area, and identifying the object in the image to be tested, determining multiple objects included in the image to be tested and the position information corresponding to each object; performing block clustering processing on each object according to the position information of each object, and determining multiple blocks after clustering; each block includes one or more objects; according to the position information of the object in each block, determining two fitting straight lines corresponding to each block, and determining the initial neatness corresponding to each block according to the relevant parameters of the two fitting straight lines of each block; the above initial neatness is used to characterize whether the block is neat.
[0118] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the object placement neatness detection method provided by the above-mentioned methods, the method comprising: obtaining an image to be tested corresponding to the object placement area, and identifying the object in the image to be tested, determining multiple objects included in the image to be tested and the position information corresponding to each object; performing block clustering processing on each object according to the position information of each object, and determining multiple blocks after clustering; each block includes one or more objects; according to the position information of the object in each block, determining two fitting straight lines corresponding to each block, and determining the initial neatness corresponding to each block according to the relevant parameters of the two fitting straight lines of each block; the above-mentioned initial neatness is used to characterize whether the block is neat.
[0119] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0120] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for detecting the neatness of object placement, characterized in that: include: Acquire an image to be tested corresponding to the object placement area, and perform recognition processing on the object in the image to be tested to determine multiple objects included in the image to be tested and position information corresponding to each object; Performing block clustering processing on each of the objects according to the location information of each of the objects, and determining a plurality of clustered blocks; each block includes one or more objects; Determine two fitting straight lines corresponding to each block according to the position information of the object in each block, and determine the initial regularity corresponding to each block according to the relevant parameters of the two fitting straight lines of each block; The initial neatness is used to indicate whether the block is neat.
2. The object placement neatness detection method according to claim 1, characterized in that: The position information of the object includes the coordinates of a first key point and a second key point located at two ends of the object, and the block clustering process is performed on each object according to the position information of each object to determine a plurality of clustered blocks, including: Determine the coordinates of the center point of each object according to the coordinates of the first key point and the second key point of each object, and form the coordinates of each center point into a set to obtain a first center point coordinate set; Executing a straight line determination operation, the straight line determination operation comprising: determining two target center points in the first center point coordinate set, and determining a first straight line corresponding to the two target center points according to the coordinates of the two target center points; A clustering operation is performed, wherein the clustering operation includes: performing block clustering processing on each of the objects according to the first center point coordinate set and the first straight line, and determining a plurality of clustered blocks.
3. The object placement neatness detection method according to claim 2, characterized in that: The performing block clustering processing on each of the objects according to the first center point coordinate set and the first straight line to determine a plurality of clustered blocks includes: For each center point in the first center point coordinate set, a first distance between the center point and the first straight line is calculated, and if the first distance of the center point is less than a first threshold, the center point is classified into a first block of a current iteration round; the first block is related to a first straight line of the current iteration round; Calculating a second distance between the center point and a previous center point adjacent to the center point, and if the second distance is greater than a second threshold, determining that the center point is out of the first block corresponding to the previous center point, and deleting the center point and its coordinates included in the first block corresponding to the previous center point from the first center point coordinate set to obtain a second center point coordinate set; The second center point coordinate set is determined as a new first center point coordinate set, and the straight line determination operation and the clustering operation are iteratively executed again until a preset iteration cutoff condition is satisfied, and each of the first blocks is determined as a plurality of clustered blocks.
4. The object placement neatness detection method according to any one of claims 1 to 3, characterized in that: The position information of the object includes the coordinates of a first key point and a second key point located at both ends of the object, and the two fitting lines corresponding to each block are determined according to the position information of the object in each block, and the initial neatness corresponding to each block is determined according to the relevant parameters of the two fitting lines of each block, including: Determine a second straight line corresponding to each block according to the coordinates of the first key point and the coordinates of the second key point of the object in each block; Determine two point sets corresponding to each block according to the second straight line of each block and the coordinates of the first key point and the second key point of the object in each block; the two point sets of each block respectively include a coordinate set of the key point located on the first side of the second straight line and a coordinate set of the key point located on the second side of the second straight line; Performing linear regression fitting processing on the two point sets of each block to determine two fitting straight lines corresponding to each block and related parameters thereof; the related parameters of each block include the fitting quantization value and slope of each of the two fitting straight lines; According to the two fitting quantization values and the two slopes of each block, the initial regularity corresponding to each block is determined.
5. The object placement neatness detection method according to claim 4, characterized in that: The determining the initial neatness corresponding to each block according to the two fitting quantization values and the two slopes of each block includes: Calculating the parallelism of each block according to the two slopes of each block, and calculating the dispersion of each block in the vertical direction according to the two fitting quantization values of each block; Determine the maximum value corresponding to each block according to the parallelism and the dispersion in the vertical direction of each block; the maximum value of the block is the maximum value between the parallelism and the dispersion in the vertical direction corresponding to the block; According to the maximum value corresponding to each of the blocks, the initial regularity corresponding to each of the blocks is determined.
6. The object placement neatness detection method according to any one of claims 1 to 3, characterized in that: The position information of the object includes coordinates of a first key point and a second key point located at two ends of the object, and the method further includes: If the initial neatness of any block is neat, then calculating the direction vector of the line segment corresponding to each object according to the coordinates of the first key point and the second key point of each object in the any block; Calculate a third distance between any two objects in any block according to the direction vector of each object in any block to obtain multiple third distances; The standard deviation corresponding to each of the third distances is calculated, and the target neatness corresponding to any one of the blocks is determined according to the standard deviation; the target neatness is used to indicate whether any one of the blocks is neat.
7. The object placement neatness detection method according to claim 6, characterized in that: The calculating, according to the direction vector of each object in the any block, a third distance between any two objects in the any block comprises: Normalizing the direction vector of each object in any one of the blocks to obtain a normalized direction vector of each object; A third distance between any two objects in any block is calculated according to the normalized direction vector of each object in any block.
8. A device for detecting the neatness of object placement, characterized in that: include: An object recognition module is used to obtain an image to be tested corresponding to the object placement area, and to perform recognition processing on the object in the image to be tested, so as to determine multiple objects included in the image to be tested and position information corresponding to each object; A block clustering module, used to perform block clustering processing on each object according to the location information of each object, and determine a plurality of clustered blocks; each block includes one or more objects; An initial regularity determination module is used to determine two fitting straight lines corresponding to each block according to the position information of the object in each block, and determine the initial regularity corresponding to each block according to the relevant parameters of the two fitting straight lines of each block; The initial neatness is used to indicate whether the block is neat.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the object placement neatness detection method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the object placement neatness detection method according to any one of claims 1 to 7 is implemented.