Container vehicle detection method, system and device and storage medium

By collecting container vehicle images and performing perspective transformation matrix calculations, automated detection of container vehicles is realized, solving the problems of large labor consumption and insufficient accuracy, and improving detection efficiency and accuracy.

CN120259233APending Publication Date: 2025-07-04SHANGHAI WESTWELL INFORMATION & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510332607.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

In the prior art, container vehicle inspection requires a lot of manpower and there is a problem of insufficient detection accuracy.

Method used

By collecting container vehicle images, performing object detection and perspective transformation matrix calculations, image distortion is eliminated, and automated detection is achieved.

Benefits of technology

It improves detection efficiency, reduces labor costs, improves detection accuracy, and simplifies the detection process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120259233A_ABST
    Figure CN120259233A_ABST
Patent Text Reader

Abstract

The invention provides a container vehicle detection method, system and device and a storage medium, and the method comprises the steps: collecting an image containing a detected position of a container vehicle, and taking the image as a target detection image; performing target detection on the target detection image to obtain a first coordinate of the first type of target and a second coordinate of the second type of target; calculating a perspective transformation matrix for mapping the first coordinate to the second coordinate based on the first coordinate of the first type of target and a third coordinate of a mapping transformation point in a reference plane; based on the perspective transformation matrix, converting the second coordinate of the second type of target into the reference plane to obtain a fourth coordinate of the second type of target; and obtaining a detection result of the container vehicle according to the fourth coordinate of the second type of target and a preset vehicle detection rule. Vehicle detection can be automatically completed by collecting the images of the container vehicle for processing and analysis, the detection efficiency and the detection precision are improved, and the labor cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] During the operation of a container vehicle, it is necessary to detect some positions of the container vehicle. For example, it is necessary to determine whether the vehicle is parked steadily aligned with the platform and whether the container door in the vehicle is closed. In the prior art, generally, staff are required to detect and calibrate the vehicle position to determine whether the vehicle is parked steadily aligned with the platform or whether the container door in the vehicle is closed. This requires a large amount of manpower and time, resulting in a high detection cost. Moreover, there may be some inevitable errors in manual detection, which cannot well meet the accuracy requirements.

[0003] It should be noted that the information disclosed in the above background art section is only used to enhance the understanding of the background of the present application. Therefore, it may include information that does not constitute the prior art known to those of ordinary skill in the art. Summary of the Invention

[0004] Aiming at the problems in the prior art, the purpose of the present application is to provide a container vehicle detection method, system, device and storage medium. By collecting and processing and analyzing the images of the container vehicle, the vehicle detection can be automatically completed. And by constructing a perspective transformation matrix, the problems caused by the inclination and distortion of the picture can be eliminated, the detection efficiency and detection accuracy can be improved, and the labor cost can be reduced.

[0005] The embodiment of the present application provides a container vehicle detection method, including the following steps:

[0006] Collect an image including the detected position of the container vehicle as the target detection image;

[0007] Perform target detection on the target detection image to obtain the first coordinates of the first type of target and the second coordinates of the second type of target;

[0008] Based on the first coordinates of the first type of target and the third coordinates of the mapping transformation points in a reference plane, calculate the perspective transformation matrix for mapping the first coordinates to the second coordinates;

[0009] Based on the perspective transformation matrix, convert the second coordinates of the second type of target to the reference plane to obtain the fourth coordinates of the second type of target;

[0010] According to the fourth coordinates of the second type of target and the preset vehicle detection rules, obtain the detection result of the container vehicle.

[0011] In some embodiments, the target detection image is an image taken from the rear of the container vehicle, and the reference plane is the plane where the rear door of the container in the container vehicle is located.

[0012] In some embodiments, the first type of target is the corner points of the rear door of the container in the container vehicle.

[0013] In some embodiments, the second type of target is the corner point of the platform opposite to the container.

[0014] In some embodiments, according to the fourth coordinate of the second type of target and the preset vehicle detection rules, the detection result of the container vehicle is obtained, including the following steps:

[0015] Calculate the first coordinate difference between the abscissa of the lower left corner point of the rear door of the container in the container vehicle and the left corner point of the platform;

