Locking identification method, device and equipment of storage tank container and storage medium

By acquiring images of the lock hole locations of storage tank containers, identifying the lock head's imaging contour, and determining its tilt angle, the safety hazards and high manpower consumption caused by manual inspection are solved, achieving automated and accurate lock detection.

CN116434129BActive Publication Date: 2026-05-29XINJIANG TIANYE GRP +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
XINJIANG TIANYE GRP
Filing Date
2022-12-27
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

The current lock-on inspection of storage tank containers mainly relies on manual inspection, which leads to monotonous work, is prone to safety hazards, and consumes a lot of manpower.

Method used

By acquiring images of the keyhole location, identifying the imaging contour of the lock head in the image, and determining whether the lock head is locked based on the tilt angle of the side imaging contour line of the lock head, the color of the lock head and noise are identified using an evaluation coefficient formula to trim the lock head contour line, thus achieving automated detection.

Benefits of technology

The system automates the locking and inspection of storage tank containers, reducing manpower consumption and improving the accuracy of inspection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116434129B_ABST
    Figure CN116434129B_ABST
Patent Text Reader

Abstract

The application discloses a kind of locking identification method, device and equipment of storage tank container and computer readable storage medium, the method includes: the image of the position where lock hole is located is collected;Image profile of the imaging of lock head through lock hole in image is identified;According to the imaging profile, the inclination angle of the side surface imaging profile line of lock head is determined, when inclination angle is in the range of set inclination angle, then determine that lock head is in the locking state.In the present application, the image of the position of the lock head on the container is collected, and the side profile of the locked state and the unlocked state of the lock head is obviously different as the basis, the inclination angle of the lock head imaging profile is determined, so as to realize the distinction of whether the lock head is locked.The whole process can be automatically identified by machine without manual intervention, which reduces the labor cost to a certain extent and ensures the accuracy of the lock head locking check result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of tank container transportation technology, and in particular to a lock-on identification method, apparatus, equipment, and computer-readable storage medium for tank containers. Background Technology

[0002] Tank containers are a type of container primarily used for transporting liquid or gaseous products. After being filled with goods at the manufacturing plant, tank containers are transported by truck to the railway system, from where they are shipped nationwide. Because tank containers are generally cylindrical, ensuring their secure locking to the truck before shipment is crucial to guarantee safety and prevent accidental rollover. However, this inspection is currently done manually, which is monotonous, prone to worker negligence, and can lead to safety hazards, while also being labor-intensive. Summary of the Invention

[0003] The purpose of this invention is to provide a method, apparatus, device, and computer-readable storage medium for locking and identifying tank containers, which can automatically detect the locking of tank containers, ensure the accuracy of the detection results, and reduce manpower consumption.

[0004] To solve the above technical problems, the present invention provides a lock-on identification method for storage tank containers, comprising:

[0005] Acquire an image of the keyhole location;

[0006] Identify the imaging profile of the lock head projected through the keyhole in the image;

[0007] The tilt angle of the side imaging contour line of the lock head is determined based on the imaging contour. When the tilt angle is within the set tilt angle range, the lock head is determined to be in the locked state.

[0008] Optionally, identifying the imaging profile of the lock head projected through the keyhole in the image includes:

[0009] Based on the color of the lock and the pixel value of each pixel in the image, the evaluation coefficient is calculated for each pixel using the evaluation coefficient formula;

[0010] Pixels whose evaluation coefficients are within the set evaluation range are used as pixels in the imaging area of ​​the lock head;

[0011] The imaging profile of the lock head is determined based on the imaging area;

[0012] Wherein, when the lock is yellow, the evaluation coefficient includes a first evaluation coefficient and a second evaluation coefficient; the formulas for the first evaluation coefficient and the second evaluation coefficient are respectively... and

[0013] When the lock is red, the evaluation coefficient formula is:

[0014] When the lock is green, the evaluation coefficient formula is:

[0015] When the lock is orange, the evaluation coefficient includes a first evaluation coefficient and a second evaluation coefficient; the formulas for the first evaluation coefficient and the second evaluation coefficient are respectively... and

[0016] When the lock is a gray or white lock, the evaluation coefficient formula is:

[0017] Where R (x,y) G (x,y) B (x,y) These are the pixel values ​​of the three primary colors of the pixel (x, y).

[0018] Optionally, determining the imaging profile of the lock head based on the imaging area includes:

[0019] Each pixel in the imaging region is binarized. Based on the binarized imaging region, the closed contour line with the longest perimeter in the imaging region is selected and identified as the lock head contour line.

[0020] A line segment containing a first set number of pixels is extracted from the outline of the lock head.

[0021] Determine whether the ratio between the straight-line distance between the first and last pixels of the contour line segment and the length of the contour line segment is greater than a set ratio. If so, replace the cut contour line segment with a straight line connecting the top corner pixels of the sliding window in order to trim the noise of the contour pixels.

