Method, system, device and medium for filtering background of two-dimensional container images from top perspective
By constructing a geometric model of container images and using image segmentation technology, filtering out irrelevant background, and identifying and processing isolated top corner surfaces, the problem of complex background in top-view container images is solved, the accuracy and robustness of damage detection are improved, and the system complexity and hardware cost are reduced.
Patent Information
- Application Number
- CN202510914924.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-07-03
AI Technical Summary
In logistics environments such as ports and docks, container images taken from a top perspective have complex backgrounds and numerous changes, resulting in insufficient accuracy and robustness in container damage detection. Existing technologies fail to effectively filter out interference elements and useless information.
By constructing the geometric model of each component in the container image, filtering out irrelevant background, combining image segmentation technology, identifying and processing isolated top corner surfaces, optimizing the image segmentation model, determining the specific working conditions of the container, and improving the accuracy and robustness of damage detection.
The accuracy and robustness of container damage detection are improved, the dependence on model recognition accuracy is reduced, hardware costs and maintenance difficulty are simplified, and the use of expensive equipment is avoided.
Smart Images

Figure CN120411527B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of intelligent image recognition of terminal containers, and in particular to a method, system, device and medium for background filtering of a two-dimensional image of a container from a top perspective. Background Art
[0002] In logistics environments such as ports and terminals, container damage detection is a vital step in ensuring the safe transportation of goods. Traditional damage detection methods rely on manual inspections, which are not only inefficient but also susceptible to subjective factors. With the development of automation technology and artificial intelligence, automatic container damage recognition technology based on image processing has gradually become mainstream. However, in practical applications, especially in quay crane operating environments, images taken from a top perspective contain complex backgrounds and ever-changing container states (such as partial occlusion, incomplete shooting, etc.), resulting in a large amount of interference elements and useless information in the image acquisition process. This not only makes it difficult to accurately locate and measure container damage, but can also result in a certain number of misidentifications, which in turn makes the system overly dependent on the recognition accuracy of the model, affecting the robustness of the system.
[0003] Some existing solutions directly identify and detect container numbers and damage information from images, such as CN114267032A, CN117635515A, CN118644868A, and CN117935274A. Although these methods can obtain container information and identify and classify damage, they do not consider the issue of size quantification, let alone the filtering of background information. Other solutions use lidar scanning to obtain three-dimensional structural information of containers to achieve more accurate identification and quantification of damage, but they do not explain how to filter out interfering elements or useless information, and are difficult to apply in quantitative scenarios where only two-dimensional images can be obtained. In addition, the container loading and unloading conditions from the top perspective of the quay crane have certain special characteristics.
[0004] Based on this, a new background filtering scheme for top-view container two-dimensional images is needed. Summary of the Invention
[0005] In view of this, the embodiments of this specification provide a method, system, device and medium for filtering the background of a two-dimensional image of a container from a top perspective. Based on the geometric model of the container in the image and the standardized benchmark, the relative positions and spatial layout of parts such as the container door, front and top surface are determined. Combined with the segmentation results, irrelevant background is removed, misidentified information is identified, and incomplete and invalid information is filtered out, thereby accurately determining the operating conditions and providing a reliable basis for damage detection.
[0006] The embodiments of this specification provide the following technical solutions:
[0007] This embodiment of the present invention provides a method for filtering the background of a two-dimensional container image from a top perspective, comprising:
[0008] Construct the geometric model of each component of the container in the container image and filter out irrelevant background to obtain the initial logo composition;
[0009] Wherein, each of the components includes one or more of the following parts: container door, container front, top surface, top corner surface;
[0010] Based on the initial identification structure, determine whether the top surface exists, if so, filter out isolated top surface corner piece faces that do not overlap with all top surfaces; if not, retain all top surface corner piece faces;
[0011] Based on the top surface segmentation results in the container image and the relative position relationship with the top surface corner fitting surface, the top surface information is filtered and processed, including: filtering out top surfaces with a top surface corner fitting number less than a preset value; filtering out top surfaces with a top surface area less than a first preset threshold;
[0012] Second, determine whether there are any top surfaces. If so, filter out isolated top corner faces that do not overlap with all top surfaces.
[0013] Based on the geometric models of the door, front, top and top corner surfaces that are finally retained, the specific working conditions of the container are determined for subsequent damage quantification.
[0014] The present invention also provides a system for filtering the background of a two-dimensional container image from a top perspective, including:
[0015] The background filtering module is used to construct the geometric model of each component of the container in the container image and filter out irrelevant background to obtain the initial logo composition;
[0016] Wherein, each of the components includes one or more of the following parts: container door, container front, top surface, top corner surface;
[0017] an isolated top surface corner piece face filtering module, configured to determine whether a top surface exists based on the initial identification structure, and if so, filter out isolated top surface corner piece faces that do not overlap with all top surfaces; if not, retain all top surface corner piece faces;
[0018] The top surface information processing module is used to filter and process the top surface information based on the top surface segmentation results in the container image and the relative position relationship with the top surface corner fitting surface, including: filtering out top surfaces with a top surface corner fitting number less than a preset value; filtering out top surfaces with a top surface area less than a first preset threshold;
[0019] The module for secondary filtering of isolated top corner faces is used to determine whether there are any top faces. If so, the module filters out isolated top corner faces that do not overlap with any top faces.
[0020] The working condition judgment module is used to determine the specific working condition of the container based on the geometric models of the door, front, top surface and top corner parts that are finally retained, for subsequent damage quantification processing.
[0021] An embodiment of this specification further provides an electronic device, including:
[0022] At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute: the method for background filtering of a two-dimensional image of a top-view container as described in any one of the present application.
[0023] An embodiment of this specification also provides a computer storage medium, which stores computer executable instructions. When the computer executable instructions are executed by a processor, they perform: the background filtering method for a top-view container two-dimensional image as described in any one of the present applications.
[0024] Compared with the prior art, the at least one technical solution adopted in the embodiments of this specification can achieve the following beneficial effects:
[0025] 1. This invention establishes a geometric model of each part in a container top view image, effectively selects quantitative identifiers, and achieves image-based anchoring of container size quantitative identifiers, thereby helping to further infer the current operating condition of the container and facilitating subsequent quantification of container damage dimensions.
[0026] 2. This application effectively optimizes the misjudgment of working conditions caused by misidentification of image segmentation models by quantifying the size and position of container markings in images, as well as the position and relationship between markings. This reduces the quantification system's dependence on model recognition accuracy and improves the robustness of the entire damage quantification system.
[0027] 3. The present invention achieves container damage quantification and marking anchoring only through two-dimensional images and image segmentation technology, avoiding the use of expensive hardware equipment and more complex data processing processes, simplifying the preprocessing process of damage quantification, and reducing the hardware cost, maintenance difficulty and overall complexity of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0029] Figure 1 This is a flowchart of the background filtering method for top-view container images in this application;
[0030] Figure 2 This is a flowchart of a method for background filtering of a top-view container image in this application;
[0031] Figure 3 It is a schematic diagram of the overlap between the top corner piece and the top surface area in this application;
[0032] Figure 4 This is a schematic diagram of determining whether a top surface is small based on the ratio between the projected lengths of the top surface and the top corner piece surface in this application;
[0033] Figure 5 It is a structural diagram of the electronic device in this application. DETAILED DESCRIPTION
[0034] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0035] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be noted that, in the absence of conflict, the features in the following embodiments and embodiments can be combined with each other. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without making creative work are within the scope of protection of this application.
[0036] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein can be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on this application, it should be understood by those skilled in the art that an aspect described herein can be implemented independently of any other aspect, and two or more of these aspects can be combined in various ways. For example, any number and aspect described herein can be used to implement an apparatus and / or practice a method. In addition, other structures and / or functionalities other than one or more of the aspects described herein can be used to implement this apparatus and / or practice this method.
[0037] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present application. The illustrations only show components related to the present application and are not drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component can be changed at will, and the component layout type may also be more complicated.
[0038] Additionally, in the following description, specific details are provided to provide a thorough understanding of the examples, however, one skilled in the art will appreciate that the examples can be practiced without these specific details.
[0039] Container loading and unloading conditions from the top of a quay crane present certain unique characteristics, such as complex backgrounds, partial occlusions, and incomplete capture, which are particularly prominent in two-dimensional images. Traditional image processing methods, when dealing with these complex scenarios, fail to consider either dimensional quantization or background information filtering. Other methods, which use lidar scanning to obtain three-dimensional structural information from containers, are difficult to apply to quantitative scenarios where only two-dimensional images are available, and fail to address how to filter out interfering elements or useless information, resulting in insufficient accuracy and robustness in damage detection.
[0040] In view of this, the inventors discovered through research and improvement exploration that in the quay crane operation environment, there are often a large number of interference elements and useless information in the images taken from the top perspective, such as: terminal facilities, other ships, debris from other containers, etc., which not only increases the difficulty of damage positioning and measurement, but also easily leads to misidentification, thereby making the system overly dependent on the recognition accuracy of the model, affecting the robustness of the system.
[0041] Based on this, the embodiment of this specification proposes a background filtering method for a two-dimensional container image from a top perspective: the overall idea is: first, a geometric model of the container door, front of the container, top surface and top corner piece surface in the container image is constructed to remove irrelevant background and obtain the initial identification composition; secondly, isolated top corner pieces are pre-filtered; then, based on the top surface segmentation situation and the relative position relationship of the corner piece surface, top surface information that does not meet the conditions is further filtered out, and isolated corner pieces are filtered out a second time; finally, the specific working conditions of the container are inferred based on the filtered results, thereby solving the problems of complex background, misidentification and incomplete information in container damage detection in ports and terminals, improving the accuracy and robustness of container damage detection, reducing dependence on the recognition accuracy of the image segmentation model, avoiding the use of expensive hardware equipment, simplifying the preprocessing process of damage quantification, and reducing the hardware cost and maintenance difficulty of the system.
[0042] The following describes the technical solutions provided by various embodiments of the present application in conjunction with the accompanying drawings.
[0043] like Figure 1As shown, the embodiment of this specification provides a method for filtering the background of a two-dimensional container image from a top perspective, comprising:
[0044] Step S101: constructing a geometric model of each component of the container in the container image and filtering out irrelevant background to obtain an initial identification structure;
[0045] Wherein, each of the components includes one or more of the following parts: container door, container front, top surface, and top corner surface.
[0046] It's important to note that during quay crane operations, crane operators typically load and unload containers from a high vantage point (such as the crane's cab). Therefore, images are captured from a top-down perspective. In practice, the yard may be filled with other containers, transport vehicles, and loading and unloading equipment, creating a complex background. Furthermore, the placement and status of containers can constantly change due to loading and unloading operations, leading to dynamic shifts between the target and background areas in the image. Furthermore, the presence of other containers or loading and unloading equipment can obscure portions of the target container, resulting in incomplete capture.
[0047] Therefore, for complex two-dimensional container images, we first construct the geometric models of each component of the container (such as the door, front, top surface, top corner surface, etc.), and then filter out irrelevant background, and only include the image representation of the parts related to damage detection, that is, the initial identification composition, to improve the accuracy of subsequent processing and reduce the possibility of misidentification and misprocessing.
[0048] Step S102: Based on the initial identification structure, determine whether the top surface exists. If so, filter out isolated top surface corner parts that do not overlap with all top surfaces; if not, retain all top surface corner parts.
[0049] In implementation, isolated top corner faces are pre-filtered based on the top face recognition in the image. If a top face is recognized in the image, each top corner face is checked to see if it overlaps with any other top faces. If no top face is recognized in the image, the face is considered isolated and filtered out. If no top face is recognized in the image, all top corner faces are retained, as they may be required for subsequent processing.
[0050] Therefore, after this step, the obtained image only contains the top corner pieces faces that overlap with the top surface, or retains all the top corner pieces faces when there is no top surface.
[0051] Step S103: Filter and process the top surface information based on the top surface segmentation result in the container image and the relative position relationship with the top surface corner fitting surface, including: filtering out the top surface with the number of corner fittings less than a preset value; filtering out the top surface with an area less than a first preset threshold.
[0052] After establishing the geometric models of each component, the top surface information can be filtered and processed more carefully based on the top surface segmentation results and the relative positional relationship between the top surface corner pieces. If the number of corner pieces within a top surface is less than a preset value, such as less than 2, the top surface is considered incomplete or misidentified and is filtered out. If the area of a top surface is less than a preset threshold, it is also considered incomplete or misidentified and is filtered out.
[0053] It should be noted that, in practice, this step is performed on the basis of step S102 to further clean up invalid or incomplete top surface information in the image, thereby ensuring that the retained top surface information is complete and valid.
[0054] Step S104: determine again whether there are any top surfaces. If so, filter out isolated top corner surfaces that do not overlap with all top surfaces.
[0055] After processing in step S103, the remaining top surface information in the image may have changed, resulting in some top surfaces being filtered out. Therefore, a second check is required to determine whether top surfaces still exist. This avoids invalid processing of non-existent top surfaces and improves system efficiency and accuracy. If top surfaces still exist, the overlap relationship between top surface corner faces and top surfaces is checked again, and isolated top surface corner faces that do not overlap with all other top surfaces are filtered out. This clears invalid information from the image, ensures that the retained top surface corner faces have a reasonable overlap relationship with the top surface, and improves the overall performance of the system.
[0056] Step S105: Based on the geometric models of the door, front, top and top corner surfaces that are finally retained, the specific working conditions of the container are determined for subsequent damage quantification processing.
[0057] Based on the retained geometric models of the door, front, top, and top corner fittings, the positional relationships and spatial layout of each component can be determined based on the corner fittings. Based on prior knowledge, the specific working condition of the container can be inferred, specifically the actual placement of the container in the 2D image. For example, if a portion of the top surface is obscured, it can be inferred that the container may be obscured by other objects or incompletely captured. This inferred working condition serves as input for subsequent damage detection and quantification, thereby improving detection accuracy and reliability.
[0058] In some embodiments, the geometric model is constructed using any one of the following methods:
[0059] Build based on standard dimensions and geometric relationships;
[0060] The mapping relationship between image coordinates and actual size coordinates is constructed through perspective transformation.
[0061] In combination with the above embodiments, the geometric model can be constructed by using any one of the methods mentioned in the two patents applied for by our company, "Container Damage Quantification Method Based on Geometric Calibration" and "Container Damage Quantification Method Based on Perspective Transformation", to construct a geometric model of the container door, front, top surface and top corner surface in the image.
[0062] In some embodiments, filtering out irrelevant background includes:
[0063] According to the geometric model, combined with image segmentation, the region of interest is separated from the background, the region of interest is retained, and irrelevant background is filtered out;
[0064] The areas of interest include: container door, container front, top surface, and top corner surfaces.
[0065] There are mainly two types of identification composition situations that this application needs to deal with: the first type is misidentification / segmentation caused by the recognition / segmentation model, such as misidentifying / segmenting the box door or front as the top surface; the second type is incomplete and invalid information, such as the top surface or top corner parts that are blocked or not fully photographed. This situation may be due to the limitation of the frame size or improper camera installation position, or it may be due to improper timing of photo triggering during operation.
[0066] During the implementation process, irrelevant background is filtered out through image segmentation combined with the construction of a geometric model. Specifically, through reasonable image segmentation of the quantitative mark, the various components of the container in the image (such as the door, front of the container, top surface, top corner surface, etc.) are separated from the background, and the area of interest in the quantification process in the two-dimensional image is selected. At the same time, irrelevant background outside the area of interest is filtered out, such as the surrounding environment, shadows during shooting, and partially obscured or incomplete parts of the container, thereby providing a clear and accurate image foundation for subsequent processing steps.
[0067] In some embodiments, the method for determining an isolated top corner face includes:
[0068] If the number of pixels where the top corner piece surface overlaps with each top surface is less than the second preset threshold, it is determined to be an isolated top corner piece surface. The formula is expressed as:
[0069] ;
[0070] in, represents the area of the top corner piece segmented out by the i-th segmentation, n represents the number of all segmented top corner pieces, represents the jth segmented top surface area, m represents the number of all segmented top surfaces, is a very small positive number used to handle numerical errors or minor boundary overlaps.
[0071] In implementation, such as Figure 3 As shown, the geometric model of each corner piece face is checked for the number of pixels that overlap with the geometric model of each top surface. If the number of pixels that overlap with the geometric models of the corner piece face and the top surface is less than the specified threshold, the corner piece face is considered to have no overlap with the top surface. If the number of pixels that overlap with the geometric models of all top surfaces is less than the specified threshold, that is, the corner piece does not overlap with any top surface, the corner piece is considered an isolated corner piece.
[0072] In some embodiments, the method for determining the number of top surface interior corner fittings includes: the number of all top surface corner fitting faces that overlap with the top surface area, which is expressed as:
[0073] ;
[0074] ;
[0075] in, represents the segmented top surface area, represents the i-th top corner piece surface, , where m represents the number of all top corner faces, express and Whether there is overlap, represented by a binary value, 1 means overlap, 0 means no overlap; Represents the top surface area The number of top corner piece faces that overlap.
[0076] In conjunction with the above embodiment, the number of corner fittings within each top surface is checked based on the overlap area between the corner fitting surface and the top surface. If the number of corner fittings within a top surface does not reach a preset minimum, for example, if there are fewer than two corner fittings, the top surface is deemed incomplete or non-compliant. Based on this determination, such top surfaces are filtered out from further analysis and processing, ensuring that only structurally intact top surfaces with sufficient information are retained for subsequent container damage detection and quantification.
[0077] In some embodiments, such as Figure 4 As shown, the top surface with a smaller area is filtered out based on the ratio of the projected lengths of the geometric model of the split top surface and the geometric model of the top corner piece surface in the length direction of the box side.
[0078] The filtering out top surfaces whose top surface area is smaller than a first preset threshold comprises:
[0079] Determine whether the ratio of the projection of the geometric model of the split top surface and the geometric model of the top corner piece surface in the length direction of the box side is less than a first preset threshold. If so, filter out the top surface. The formula is expressed as:
[0080] ;
[0081] in, Represents the geometric model of the segmented top surface, The geometric model representing the top corner piece surface, Indicates the length direction of the box side, express In the length direction of the box side The projection length on express In the length direction of the box side The projection length on Indicates the set ratio threshold.
[0082] In some embodiments, determining the specific operating condition of the container includes:
[0083] Determine the relative positions and spatial layout of the door, front, top and top corner surfaces that will be retained;
[0084] The relative pose from the perspective of the external camera based on the relative position and spatial layout.
[0085] Another example is given below, which is a schematic illustration formed by combining the above examples.
[0086] refer to Figure 2 In summary, the present invention proposes a method for removing the background from a two-dimensional image of a container from a top perspective, which may include the following steps:
[0087] Step 1: Based on the method mentioned in the container damage quantification method, a geometric model of the container door, front, top surface, and top corner surfaces in the image is constructed, and irrelevant background is filtered out to obtain the initial identification structure;
[0088] Step 2: Based on the top surface recognition in the image, pre-filter out the isolated top corner faces. If a top surface is recognized, filter out the isolated top corner faces. If no top surface is recognized, retain the isolated corner faces.
[0089] Step 3: Based on the top surface segmentation in the image and its relative position to the top surface corner pieces, the top surface information is filtered and processed. First, top surfaces with less than 2 corner pieces need to be filtered out, and second, top surfaces with a small area need to be filtered out.
[0090] Step 4: Based on the filtering results of the previous step, if there are still top surfaces, filter out isolated corner pieces that are not on any surface, as in step 2.
[0091] Step 5: Based on the conditions of the final filtered door, box front, top surface and top corner parts, the final working condition of the current image is obtained.
[0092] Furthermore, the filtering of irrelevant background in step 1 is achieved by image segmentation and constructing a geometric model. By reasonably segmenting the image for quantization identification, the area of interest in the quantization process in the two-dimensional image is selected, and the irrelevant background is filtered out.
[0093] Furthermore, the method for determining the isolated top corner piece in step 2 is that there is no overlapping part between the top corner piece and the top surface identified in the image, wherein the calculation formula can refer to the above example and will not be expanded.
[0094] Furthermore, the method for determining the number of top surface inner corner fittings in step 3 is the number of all top surface corner fitting faces that overlap with the top surface area, wherein the calculation formula can refer to the above example and will not be expanded.
[0095] Furthermore, the basis for determining the top surface with a smaller area in the step 3 is the ratio of the geometric model of the segmented top surface and the geometric model of the top corner surface projected in the length direction of the box side. When the ratio is less than the set threshold, it is determined to be a top surface with a smaller area. The calculation formula can refer to the above example and will not be expanded.
[0096] Furthermore, the method for inferring the specific working condition of the container in step 5 is to use the filtered quantitative identification information as input parameters, apply it to the working condition judgment mentioned in the container damage quantification method, determine the relative position and spatial layout of each part, and thus infer the actual working condition of the current container.
[0097] This application establishes a geometric model of each part in the container top surface perspective image, effectively selects quantitative identification, and realizes the anchoring of the container size quantitative identification based on the image, so as to help further infer the working condition of the current operating container, thereby quantifying the container damage size.
[0098] By establishing the geometric model of each part in the container top surface perspective image, the quantitative identification is effectively selected, and the image-based anchoring of the container size quantitative identification is achieved to help further infer the working condition of the current operating container, thereby quantifying the container damage size.
[0099] The present invention realizes container damage quantification and marking anchoring only through two-dimensional images and image segmentation technology, avoiding the use of expensive hardware equipment and more complicated data processing processes, simplifying the preprocessing process of damage quantification, and reducing the hardware cost, maintenance difficulty and overall complexity of the system.
[0100] Based on the same inventive concept, the present invention also provides a system for removing background from a two-dimensional image of a container from a top perspective, comprising:
[0101] The background filtering module is used to construct the geometric model of each component of the container in the container image and filter out irrelevant background to obtain the initial logo composition;
[0102] Wherein, each of the components includes one or more of the following parts: container door, container front, top surface, top corner surface;
[0103] an isolated top surface corner piece face filtering module, configured to determine whether a top surface exists based on the initial identification structure, and if so, filter out isolated top surface corner piece faces that do not overlap with all top surfaces; if not, retain all top surface corner piece faces;
[0104] The top surface information processing module is used to filter out the background of the two-dimensional image of the container from the top perspective and the relative position relationship with the top corner fitting surface, and to filter and process the top surface information, including: filtering out top surfaces with a number of top corner fittings less than a preset value; filtering out top surfaces with a top surface area less than a first preset threshold;
[0105] The module for secondary filtering of isolated top corner faces is used to determine whether there are any top faces. If so, the module filters out isolated top corner faces that do not overlap with any top faces.
[0106] The working condition judgment module is used to determine the specific working condition of the container based on the geometric models of the door, front, top surface and top corner parts that are finally retained, for subsequent damage quantification processing.
[0107] It should be noted that the functions and number of unit modules in the top-view container two-dimensional image background filtering system can be set accordingly according to the aforementioned method embodiment, and will not be further explained here.
[0108] Based on the same inventive concept, the present invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute: the method for filtering the background of a two-dimensional image of a container from a top perspective as described in any embodiment of the present application.
[0109] like Figure 5 As shown, the present application also provides a structural diagram of an electronic device, which shows the structure of the electronic device 500. The electronic device 500 here is only an example and should not limit the functions and scope of use of the embodiments of the present invention.
[0110] The electronic device 500 may include: at least one processor 510; and a memory 520 communicatively connected to the at least one processor; wherein the memory storage 520 contains instructions that can be executed by the at least one processor 510, and the instructions are executed by the at least one processor 510 to enable the at least one processor 510 to execute: the method for filtering the background of a two-dimensional image of a container from a top perspective as described in any embodiment of the present application.
[0111] It should be noted that the electronic device 500 may be in the form of a general-purpose computing device, for example, it may be a server device.
[0112] In implementation, the components of the electronic device 500 may include but are not limited to: the above-mentioned at least one processor 510, the above-mentioned at least one memory 520, and a bus 530 connecting different system components (including the memory 520 and the processor 510), wherein the bus 530 may include a data bus, an address bus, and a control bus.
[0113] In implementation, the memory 520 may include a volatile memory, such as a random access memory (RAM) 5201 and / or a cache memory 5202 , and may further include a read-only memory (ROM) 5203 .
[0114] The memory 520 may also include a program tool 5205 having a set (at least one) of program modules 5204, such program modules 5204 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include an implementation of a network environment.
[0115] The processor 510 executes various functional applications and data processing by running computer programs stored in the memory 520 .
[0116] The electronic device 500 can also communicate with one or more external devices 540 (e.g., a keyboard, pointing device, etc.). This communication can be performed via an input / output (I / O) interface 550. Furthermore, the electronic device 500 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 560. The network adapter 560 communicates with other modules in the electronic device 500 via a bus 530. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with the electronic device 500, including but not limited to microcode, device drivers, redundant processors, external disk drive arrays, RAID (RAID) systems, tape drives, and data backup storage systems.
[0117] Based on the same inventive concept, the present invention also provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps of the method for background filtering of a two-dimensional container image from a top perspective provided in the above embodiment are implemented.
[0118] The readable storage medium may include, but is not limited to, a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0119] In a possible embodiment, the present invention can also be implemented in the form of a program product, which includes program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps of the top-view container two-dimensional image background filtering method provided in the above embodiment.
[0120] The program code for executing the present invention may be written in any combination of one or more programming languages, and may be executed entirely on the user device, partially on the user device, as an independent software package, partially on the user device and partially on a remote device, or entirely on the remote device.
[0121] In this specification, the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the embodiments described later, the description is relatively simple, and the relevant parts can be referred to the partial description of the previous embodiments.
[0122] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A method for removing background from a two-dimensional container image from a top perspective, characterized in that: include: Construct the geometric model of each component of the container in the container image and filter out irrelevant background to obtain the initial logo composition; Wherein, each of the components includes one or more of the following parts: container door, container front, top surface, top corner surface; Based on the initial identification structure, determine whether the top surface exists, if so, filter out isolated top surface corner piece faces that do not overlap with all top surfaces; if not, retain all top surface corner piece faces; Based on the top surface segmentation results in the container image and the relative position relationship with the top surface corner fitting surface, the top surface information is filtered and processed, including: filtering out top surfaces with a top surface corner fitting number less than a preset value; filtering out top surfaces with a top surface area less than a first preset threshold; Second, determine whether there are any top surfaces. If so, filter out isolated top corner faces that do not overlap with all top surfaces. Based on the geometric models of the door, front, top, and top corner surfaces that are ultimately retained, the specific working conditions of the container are determined for subsequent damage quantification. The method for determining the isolated top corner face includes: If the number of pixels where the top corner piece surface overlaps with each top surface is less than the second preset threshold, it is determined to be an isolated top corner piece surface. The formula is expressed as: ; in, represents the area of the top corner piece segmented out by the i-th segmentation, n represents the number of all segmented top corner pieces, represents the jth segmented top surface area, m represents the number of all segmented top surfaces, is a very small positive number used to handle numerical errors or minor boundary overlaps.
2. The method for removing background from a two-dimensional container image from a top perspective according to claim 1, characterized in that: Use any of the following methods to construct the geometric model: Build based on standard dimensions and geometric relationships; The mapping relationship between image coordinates and actual size coordinates is constructed through perspective transformation.
3. The method for removing background from a two-dimensional container image from a top perspective according to claim 1, characterized in that: The filtering out of irrelevant background includes: According to the geometric model, combined with image segmentation, the region of interest is separated from the background, the region of interest is retained, and irrelevant background is filtered out; The areas of interest include: container door, container front, top surface, and top corner surfaces.
4. The method for removing background from a two-dimensional container image from a top perspective according to claim 1, characterized in that: The method for determining the number of top surface inner corner fittings includes: the number of all top surface corner fitting faces that overlap with the top surface area, and the formula is expressed as: ; ; in, represents the segmented top surface area, represents the i-th top corner piece surface, , where m represents the number of all top corner faces, express and Whether there is overlap, represented by a binary value, 1 means overlap, 0 means no overlap; Represents the top surface area The number of top corner piece faces that overlap.
5. The method for removing background from a two-dimensional container image from a top perspective according to claim 1, characterized in that: The filtering out top surfaces whose top surface area is smaller than a first preset threshold comprises: Determine whether the ratio of the projection of the geometric model of the split top surface and the geometric model of the top corner piece surface in the length direction of the box side is less than a first preset threshold. If so, filter out the top surface. The formula is expressed as: ; in, Represents the geometric model of the segmented top surface, The geometric model representing the top corner piece surface, Indicates the length direction of the box side, express In the length direction of the box side The projection length on express In the length direction of the box side The projection length on Indicates the set ratio threshold.
6. The method for removing background from a two-dimensional container image from a top perspective according to claim 1, characterized in that: Determining the specific working conditions of the container includes: Determine the relative positions and spatial layout of the door, front, top and top corner surfaces that will be retained; According to the relative position and spatial layout, the relative posture of the container under the shooting angle of the external camera is obtained.
7. A background filtering system for a top-view container two-dimensional image, characterized in that: include: The background filtering module is used to construct the geometric model of each component of the container in the container image and filter out irrelevant background to obtain the initial logo composition; Wherein, each of the components includes one or more of the following parts: container door, container front, top surface, top corner surface; an isolated top surface corner piece face filtering module, configured to determine whether a top surface exists based on the initial identification structure, and if so, filter out isolated top surface corner piece faces that do not overlap with all top surfaces; if not, retain all top surface corner piece faces; The top surface information processing module is used to filter and process the top surface information based on the top surface segmentation results in the container image and the relative position relationship with the top surface corner fitting surface, including: filtering out top surfaces with a top surface corner fitting number less than a preset value; filtering out top surfaces with a top surface area less than a first preset threshold; The module for secondary filtering of isolated top surface corner parts is used to determine whether there are any top surfaces. If so, the module filters out isolated top surface corner parts that do not overlap with any top surfaces. The working condition judgment module is used to determine the specific working condition of the container based on the geometric models of the door, front, top surface, and top corner parts that are finally retained, for subsequent damage quantification processing; The method for determining the isolated top corner face includes: If the number of pixels where the top corner piece surface overlaps with each top surface is less than the second preset threshold, it is determined to be an isolated top corner piece surface. The formula is expressed as: ; in, represents the area of the top corner piece segmented out by the i-th segmentation, n represents the number of all segmented top corner pieces, represents the jth segmented top surface area, m represents the number of all segmented top surfaces, is a very small positive number used to handle numerical errors or minor boundary overlaps.
8. An electronic device, characterized in that: include: at least one processor; And, a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute: the background filtering method for a two-dimensional image of a top-view container as described in any one of claims 1-6.
9. A computer storage medium, characterized in that The computer storage medium stores computer executable instructions, and when the computer executable instructions are executed by the processor, the method for filtering the background of a two-dimensional image of a container from a top perspective according to any one of claims 1 to 6 is performed.
Citation Information
Patent Citations
Container positioning identification method, device and equipment and storage medium
CN114267032A
Container body detection system and method
CN117635515A
Container identification method and device applied to quay crane system
CN117935274A
Container identification method
CN118644868A
Container corner piece and container with same
CN107444790A