[0016] Calculate the second coordinate difference between the abscissa of the lower right corner point of the rear door of the container in the container vehicle and the right corner point of the platform;

[0017] Calculate the difference between the first coordinate difference and the second coordinate difference, and determine whether the absolute value of the difference is greater than the first difference threshold;

[0018] If so, the detection result of the container vehicle is that the vehicle is not aligned with the platform;

[0019] If not, the detection result of the container vehicle is that the vehicle is aligned with the platform.

[0020] In some embodiments, the second type of target includes at least two rear door locks of the container in the container vehicle.

[0021] In some embodiments, converting the second coordinate of the second type of target into the reference plane to obtain the fourth coordinate of the second type of target includes the following steps:

[0022] Convert the second coordinate range of the target box corresponding to the second type of target into the reference plane to obtain the fourth coordinate range of the target box corresponding to the second type of target.

[0023] In some embodiments, according to the fourth coordinate of the second type of target and the preset vehicle detection rules, the detection result of the container vehicle is obtained, including the following steps:

[0024] Calculate the ordinate of the center point of the target box corresponding to each second type of target respectively;

[0025] Calculate the difference between the ordinates of the center points of the two target boxes, and determine whether the absolute value of the difference is greater than the second difference threshold;

[0026] If so, the detection result of the container vehicle is that the box door is open;

[0027] If not, the detection result of the container vehicle is that the box door is closed.

[0028] In some embodiments, a trained target detection model is used to perform target detection on the target detection image.

[0029] The embodiments of the present application further provide a container vehicle detection system for implementing the above-mentioned container vehicle detection method. The system includes:

[0030] An image acquisition module, configured to acquire an image of the detected position including the container vehicle as a target detection image;

[0031] A target detection module, configured to perform target detection on the target detection image to obtain the first coordinates of the first type of target and the second coordinates of the second type of target;

[0032] A coordinate conversion module, configured to calculate a perspective transformation matrix for mapping the first coordinates to the second coordinates based on the first coordinates of the first type of target and the third coordinates of the mapping transformation points in a reference plane; and based on the perspective transformation matrix, convert the second coordinates of the second type of target to the reference plane to obtain the fourth coordinates of the second type of target;

[0033] A vehicle detection module, configured to obtain the detection result of the container vehicle according to the fourth coordinates of the second type of target and a preset vehicle detection rule.

[0034] The embodiments of the present application further provide a container vehicle detection device, including:

[0035] A processor;

[0036] A memory, in which executable instructions of the processor are stored;

[0037] Wherein, the processor is configured to execute the steps of the above-mentioned container vehicle detection method by executing the executable instructions.

[0038] The embodiments of the present application further provide a computer-readable storage medium for storing a program, and when the program is executed by a processor, the steps of the above-mentioned container vehicle detection method are implemented.

[0039] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure.

[0040] The container vehicle detection method, system, device and storage medium of the present application have the following beneficial effects:

[0041] By adopting the container vehicle detection method of the present application, only a single camera needs to be set to capture the target detection image containing the container vehicle, and the target detection and analysis processing are performed on the image, so as to realize the automatic detection of the container vehicle, greatly improving the detection efficiency and reducing the labor cost; by adopting the perspective transformation method, the part to be detected in the captured container vehicle image is transformed into the reference plane, eliminating the influence of problems such as image distortion, perspective foreshortening, and tilted image caused by the camera shooting on the detection result, thereby effectively improving the accuracy of container vehicle detection. Therefore, the overall solution of the present application is simple to implement and easy to deploy. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Other features, objects, and advantages of the present application will become more apparent by reading the following detailed description of non-limiting embodiments with reference to the accompanying drawings.

[0043] Figure 1 is a flowchart of the container vehicle detection method according to an embodiment of the present application;

[0044] Figure 2 is a schematic diagram of the target detection image before correction according to an embodiment of the present application;

[0045] Figure 3 is a schematic diagram of the target detection image after correction according to an embodiment of the present application;

[0046] Figure 4 is a schematic diagram of the target detection image before correction according to another embodiment of the present application;

[0047] Figure 5 is a schematic diagram of the target detection image after correction according to another embodiment of the present application;