[0022] The process of repeatedly extracting contour segments containing a first set number of pixels from the lock head contour line is repeated until all pixels of the lock head contour line have been extracted into contour segments. The lock head contour line with noise reduction is then used as the imaging contour. The number of pixels between the first-end pixels of two adjacent extracted contour segments on the lock head contour line is a second set number of pixels, and the first set number of pixels is greater than the second set number of pixels.

[0023] Optionally, the tilt angle of the side imaging profile of the lock head is determined based on the imaging profile. When the tilt angle is within a set tilt angle range, the lock head is in a locked state, including:

[0024] The contour line of the imaging contour is divided into a preset number of local contour line segments.

[0025] For each segment of the local contour line, perform slope calculation and determine the number of segments with slope values ​​in (0, 2) and with slope values ​​of infinity. Determine whether the proportion of the number of segments to the preset number of segments is less than a preset proportion. If so, determine that the lock head is locked.

[0026] Optionally, an image of the keyhole location is acquired, including:

[0027] The positioning and identification device identifies whether the truck transporting the container has reached the designated parking area. If so, an image of the truck, including the container, is captured.

[0028] The truck image is binarized, and the container imaging outline is determined based on the binarized truck image.

[0029] Based on the container imaging profile, the keyhole imaging area is determined, and the keyhole imaging profile line is identified in the keyhole imaging area;

[0030] Based on the position of the center pixel of the area enclosed by the keyhole imaging outline, the camera is focused and an image of the area where the keyhole is located is captured.

[0031] A locking and identification device for a storage tank container, comprising:

[0032] The image acquisition module is used to acquire images of the location of the keyhole;

[0033] A contour recognition module is used to recognize the imaging contour of the lock head through the keyhole in the image;

[0034] The locking determination module is used to determine the tilt angle of the side imaging contour line of the lock head based on the imaging contour. When the tilt angle is within the set tilt angle range, the lock head is determined to be in a locked state.

[0035] Optionally, the contour recognition module is used to calculate the evaluation coefficient corresponding to each pixel by using the evaluation coefficient formula based on the current color of the lock head and the pixel value of each pixel in the image; to take the pixels whose evaluation coefficients are within a set evaluation range as pixels in the imaging area of ​​the lock head; and to determine the imaging contour based on the imaging area.

[0036] Wherein, when the lock is yellow, the evaluation coefficient includes a first evaluation coefficient and a second evaluation coefficient; the formulas for the first evaluation coefficient and the second evaluation coefficient are respectively... and

[0037] When the lock is red, the evaluation coefficient formula is:

[0038] When the lock is green, the evaluation coefficient formula is:

[0039] When the lock is orange, the evaluation coefficient includes a first evaluation coefficient and a second evaluation coefficient; the formulas for the first evaluation coefficient and the second evaluation coefficient are respectively... and

[0040] When the lock is a gray or white lock, the evaluation coefficient formula is:

[0041] Where R (x,y) G (x,y) B (x,y) These are the pixel values ​​of the three primary colors of the pixel (x, y).

[0042] Optionally, the contour recognition module includes:

[0043] The first processing unit is used to perform binarization processing on each pixel of the imaging area; and based on the binarized imaging area, to select and identify the closed contour line with the longest perimeter in the imaging area as the lock head contour line.

[0044] The second calculation unit is used to extract a contour line segment from the lock head contour line containing a first set number of pixels on the lock head contour line.

[0045] The third calculation unit is used to determine whether the ratio between the straight-line distance between the first and last pixels of the contour line segment and the length of the contour line segment is greater than a set ratio. If so, the extracted contour line segment is replaced by a straight line connecting the top corner pixels of the sliding window in order to perform noise trimming on the contour pixels.

[0046] The fourth processing unit is used to repeatedly execute the step of extracting a contour line segment containing a first set number of pixels on the lock head contour line until all pixels on the lock head contour line have been extracted into a contour line segment, and the lock head contour line with noise reduction is used as the imaging contour. The number of pixels between the first-end pixels of two adjacent extracted contour line segments on the lock head contour line is a second set number of pixels, and the first set number of pixels is greater than the second set number of pixels.

[0047] A lock-on identification device for a storage tank container, comprising:

[0048] Memory, used to store computer programs;

[0049] A processor for executing the computer program to implement the steps of the lock-up identification method for tank containers as described in any of the preceding claims.

[0050] A computer-readable storage medium storing a computer program; the computer program being executed by a processor to implement the steps of the locking identification method for a tank container as described in any of the preceding claims.

[0051] This application provides a lock-on identification method, apparatus, device, and computer-readable storage medium for a storage tank container. The method includes: acquiring an image of the location of the keyhole; identifying the imaging contour of the lock head through the keyhole in the image; determining the tilt angle of the side imaging contour line of the lock head based on the imaging contour; and determining that the lock head is in a locked state when the tilt angle is within a set tilt angle range.

