Container door plate measuring method and device based on machine vision
By identifying the clamping mechanism marks in the container door panel image, forming a straight line and determining the intersection point, the problem of environmental interference in container door panel measurement is solved, and high-precision and efficient dimensional detection is achieved.
Patent Information
- Application Number
- CN202510458383.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2025-07-18
AI Technical Summary
In the prior art, the size detection of container door panels is susceptible to environmental interference such as light and vibration, and the measurement accuracy and stability need to be improved.
By acquiring the container door panel image, performing object detection and identifying marks on the clamping mechanism, determining the mark center coordinates, forming straight lines, and determining corner points using straight lines intersection points, combining image preprocessing and Gaussian blur processing to reduce the calculation amount and improve robustness.
High-precision container door panel measurement is realized, reducing image processing calculations, improving detection speed and robustness of machine vision models.
Smart Images

Figure CN120333293A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of image processing, and in particular, to a method and device for measuring a container door panel based on machine vision. Background Art
[0002] During the production process of containers, there are size deviation problems with container door panels, and it is necessary to detect the size deviation problems of container door panels in a timely manner. Currently, the detection of container door panels can be improved by using machine vision. In the field of machine vision, traditional measurement methods mainly rely on image processing algorithms to extract edge features for calculating sizes. This method is vulnerable to environmental interferences such as light and vibration, and the measurement accuracy and stability need to be improved. Summary of the Invention
[0003] The following is an overview of the subject matter described in detail herein. This overview is not intended to limit the scope of protection of the claims.
[0004] An object of the present application is to solve at least to some extent one of the technical problems existing in the related art. Embodiments of the present application provide a method and device for measuring a container door panel based on machine vision, which improve the robustness of the machine vision model for measuring the container door panel.
[0005] In an embodiment of the first aspect of the present application, a method for measuring a container door panel based on machine vision includes:
[0006] Obtain an image of the container door panel;
[0007] Perform object detection on the container door panel image to obtain a prediction box corresponding to the corner points of the container door panel. The prediction box contains a clamping mechanism for clamping the container door panel, and the clamping mechanism is marked with a mark for assisting in identifying the corner points;
[0008] Identify the mark in the prediction box and determine the center coordinates of the mark;
[0009] Group and pair the marks according to the center coordinates of the marks to form a straight line;
[0010] Translate the straight line by a preset distance, and determine the corner points of the container door panel according to the intersection points of the multiple translated straight lines.
[0011] According to certain embodiments of the first aspect of the present application, the performing object detection on the container door panel image to obtain a prediction box corresponding to the corner points of the container door panel includes:
[0012] Perform object detection on the container door panel image to obtain multiple first candidate prediction boxes;
[0013] Select the second candidate prediction box from the first candidate prediction boxes according to the confidence of the first candidate prediction boxes;
[0014] Select multiple prediction boxes from the second candidate prediction boxes by non-maximum suppression method;
[0015] Wherein, the number of the prediction boxes is equal to the number of the corner points of the container door panel.
[0016] According to some embodiments of the first aspect of the present application, after obtaining the prediction box corresponding to the corner point of the container door panel, the method further includes:
[0017] Crop the container door panel image according to the prediction box to obtain the region of interest;
[0018] Convert the region of interest into a grayscale image;
[0019] Perform Gaussian blur processing on the region of interest converted into a grayscale image according to the preset Gaussian kernel size and standard deviation to generate a smoothed image.
[0020] According to some embodiments of the first aspect of the present application, the marker is a dot, and the marker marked on the clamping mechanism in the prediction box is identified by the Hough circle detection method.
[0021] According to some embodiments of the first aspect of the present application, in the process of identifying the marker in the prediction box, redundant markers are filtered by calculating the optimal fit of the center of the marker.
[0022] According to some embodiments of the first aspect of the present application, after translating the straight line by a preset distance and determining the corner point of the container door panel according to the intersection points of the multiple translated straight lines, the method includes:
[0023] Obtain the size conversion ratio according to the actual length of the calibration plate and the length of the calibration plate in the container door panel image;
[0024] Calculate the length of the side of the door panel in the container door panel image according to the coordinates of the corner points of the container door panel;
[0025] Calculate the actual length of the side of the door panel according to the size conversion ratio and the length of the side of the door panel in the container door panel image.
[0026] According to some embodiments of the first aspect of the present application, the dot includes a first dot, a second dot, a third dot and a fourth dot, and the intersection point of the straight line formed by the first dot and the second dot and the straight line formed by the third dot and the fourth dot corresponds to the corner point.
[0027] An embodiment of the second aspect of the present application, a container door panel measurement device based on machine vision, includes:
[0028] An input unit for acquiring an image of the container door panel;
[0029] A preliminary positioning unit for performing target detection based on the image of the container door panel to obtain a prediction box corresponding to the corner points of the container door panel, wherein the prediction box contains a clamping mechanism for clamping the container door panel, and the clamping mechanism is marked with marks for assisting in identifying the corner points;
[0030] A fine positioning unit for identifying the marks in the prediction box, determining the center coordinates of the marks, grouping and pairing the marks according to the center coordinates of the marks to form a straight line, translating the straight line by a preset distance, and determining the corner points of the container door panel according to the intersection points of the multiple translated straight lines.
[0031] An embodiment of the third aspect of the present application, an electronic device, includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, it implements the machine vision-based container door panel measurement method as described in the embodiment of the first aspect of the present application.
[0032] An embodiment of the fourth aspect of the present application, a computer storage medium stores computer executable instructions, and the computer executable instructions are used to execute the machine vision-based container door panel measurement method as described in the embodiment of the first aspect of the present application.
[0033] The above solution has at least the following beneficial effects: By acquiring an image of the container door panel; performing target detection based on the image of the container door panel to obtain a prediction box corresponding to the corner points of the container door panel, the prediction box contains a clamping mechanism for clamping the container door panel, and the clamping mechanism is marked with marks for assisting in identifying the corner points; identifying the marks in the prediction box and determining the center coordinates of the marks; grouping and pairing the marks according to the center coordinates of the marks to form a straight line; translating the straight line by a preset distance, and determining the corner points of the container door panel according to the intersection points of the multiple translated straight lines; by means of the identification of the marks, high-precision measurement is achieved, the amount of image processing calculation is reduced, the detection speed is increased, and the robustness of the machine vision model is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The drawings are used to provide a further understanding of the technical solutions of the present application, and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solutions of the present application, and do not constitute a limitation to the technical solutions of the present application.
[0035] Figure 1 It is a step diagram of the container door panel measurement method;
[0036] Figure 2 It is a sub-step diagram of step S200;
[0037] Figure 3 It is a sub-step diagram of the image preprocessing step;
[0038] Figure 4 It is a sub-step diagram of the size conversion step;
[0039] Figure 5 It is a structural diagram of the measuring system clamping the container door panel;
[0040] Figure 6 It is a structural diagram of the clamping structure clamping the container door panel. Detailed implementation manners
[0041] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0042] It should be noted that although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order from the module division in the device or the flowchart. Terms such as "first" and "second" in the specification, claims or the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence.
[0043] The following further elaborates on the embodiments of the present application with reference to the accompanying drawings.
[0044] An embodiment of the present application provides a method for measuring a container door panel 20 based on machine vision.
[0045] Referring to Figure 1 , the method for measuring a container door panel includes the following steps:
[0046] Step S100, acquiring an image of the container door panel;
[0047] Step S200, performing target detection based on the image of the container door panel to obtain a prediction box corresponding to the corner points of the container door panel;
[0048] Step S300, identifying the marks in the prediction box and determining the center coordinates of the marks;
[0049] Step S400, grouping and pairing the marks according to the center coordinates of the marks to form a straight line;
[0050] Step S500, translating the straight line by a preset distance, and determining the corner points of the container door panel according to the intersection points of multiple translated straight lines.
[0051] Reference Figure 5 and Figure 6 As shown in FIGS. 1 and 2, the measurement system 10 is provided with four clamping mechanisms 30, and each clamping mechanism 30 is arranged with four white dots as marks. The four corners of the container door panel 20 are respectively clamped by the four clamping mechanisms 30. The dots include a first dot, a second dot, a third dot, and a fourth dot. The intersection of the straight line formed by the first dot and the second dot and the straight line formed by the third dot and the fourth dot corresponds to the corner point. Specifically, the distance between the intersection of the straight line formed by the first dot and the second dot and the straight line formed by the third dot and the fourth dot and the corner point is a preset distance, and the angle formed by the straight line formed by the intersection of the straight line formed by the first dot and the second dot and the straight line formed by the third dot and the fourth dot and the side of the container door panel 20 clamped is a preset angle.
[0052] Image acquisition adopts a dual-camera collaborative mode. Local images are acquired at three preset positions, and a total of six local images are obtained and synthesized into a complete door panel image through stitching technology. Of course, in other embodiments, a single camera combined with a robotic arm moving shooting can also be used to replace the dual-camera system, and the camera is driven by the robotic arm to move and shoot images at different positions.
[0053] To ensure data accuracy, the system has completed camera calibration and image correction work. Camera calibration can adopt methods such as active vision camera calibration method, camera self-calibration method, zero-distortion camera calibration method, etc. Image correction is a process of correcting image geometric distortion and gray-scale distortion through mathematical modeling and digital processing technology, mainly including geometric correction and gray-scale correction.
[0054] In the construction of the data set, the Labelimg tool is used to label the clamping mechanism 30 to generate an initial data set, and data augmentation is used to improve the generalization ability of the data set. The augmented data set is divided into a training set, a validation set, and a test set according to a ratio. The prediction model is trained through the training set to obtain a trained prediction model. The prediction model is based on YOLOv10, which is a deep learning object detection algorithm belonging to the YOLO (You Only Look Once) series and can complete object detection and positioning in a single forward propagation.
[0055] For step S200, object detection is performed according to the container door panel image to obtain a prediction box corresponding to the corner point of the container door panel 20. The prediction box contains the clamping mechanism 30 that clamps the container door panel 20, and the clamping mechanism 30 is marked with a mark for assisting in identifying the corner point.
[0056] Reference Figure 2 As shown in FIG. 3, object detection is performed according to the container door panel image to obtain a prediction box corresponding to the corner point of the container door panel, including the following steps:
[0057] Step S210: Perform object detection on the container door panel image to obtain multiple first candidate prediction boxes;
[0058] Step S220: Screen out second candidate prediction boxes from the first candidate prediction boxes according to the confidence levels of the first candidate prediction boxes;
[0059] Step S230: Screen out multiple prediction boxes from the second candidate prediction boxes by using the non-maximum suppression method.
[0060] Among them, the number of prediction boxes is equal to the number of corner points of the container door panel 20.
[0061] Perform object detection on the container door panel image to obtain multiple first candidate prediction boxes. When using Y0L0v10 to perform object detection on the container door panel image, the number of prediction boxes often fluctuates, and the number of first candidate prediction boxes in each image is usually greater than the number of corner points of the container door panel 20, that is, more than four. To accurately locate the clamping mechanism 30 and the corner points of the container door panel 20, a confidence filtering mechanism is adopted to screen out the optimal prediction boxes.
[0062] Screen out second candidate prediction boxes from the first candidate prediction boxes according to the confidence levels of the first candidate prediction boxes. For example, when the confidence level of the first candidate prediction box is greater than the confidence threshold, the confidence level of this first candidate prediction box is screened out as the second candidate prediction box. Set the confidence threshold to 0.8, that is, when the confidence level of the first candidate prediction box is greater than 0.8, the confidence level of this first candidate prediction box is screened out as the second candidate prediction box.
[0063] According to the following filtering formula: B filtered ={B i |C i ≥θ}, screen out second candidate prediction boxes from the first candidate prediction boxes according to the confidence levels of the first candidate prediction boxes. In the formula, B filtered represents the second candidate prediction box, Bi is the i-th prediction box, Ci is its confidence level, and θ is the confidence threshold.
[0064] Screen out second candidate prediction boxes from the first candidate prediction boxes according to the confidence levels of the first candidate prediction boxes. For duplicate prediction boxes, use the non-maximum suppression method for further screening. The non-maximum suppression method retains the detection box with the highest confidence level, suppresses other boxes with a high overlap degree with it, and eliminates redundant boxes according to the intersection over union (IoU), and retains the bounding boxes with an intersection over union less than the intersection over union threshold as the second candidate prediction boxes until four optimal bounding boxes are retained as the second candidate prediction boxes, and these second candidate prediction boxes can effectively cover the clamping mechanism 30 and the corner points of the container door panel 20. Specifically, the non-maximum suppression method can be expressed by the following formula: BNMS = {B i | IoU(B i , B j ) < θ IoU}}. In the formula, B NMS represents the second candidate prediction box, Bi is the i-th prediction box, Bj is the j-th prediction box, and θ IoU is the intersection over union threshold.
[0065] Referring to Figure 3 , when obtaining the prediction box corresponding to the corner point of the container door panel, the method further includes an image preprocessing step, and the image preprocessing step includes the following steps:
[0066] Step S241, crop the container door panel image according to the prediction box to obtain the region of interest;
[0067] Step S242, convert the region of interest into a grayscale image;
[0068] Step S243, perform Gaussian blur processing on the region of interest converted into a grayscale image according to the preset Gaussian kernel size and standard deviation to generate a smoothed image.
[0069] Specifically, based on the filtered optimal bounding box, the container door panel image is precisely cropped into four small rectangular regions containing the clamping mechanism 30, so as to focus on the region of interest, reduce the interference of redundant data, improve the efficiency of subsequent image processing and reduce the consumption of computing resources. After cropping, the image is converted into a grayscale image to simplify subsequent processing, reduce computational complexity, and at the same time maintain the structural information of the image. To improve the stability of edge detection and feature extraction, the cropped image is subjected to Gaussian blur processing to reduce noise and avoid overemphasis on details. By selecting appropriate Gaussian kernel size and standard deviation, a smoothed image is generated, providing a robust basis for subsequent processing and enhancing the robustness and accuracy of the overall image processing chain.
[0070] For step S300, identify the marks in the prediction box and determine the center coordinates of the marks. Among them, the mark is a dot, and the white dot mark marked on the clamping mechanism 30 in the prediction box is identified by the Hough circle detection method.
[0071] Specifically, the Hough circle detection is a method based on the Hough transform for detecting circles in an image. Its core idea is to map the circles in the image space to the parameter space and find the most likely combination of the center and radius through a voting mechanism. In the Hough circle detection, the three parameters a, b, and r of the circle form a three-dimensional parameter space. For each edge point (x, y) in the image, all possible combinations of the center (a, b) and radius r satisfy the circle equation (x - a) 2 + (y - b) 2 = r2 。
[0072] The core idea of the Hough circle detection is to find the most likely combination of the center and radius in the parameter space through a voting mechanism. First, perform edge detection on the input image (such as using the Canny operator) to obtain the set of edge points in the image. Create a three-dimensional accumulator array to store the voting values for each possible center (a, b) and radius r. For each edge point (x, y), traverse all possible combinations of the center (a, b) and radius r such that Then increment the corresponding position (a, b, r) in the accumulator by 1. In the accumulator, the position with a higher voting value corresponds to the possible circle in the image. By finding the local maximum in the accumulator, the center (a, b) and radius r can be determined.
[0073] To accurately identify the position of the dot, during the process of identifying the markers in the predicted bounding box, filter redundant markers by calculating the optimal fit of the center of the marker (i.e., the position of the center of the circle), and use the Hough transform to calibrate the center coordinates.
[0074] For step S400, group and pair the markers according to the center coordinates of the markers to form lines. For example, the markers are dots, and the dots include the first dot, the second dot, the third dot, and the fourth dot. Determine the distance between every two dots according to the center coordinates (i.e., the center coordinates of the circle), and select the two groups with the smallest distance for pairing. For example, if the distance between the first dot and the second dot and the distance between the third dot and the fourth dot are the smallest, then pair the first dot and the second dot, and pair the third dot and the fourth dot; connect the first dot and the second dot to form a straight line, and connect the third dot and the fourth dot to form another straight line.
[0075] The equation of the straight line is represented by the following formula: y = mx +b ; where m is the slope of the straight line and b is the intercept.
[0076] For step S500, translate the straight line by a preset distance, and determine the corner points of the container door panel 20 according to the intersection points of multiple translated straight lines.
[0077] Stitch the cropped images corresponding to the four successfully located corner points back to the original image, thereby reconstructing the complete container door panel image, and output the coordinates of the four corner points in the overall image to ensure accurate positioning, realize the accurate positioning of the corner points of the container door panel 20, and provide a reliable basis for subsequent dimension measurement.
[0078] Refer to Figure 4 , after determining the corner points of the container door panel, perform the dimension conversion step, and the dimension conversion step includes the following steps:
[0079] Step S610: Obtain the size conversion ratio according to the actual length of the calibration board and the length of the calibration board in the container door panel image.
[0080] Step S620: Calculate the length of the side of the door panel in the container door panel image based on the coordinates of the corner points of the container door panel.
[0081] Step S630: Calculate the actual length of the side of the door panel according to the size conversion ratio and the length of the side of the door panel in the container door panel image.
[0082] Specifically, the conversion ratio between the pixels in the image and the actual physical size is calculated through the calibration board, realizing an accurate mapping from the image data to the real-world size.
[0083] Assume the actual length of the calibration board is L real meters, and the length of the calibration board measured in the image is L image pixels. Then the size conversion ratio is the ratio of the actual length of the calibration board to the length of the calibration board measured in the container door panel image, and there is r = L image / L real . Based on the known coordinates of the four corner points in the image, calculate the side length of the door panel 20 in the image, that is, the pixel distance d between two adjacent corner points. d can be calculated through the Euclidean distance formula and is expressed by the following formula: Furthermore, determine the pixel lengths of each side of the door panel 20 in the image.
[0084] Using the previously calculated conversion ratio r, these pixel distances can be converted into actual physical sizes. For example, if the side length of the door panel 20 in the image is W inags pixels, then its actual length W real = can be obtained through the following formula: W real = W image ×r.
[0085] An embodiment of the present application provides a container door panel measuring device based on machine vision.
[0086] The container door panel measuring device based on machine vision includes: an input unit, a preliminary positioning unit, and a precise positioning unit.
[0087] Among them, the input unit is used to obtain the container door panel image; the preliminary positioning unit is used to perform target detection according to the container door panel image to obtain the prediction box corresponding to the corner points of the container door panel; the precise positioning unit is used to identify the marks in the prediction box, determine the center coordinates of the marks, group and pair the marks according to the center coordinates of the marks to form a straight line, translate the straight line by a preset distance, and determine the corner points of the container door panel according to the intersection points of multiple translated straight lines.
[0088] The prediction box contains a clamping mechanism for clamping the container door panel, and the clamping mechanism is marked with marks for assisting in identifying the corner points.
[0089] It can be understood that the container door panel measuring device based on machine vision provided in this embodiment applies the above-mentioned container door panel measuring method based on machine vision, and each unit of the container door panel measuring device corresponds to each step of the container door panel measuring method. The container door panel measuring device and the container door panel measuring method have the same technical solution, solve the same technical problems, and bring the same technical effects.
[0090] An embodiment of the present application provides an electronic device. The electronic device includes: a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the above-mentioned container door panel measuring method based on machine vision is implemented.
[0091] The electronic device can be any intelligent terminal including a computer, etc.
[0092] Generally speaking, for the hardware structure of the electronic device, the processor can be implemented in ways such as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., for executing relevant programs to implement the technical solution provided by the embodiment of the present application.
[0093] The memory can be implemented in forms such as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory can store an operating system and other application programs. When implementing the technical solution provided by the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory and are called by the processor to execute the method of the embodiments of the present application.
[0094] The input / output interface is used to implement information input and output.
[0095] The communication interface is used to implement communication interaction between this device and other devices, and can communicate through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0096] The bus transfers information among various components of the device, such as a processor, a memory, an input / output interface, and a communication interface. The processor, the memory, the input / output interface, and the communication interface achieve communication connections with each other inside the device through the bus.
[0097] Embodiments of the present application provide a computer storage medium. The computer storage medium stores computer-executable instructions for executing the method for measuring a container door panel based on machine vision as described above.
[0098] Those of ordinary skill in the art can understand that all or some of the steps and systems disclosed above can be implemented as software, firmware, hardware, and their appropriate combinations. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include a computer storage medium (or a non-transitory medium) and a communication medium (or a transitory medium). As is well known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information, such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory, or other memory technologies, CD-ROM, digital versatile disk (DVD), or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage, or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, as is well known to those of ordinary skill in the art, a communication medium typically includes computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and can include any information delivery medium. In the above description of this specification, the description with reference to the terms "one embodiment / embodiment example", "another embodiment / embodiment example", or "certain embodiments / embodiment examples", etc. means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0099] Those of ordinary skill in the art can understand that all or some of the steps, systems, and functional modules / units in the devices in the methods disclosed above can be implemented as software, firmware, hardware, and their appropriate combinations.
[0100] The units described above as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed over multiple network units. Some or all of these units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0101] In addition, in each embodiment of the present application, the various functional units may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0102] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in each embodiment of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store programs.
[0103] In several embodiments provided by the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the above-mentioned division of units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms. Although the embodiments of the present application have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and purposes of the present application. The scope of the present application is defined by the claims and their equivalents.
[0104] The above is a specific description of the preferred embodiment of the present application. However, the present application is not limited to the embodiments. Those skilled in the art can make various equivalent deformations or substitutions without departing from the spirit of the present application, and these equivalent deformations or substitutions are all included within the scope defined by the claims of the present application.
Claims
1. A method for measuring the container door panel based on machine vision, characterized in that, Including: Obtain the image of the container door panel; Perform object detection based on the image of the container door panel to obtain a prediction box corresponding to the corner point of the container door panel. The prediction box contains a clamping mechanism for clamping the container door panel, and the clamping mechanism is marked with a mark for assisting in identifying the corner point; Identify the mark in the prediction box and determine the center coordinates of the mark; Group and pair the marks according to the center coordinates of the marks to form a straight line; Translate the straight line by a preset distance, and determine the corner points of the container door panel according to the intersection points of multiple translated straight lines.
2. The method for measuring the container door panel based on machine vision according to claim 1, wherein, The performing object detection based on the image of the container door panel to obtain a prediction box corresponding to the corner point of the container door panel includes: Perform object detection based on the image of the container door panel to obtain multiple first candidate prediction boxes; Filter the second candidate prediction boxes from the first candidate prediction boxes according to the confidence of the first candidate prediction boxes; Filter multiple prediction boxes from the second candidate prediction boxes by using the non-maximum suppression method; Wherein, the number of the prediction boxes is equal to the number of the corner points of the container door panel.
3. The method for measuring the container door panel based on machine vision according to claim 2, wherein, After obtaining the prediction box corresponding to the corner point of the container door panel, the method further includes: Perform cropping processing on the image of the container door panel according to the prediction box to obtain a region of interest; Convert the region of interest into a gray image; Perform Gaussian blur processing on the region of interest converted into a gray image according to the preset Gaussian kernel size and standard deviation to generate a smooth image.
4. The method for measuring the container door panel based on machine vision according to claim 1, characterized in that, The mark is a dot, and the mark marked on the clamping mechanism in the prediction box is identified by using the Hough circle detection method.
5. The method for measuring the container door panel based on machine vision according to claim 1, wherein During the process of identifying the mark in the prediction box, redundant marks are filtered by calculating the optimal fitting of the center of the mark.
6. The method for measuring the container door panel based on machine vision according to claim 1, wherein, After translating the straight line by a preset distance and determining the corner points of the container door panel according to the intersection points of multiple translated straight lines, the method includes: Obtain a size conversion ratio according to the actual length of the calibration plate and the length of the calibration plate in the image of the container door panel; Calculate the length of the side of the door panel in the image of the container door panel according to the coordinates of the corner points of the container door panel; Calculate the actual length of the side of the door panel according to the size conversion ratio and the length of the side of the door panel in the image of the container door panel.
7. The method for measuring the container door panel based on machine vision according to claim 1, wherein The dot includes a first dot, a second dot, a third dot and a fourth dot, and the intersection point of the straight line formed by the first dot and the second dot and the straight line formed by the third dot and the fourth dot corresponds to the corner point.
8. A container door panel measuring device based on machine vision, characterized in that, Including: An input unit for obtaining the image of the container door panel; A primary positioning unit for performing object detection based on the image of the container door panel to obtain a prediction box corresponding to the corner point of the container door panel. The prediction box contains a clamping mechanism for clamping the container door panel, and the clamping mechanism is marked with a mark for assisting in identifying the corner point; A fine positioning unit for identifying the mark in the prediction box, determining the center coordinates of the mark, grouping and pairing the marks according to the center coordinates of the mark to form a straight line, translating the straight line by a preset distance, and determining the corner points of the container door panel according to the intersection points of multiple translated straight lines.
9. An electronic device, characterized in that, Including: A memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the computer program, the method for measuring a container door panel based on machine vision according to any one of claims 1 to 7 is implemented.
10. A computer storage medium, characterized in that, Computer-executable instructions are stored, and the computer-executable instructions are used to execute the method for measuring a container door panel based on machine vision according to any one of claims 1 to 7.