[0048] Figure 6 is a schematic diagram of the structure of the container vehicle detection system according to an embodiment of the present application;

[0049] Figure 7 is a schematic diagram of the structure of the container vehicle detection device according to an embodiment of the present application;

[0050] Figure 8 is a schematic diagram of the structure of the computer-readable storage medium according to an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0051] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments. Spatial relational terms such as "on..." may be used herein to describe the relationship of one element or feature shown in the drawings to other elements or features. It should be understood that, in addition to the orientation shown in the drawings, spatial relational terms also include different orientations of the device during use and operation. For example, if the device in the drawings is flipped, an element or feature described as "on..." will be oriented "under..." other elements or features.

[0052] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus repeated descriptions thereof will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices. Although terms such as "first" or "second" are used in this specification to denote certain features, they are only for the purpose of indication and do not limit the quantity and importance of the specific features.

[0053] The flowcharts shown in the accompanying drawings are only illustrative and do not necessarily include all steps. For example, some steps may be decomposed, while some steps may be combined or partially combined. Therefore, the actual execution order may be changed according to the actual situation.

[0054] As Figure 1 shown, an embodiment of the present application provides a container vehicle detection method, including the following steps:

[0055] S100: Collect an image of the detected position including the container vehicle as a target detection image;

[0056] In this embodiment, the target detection image is an image taken from the rear of the container vehicle;

[0057] Taking Figure 2 as an example, an image including the rear door area of the container in the container vehicle is collected by a camera arranged at the rear of the container vehicle as the target detection image. From Figure 2It can be seen that due to the installation and shooting angles of the camera and the sizes of different container vehicles, there are problems such as distortion, objects being larger when closer and smaller when farther away, and the image being tilted in the captured images. If the captured images are directly analyzed and detected, it may affect the detection accuracy;

[0058] S200: Perform object detection on the object detection image to obtain the first coordinates of the first type of object and the second coordinates of the second type of object;

[0059] In this embodiment, a vertex position of the object detection image is used as the coordinate origin, the left - right direction is the x - axis direction, that is, the horizontal coordinate axis direction, and the up - down direction is the y - axis direction, that is, the vertical coordinate axis direction. For example, the lower - left vertex of the object detection image is used as the coordinate origin, the right - hand direction is the positive direction of the x - axis, and the upward direction is the positive direction of the y - axis;

[0060] In this embodiment, the first type of object is the corner point of the rear door of the container in the container vehicle, which is used to construct a perspective transformation matrix later;

[0061] In this embodiment, a trained object detection model is used to perform object detection on the object detection image; the object detection model is, for example, a machine learning model constructed based on a neural network, such as the YOLOV8 model (You - Only - Look - Once V8), but the present application is not limited thereto, and other network models that can achieve object detection can also be used in the present application, rather than being limited to those listed here;

[0062] The second type of object is the object for vehicle detection, and the type of the second type of object is different according to the type of vehicle detection;

[0063] When training the object detection model, first collect multiple sample images in the same scene, manually annotate the objects in the sample images, and then divide the sample images into a training set and a test set. For example, 80% of the sample images are used as the training set to train the object detection model until the model converges to obtain a trained object detection model;

[0064] S300: Calculate a perspective transformation matrix for mapping the first coordinates to the second coordinates based on the first coordinates of the first type of object and the third coordinates of the mapping transformation points in a reference plane;

[0065] In this embodiment, the reference plane is the plane where the rear door of the container in the container vehicle is located. For example, by Figure 2 Based on the perspective transformation matrix of the image, Figure 3 The transformed image shown in can be obtained, in which correction is made based on the plane of the rear door of the container, eliminating the influence of problems such as distortion, objects being larger when closer and smaller when farther away, and the image being tilted in the images captured by the camera on the detection result;

[0066] S400: Based on the perspective transformation matrix, convert the second coordinates of the second type of target into the reference plane to obtain the fourth coordinates of the second type of target.