[0052] This application uses images of the lock positions on containers to distinguish whether a lock is locked or unlocked, based on the clear difference between the side profiles of the lock in the locked and unlocked states. The tilt angle of the lock image profile is adjusted to determine whether the lock is locked or unlocked. The entire process can be automated by machine without human intervention, which reduces the cost of manual labor to a certain extent and ensures the accuracy of the lock locking inspection results. Attached Figure Description

[0053] To more clearly illustrate the technical solutions of the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0054] Figure 1 A flowchart illustrating the locking and identification method for a storage tank container provided in this application embodiment;

[0055] Figure 2 This is a schematic diagram of the lock cylinder structure;

[0056] Figure 3 for Figure 2 A schematic diagram of the outline of a side profile of the lock head;

[0057] Figure 4 for Figure 2 A schematic diagram of the outline of another side profile of the lock head;

[0058] Figure 5a This is an image of the locked state corresponding to the yellow padlock provided in an embodiment of this application;

[0059] Figure 5b for Figure 5a A schematic diagram of the image area of ​​a lock head using lock head color recognition;

[0060] Figure 5c for Figure 5b A schematic diagram of the imaging region after binarization;

[0061] Figure 5d To Figure 5c A schematic diagram of the contour lines after contour recognition of the binarized imaging region image.

[0062] Figure 5e To Figure 5d A schematic diagram of the lock head outline after filtering;

[0063] Figure 5f To Figure 5e A schematic diagram of the lock head outline after trimming;

[0064] Figure 5g This is a schematic diagram of the outline of a lock when it is not locked.

[0065] Figure 6 This is a structural block diagram of a lock-up identification device for a storage tank container provided in an embodiment of the present invention. Detailed Implementation

[0066] To enable those skilled in the art to better understand the present invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0067] like Figure 1 , Figure 2 , Figure 3 , Figure 4 As shown, Figure 1 A flowchart illustrating the locking and identification method for a storage tank container provided in this application embodiment; Figure 2 This is a schematic diagram of the lock cylinder structure;

[0068] Figure 3 for Figure 2 A schematic diagram of the outline of a side profile of the lock head; Figure 4 for Figure 2 A schematic diagram of the outline of the other side of the lock head.

[0069] The lock-on identification method for the storage tank container may include:

[0070] S11: Acquire an image of the keyhole location.

[0071] S12: Identify the imaging profile of the lock head through the keyhole in the image.

[0072] S13: Determine the tilt angle of the side imaging contour line of the lock head based on the imaging contour. When the tilt angle is within the set tilt angle range, the lock head is determined to be in the locked state.

[0073] It should be noted that the locks identified in this application, whether locked or unlocked, are locks with a generally pyramidal structure, and the inclination angles of two adjacent sides of the lock are significantly different. (Reference) Figure 2 , Figure 3 and Figure 4 ,in, Figure 3 The outline shown is Figure 2 The outline of side A of the lock head shown is shown, while Figure 4 The outline shown is Figure 2The diagram shows the outline of side B of the lock cylinder. The keyhole is a roughly circular through-hole. When the lock cylinder is unlocked, side B faces the keyhole. When the lock cylinder is locked, it rotates 180 degrees, changing the side facing the keyhole from side B to side A and engaging within the keyhole. Therefore, when observing the lock cylinder through the keyhole in both locked and unlocked states, the different surfaces of the lock cylinder should be visible.

[0074] The two surfaces of the lock cylinder have a significant difference: the inclination angle of their side edge contours differs considerably. When the lock is locked, the side edge contours are steeper, while when unlocked, the angle between the side edge contours and the vertical direction is larger. Therefore, this application uses this as a criterion for identifying whether the lock is locked. An image of the lock is captured through the keyhole, and the lock's locked state is identified by the outline of the lock in the image. The entire process is simple and easy to execute, requires minimal manpower, and ensures the accuracy of the detection results.

[0075] Furthermore, it should be noted that trucks are generally equipped with a rectangular frame for securing tank containers, and the keyhole is located at the lower left corner of this rectangular frame, and is a relatively small through hole. To ensure that the acquired image clearly and accurately captures the outline of the lock head, in an optional embodiment of this application, the process of acquiring an image of the area where the keyhole is located may include:

[0076] S111: Based on the positioning and identification equipment, identify whether the truck transporting the container has reached the set parking area. If so, collect images of the truck, including the container.

[0077] Generally, the locking of the lock is confirmed before the truck leaves the factory. Access control can be set up at the truck's departure point, and a camera can be installed to capture images to determine whether the lock is locked. If it is locked, the truck can be allowed to pass; otherwise, it cannot.

[0078] To ensure accurate image capture of the lock, the truck is first instructed to reach a designated location, ensuring the container enters the camera's field of view. During this process, positioning and identification devices such as infrared rangefinders can be used to detect whether the truck has reached the designated area. If it has not, the driver can be prompted to adjust the truck's position; if it has reached the designated location, the truck image capture can begin.

