Container deformation identification method and device and electronic equipment
The use of image processing technology to identify container deformation solves the time-consuming and labor-intensive problem of container deformation identification, achieves fast and accurate deformation detection, and improves transportation safety and efficiency.
Patent Information
- Application Number
- CN202410546583.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-30
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-04-30
AI Technical Summary
During the logistics transportation process, container deformation leads to safety risks, and the existing technology lacks convenient and fast identification methods, making manual confirmation time-consuming and labor-intensive.
By acquiring and processing container image data, the container edges and corners are identified, the deviation between the lines between the corner points and the edges is calculated, the container deformation is determined, and the deformation position is identified based on the preset error range and features.
It achieves rapid and accurate identification of container deformation, avoids placement risks, and improves transportation safety and efficiency.
Smart Images

Figure CN118657706A
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of container transportation and management, and in particular to a method, device and electronic equipment for identifying container deformation. Background Art
[0002] During the logistics transportation process, the containers for transporting goods will be placed together to reduce the occupied space and improve the space utilization rate. The design of the containers is also mostly rectangular to adapt to stacking and close placement.
[0003] However, if a container is deformed, it will not only affect the placement of the goods inside the container, but also affect the placement of other containers placed close or stacked. For example, if a container is bulging, the container will rotate in the air during container lifting operations, and the bulge is likely to collide / rub against adjacent containers, which may cause safety accidents.
[0004] Due to the large size of containers, manually confirming each container during logistics operations consumes a lot of manpower and time. Obviously, there is an urgent need for a convenient and fast container deformation recognition method to ensure the safe placement of containers during logistics transportation. Summary of the invention
[0005] In view of this, the embodiments of the present application are dedicated to providing a container deformation recognition method to solve the technical problem that the prior art urgently needs a convenient and fast container deformation recognition method to ensure the safe placement of containers in logistics transportation.
[0006] In a first aspect, an embodiment of the present application provides a container deformation recognition method, comprising:
[0007] Acquire and process image data to obtain container images with clear lines;
[0008] Identify and obtain container edges and container corners in the container image, where the container corners are vertices of angles formed by edges of the container;
[0009] The deviation between the connecting line between all adjacent corner points of the container and the container sideline between the adjacent corner points is calculated. When the deviation is greater than a preset first error range, it is determined that the container is deformed. The adjacent corner points are container corner points located on the same container sideline.
[0010] Optionally, the calculating of the deviation between a line connecting all adjacent corner points of the container and a container sideline between the adjacent corner points includes:
[0011] Obtain all adjacent corner points of the container corner point;
[0012] Obtaining the deviation between the container sideline and the line between the adjacent corner points of all adjacent corner points, wherein the length of the perpendicular line segment between any point on the deviation and the line between the adjacent corner points is greater than the first error range;
[0013] The deviated portion is divided into at least one deformed edge line, each deformed edge line obtained by the division includes a continuous container edge line with one undulation, and the undulation refers to the trend that the distance between a point on the container edge line and a line connecting adjacent corner points increases first and then decreases;
[0014] The distance between each deformed edge line and the connecting line between the adjacent corner points is obtained as the deviation.
[0015] Optionally, obtaining the distance between each deformed edge line and the line connecting the adjacent corner points as the deviation includes:
[0016] For each deformed edge line, determine the point in the deformed edge line with the largest distance from the connecting line between the adjacent corner points as the deformed vertex;
[0017] The length of the perpendicular line segment between each deformation vertex and the adjacent corner point is calculated as the deviation.
[0018] Optionally, the method further includes:
[0019] Identify the container placement direction according to preset container features, wherein the container features include the shape of the container door;
[0020] The container deformation position is determined according to the container placement direction and the deviation.
[0021] Optionally, the method further includes:
[0022] For any corner point of a container, the angle of the angle at which the corner point of the container is located is calculated. When the angle of the angle at which the corner point of the container is located is greater than or less than a preset angle range, it is determined that the container is deformed.
[0023] Optionally, the method further includes:
[0024] Acquire ambient light intensity, and determine a second error range according to the ambient light intensity;
[0025] A sunken area of the container image is identified and acquired, wherein a color difference between the sunken area and an area within a preset distance range around the sunken area is greater than the second error range.
[0026] Optionally, the identifying and acquiring the sunken area of the container image includes:
[0027] Identify and obtain an abnormal area of the container image, where the color difference between the abnormal area and other areas in the container image is greater than a preset third error range;
[0028] Performing shape and uniformity identification on the abnormal region, dividing the abnormal region into at least two region sets, wherein the at least two region sets include a first concave region set, and the first concave region set does not include a region in the abnormal region that has a regular shape and / or a region with uniform color inside;
[0029] For the area set, an area set other than the first concave area set is identified to obtain a second concave area set, wherein a color difference between an area in the second concave area set and other areas in the area set other than the first concave area set in the area set is greater than the second error range;
[0030] The first concave area set and the second concave area set are combined to obtain the concave area.
[0031] Optionally, the method further includes:
[0032] The distance between the distance measuring device and the container and the distance between the distance measuring device and the sunken area are obtained by using a distance measuring device, and the sunken amount of the sunken area is calculated.
[0033] In a second aspect, an embodiment of the present application provides a container deformation recognition device, including:
[0034] An image processing unit, used to obtain image data, identify, segment and process edges of the image data, and obtain a container image with clear edges;
[0035] an identification unit, used to identify and obtain container edges and container corner points in the container image, wherein the container corner points are vertices of angles formed by the edges of the container;
[0036] A calculation unit is used to calculate the deviation of the connection line between all adjacent corner points of the container and the container sideline between the adjacent corner points. When the deviation is greater than a preset first error range, it is determined that the container is deformed. The adjacent corner points are container corner points located on the same container sideline.
[0037] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor;
[0038] The memory is connected to the processor and is used to store programs;
[0039] The electronic device implements the container deformation recognition method as described in the first aspect by running the program in the memory through the processor.
[0040] The present application provides a container deformation recognition method, which obtains the container edge line and container corner points by recognizing the container image, and determines whether the container is deformed by analyzing the deviation between the connecting line between the container corner points and the container edge line between the container corner points. The method can timely and accurately detect the deformation problem of the container during the use of the container, and avoid the risk of placement. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0042] Figure 1 A schematic flow chart of a container deformation recognition method provided in an embodiment of the present application.
[0043] Figure 2 These are four examples of container top view images provided in the embodiments of the present application.
[0044] Figure 3 These are four examples of left view images of containers provided in the embodiments of the present application.
[0045] Figure 4 These are four examples of container front view images provided in the embodiments of the present application.
[0046] Figure 5 A schematic diagram of the shape of a container provided in an embodiment of the present application.
[0047] Figure 6 A schematic structural diagram of a container deformation recognition device provided in an embodiment of the present application.
[0048] Figure 7 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0049] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0050] The first embodiment of the present application provides a container deformation recognition method, such as Figure 1 As shown, the method may include the following steps:
[0051] Step 101: Acquire and process image data to obtain a container image with clear lines.
[0052] In this embodiment, the image data may be acquired through an image acquisition device, such as a picture acquired through a camera, an infrared image acquired by an infrared imaging device, and the like.
[0053] The processing of image data may include image recognition, image segmentation, edge fitting and other processing methods. Since the image data collected by the image acquisition device covers a large area and includes a lot of content, in order to reduce the subsequent processing load, the image data can be identified. For example, the image can be identified through semantic analysis to identify the part of the area belonging to the container.
[0054] Then, the container image can be segmented from the entire image to reduce the image size that needs to be processed in subsequent processing.
[0055] The processing of image data may include edge fitting. Since the clarity of image data is limited by the hardware conditions of the image acquisition device, in the case of low image clarity, the lines in the image may be processed through edge fitting to obtain an image with clear lines.
[0056] The method of cutting the container image can be to perform a larger range of cutting on the recognized container image, that is, most of the content in the cut container image is the container, but also includes a part of the environment content around the container; or, it can be cut strictly along the lines of the container, similar to the cutting method of "cutting along the lines" in the paper cutting process. The container image after cutting in this way does not include content other than the container.
[0057] This embodiment does not limit the specific amount of image data. For example, the image acquisition device acquires images of the same container A from multiple angles, and divides them into the front view, left view, and top view of the container A, all of which are used as image data. Then, the front view, left view, and top view are all processed to obtain images of the container A at three angles. Acquiring image data from multiple angles helps to more comprehensively identify the deformation of the container.
[0058] If the image data is comprehensive, including the front view, left view and top view of the container, then after subsequent processing, the entire situation of the container, that is, the situation of each side of the container, can be obtained. Through quantitative analysis, such as establishing a spatial coordinate system and analyzing the distance of deformation of each surface in the x, y, and z directions, the precise coordinates of each deformation point can be obtained, and the specific deformation distance can also be calculated as the deviation.
[0059] Step 102: Identify and obtain container edges and container corners in the container image. The container corners are vertices of angles formed by the edges of the container.
[0060] In a container image with clear lines, the container should be embodied as a polygon. For example, for a rectangular container without deformation, the container image obtained from the side of the container should be a regular rectangle.
[0061] Decompose the polygons in the container image to obtain the container edge and container corner points. Each edge of the polygon corresponds to an edge of the container, and each edge of the polygon is used as the container edge. Each vertex of the polygon corresponds to a corner of the container, and each vertex of the polygon is used as the container corner point.
[0062] Step 103: Calculate the deviation between the connecting line between all adjacent corner points of the container and the container sideline between the adjacent corner points. When the deviation is greater than a preset first error range, it is determined that the container is deformed and the adjacent corner points are container corner points located on the same container sideline.
[0063] Figure 2 , Figure 3 and Figure 4 This is an example of the deformation of a rectangular container. Figure 2 The top view of the container is included, including four container image examples. Figure 3 The left view is collected for the container, including four container image examples. Figure 4 The front view is captured for the container, that is, the container image is captured from the door or the rear of the container, including four container image examples.
[0064] by Figure 2For example, a group of adjacent corner points are called points A and B, and a bulge deformation occurs between AB, and the vertex of the bulge is called point P. Then, the line segment AB obtained by directly connecting AB and the line segment APB passing through point P do not overlap near point P, and the line segment APB deviates from the line segment AB near point P. Calculate the deviation between the line segment APB and the line segment AB. For an image composed of pixels, the deviation can be the number of pixels between the line segment APB and the line segment AB. For a vector image, the deviation can be the distance between the line segment APB and the line segment AB. When the deviation is greater than the first error range, it is determined that the container is deformed.
[0065] Since both the image acquisition device and image processing have certain precision limitations, a first error range is preset to reduce misidentification. For example, for an image composed of pixels, the first error range is set to 5 pixels, that is, the line between adjacent corner points does not coincide with the container edge line between adjacent corner points, but when the deviation range is within 5 pixels, it is still considered that the container has not been deformed.
[0066] The second embodiment of the present application further defines the container deformation recognition method in the first embodiment in more detail and specificity. Some or all of the technical features in the second embodiment can be combined with or replaced with the first embodiment alone or in combination, so as to obtain more feasible container deformation recognition methods.
[0067] The container deformation recognition method in the second embodiment of the present application is described in detail below:
[0068] Optionally, the deviation of the line connecting all adjacent corner points in the container corner points from the container sideline between adjacent corner points is calculated, including: obtaining all adjacent corner points in the container corner points; obtaining the deviation part of the container sideline between all adjacent corner points and the line connecting the adjacent corner points, the length of the perpendicular segment between any point on the deviation part and the line connecting the adjacent corner points is greater than a first error range; dividing the deviation part into at least one deformed sideline, each deformed sideline obtained by the segmentation includes a continuous container sideline with one undulation, the undulation refers to the trend of the change of the distance from the point on the container sideline to the line connecting the adjacent corner points first increasing and then decreasing; obtaining the distance between each deformed sideline and the line connecting the adjacent corner points as the deviation.
[0069] This embodiment defines a method for obtaining the deviation when the container sideline is relatively complex. First, in the container sideline, a set of points whose lengths of perpendicular segments connecting adjacent corner points are greater than a first error range are selected to form the deviation part.
[0070] The container edge line in the deviation part may be just one continuous curve or multiple continuous curves. Figure 3In the third example image counted from left to right, there are two bulges between corner point A and corner point B, so the deviation portion obtained for this section of the container edge may include two continuous curves.
[0071] Take a bulge or a dent for analysis. Regardless of whether it is a bulge or a dent, the distance between the points on the container sideline that constitute a bulge or a dent and the line between adjacent corner points will first increase and then decrease. In addition, the container sideline that constitutes a bulge or a dent is continuous. Therefore, based on the characteristic of having a continuous undulation, the deviation part is segmented to determine the specific amount of deformation. The number of segmented deformed sidelines represents the number of deformations on the container sideline. For example, if two deformed sidelines are segmented, it means that there are two deformations on the container sideline.
[0072] Finally, the distance between each deformed edge and the line connecting the adjacent corner points is obtained as the deviation. The number of deviation data should correspond to the number of deformed edges, that is, for each deformed edge, the deviation should contain a deviation distance corresponding to the deformed edge.
[0073] Optionally, the distance between each deformed edge line and the line connecting the adjacent corner points is obtained as the deviation, including: for each deformed edge line, determining the point in the deformed edge line with the largest distance between the deformed edge line and the line connecting the adjacent corner points as the deformed vertex; calculating the length of the perpendicular line segment between each deformed vertex and the adjacent corner point as the deviation.
[0074] This embodiment defines the specific method for obtaining the deviation. Since the distance between a continuous deformed edge line and the line connecting the adjacent corner points increases first and then decreases, the point where the distance from the increase to the decrease is the extreme point in the deformed edge line with the largest distance from the line connecting the adjacent corner points, i.e. Figure 2-4 Point P in . This point is used as the deformation vertex to draw a perpendicular line segment to the line between the adjacent corner points, and the length of the perpendicular line segment is calculated as the deviation. The length unit of the perpendicular line segment is selected according to the image type. For an image composed of pixels, the length of the perpendicular line segment can be described by the number of pixels.
[0075] Taking the distance between the extreme point P and the line connecting the adjacent corner points as the deviation helps to quantitatively describe the severity of the deformation.
[0076] In addition, if the size of the container or the image ratio is known, the conversion ratio between the distance in the container image and the actual distance can be obtained, and based on this, the number of centimeters the container is deformed in reality can be further calculated according to the deviation.
[0077] Optionally, the container deformation identification method further includes: identifying the container placement direction according to preset container features, the container features including the container door shape; and determining the container deformation position according to the container placement direction and the deviation.
[0078] This embodiment provides a method for determining the specific location of container deformation. Since image recognition can only identify deformations such as bulges or depressions, but cannot describe the specific location of the deformation, this embodiment proposes that some shape features of the container can be obtained in advance, such as Figure 5 The container shown in the figure has a standard rectangular depression at the door. The placement direction of the container can be determined based on the shape characteristics of the container. For example, Figure 2 It can be clearly found that the door is on the left, that is, the container is placed on the left. For other containers with shape characteristics or painting characteristics, these characteristics can also be added to the preset container characteristics. For example, if a company's container has a lot of red wavy painting on the door side, then "red wavy" can be added to the container characteristics to determine the direction of the door.
[0079] Then, the container deformation position can be determined based on the container placement direction combined with the container edge and position where the deviation is located. Figure 2 In the third example image, counting from left to right, it can be determined that the container is placed on the left, and the deviation occurs at the bottom of the image, which can determine that the left side of the container has a bulging deformation in reality.
[0080] Optionally, the container deformation identification method further includes: for any corner point of the container, calculating the angle of the angle at which the corner point of the container is located, and when the angle of the angle at which the corner point of the container is located is greater than or less than a preset angle range, determining that the container is deformed.
[0081] This embodiment also proposes a method for analyzing the shape of a container according to an angle to identify whether the container is deformed. The angle of the angle at which the corner point of the container is located is calculated.
[0082] For example, for a rectangular container, when the image acquisition device is facing the container and can obtain the standard three-view image of the container, the acquired image should have four container corner points, each of which should be the vertex of a right angle and an apparent angle, the right angle should be 90°, and the apparent angle should be 270°. When the image acquisition device is not facing the container for image acquisition, the number of container corner points in the image is determined by the shooting angle of the image acquisition device relative to the container. For example, if the image includes two faces of the container, there should be six container corner points in the image, four of which are the vertices of a 90° right angle and a 270° apparent angle, and the other two are the vertices of two 90° right angles and a 180° straight angle. If the image includes three faces of the container, refer to Figure 5 , then there should be seven container corners in the image (ignoring the structural features of the container, such as the concave features of the door). In the absence of deformation, the angle of each container corner is determined by the shooting angle of the image acquisition device relative to the container. As the shooting angle changes, the angle of each container corner will also change accordingly and are interrelated. For example, if Figure 5 The three included angles where the container corner point A is located are all 120°, so the included angles where the container corner point B is located should be 60°, 60° and 240°.
[0083] Therefore, the angle range needs to be preset according to the shooting angle of the image acquisition device relative to the container. When the shooting angle of the image acquisition device relative to the container changes, the preset angle range needs to be adjusted accordingly. The preset angle range is specifically for the angle where the corner point of the container is located, and can be set as needed. Generally, the angle range is set for the acute angle, right angle or obtuse angle where the corner point of the container is located, and the corresponding angle range is rarely set for the superior angle and the flat angle.
[0084] Considering that both image acquisition equipment and image processing have certain precision limitations, a preset angle range is set. For example, for the standard three-view image of a container, the angle range corresponding to the right angle where the corner points of the container are located can be [89°, 91°]. Within this range, the container is judged to be not deformed, and when it is greater than 89° or less than 91°, the container is judged to be deformed.
[0085] This embodiment performs analysis based on the angles of the corner points of the container, and can be used to supplement the methods in the aforementioned embodiments, and can be used to identify situations where a small deformation of the container, that is, the deviation is within the first error range but the deformation involves a large range, resulting in a change in the angle of the corner point of the container.
[0086] Optionally, the container deformation recognition method further includes: obtaining ambient light intensity, and determining a second error range based on the ambient light intensity; identifying and obtaining a sunken area of the container image, wherein the color difference between the sunken area and an area within a preset distance range around the sunken area is greater than the second error range.
[0087] This embodiment proposes a method for obtaining a concave area of a container image. Due to the characteristics of the concave structure, its ability to reflect ambient light is greatly different from that of the undeformed container surface, which is reflected in the image as a color difference between the concave area and the normal area around the concave area. This embodiment defines that a concave area is determined to exist if the color within the preset distance around the concave area has an error greater than the second error range with the color of the concave area.
[0088] The intensity of ambient light determines the color difference between the sunken area and the normal area in the image. Specifically, when the ambient light is strong, the color difference between the sunken area and the normal area is large, and when the ambient light is weak, the color difference between the sunken area and the normal area is large. Therefore, it is necessary to obtain the ambient light intensity in advance to set the second error range. In addition, different light sources irradiate the surface of the container, which may cause errors between normal areas. For example, a light bulb is used for lighting at a distance close to the container. The light bulb acts as a point light source. Its light irradiates the nearby container surface and the distant container surface, which also causes a small color difference between the nearby and distant container surfaces in the image. Therefore, the second error range also needs to ensure that the color difference caused by the ambient light can be filtered out.
[0089] The specific definition of color difference can be determined according to the image type. For example, for an image composed of pixels, the color difference between regions can be obtained by calculating the RGB values of the pixels.
[0090] Since some containers are sunken and deformed, and their deformation areas do not involve the container edges, these sunken areas cannot be discovered by analyzing the container edges. The method of determining the sunken area based on the color difference in the image in this embodiment makes up for the above defects.
[0091] Optionally, identifying and obtaining a sunken area of a container image includes: identifying and obtaining an abnormal area of the container image, wherein the color difference between the abnormal area and other areas in the container image is greater than a preset third error range; performing shape and uniformity identification on the abnormal area, dividing the abnormal area into at least two area sets, wherein the at least two area sets include a first sunken area set, and the first sunken area set does not include areas in the abnormal area that have a regular shape and / or uniform color inside the area; identifying an area set other than the first sunken area set in the area set, obtaining a second sunken area set, wherein the color difference between areas in the second sunken area set and other areas in the area set other than the first sunken area set in the area set is greater than a second error range; and merging the first sunken area set with the second sunken area set to obtain a sunken area.
[0092] In actual applications, containers may be painted or shadows may be generated on the containers due to the occlusion of other containers and other objects around them. The above situations will cause color difference between normal areas in the container image.
[0093] This embodiment proposes to distinguish the normal area from the sunken area by identifying the color of the image.
[0094] First, separate the areas where the color difference is greater than the preset third error range. The specific value of the third error range and its size relationship with the second error range can be set according to specific needs. For example, for container A painted 70% red and 30% white, if the red painted part and the white painted part need to be analyzed separately, then the value setting of the third error range only needs to meet the requirement of distinguishing different colors of paint. In the same color painted area, the color difference between the depression and the normal surface is generally smaller than the color difference between different colors of paint. Therefore, in this case, the third error range is greater than the second error range. If you want to separate all possible depression areas during the area separation process, you can set the value of the third error range equal to the second error range.
[0095] For container A painted 70% red and 30% white in the above example, the separation result may be that the white area is an abnormal area, and, if there is a depression in the red painted area of container A and the value of the third error range is equal to the second error range, then an abnormal area will also be separated in the red painted area.
[0096] Then, the shape and uniformity of the abnormal area are identified. Specifically, the concave area generally has the following characteristics: 1. The shape of the concave area is irregular and cannot be presented as a strict circular / elliptical shape in the image; 2. The container image with clear lines has been obtained in the image data processing, but the edge of the concave area is not obvious and irregular, which is reflected in the poor edge line clarity in the image before processing. Therefore, the image data processing will not identify the lines with poor edge clarity in the concave area, and the edge line of the concave area will not be clarified; 3. The ability of different positions inside the concave area to reflect light is also different, so the color inside the concave area is also uneven. Select one or more of the above features to preliminarily determine the concave area. For example, if an abnormal area has a regular shape (having a regular shape means that the abnormal area not only has a clear and identifiable edge line, but also the shape of the area is a common geometric figure or a combination of several common geometric figures, such as a triangle, a circle, a parallelogram, etc.) and the color inside the area is uniform. It is considered that the area may not be a concave area, and the area can be freely named, such as the first abnormal area set. If the edge of the abnormal area is unclear, the shape is irregular, or the internal color is uneven, then the area is a concave area, and the area is added to the first concave area set.
[0097] Finally, the areas in the area set obtained by the previous step that were not identified as sunken areas are reviewed again. The review mainly focuses on whether there are areas inside these areas where the color difference with other areas is greater than the second error range. For example, if the 30% white painted part on container A has a depression inside, and the entire white painted part is identified as an abnormal area, since the entire white painted area has a regular shape and most of the internal areas are uniform in color, this area passes the above steps of identifying the shape and uniformity of the abnormal area. During the review, the interior of the white painted area will be checked again. During the review, it will be found that there are some areas inside the white painted area where the color difference with other areas is greater than the second error range. This part of the area is added to the second sunken area set as a sunken area.
[0098] By merging the first concave area set with the second concave area set, all the concave areas in the container image can be obtained.
[0099] Optionally, the container deformation identification method further includes: obtaining, by means of a distance measuring device, a distance between the distance measuring device and the container and a distance between the distance measuring device and the sunken area, and calculating a sunken amount of the sunken area.
[0100] Since the method provided in the above embodiment does not include the relevant content of the concave distance in the analysis of the concave area, this embodiment provides a method, which uses a distance measuring device, such as a laser radar, to obtain the distance between the distance measuring device and the container (the container distance here refers to the distance to the surface of the container that has not been deformed) and the distance between the distance measuring device and the concave area, and the distance between the distance measuring device and the concave area can be subtracted to determine the concave amount of the concave area.
[0101] Correspondingly, the third embodiment of the present application also provides a container deformation recognition device, such as Figure 6 As shown, the device comprises:
[0102] An image processing unit 601 is used to obtain image data, identify, segment and process the edges of the image data, and obtain a container image with clear edges;
[0103] The recognition unit 602 is used to recognize and obtain the container edge line and the container corner point in the container image, where the container corner point is the vertex of the angle formed by the edges of the container;
[0104] The calculation unit 603 is used to calculate the deviation between the connecting line between all adjacent corner points of the container and the container sideline between the adjacent corner points. When the deviation is greater than a preset first error range, it is determined that the container is deformed and the adjacent corner points are container corner points located on the same container sideline.
[0105] Optionally, calculating the deviation between the connecting line between all adjacent corner points and the container sideline between adjacent corner points in the container corner points includes:
[0106] Get all adjacent corner points of the container corner point;
[0107] Obtain the deviation between the container sideline and the line between the adjacent corner points of all adjacent corner points, and the length of the perpendicular line segment between any point on the deviation part and the line between the adjacent corner points is greater than the first error range;
[0108] The deviated part is divided into at least one deformed edge line, and each deformed edge line obtained by the division includes a continuous container edge line with one undulation, and the undulation refers to the trend that the distance between a point on the container edge line and a line connecting adjacent corner points increases first and then decreases;
[0109] The distance between each deformed edge and the line connecting the adjacent corner points is obtained as the deviation.
[0110] Optionally, the distance between each deformed edge and the line connecting the adjacent corner points is obtained as the deviation, including:
[0111] For each deformed edge, determine the point in the deformed edge with the largest distance between the line connecting the adjacent corner points as the deformed vertex;
[0112] The length of the perpendicular segment between each deformed vertex and the adjacent corner point is calculated as the deviation.
[0113] Optionally, the method further comprises:
[0114] Identify the container placement direction according to preset container features, including the container door shape;
[0115] The container deformation position is determined according to the container placement direction and deviation.
[0116] Optionally, the method further comprises:
[0117] For any corner point of the container, the angle of the angle at which the corner point of the container is located is calculated. When the angle of the angle at which the corner point of the container is located is greater than or less than a preset angle range, it is determined that the container is deformed.
[0118] Optionally, the method further comprises:
[0119] Acquire the ambient light intensity, and determine a second error range according to the ambient light intensity;
[0120] A sunken area of the container image is identified and acquired, and a color difference between the sunken area and an area within a preset distance range around the sunken area is greater than a second error range.
[0121] Optionally, identifying and acquiring a sunken area of the container image includes:
[0122] Identify and obtain an abnormal area of the container image, where the color difference between the abnormal area and other areas in the container image is greater than a preset third error range;
[0123] Perform shape and uniformity identification on the abnormal region, and divide the abnormal region into at least two region sets, wherein the at least two region sets include a first concave region set, and the first concave region set does not include a region in the abnormal region that has a regular shape and / or a region with uniform color inside;
[0124] For the region set, the region set other than the first concave region set is identified to obtain a second concave region set, wherein the color difference between the regions in the second concave region set and other regions in the region set other than the first concave region set in the region set is greater than a second error range;
[0125] The first concave area set and the second concave area set are combined to obtain the concave areas.
[0126] Optionally, the method further comprises:
[0127] The distance between the distance measuring device and the container and the distance between the distance measuring device and the sunken area are obtained by using the distance measuring device, and the sunken amount of the sunken area is calculated.
[0128] The container deformation recognition device provided in this embodiment belongs to the same application concept as the container deformation recognition method provided in the above embodiments of this application, and can execute the container deformation recognition method provided in any of the above embodiments of this application, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not fully described in this embodiment, please refer to the specific processing content of the container deformation recognition method embodiment provided in the above embodiments of this application, and will not be repeated here.
[0129] The functions implemented by the above image processing unit 601, recognition unit 602 and calculation unit 603 can be implemented by the same or different processors respectively, and the embodiment of the present application is not limited thereto.
[0130] It should be understood that the units in the above devices can be implemented in the form of a processor calling software. For example, the device includes a processor, the processor is connected to a memory, and instructions are stored in the memory. The processor calls the instructions stored in the memory to implement any of the above methods or realize the functions of each unit of the device, wherein the processor can be a general-purpose processor, such as a CPU or a microprocessor, etc., and the memory can be a memory in the device or a memory outside the device. Alternatively, the units in the device can be implemented in the form of hardware circuits, and the functions of some or all units can be realized by designing the hardware circuits. The hardware circuit can be understood as one or more processors; for example, in one implementation, the hardware circuit is an ASIC, and the functions of some or all of the above units are realized by designing the logical relationship of the components in the circuit; for another example, in another implementation, the hardware circuit can be implemented by PLD, taking FPGA as an example, which can include a large number of logic gate circuits, and the connection relationship between the logic gate circuits is configured by the configuration file, so as to realize the functions of some or all of the above units. All units of the above devices can be implemented in the form of a processor calling software, or in the form of hardware circuits, or in part by a processor calling software, and the remaining part is implemented in the form of hardware circuits.
[0131] In an embodiment of the present application, a processor is a circuit with the ability to process signals. In one implementation, the processor may be a circuit with the ability to read and run instructions, such as a CPU, a microprocessor, a GPU, or a DSP; in another implementation, the processor may implement certain functions through the logical relationship of a hardware circuit, and the logical relationship of the hardware circuit is fixed or reconfigurable, such as a hardware circuit implemented by an ASIC or PLD, such as an FPGA. In a reconfigurable hardware circuit, the process of the processor loading a configuration document to implement the hardware circuit configuration can be understood as the process of the processor loading instructions to implement the functions of some or all of the above units. In addition, it can also be a hardware circuit designed for artificial intelligence, which can be understood as an ASIC, such as an NPU, TPU, DPU, etc.
[0132] It can be seen that each unit in the above device can be one or more processors (or processing circuits) configured to implement the above method, such as: CPU, GPU, NPU, TPU, DPU, microprocessor, DSP, ASIC, FPGA, or a combination of at least two of these processor forms.
[0133] In addition, all or part of the units in the above device can be integrated together, or can be implemented independently. In one implementation, these units are integrated together and implemented in the form of a SOC. The SOC may include at least one processor for implementing any of the above methods or implementing the functions of each unit of the device. The type of the at least one processor may be different, for example, including a CPU and an FPGA, a CPU and an artificial intelligence processor, a CPU and a GPU, etc.
[0134] The fourth embodiment of the present application also provides an electronic device, see Figure 7 As shown, the device includes:
[0135] Memory 700 and processor 710;
[0136] The memory 700 is connected to the processor 710 and is used to store programs;
[0137] The processor 710 is used to implement the container deformation identification method disclosed in any of the above embodiments by running the program stored in the memory 700.
[0138] Specifically, the electronic device may further include: a bus, a communication interface 720 , an input device 730 and an output device 740 .
[0139] The processor 710, the memory 700, the communication interface 720, the input device 730 and the output device 740 are connected to each other via a bus.
[0140] A bus may include a pathway that transfers information between components of a computer system.
[0141] Processor 710 may be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the scheme of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0142] The processor 710 may include a main processor, and may also include a baseband chip, a modem, and the like.
[0143] The memory 700 stores a program for executing the technical solution of the present invention, and may also store an operating system and other key services. Specifically, the program may include a program code, and the program code includes a computer operation instruction. More specifically, the memory 700 may include a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM), other types of dynamic storage devices that can store information and instructions, a disk storage, a flash, and the like.
[0144] The input device 730 may include a device for receiving data and information input by a user, such as a keyboard, a mouse, a camera, a scanner, a light pen, a voice input device, a touch screen, a pedometer, or a gravity sensor.
[0145] Output device 740 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0146] The communication interface 720 may include any transceiver or the like to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0147] The processor 710 executes the program stored in the memory 700 and calls other devices, which can be used to implement each step of any container deformation identification method provided in the above embodiments of the present application.
[0148] For the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0149] It should be noted that each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0150] The steps in the methods of each embodiment of the present application can be adjusted in sequence, combined and deleted according to actual needs, and the technical features recorded in each embodiment can be replaced or combined.
[0151] The modules and sub-modules in the devices and terminals of the various embodiments of the present application can be combined, divided and deleted according to actual needs.
[0152] In the several embodiments provided in the present application, it should be understood that the disclosed terminals, devices and methods can be implemented in other ways. For example, the terminal embodiments described above are only schematic, for example, the division of modules or submodules is only a logical function division, and there may be other division methods in actual implementation, for example, multiple submodules or modules can be combined or integrated into another module, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or modules, which can be electrical, mechanical or other forms.
[0153] The modules or submodules described as separate components may or may not be physically separated, and the components of the modules or submodules may or may not be physical modules or submodules, that is, they may be located in one place, or they may be distributed on multiple network modules or submodules. Some or all of the modules or submodules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0154] In addition, each functional module or submodule in each embodiment of the present application may be integrated into one processing module, or each module or submodule may exist physically separately, or two or more modules or submodules may be integrated into one module. The above-mentioned integrated modules or submodules may be implemented in the form of hardware or in the form of software functional modules or submodules.
[0155] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0156] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly by hardware, software units executed by a processor, or a combination of the two. The software units may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0157] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0158] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be 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 the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A container deformation recognition method, characterized in that: include: Acquire and process image data to obtain container images with clear lines; Identify and obtain container edges and container corners in the container image, where the container corners are vertices of angles formed by edges of the container; The deviation between the connecting line between all adjacent corner points of the container and the container sideline between the adjacent corner points is calculated. When the deviation is greater than a preset first error range, it is determined that the container is deformed. The adjacent corner points are container corner points located on the same container sideline.
2. The method according to claim 1, characterized in that The calculating of the deviation between the connecting line between all adjacent corner points of the container and the container sideline between the adjacent corner points includes: Obtain all adjacent corner points of the container corner point; Obtaining the deviation between the container sideline and the line between the adjacent corner points of all adjacent corner points, wherein the length of the perpendicular line segment between any point on the deviation and the line between the adjacent corner points is greater than the first error range; The deviated portion is divided into at least one deformed edge line, each deformed edge line obtained by the division includes a continuous container edge line with one undulation, and the undulation refers to the trend that the distance between a point on the container edge line and a line connecting adjacent corner points increases first and then decreases; The distance between each deformed edge line and the connecting line between the adjacent corner points is obtained as the deviation.
3. The method according to claim 2, characterized in that The obtaining the distance between each deformed edge line and the connecting line between the adjacent corner points as the deviation comprises: For each deformed edge line, determine the point in the deformed edge line with the largest distance from the connecting line between the adjacent corner points as the deformed vertex; The length of the perpendicular line segment between each deformation vertex and the adjacent corner point is calculated as the deviation.
4. The method according to claim 1, characterized in that: The method further comprises: Identify the container placement direction according to preset container features, wherein the container features include the shape of the container door; The container deformation position is determined according to the container placement direction and the deviation.
5. The method according to claim 1, characterized in that The method further comprises: For any corner point of the container, the angle of the angle at which the corner point of the container is located is calculated. When the angle of the angle at which the corner point of the container is located is greater than or less than a preset angle range, it is determined that the container is deformed.
6. The method according to claim 1, characterized in that The method further comprises: Acquire ambient light intensity, and determine a second error range according to the ambient light intensity; A sunken area of the container image is identified and acquired, wherein a color difference between the sunken area and an area within a preset distance range around the sunken area is greater than the second error range.
7. The method according to claim 6, characterized in that The identifying and acquiring the sunken area of the container image includes: Identify and obtain an abnormal area of the container image, where the color difference between the abnormal area and other areas in the container image is greater than a preset third error range; Performing shape and uniformity identification on the abnormal region, dividing the abnormal region into at least two region sets, wherein the at least two region sets include a first concave region set, and the first concave region set does not include a region in the abnormal region that has a regular shape and / or a region with uniform color inside; For the area set, an area set other than the first concave area set is identified to obtain a second concave area set, wherein a color difference between an area in the second concave area set and other areas in the area set other than the first concave area set in the area set is greater than the second error range; The first concave area set and the second concave area set are combined to obtain the concave area.
8. The method according to claim 7, characterized in that The method further comprises: The distance between the distance measuring device and the container and the distance between the distance measuring device and the sunken area are obtained by using a distance measuring device, and the sunken amount of the sunken area is calculated.
9. A container deformation recognition device, characterized in that: include: An image processing unit, used to obtain image data, identify, segment and process edges of the image data, and obtain a container image with clear edges; an identification unit, used to identify and obtain container edges and container corner points in the container image, wherein the container corner points are vertices of angles formed by the edges of the container; A calculation unit is used to calculate the deviation of the connection line between all adjacent corner points of the container and the container sideline between the adjacent corner points. When the deviation is greater than a preset first error range, it is determined that the container is deformed. The adjacent corner points are container corner points located on the same container sideline.
10. An electronic device, characterized in that: including memory and processor; The memory is connected to the processor and is used to store programs; The electronic device implements the container deformation recognition method according to any one of claims 1 to 8 by running the program in the memory through the processor.
Citation Information
Patent Citations
Deformation detection method, device and equipment and computer readable storage medium
CN113393448A
Box-type structure deformation detection method and device, electronic equipment and storage medium
CN113409282A
Deformation detection method, device and equipment and computer readable storage medium
CN113706445A
Container state detection method and device and electronic equipment
CN116338722A
Object deformation detection method and device, metal deformation detection equipment and storage medium
CN116739960A