[0067] When detecting a container vehicle, only the part of the container vehicle that needs to be detected (the second type of target) needs to be analyzed and processed. Therefore, it is not necessary to map and transform each pixel point in the entire image to the reference plane. It is only necessary to perform mapping transformation on the second type of target, which can reduce the amount of image processing calculation and improve the image processing speed. Perspective transformation is a transformation that projects a two-dimensional planar image from one perspective to another. It can transform a rectangular image area into an arbitrary quadrilateral. In this embodiment, the perspective transformation of the target detection image can be implemented, for example, through the cv2.warpPerspective function.

[0068] S500: According to the fourth coordinates of the second type of target and the preset vehicle detection rules, obtain the detection result of the container vehicle.

[0069] By adopting the container vehicle detection method of the present application, only a single camera needs to be set to capture the target detection image containing the container vehicle, and the image is subjected to target detection, analysis and processing, so as to realize the automatic detection of the container vehicle, greatly improving the detection efficiency and reducing the labor cost. By adopting the perspective transformation method, the present application transforms the part to be detected in the collected container vehicle image into the reference plane, eliminating the influence of problems such as distortion, perspective foreshortening, and tilting of the image captured by the camera on the detection result, thereby effectively improving the accuracy of container vehicle detection. Therefore, the overall solution of the present application is simple to implement, easy to deploy, and does not require additional devices such as laser sensors or other sensors.

[0070] In one embodiment, the container vehicle detection method is used to detect whether the container vehicle is aligned with the platform after stopping, so as to facilitate subsequent loading and unloading of goods. In this embodiment, the second type of target is the corner points of the platform opposite to the container. The following combines Figure 2 and Figure 3 to specifically introduce the implementation manner of the container vehicle detection method in this embodiment. Figure 2 is a schematic diagram of the target detection image before correction in an embodiment of the present application. Above is the container vehicle and the container loaded therein, and the four corner points of the container before correction are represented by p1 to p4, that is, the first type of target. Below is the platform, and the two corner points of the platform before correction are represented by p5 and p6, that is, the second type of target.

[0071] Through step S200, target detection is performed on the target detection image to obtain the first coordinates p1(x1, y1), p2(x2, y2), p3(x3, y3), p4(x4, y4) of the first type of target and the second coordinates p5(x5, y5), p6(x6, y6) of the second type of target.

[0072] In the said step S300, based on the first coordinates of the first type of target and the third coordinates of the mapping transformation points in a reference plane, calculating the perspective transformation matrix for mapping the first coordinates to the second coordinates includes the following steps:

[0073] Select the first coordinates p1(x1, y1), p2(x2, y2), p3(x3, y3), p4(x4, y4) of four first type of targets, as Figure 3 shown, set the third coordinates of the four points after mapping transformation to be P1(X1, Y1), P2(X2, Y2), P3(X3, Y3), P4(X4, Y4) respectively. The connection of these 4 points needs to form a rectangle, and the length and width are set to be reduced proportionally according to the actual length and width of the container. Specifically, the third coordinates of four of the mapping transformation points can be determined in advance according to the resolution of the image collected by the camera, so that the four mapping transformation points can form a rectangle. The length and width of this rectangle are reduced proportionally compared with the length and width of the back door of the actual container, and the four sides of this rectangle are respectively parallel to the boundaries of the image canvas, and there is a certain distance between each side and the boundaries of the image canvas;

[0074] Construct and solve the perspective transformation matrix A from Figure 2 to Figure 3 based on the first coordinates of the four first type of targets and the third coordinates after mapping transformation as follows:

[0075]

[0076] where x and y represent the coordinates before mapping transformation, X and Y represent the coordinates after mapping transformation. Since it is two-dimensional image information, the z-axis coordinate value is generally 1. Solving the coefficients a 11 ~a 33 in the above equations can obtain the perspective transformation matrix A.

[0077] In the said step S400, based on the perspective transformation matrix, converting the second coordinates of the second type of target to the reference plane to obtain the fourth coordinates of the second type of target includes:

[0078] According to the obtained perspective transformation matrix A above, the second coordinates p5(x5, y5), p6(x6, y6) of the second type of target are respectively calculated to obtain the corresponding fourth coordinates P5(X5, Y5), P6(X6, Y6) in the reference plane by using the following formulas:

[0079]

[0080] Among them, x and y represent the coordinates before the mapping transformation, and X and Y represent the coordinates after the mapping transformation.