[0079] S112: The truck image is binarized, and the container imaging outline is determined based on the binarized truck image.

[0080] After acquiring the truck image, it can first be converted to grayscale, and then the grayscale image can be binarized. For example... Figure 4 As shown, binarizing the truck image roughly reveals the container's outline. The Canny operator can then be used to extract the truck body outline. Aspect ratio and area thresholds are set for the container's rectangle. All rectangles in the image are identified; when a rectangle meets both the aspect ratio and area thresholds, it is considered the container's outer outline, thus locating the container. After locating the container outline, the bounding box is expanded outwards. Each vertical side is expanded downwards by a length equal to the side length. The new positioning frame can then be used as the outline of the container for processing.

[0081] S113: Determine the keyhole imaging area based on the container imaging profile, and identify the keyhole imaging profile line within the keyhole imaging area.

[0082] Based on the image within the new bounding box, the outline is divided into four parts, centered on the container rectangle and divided by horizontal and vertical lines. The lower left portion of the image contains two small circles. A radius is defined for these two circles, and Hough transform is used to detect circles within this radius. If both circles are detected, the lower circle is selected as the keyhole, based on the vertical direction. If only one circle is detected, the bounding box is expanded again. If no circles are detected, the container outline is re-extracted.

[0083] S114: Based on the position of the center pixel of the area enclosed by the keyhole imaging outline, focus the camera and capture an image of the area where the keyhole is located.

[0084] Because the keyhole has an irregular shape, the edge contour of the keyhole is extracted, and the center of the edge contour is found. Using the center of the keyhole as the focus, the camera is adjusted to adjust the focus, the flash is turned on, and a clear image of the inside of the keyhole is captured.

[0085] In this embodiment, the location of the keyhole is first identified by acquiring an image of the entire truck. The keyhole is then located using the truck image. A clearer image of the keyhole is then acquired again to ensure more accurate identification of the lock head in the future.

[0086] In summary, the lock recognition method in this application acquires an image of the keyhole location, and the lock head is imaged through the keyhole in the image, thereby identifying the imaging area of ​​the lock head in the image and then identifying the lock head imaging contour. Furthermore, based on the different tilt angles of the side contour lines when the lock is locked and unlocked, the method determines whether the lock head is in a locked state, automatically identifying whether the lock head is locked. The entire process requires no manual intervention, reducing the consumption of human labor and improving the accuracy of lock head locking recognition.

[0087] The following will describe in detail the imaging contour recognition process for recognizing the lock head using specific embodiments.

[0088] In an optional embodiment of this application, the imaging contour recognition process of the lock head may include:

[0089] S121: Based on the current color of the lock and the pixel value of each pixel in the image, calculate the evaluation coefficient using the evaluation coefficient formula to obtain the evaluation coefficient corresponding to each pixel.

[0090] S122: Each pixel whose evaluation coefficient is within the set evaluation range is used as a pixel in the imaging area of ​​the lock head.

[0091] S123: Determine the imaging profile based on the imaging area.

[0092] It should be noted that, generally, the color of the lock cylinder and the edge of the keyhole are two different colors, and the lock cylinder color is often sampled as a relatively vibrant color. Therefore, when identifying the imaging area of ​​the lock cylinder, the identification can be based on the unique characteristics of the lock cylinder's color.

[0093] Each pixel in an image contains three pixel values ​​for the three primary colors: R, G, and B. When the color of the lock is different, the magnitudes of the R, G, and B values ​​of the corresponding pixels in the lock's imaging area, as well as the proportional relationships between them, will vary. Therefore, in this embodiment, these values ​​can be used to identify the pixels in the lock's imaging area, thereby determining the lock's imaging outline.

[0094] For example, when the lock is yellow, the evaluation coefficient includes a first evaluation coefficient and a second evaluation coefficient; the formulas for the first evaluation coefficient and the second evaluation coefficient are respectively... and Where R (x,y) G (x,y) B (x,y) These are the pixel values ​​of the three primary colors of the pixel (x, y).

[0095] Accordingly, when the first evaluation coefficient of a certain pixel is greater than 0.45 and the second evaluation coefficient is less than 0.17, the pixel can be considered as a pixel in the lock imaging area.

[0096] like Figure 5a and Figure 5b As shown, Figure 5a This is an image of the locked state corresponding to the yellow padlock provided in an embodiment of this application. Figure 5b for Figure 5a A schematic diagram of the image area of ​​a lock head using lock head color recognition. Figure 5a The imaging area of ​​the yellow padlock was identified using the above evaluation method.

[0097] When the lock is red, the evaluation coefficient formula is: Since red is one of the three primary colors, the relationship between its R, G, and B values ​​is relatively simple. Therefore, only one evaluation coefficient can be used to determine it. After obtaining the evaluation coefficient of each pixel based on the evaluation system formula, if the evaluation coefficient is greater than 0.8, then the pixel can be considered as a pixel in the imaging area of ​​the lock head.

[0098] When the lock is green, the evaluation coefficient formula is: Similar to the case of the red padlock mentioned above, when the evaluation coefficient of a pixel is determined to be greater than 0.8 based on the evaluation coefficient formula, the pixel can be identified as a pixel in the padlock imaging area.

[0099] When the lock is orange, the evaluation coefficient includes a first evaluation coefficient and a second evaluation coefficient; the formulas for the first evaluation coefficient and the second evaluation coefficient are respectively... and If the first evaluation coefficient of a pixel is greater than 0.45 and the second evaluation coefficient is less than 0.17, then the pixel is a pixel in the lock imaging area.

[0100] When the lock is gray or white, the evaluation coefficient formula is: If the rating coefficient of a pixel is less than 0.17, then the pixel is a pixel in the lock imaging area.

[0101] Optionally, refer to Figure 5c , Figure 5d , Figure 5e , Figure 5f ; Figure 5c for Figure 5b A schematic diagram of the imaging region after binarization; Figure 5d To Figure 5c A schematic diagram of the contour lines after contour recognition of the binarized imaging region image. Figure 5e To Figure 5d A schematic diagram of the lock head outline after filtering; Figure 5f To Figure 5e A schematic diagram of the lock head outline after trimming.

[0102] After identifying the imaging area of ​​the lock head, the process of determining the imaging contour of the lock head based on that imaging area may include:

[0103] S1231: Binarize each pixel in the imaging area, and based on the binarized imaging area, select and identify the closed contour line with the longest perimeter in the imaging area as the lock head contour.

[0104] Depend on Figure 5c and Figure 5d It is known that the imaging area identified by the lock head based on the lock head color may still contain noise interference from some non-lock head imaging areas. Therefore, this application needs to further refine the contour of the imaging area.

[0105] Reference Figure 5c It can be seen that among the contour lines formed by the binarized imaging area of ​​the lock head, the contour lines of the lock head generally have the largest perimeter. Therefore, we can retain only the contour lines of the imaging area of ​​the lock head formed by the contour lines with the largest perimeter among multiple closed contour lines, thereby achieving the screening of the lock head contour lines.

[0106] S1232: Extract a line segment from the lock head outline that contains a first set number of pixels on the lock head outline.

[0107] S1233: Determine whether the ratio between the straight-line distance between the first and last pixels of the contour line segment and the length of the contour line segment is greater than a set ratio. If yes, proceed to S1234; otherwise, proceed to S1235.

[0108] S1234 replaces the captured contour segments with straight lines connecting the top corner pixels of the sliding window in order to trim noise from the contour pixels.

[0109] S1235: Determine if all pixels of the lock head outline have been truncated to the outline segment. If so, use the lock head outline with noise trimming as the imaging outline. If not, use the pixel on the lock head outline that is a second set number of pixels away from the first pixel of the outline segment as the new first pixel and execute S1231.

[0110] Among them, the number of pixels between the first-end pixels of the two adjacent cut contour segments on the lock head contour line is the second set number of pixels, and the first set number of pixels is greater than the second set number of pixels.

[0111] After filtering out the outline of the lock head, as follows: Figure 5e As shown, the smoothness of the lock head's outline is still insufficient. Therefore, the lock head's outline can be further trimmed to remove noise interference and ensure the accuracy of the subsequent determination of the outline's inclination.

[0112] To further trim the contour lines, contour line segments are cut off in this embodiment.

[0113] First, taking a pixel on the lock head outline as the starting pixel (x1, y1), a line segment containing p pixels is extracted along the lock head outline in a clockwise direction. The ending pixel of this line segment can then be represented as (x1, y1). 1+p ,y 1+p ).

[0114] Obviously, when the contour segment is relatively smooth, its length should be close to the length of the first pixel (x1, y1) and the last pixel (x2, y1). 1+p ,y 1+p The straight-line distance between the pixels is used; however, when the contour line segment fluctuates significantly, the contour line segment and the line segment need to be trimmed. Therefore, in this application, the total length formed by connecting the pixels sequentially on the contour line segment and the length of the first pixel (x1, y1) and the last pixel (x...) are used. 1+p ,y 1+p To compare the distances between the two points, for example, a ratio threshold of 2.5 can be set, comparing the total length of the contour line segment with the distances between the first pixel (x1, y1) and the last pixel (x...). 1+p ,y 1+p The lengths of the straight lines between the two points are compared. If the ratio is greater than a threshold, the contour segment is considered to have excessive fluctuation and can be trimmed. In this case, the lengths of the first and last pixels (x1, y1) and the last pixel (x2, y1) can be used as the basis for the trimming. 1+p ,y 1+p The straight line connecting the two points can replace the outline segment.