[0081] In this embodiment, step S500: Obtain the detection result of the container vehicle according to the fourth coordinate of the second type of target and the preset vehicle detection rule, including the following steps:

[0082] Calculate the first coordinate difference (X4 - X5) of the abscissas between the lower left corner point P4(X4, Y4) of the rear door of the container in the container vehicle and the left corner point P5(X5, Y5) of the platform;

[0083] Calculate the second coordinate difference (X3 - X6) of the abscissas between the lower right corner point P3(X3, Y3) of the rear door of the container in the container vehicle and the right corner point P6(X6, Y6) of the platform;

[0084] Calculate the difference between the first coordinate difference and the second coordinate difference, and determine whether the absolute value of the difference |(X4 - X5) - (X3 - X6)| is greater than the first difference threshold; the value of the first difference threshold here can be set according to the selection. For example, it is set to a very small allowable error value. When the absolute value of the difference is greater than the first difference threshold, it is considered that the container vehicle is parked at a certain inclination angle relative to the platform, that is, the container vehicle is not parked stably aligned with the platform;

[0085] If so, the detection result of the container vehicle is that the vehicle is not aligned with the platform;

[0086] If not, the detection result of the container vehicle is that the vehicle is aligned with the platform.

[0087] In another embodiment, the container vehicle detection method is used to detect whether the rear door of the container loaded in the container vehicle is opened. The second type of target includes at least two rear door locks of the container in the container vehicle. Since the camera image is a two-dimensional image, the visual difference between the closed and slightly opened box doors is not obvious. In this application, it is determined whether the box door is opened by detecting whether the two rear door locks are at the same horizontal position, and the influence of image tilt, distortion, etc. on the detection accuracy is eliminated through coordinate mapping transformation. The following combines Figure 4 and Figure 5 Specifically introduce the implementation process of the container vehicle detection method in this other embodiment.

[0088] In the step S200, as Figure 4As shown in the figure, object detection is performed on the object detection image to obtain the first coordinates p1(x1, y1), p2(x2, y2), p3(x3, y3), p4(x4, y4) of the first type of object and the second coordinates of the second type of object. Each detected second type of object is a rectangular frame covering the door lock. Therefore, the second coordinates of the two second type of objects are the second coordinate ranges r1(x5, y5, x6, y6) and r2(x7, y7, x8, y8) respectively.

[0089] In the step S300, based on the first coordinates of the first type of object and the third coordinates of the mapping transformation points in a reference plane, a perspective transformation matrix for mapping the first coordinates to the second coordinates is calculated, including the following steps:

[0090] Select the first coordinates p1(x1, y1), p2(x2, y2), p3(x3, y3), p4(x4, y4) of four first type of objects, as Figure 5 shown in the figure, set the third coordinates of the four points after mapping transformation to be P1(X1, Y1), P2(X2, Y2), P3(X3, Y3), P4(X4, Y4) respectively. The connection of these 4 points needs to form a rectangle, and the length and width are set to be reduced in proportion to the actual length and width of the container;

[0091] Construct and solve the perspective transformation matrix A from Figure 4 to Figure 5 according to the first coordinates of the four first type of objects and the third coordinates after mapping transformation as follows:

[0092]

[0093] where x and y represent the coordinates before mapping transformation, and X and Y represent the coordinates after mapping transformation. Since it is two-dimensional image information, the z-axis coordinate value is generally 1. Solve the coefficients a 11 ~a 33 in the above equations to obtain the perspective transformation matrix A.

[0094] In the step S400, based on the perspective transformation matrix, the second coordinates of the second type of object are converted to the reference plane to obtain the fourth coordinates of the second type of object, including:

[0095] According to the obtained perspective transformation matrix A above, the second coordinate ranges r1(x5, y5, x6, y6) and r2(x7, y7, x8, y8) of the second type of object are respectively calculated by the following formulas to obtain the fourth coordinate ranges R1(X5, Y5, X6, Y6) and R2(X7, y7, X8, Y8) of the corresponding target frames in the reference plane:

[0096]

[0097] Among them, x and y represent the coordinates before the mapping transformation, and X and Y represent the coordinates after the mapping transformation.