[0115] After trimming one contour segment, you can continue to cut the next contour segment. The interval between two contour segment cuts can be preset. It can be set to a difference of d pixels between the first pixels of the two contour segments cut on the lock head contour line. Then the cut contour segment is also the pixel (x) 1+d ,y 1+d ) to pixel (x 1+p+d ,y 1+p+d ), and d≤p; in a similar manner to the above, the pixel (x) 1+d ,y 1+d ) to pixel (x 1+p+d ,y 1+p+d Trim the outline segments between the lock head and the lock head outline, and then cut multiple outline segments in sequence to achieve noise reduction trimming of the lock head outline.

[0116] Optionally, in order to further improve the accuracy of the lock head outline trimming, the fluctuation of the M consecutively cut outline segments can be comprehensively judged. If the ratio of the total length of the M consecutively cut outline segments to the straight-line distance between the first and last pixels exceeds a preset threshold by too many times, then the M outline segments can be trimmed uniformly.

[0117] Reference Figure 5f , Figure 5f To Figure 5e The trimmed outline of the lock head is clearly... Figure 5f The lock head outline shown is smoother, eliminating a significant amount of noise interference. After trimming all the outlines, the side slope of the lock head outline can be determined.

[0118] Optionally, the process of determining the inclination angle of the lock head outline may specifically include:

[0119] The contour line of the imaging profile is divided into local contour line segments of a preset number.

[0120] Perform slope calculation on each local contour line segment, and determine the number of local contour line segments with slope values ​​in (0, 2) and with slope values ​​of infinity. Check if the proportion of these segments to the preset number of segments is less than the preset proportion. If so, lock the lock.

[0121] Because the outline of the lock's image is a closed loop rather than a single straight line, the outlines of its different parts are obviously not the same. However, whether the lock is locked or unlocked, its bottom and top are both outlines that are close to the horizontal line. The difference lies in the outlines of the side positions.

[0122] As mentioned earlier, the slope of the side profile of a lock is different when it is locked and unlocked. When the lock is locked, its side profile is steeper. Based on the existing lock structure, a slope threshold greater than 2 is set. When the slope of the lock's side profile is in the range of (0, 2) more often, the lock can be considered to be unlocked. When the slope of the lock's side profile is greater than 2 more often, the lock can be considered to be locked.

[0123] In addition, it should be noted that when the lock is not locked, one side of the lock cylinder's outline may be obscured by the edge of the keyhole. In this case, the outline of the trimmed lock cylinder can be referenced. Figure 5g , Figure 5gThis is a schematic diagram of a lock cylinder when it is not locked. Clearly, one side of the lock cylinder's outline is a vertical line, while the other side is an angled line between (0, 2). Therefore, to ensure the accuracy of the lock cylinder's locking / unlocking determination, the proportion of outlines with slopes close to infinity and slopes between (0, 2) can be used as the basis for judging whether the lock cylinder is locked. If the proportion is too large, the lock cylinder is considered unlocked; otherwise, it is considered locked.

[0124] The following describes the locking and identification device for tank containers provided in the embodiments of the present invention. The locking and identification device for tank containers described below can be referred to in correspondence with the locking and identification method for tank containers described above.

[0125] Figure 6 This is a structural block diagram of the locking and identification device for a storage tank container provided in an embodiment of the present invention, with reference to... Figure 6 The locking identification device for the storage tank container may include:

[0126] Image acquisition module 100 is used to acquire images of the location of the keyhole;

[0127] Contour recognition module 200 is used to recognize the imaging contour of the lock head through the keyhole in the image;

[0128] The locking determination module 300 is used to determine the tilt angle of the side imaging contour line of the lock head according to the imaging contour. When the tilt angle is within the set tilt angle range, the lock head is determined to be in a locked state.

[0129] In an optional embodiment of this application, the contour recognition module 200 is used to calculate the evaluation coefficient corresponding to each pixel by using an evaluation coefficient formula based on the current color of the lock head and the pixel value of each pixel in the image; to take the pixels whose evaluation coefficients are within a set evaluation range as pixels in the imaging area of ​​the lock head; and to determine the imaging contour based on the imaging area.

[0130] Wherein, when the lock is yellow, the evaluation coefficient includes a first evaluation coefficient and a second evaluation coefficient; the formulas for the first evaluation coefficient and the second evaluation coefficient are respectively... and

[0131] When the lock is red, the evaluation coefficient formula is:

[0132] When the lock is green, the evaluation coefficient formula is:

[0133] When the lock is orange, the evaluation coefficient includes a first evaluation coefficient and a second evaluation coefficient; the formulas for the first evaluation coefficient and the second evaluation coefficient are respectively... and

[0134] When the lock is a gray or white lock, the evaluation coefficient formula is:

[0135] Where R (x,y) G (x,y) B (x,y) In an optional embodiment of this application, the contour recognition module 200 includes the pixel values ​​of the three primary colors of the pixel point (x, y), respectively.

[0136] The first processing unit is used to perform binarization processing on each pixel of the imaging area; and based on the binarized imaging area, to select and identify the closed contour line with the longest perimeter in the imaging area as the lock head contour line.

[0137] The second calculation unit is used to extract a contour line segment from the lock head contour line containing a first set number of pixels on the lock head contour line.

[0138] The third calculation unit is used to determine whether the ratio between the straight-line distance between the first and last pixels of the contour line segment and the length of the contour line segment is greater than a set ratio. If so, the extracted contour line segment is replaced by a straight line connecting the top corner pixels of the sliding window in order to perform noise trimming on the contour pixels.

[0139] The fourth processing unit is used to repeatedly execute the step of extracting a contour line segment containing a first set number of pixels on the lock head contour line until all pixels on the lock head contour line have been extracted into a contour line segment, and the lock head contour line with noise reduction is used as the imaging contour. The number of pixels between the first-end pixels of two adjacent extracted contour line segments on the lock head contour line is a second set number of pixels, and the first set number of pixels is greater than the second set number of pixels.

[0140] In an optional embodiment of this application, the locking determination module 300 is specifically used to divide the contour line of the imaging contour into a preset number of local contour line segments; perform slope calculation on each of the local contour line segments, and determine whether the number of local contour line segments with a slope of (0, 2) and a slope of infinity is less than a preset proportion; if so, then determine that the lock is locked.

[0141] In an optional embodiment of this application, the image acquisition module 100 is specifically used to identify whether the truck transporting the container has reached the set parking area according to the positioning and recognition device; if so, to acquire an image of the truck including the container; to perform binarization processing on the truck image and determine the container imaging outline based on the binarized truck image; to determine the keyhole imaging area based on the container imaging outline and to identify the keyhole imaging outline line in the keyhole imaging area; to focus the camera according to the center point pixel position of the area enclosed by the keyhole imaging outline line and to capture an image of the area where the keyhole is located.

[0142] The lock-up identification device for the storage tank container in this embodiment is used to implement the aforementioned lock-up identification method for the storage tank container. Therefore, the specific implementation method of the lock-up identification device for the storage tank container can be found in the embodiment section of the lock-up identification method for the storage tank container mentioned above, and will not be repeated here.

[0143] This application also provides an embodiment of a lock-up identification device for a storage tank container, the device comprising:

[0144] Memory, used to store computer programs;

[0145] A processor for executing a computer program to implement the steps of the lock-up identification method for a tank container as described in any of the preceding claims.

[0146] The steps of the lock-up identification method for tank containers executed by the processor may include:

[0147] Acquire an image of the keyhole location;

[0148] Identify the imaging profile of the lock head projected through the keyhole in the image;

[0149] The tilt angle of the side imaging contour line of the lock head is determined based on the imaging contour. When the tilt angle is within the set tilt angle range, the lock head is in the locked state.

[0150] This application also provides an embodiment of a computer-readable storage medium storing a computer program; the computer program is executed by a processor to implement the steps of the locking identification method for a tank container as described in any of the preceding claims.

[0151] The computer-readable storage medium may include random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0152] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that the elements inherent in a process, method, article, or apparatus that includes a list of elements are included. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element. Additionally, portions of the technical solutions provided in the embodiments of this application that are consistent with the implementation principles of corresponding technical solutions in the prior art have not been described in detail to avoid excessive elaboration.

[0153] This article uses specific examples to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. It should be noted that those skilled in the art can make several improvements and modifications to the present invention without departing from the principles of the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.

Claims

1. A method for locking and identifying a storage tank container, characterized in that, include: Acquire an image of the keyhole location; Identify the imaging profile of the lock head projected through the keyhole in the image; The tilt angle of the side imaging contour line of the lock head is determined based on the imaging contour. When the tilt angle is within the set tilt angle range, the lock head is determined to be in the locked state. Identifying the imaging profile of the lock head projected through the keyhole in the image includes: Based on the color of the lock and the pixel value of each pixel in the image, the evaluation coefficient is calculated for each pixel using the evaluation coefficient formula; Pixels whose evaluation coefficients are within the set evaluation range are used as pixels in the imaging area of ​​the lock head; The imaging profile of the lock head is determined based on the imaging area; Wherein, when the lock is a yellow lock, the evaluation coefficient formula includes a first evaluation coefficient formula and a second evaluation coefficient formula; the first evaluation coefficient formula and the second evaluation coefficient formula are respectively and ; When the lock is red, the evaluation coefficient formula is: ; When the lock is green, the evaluation coefficient formula is: ; When the lock is orange, the evaluation coefficient formula includes a first evaluation coefficient formula and a second evaluation coefficient formula; the first evaluation coefficient formula and the second evaluation coefficient formula are respectively... and ; When the lock is a gray or white lock, the evaluation coefficient formula is: ; in Each pixel The pixel values ​​of the three primary colors.