[0098] In this embodiment, step S500: According to the fourth coordinate of the second-type target and the preset vehicle detection rule, obtain the detection result of the container vehicle, including the following steps:

[0099] Calculate the ordinate of the center point of the target box corresponding to each second-type target respectively;

[0100] Calculate the difference between the ordinates of the center points of the two target boxes, and determine whether the absolute value of the difference is greater than the second difference threshold; the value of the second difference threshold here can be set as needed. For example, it can be set as a relatively small value according to factors such as the size of the container image and the proportion of the door lock in the container size. When the difference between the ordinates of the center points of the two target boxes is greater than the second difference threshold, it means that the two door locks are not on the same horizontal line, and it can be considered that the container door is open;

[0101] If so, the detection result of the container vehicle is that the container door is open;

[0102] If not, the detection result of the container vehicle is that the container door is closed.

[0103] The above respectively introduce the detection of whether the vehicle is aligned with the platform and the detection of whether the container door is open based on the result of the mapping change. In another embodiment, the two detections can also be completed at one time, that is, in step S200, when detecting the second-type target, the platform corner point and the door lock of the rear container are detected at the same time. Correspondingly, when training the target detection model, the positions of the platform corner point and the door lock of the rear container are marked while marking the first-type target in the sample image. Then in step S400, the mapping transformation is performed on each second-type target respectively, and in step S500, the detection of whether the vehicle is aligned with the platform is performed based on the platform corner point and the container corner point respectively, and the detection of whether the container door is open is performed based on the door lock. Thus, only one image needs to be collected, and only one perspective transformation matrix needs to be calculated, and two or more types of vehicle detections can be completed at the same time.

[0104] In other alternative embodiments, the types of vehicle detection are not limited to the above-mentioned detection of whether the vehicle is aligned with the platform and the detection of whether the container door is open, and other types of detection can also be performed. In step S200, the obtained second-type target is the part to be detected corresponding to the detection content, which can be a certain key point or a certain key area. Correspondingly, when training the target detection model, markings are made at the positions corresponding to the second-type target in the sample image.

[0105] Such as Figure 6As shown in the figure, an embodiment of the present application further provides a container vehicle detection system for implementing the above-mentioned container vehicle detection method. The system includes:

[0106] An image acquisition module M100, configured to acquire an image of the detected position including the container vehicle as a target detection image. In this embodiment, the target detection image is acquired by a camera disposed behind the container vehicle, that is, the target detection image is an image taken from the rear of the container vehicle.

[0107] A target detection module M200, configured to perform target detection on the target detection image to obtain the first coordinates of the first type of target and the second coordinates of the second type of target. In this embodiment, the first type of target is the corner point of the rear door of the container in the container vehicle, which is used to construct a perspective transformation matrix subsequently, and the second type of target corresponds to the part that needs to be detected.

[0108] A coordinate conversion module M300, configured to calculate a perspective transformation matrix for mapping the first coordinates to the second coordinates based on the first coordinates of the first type of target and the third coordinates of the mapping transformation points in a reference plane; and based on the perspective transformation matrix, convert the second coordinates of the second type of target to the reference plane to obtain the fourth coordinates of the second type of target.

[0109] A vehicle detection module M400, configured to obtain a detection result of the container vehicle according to the fourth coordinates of the second type of target and a preset vehicle detection rule. In one embodiment, the second type of target is the corner point of the platform, and the vehicle detection module M400 is configured to detect whether the container vehicle is parked in alignment with the platform according to whether the lower two corner points of the container are aligned with the corner points of the platform. In another embodiment, the second type of target is the door lock of the rear door of the container, and the vehicle detection module M400 is configured to determine whether the door is opened according to whether the two door locks of the rear door of the container are at the same horizontal position.

[0110] By adopting the container vehicle detection system of the present application, only a single camera needs to be set to capture a target detection image including the container vehicle, and perform target detection and analysis processing on the image, so as to realize the automatic detection of the container vehicle, greatly improving the detection efficiency and reducing the labor cost; the present application adopts a perspective transformation method to transform the part to be detected in the captured container vehicle image to the reference plane, eliminating the influence of problems such as distortion, perspective foreshortening, and tilting of the camera-captured image on the detection result, thereby effectively improving the accuracy of container vehicle detection. Therefore, the overall solution of the present application is simple to implement and easy to deploy.