2. The locking and identification method for tank containers as described in claim 1, characterized in that, Determining the imaging profile of the lock head based on the imaging region includes: Each pixel in the imaging region is binarized. Based on the binarized imaging region, the closed contour line with the longest perimeter in the imaging region is selected and identified as the lock head contour line. A line segment containing a first set number of pixels is extracted from the outline of the lock head. Determine whether the ratio between the straight-line distance between the first and last pixels of the contour line segment and the length of the contour line segment is greater than a set ratio. If so, replace the straight-line connection between the top corner pixels of the sliding window used for the cut contour line segment with the straight-line connection between the top corner pixels of the sliding window in order to perform noise trimming on the contour line segment. The process of repeatedly extracting contour segments containing a first set number of pixels from the lock head contour line is repeated until all pixels of the lock head contour line have been extracted into contour segments. The lock head contour line with noise reduction is then used as the imaging contour. The number of pixels between the first-end pixels of two adjacent extracted contour segments on the lock head contour line is a second set number of pixels, and the first set number of pixels is greater than the second set number of pixels.

3. The locking and identification method for tank containers as described in claim 2, characterized in that, The tilt angle of the side imaging profile of the lock head is determined based on the imaging profile. When the tilt angle is within a set tilt angle range, the lock head is determined to be in a locked state, including: The contour line of the imaging contour is divided into a preset number of local contour line segments. For each segment of the local contour line, perform slope calculation and determine the number of segments with slope values ​​in (0, 2) and with slope values ​​of infinity. Determine whether the proportion of the number of segments to the preset number of segments is less than a preset proportion. If so, determine that the lock head is locked.

4. The locking and identification method for a storage tank container as described in any one of claims 1 to 3, characterized in that, Acquire images of the keyhole location, including: The positioning and identification device identifies whether the truck transporting the container has reached the designated parking area. If so, an image of the truck, including the container, is captured. The truck image is binarized, and the container imaging outline is determined based on the binarized truck image. Based on the container imaging profile, the keyhole imaging area is determined, and the keyhole imaging profile line is identified in the keyhole imaging area; Based on the position of the center pixel of the area enclosed by the keyhole imaging outline, the camera is focused and an image of the area where the keyhole is located is captured.

5. A locking and identification device for a storage tank container, characterized in that, include: The image acquisition module is used to acquire images of the location of the keyhole; A contour recognition module is used to recognize the imaging contour of the lock head through the keyhole in the image; The locking determination module is used to determine the tilt angle of the side imaging contour line of the lock head based on the imaging contour. When the tilt angle is within the set tilt angle range, the lock head is determined to be in a locked state. The contour recognition module is used to calculate the evaluation coefficient for each pixel based on the current color of the lock head and the pixel value of each pixel in the image using an evaluation coefficient formula; the pixels whose evaluation coefficients are within a set evaluation range are taken as pixels in the imaging area of ​​the lock head; and the imaging contour is determined based on the imaging area. Wherein, when the lock is a yellow lock, the evaluation coefficient formula includes a first evaluation coefficient formula and a second evaluation coefficient formula; the first evaluation coefficient formula and the second evaluation coefficient formula are respectively and ; When the lock is red, the evaluation coefficient formula is: ; When the lock is green, the evaluation coefficient formula is: ; When the lock is orange, the evaluation coefficient formula includes a first evaluation coefficient formula and a second evaluation coefficient formula; the first evaluation coefficient formula and the second evaluation coefficient formula are respectively... and ; When the lock is a gray or white lock, the evaluation coefficient formula is: ; in Each pixel The pixel values ​​of the three primary colors.

6. The locking and identification device for a storage tank container as described in claim 5, characterized in that, The contour recognition module includes: The first processing unit is used to perform binarization processing on each pixel of the imaging area; and based on the binarized imaging area, to select and identify the closed contour line with the longest perimeter in the imaging area as the lock head contour line. The second calculation unit is used to extract a contour line segment from the lock head contour line containing a first set number of pixels on the lock head contour line. The third calculation unit is used to determine whether the ratio between the straight-line distance between the first and last pixels of the contour line segment and the length of the contour line segment is greater than a set ratio. If so, the straight-line connection between the top corner pixels of the sliding window used to cut the contour line segment is replaced to perform noise trimming on the contour line segment. The fourth processing unit is used to repeatedly execute the step of extracting a contour line segment containing a first set number of pixels on the lock head contour line until all pixels on the lock head contour line have been extracted into a contour line segment, and the lock head contour line with noise reduction is used as the imaging contour. The number of pixels between the first-end pixels of two adjacent extracted contour line segments on the lock head contour line is a second set number of pixels, and the first set number of pixels is greater than the second set number of pixels.

7. A lock-on identification device for a storage tank container, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the lock-up identification method for a tank container as described in any one of claims 1 to 4.

8. A computer-readable storage medium, characterized in that, The computer-readable storage contains a computer program; the computer program is executed by a processor to implement the steps of the locking identification method for tank containers as described in any one of claims 1 to 4.