[0111] In the container vehicle detection system of the present application, the functions of each module can be implemented by the specific implementation manners of the above-mentioned container vehicle detection method, which will not be elaborated herein.

[0112] An embodiment of the present application further provides a container vehicle detection device, including a processor; a memory storing executable instructions of the processor; wherein the processor is configured to execute the steps of the container vehicle detection method by executing the executable instructions.

[0113] Those skilled in the art can understand that various aspects of the present application can be implemented as a system, a method, or a program product. Therefore, various aspects of the present application can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which can be collectively referred to as "circuitry", "module", or "platform" here.

[0114] The following refers to Figure 7 to describe the electronic device 600 according to this embodiment of the present application. Figure 7 The displayed electronic device 600 is only an example and should not impose any limitations on the functions and usage scope of the embodiments of the present application.

[0115] As Figure 7 shown, the electronic device 600 is presented in the form of a general-purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.

[0116] Wherein, the storage unit stores program code, and the program code can be executed by the processing unit 610, so that the processing unit 610 executes the steps according to various exemplary embodiments of the present application described in the above container vehicle detection method part of this specification. For example, the processing unit 610 can execute the steps as Figure 1 shown in.

[0117] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 6201 and / or a cache storage unit 6202, and may further include a read-only storage unit (ROM) 6203.

[0118] The storage unit 620 may further include a program / utilities 6204 having a set (at least one) of program modules 6205. Such program modules 6205 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. The implementation of a network environment may be included in each or some combination of these examples.

[0119] The bus 630 can represent one or more of several types of bus structures, including a memory unit bus or a memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of the various bus structures.

[0120] The electronic device 600 can also communicate with one or more external devices 700 (such as a keyboard, a pointing device, a Bluetooth device, etc.), can also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or can communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (such as a router, a modem, etc.). Such communication can be carried out through the input / output (I / O) interface 650. Moreover, the electronic device 600 can also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through the network adapter 660. The network adapter 660 can communicate with other modules of the electronic device 600 through the bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in combination with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.

[0121] In the container vehicle detection device, when the program in the memory is executed by the processor, the steps of the above-mentioned container vehicle detection method are implemented. Therefore, the device can also obtain the technical effects of the above-mentioned container vehicle detection method.

[0122] The embodiment of the present application also provides a computer-readable storage medium for storing a program, and when the program is executed by the processor, the steps of the above-mentioned container vehicle detection method are implemented. In some possible implementation manners, various aspects of the present application can also be implemented in the form of a program product, which includes program code. When the program product is executed on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary embodiments described in the above-mentioned container vehicle detection method part of this specification.

[0123] Reference Figure 8 As shown, a program product 800 for implementing the above method according to an embodiment of the present application is described. It can adopt a portable compact disc read-only memory (CD-ROM) and include program code, and can be executed on a terminal device, such as a personal computer. However, the program product of the present application is not limited to this. In this document, the readable storage medium can be any tangible medium that contains or stores a program, and this program can be used by or in combination with an instruction execution system, apparatus, or device.

[0124] The program product may employ any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0125] The computer-readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, in which the readable program code is carried. Such a propagated data signal may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The readable storage medium may also be any readable medium other than the readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0126] The program code for performing the operations of this application may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as the "C" language or similar programming languages. The program code may execute entirely on the user's computing device, partially on the user's device, execute as a stand-alone software package, execute partially on the user's computing device and partially on a remote computing device, or execute entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).

[0127] When the program in the computer storage medium is executed by a processor, the steps of the container vehicle detection method described above are implemented. Therefore, the computer storage medium can also achieve the technical effects of the above container vehicle detection method.

[0128] The above content is a further detailed description of the present application in combination with specific preferred embodiments. It cannot be determined that the specific implementation of the present application is only limited to these descriptions. For those of ordinary skill in the technical field to which the present application pertains, without departing from the concept of the present application, several simple deductions or substitutions can be made, which should all be regarded as falling within the protection scope of the present application.

Claims

1. A container vehicle detection method, characterized in that, It includes the following steps: Collect an image including the detected position of the container vehicle as the target detection image; Perform target detection on the target detection image to obtain the first coordinates of the first type of target and the second coordinates of the second type of target; Based on the first coordinates of the first type of target and the third coordinates of the mapping transformation points in a reference plane, calculate the perspective transformation matrix for mapping the first coordinates to the second coordinates; Based on the perspective transformation matrix, convert the second coordinates of the second type of target to the reference plane to obtain the fourth coordinates of the second type of target; According to the fourth coordinates of the second type of target and the preset vehicle detection rules, obtain the detection result of the container vehicle.

2. The container vehicle detection method according to claim 1, wherein The target detection image is an image taken from the rear of the container vehicle, and the reference plane is the plane where the rear door of the container in the container vehicle is located.

3. The container vehicle detection method according to claim 1, wherein The first type of target is the corner points of the rear door of the container in the container vehicle.

4. The container vehicle detection method according to claim 3, wherein The second type of target is the corner points of the platform opposite to the container.

5. The container vehicle detection method according to claim 4, wherein According to the fourth coordinates of the second type of target and the preset vehicle detection rules, obtaining the detection result of the container vehicle includes the following steps: Calculate the first coordinate difference between the abscissas of the lower left corner point of the rear door of the container in the container vehicle and the left corner point of the platform; Calculate the second coordinate difference between the abscissas of the lower right corner point of the rear door of the container in the container vehicle and the right corner point of the platform; Calculate the difference between the first coordinate difference and the second coordinate difference, and determine whether the absolute value of the difference is greater than the first difference threshold; If so, the detection result of the container vehicle is that the vehicle is not aligned with the platform; If not, the detection result of the container vehicle is that the vehicle is aligned with the platform.

6. The container vehicle detection method according to claim 1, wherein, The second type of target includes at least two rear door locks of the container in the container vehicle.

7. The container vehicle detection method according to claim 6, wherein Converting the second coordinates of the second type of target to the reference plane to obtain the fourth coordinates of the second type of target includes the following steps: Convert the second coordinate range of the target box corresponding to the second type of target to the reference plane to obtain the fourth coordinate range of the target box corresponding to the second type of target.

8. The container vehicle detection method according to claim 7, wherein According to the fourth coordinates of the second type of target and the preset vehicle detection rules, obtaining the detection result of the container vehicle includes the following steps: Calculate the ordinates of the center points of the target boxes corresponding to each of the second type of targets respectively; Calculate the difference between the ordinates of the center points of the two target boxes, and determine whether the absolute value of the difference is greater than the second difference threshold; If so, the detection result of the container vehicle is that the box door is open; If not, the detection result of the container vehicle is that the box door is closed.

9. The container vehicle detection method according to claim 1, characterized in that Use the trained target detection model to perform target detection on the target detection image.

10. A container vehicle detection system, characterized in that, For implementing the container vehicle detection method according to any one of claims 1 to 9, the system includes: An image acquisition module for collecting an image including the detected position of the container vehicle as the target detection image; A target detection module, configured to perform target detection on the target detection image to obtain the first coordinates of the first type of target and the second coordinates of the second type of target; A coordinate transformation module, configured to calculate a perspective transformation matrix for mapping the first coordinates to the second coordinates based on the first coordinates of the first type of target and the third coordinates of the mapping transformation points in a reference plane; and based on the perspective transformation matrix, transform the second coordinates of the second type of target into the reference plane to obtain the fourth coordinates of the second type of target; A vehicle detection module, configured to obtain the detection result of the container vehicle according to the fourth coordinates of the second type of target and a preset vehicle detection rule.

11. A container vehicle detection device, characterized in that, Comprising: A processor; A memory, which stores executable instructions of the processor; Wherein, the processor is configured to execute the steps of the container vehicle detection method according to any one of claims 1 to 9 by executing the executable instructions.

12. A computer-readable storage medium for storing a program, characterized in that, When the program is executed by the processor, the steps of the container vehicle detection method according to any one of claims 1 to 9 are implemented.