Material size measurement method, system and equipment based on visual inspection and medium
By using depth cameras and intelligent algorithms to quickly and accurately measure the size of power materials, the problem of measurement efficiency and accuracy when power materials are put into storage is solved, reasonable cargo space allocation is achieved, and warehouse storage efficiency and utilization are improved.
Patent Information
- Application Number
- CN202510834543.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-10-03
AI Technical Summary
Existing technologies make it difficult to quickly and accurately measure the irregular shapes of electrical materials, resulting in inefficiency and inaccurate size allocation when materials are put into warehouses, affecting storage efficiency and storage capacity.
Using a depth camera and intelligent algorithms, the system acquires depth image data, converts it into three-dimensional point cloud data, filters outliers, calculates the length, width and height of materials, and combines it with the minimum enclosing rectangle algorithm to achieve material size measurement and reasonable cargo location allocation.
It achieves fast and accurate material size measurement, improves material warehousing efficiency and warehouse storage capacity utilization, reduces cargo space waste, and improves warehouse operation efficiency.
Smart Images

Figure CN120747191A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of warehouse material storage management, and in particular to a material size measurement method, system, equipment and medium based on visual detection. Background Art
[0002] Unmanned warehouses are a key development trend in power system warehousing management. An increasing number of power supply warehouses are undergoing renovations and upgrades to achieve unmanned warehouses to improve storage efficiency and management. During the material entry process in unmanned warehouses, accurately measuring the length, width, and height of materials is a key prerequisite for optimal storage location allocation. By accurately measuring material dimensions, the system can assign appropriate storage locations of similar dimensions to each item, thereby maximizing warehouse storage capacity and utilization. With the continuous development of unmanned warehouse technology, its application in power system warehousing management will become more extensive and in-depth. By continuously optimizing storage location allocation algorithms and enhancing the intelligence level of equipment, unmanned warehouses will further improve the efficiency and economic benefits of power supply storage.
[0003] Power supplies are diverse and often have irregular shapes. Manual measurement is not only inefficient but also inaccurate. Traditional dimensional measurement methods, such as contact tools like calipers and micrometers, while accurate, are inefficient and difficult to use for complex shaped power supplies. To address this issue, the present invention proposes a material dimensional measurement method, system, equipment, and medium based on visual inspection to quickly and accurately measure the dimensions of stored materials and allocate storage locations. Summary of the Invention
[0004] To solve the above problems, the present invention provides a material size measurement method, system, equipment and medium based on visual detection. Through a depth camera and an intelligent algorithm, it can quickly and accurately complete the size measurement of stored materials and then allocate storage locations.
[0005] In a first aspect, the present invention provides a method for measuring material dimensions based on visual inspection, comprising:
[0006] Use a depth camera to obtain images of the material to be tested and continuously capture depth image data;
[0007] Convert the depth image data into three-dimensional spatial coordinate points, and aggregate the three-dimensional spatial coordinate points into point cloud data;
[0008] Filter the point cloud data to remove non-target point clouds, and perform filtering on the remaining point cloud data to remove outliers in the remaining point cloud data;
[0009] Analyze the remaining point cloud data and calculate the length, width and height of the materials;
[0010] Allocate appropriate storage locations for materials based on their length, width, and height.
[0011] Furthermore, a depth camera is arranged above a conveyor line in a warehouse, and the conveyor line is perpendicular to the depth camera; a measuring point is set on the conveyor line, and the measuring point is located directly below the depth camera. The materials to be measured are placed on a pallet on the conveyor line and transported to the measuring point through the conveyor line. A through-beam photoelectric sensor is also provided on the conveyor line. The transmitter and receiver of the through-beam photoelectric sensor are arranged on both sides of the measuring point to detect whether the pallet has arrived at the measuring point. When the pallet arrives at the measuring point, the through-beam photoelectric sensor sends an in-position signal to the control host. The function of the in-position signal is to trigger the depth camera to acquire images, and the depth camera continuously captures depth image data.
[0012] Furthermore, the depth image data collected by the depth camera includes distance information, pixel coordinates, and depth values. The two-dimensional depth image data is converted into three-dimensional point coordinates through the camera focal length and optical center coordinates. The conversion formula is as follows:
[0013] Z = Z, where (u, v) is the pixel coordinate in the depth image, u represents the column coordinate (horizontal position) of the pixel in the image, v represents the row coordinate (vertical position) of the pixel in the image, Z is the depth value corresponding to (u, v), (x, y, z) is the three-dimensional coordinate point, (cx, cy) is the coordinate of the optical center, and (fx, fy) is the focal length.
[0014] Furthermore, the point cloud data is filtered to remove non-target point clouds, and the remaining point cloud data is filtered to remove outliers in the remaining point cloud data, including:
[0015] According to the set detection distance range, the point cloud data of the points whose Z coordinates in the three-dimensional point coordinates are not in the range are filtered out. According to the set width range, the point cloud data of the points whose X and Y coordinates in the three-dimensional point coordinates are not in the range are filtered out. The statistical filtering function is used to further process the remaining point cloud data to filter out outliers.
[0016] Furthermore, the steps to filter out outliers are:
[0017] Calculate each point P in the remaining point cloud data i The distance d to its nearest k points ij , and then calculate d according to the following formula ij The average value μ i :
[0018]
[0019] Among them, k represents the number of neighbor points, μ i represents the average value, d ijRepresented as each point P in the remaining point cloud data i The distance to its nearest k points;
[0020] Calculate the average distance μ and standard deviation σ of all points in the remaining point cloud data:
[0021]
[0022] Where N is the number of three-dimensional coordinates of the remaining point cloud data;
[0023] The threshold t is determined according to the multiple α of the standard deviation. The threshold t is obtained by the following formula:
[0024] t=μ+α×σ
[0025] Here, α represents the multiple of the standard deviation and is used to determine the threshold t.
[0026] Filter out all points whose average distance is less than the threshold, that is, retain the points that meet the following conditions:
[0027] μ i <t.
[0028] Furthermore, based on the remaining point cloud data, the length, width and height of the material are calculated, including:
[0029] Sort all points by Z coordinate from small to large, take the n points with the largest Z values from the sorted data, and calculate their average value as the maximum height d of the material;
[0030] Subtract this distance d from the installation height of the depth camera to get the height h of the material;
[0031] Project the filtered point cloud onto the two-dimensional plane of coordinates XY, and calculate the minimum circumscribed rectangle of these points on the two-dimensional plane. The length and width of this circumscribed rectangle are the length and width of the material.
[0032] Furthermore, the filtered point cloud is projected onto a two-dimensional plane of coordinates XY to obtain a two-dimensional point set. Calculating the minimum bounding rectangle of the point set includes:
[0033] Draw the outline of a two-dimensional point set. The traversal angle of rotation of each side length of the two-dimensional point set outline is θ∈[0°,180°). Rotate the point set by θ degrees and calculate the extreme values of the X and Y coordinates of the rotated points: Xmin(θ), Xmax(θ), Ymin(θ), Ymax(θ). The extreme values generate an initial bounding rectangle, whose area is calculated by the formula [Xmax(θ)-Xmin(θ)]×[Ymax(θ)-Ymin(θ)]. Record the areas of the initial bounding rectangles rotated at all angles and select the initial bounding rectangle with the smallest area as the minimum bounding rectangle. The length and width of the bounding rectangle are the length and width of the material.
[0034] In a second aspect, the present invention further provides a material size measurement system based on visual inspection, comprising:
[0035] Data acquisition module: obtains images of the material to be tested through a depth camera and continuously captures depth image data;
[0036] Data processing module: converts the depth image data into three-dimensional spatial coordinate points, aggregates the three-dimensional spatial coordinate points into point cloud data, and performs filtering processing on the point cloud data to filter out non-target point clouds, and performs filtering processing on the remaining point cloud data to remove outliers in the remaining point cloud data;
[0037] Size calculation module: Analyze the remaining point cloud data to calculate the length, width and height of the material;
[0038] Cargo allocation module: allocates appropriate cargo locations for materials based on the calculated size information.
[0039] In a third aspect, the present invention further provides an electronic device comprising a storage medium and a processor; the storage medium is used to store instructions; and the processor is used to operate according to the instructions to execute the above-mentioned material size measurement method based on visual inspection.
[0040] In a fourth aspect, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, the above-mentioned material size measurement method based on visual inspection is implemented.
[0041] Beneficial effects of the present invention:
[0042] 1. This invention uses a depth camera to rapidly capture depth images of materials. Combined with an efficient point cloud processing algorithm, it can quickly measure material dimensions, significantly improving the efficiency of material storage. Furthermore, the depth camera acquires high-precision depth images, and statistical filtering removes noise and outliers to ensure accurate dimensional measurement. Compared to traditional manual measurement methods, this invention can more accurately measure the dimensions of complex materials.
[0043] 2. By accurately measuring the length, width, and height of materials, the present invention can assign appropriate storage locations with similar dimensions to each item, thereby maximizing warehouse storage capacity and utilization. This not only reduces storage space waste but also improves the overall operational efficiency of the warehouse.
[0044] 3. The present invention can handle storage materials of various shapes. Through three-dimensional modeling of point cloud data and calculation of the minimum circumscribed rectangle, the system can accurately measure and adapt to materials of various complex shapes. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 This is a flow chart of a material size measurement method provided by the present invention.
[0046] Figure 2 This is a structural block diagram of a material size measurement system provided by the present invention. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solutions and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings and a preferred embodiment.
[0048] The present invention provides a material size measurement method based on visual inspection, such as Figure 1 As shown, the following steps are included.
[0049] Step 1: Use a depth camera to obtain an image of the material to be tested and continuously capture depth image data.
[0050] In this embodiment, a depth camera is arranged above the conveyor line in the warehouse. The model of the depth camera is Zivid One+, and the conveyor line is perpendicular to the depth camera. A measuring point is set on the conveyor line, and the measuring point is located directly below the depth camera. The materials to be measured are placed on the pallet of the conveyor line and transported to the measuring point through the conveyor line. A through-beam photoelectric sensor is also provided on the conveyor line. The transmitter and receiver of the through-beam photoelectric sensor are arranged on both sides of the measuring point to detect whether the pallet has arrived at the measuring point. When the pallet arrives at the measuring point, the through-beam photoelectric sensor sends an in-position signal to the control host. The function of the in-position signal is to trigger the depth camera to acquire images.
[0051] Step 2: Convert the depth image data into three-dimensional spatial coordinate points, and aggregate the three-dimensional spatial coordinate points into point cloud data.
[0052] The depth image data collected by the depth camera includes distance information, pixel coordinates and depth values. The distance information is the depth value of each pixel in the depth image, which indicates the actual distance from the depth camera to the point. The pixel coordinates are the two-dimensional coordinate position of each pixel in the image, and the depth value is the depth information corresponding to each pixel.
[0053] The specific process of converting 2D depth image data into 3D point cloud data is as follows: use OpenCV to read the depth image file and confirm whether the image data type is np.uint16, which is a common data type for depth images; convert the image into a stack of arrays, and then traverse the array to extract the depth value of each pixel; use the camera focal length (f x , f y ) and the optical center coordinates (C x , C y ) Convert the depth value into three-dimensional point coordinates. The conversion formula is as follows: Z = Z, where (u, v) is the pixel coordinate in the depth image, u represents the column coordinate (horizontal position) of the pixel in the image, v represents the row coordinate (vertical position) of the pixel in the image, Z is the depth value corresponding to (u, v), (x, y, z) is the three-dimensional coordinate point, (cx, cy) is the coordinate of the optical center, and (fx, fy) is the focal length.
[0054] Each pixel coordinate of the depth image is converted into a three-dimensional point coordinate, and all the converted three-dimensional coordinate points are combined to form point cloud data. Through this process, the system can accurately obtain the three-dimensional spatial information of the materials on the pallet, providing strong support for subsequent warehouse management and automated operations.
[0055] Step 3: Filter the point cloud data to remove non-target point clouds, and perform filtering on the remaining point cloud data to remove outliers in the remaining point cloud data.
[0056] First, based on the set detection distance range of 0.5-3m, point cloud data with Z coordinates outside the range is filtered out. Then, based on the set width range of 0.2-2.5m, point cloud data with X and Y coordinates outside the range is filtered out. The remaining point cloud data is further processed using the statistical filtering function of the point cloud library Open3D to filter out outliers and improve the accuracy of the final measurement results. The specific process is as follows:
[0057] Calculate each point P in the remaining point cloud data i The distance d to its nearest k points ij , and then calculate d according to the following formula ij The average value μ i :
[0058]
[0059] Among them, k represents the number of neighbor points, μ i represents the average value, d ij Represented as each point P in the remaining point cloud data i The distance to its k nearest points.
[0060] Calculate the average distance μ and standard deviation σ of all points in the remaining point cloud data:
[0061]
[0062]
[0063] Wherein, N is the number of 3D coordinates of the remaining point cloud data.
[0064] The threshold t is determined according to the multiple α of the standard deviation. The threshold t is obtained by the following formula:
[0065] t=μ+α×σ
[0066] Here, α represents the multiple of the standard deviation and is a parameter that can be set manually according to needs and is used to determine the threshold t.
[0067] Filter out all points whose average distance is less than the threshold, that is, retain the points that meet the following conditions:
[0068] μ i <t
[0069] Through the above process, Open3D's statistical filtering function can effectively remove outliers in the remaining point cloud data, thereby improving the quality of the retained point cloud data and the accuracy of subsequent measurement results.
[0070] Step 4: Analyze the remaining point cloud data and calculate the length, width and height of the material.
[0071] First, sort all points in ascending order of Z coordinates, select the n points with the largest Z values from the sorted data, and calculate their average value as the maximum height d of the material;
[0072] Subtract this distance d from the installation height of the depth camera to get the height h of the material;
[0073] Project the filtered point cloud onto the two-dimensional plane of coordinates XY to obtain a two-dimensional point set, and calculate the minimum bounding rectangle of the point set. The length and width of this bounding rectangle are the length and width of the material. The specific process includes:
[0074] The Graham scanning method is used to depict the outline of a two-dimensional point set, where the outline of the two-dimensional point set is a polygon.
[0075] The traversal angle of each side length rotation of the two-dimensional point set contour is θ∈[0°,180°). The point set is rotated by θ degrees, and the extreme values of the X and Y coordinates of the rotated points are calculated: Xmin(θ), Xmax(θ), Ymin(θ), Ymax(θ). The extreme values generate an initial bounding rectangle, whose area is calculated by the formula [Xmax(θ)-Xmin(θ)]×[Ymax(θ)-Ymin(θ)]. The areas of the initial bounding rectangles rotated at all angles are recorded, and the initial bounding rectangle with the smallest area is selected as the minimum bounding rectangle. The length and width of the bounding rectangle are the length and width of the material.
[0076] Step 5: Allocate appropriate storage locations for materials based on their length, width, and height. The specific process is as follows:
[0077] The cargo location allocation module extracts the number, length, width, and height of all available cargo locations from the cargo location database; and obtains the length, width, and height of the materials from the measurement system;
[0078] For each available cargo location, check whether its length, width, and height are greater than or equal to the length, width, and height of the material, and add the cargo locations that meet the conditions to the candidate cargo location list;
[0079] For each candidate cargo location, calculate the matching degree S with the material size. The calculation formula is:
[0080]
[0081] Among them, L P 、W p 、H p Respectively represent the length, width and height of the cargo space; L i 、W i 、H i Respectively represent the length, width and height of the material; Indicates the ratio of the difference between the cargo space length and the material length to the cargo space length; Indicates the ratio of the difference between the cargo space width and the material width to the cargo space width; Indicates the ratio of the difference between the cargo space height and the material height to the cargo space height;
[0082] The matching degree S is used to measure the degree of adaptability between the cargo location and the material size. The smaller the matching degree, the closer the cargo location and material size are matched. If S = 0, it means that the cargo location and material size are completely matched. If S > 0, it means that the cargo location is larger than the material. Through the above cargo location allocation method, the adaptability of different cargo locations and goods can be quantitatively compared, so as to select the optimal cargo location.
[0083] According to the location of the target goods, a handling instruction is generated and sent to the robotic arm operating unit. The robotic arm operating unit moves the materials to the target location according to the instruction.
[0084] On the one hand, the present invention uses a depth camera to quickly capture depth images of materials, combined with an efficient point cloud processing algorithm, to complete the measurement of material dimensions in a short period of time, significantly improving the efficiency of material warehousing; on the other hand, a depth camera is used to obtain high-precision depth images, and a filtering process is used to remove noise and outliers, thereby ensuring the accuracy of dimension measurement. Compared with traditional manual measurement methods, the present invention can more accurately measure the dimensions of materials with complex shapes; by accurately measuring the length, width, and height dimensions of materials, each piece of material can be assigned a suitable cargo location with similar dimensions, thereby maximizing the storage capacity and utilization of the warehouse. This not only reduces cargo space waste, but also improves the overall operational efficiency of the warehouse; the present invention can handle storage materials of various shapes, and through three-dimensional modeling of point cloud data and calculation of the minimum circumscribed rectangle, the system can accurately measure and adapt to materials of various complex shapes.
[0085] The present invention also provides a material size measurement system based on visual inspection, such as Figure 2As shown, the method for implementing the above-mentioned material size measurement based on visual inspection includes:
[0086] Data acquisition module: obtains images of the material to be tested through a depth camera and continuously captures depth image data;
[0087] Data processing module: converts the depth image data into three-dimensional spatial coordinate points, aggregates the three-dimensional spatial coordinate points into point cloud data, and performs filtering processing on the point cloud data to filter out non-target point clouds, and performs filtering processing on the remaining point cloud data to remove outliers in the remaining point cloud data;
[0088] Size calculation module: Analyze the remaining point cloud data to calculate the length, width and height of the material;
[0089] Cargo allocation module: allocates appropriate cargo locations for materials based on the calculated size information.
[0090] The present invention also provides an electronic device, comprising a storage medium and a processor; the storage medium is used to store instructions; the processor is used to operate according to the instructions to execute the above-mentioned material size measurement method based on visual inspection.
[0091] The electronic device includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device, including volatile and non-volatile media, removable and non-removable media.
[0092] The storage medium can be a computer system readable medium in the form of a volatile memory. The processor executes various functional applications and data processing by running programs carried by various computer system readable media, such as implementing the material size measurement method based on visual inspection provided in an embodiment of the present invention.
[0093] The present invention also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed, it implements the above-mentioned material size measurement method based on visual inspection. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device.
[0094] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0095] The computer program code for executing the above-mentioned visual inspection-based storage material size measurement method can be written in one or more programming languages or a combination thereof. The data acquisition module is a depth camera, and the data processing module is implemented in an edge control host. The edge control host includes a processing device, such as a central processing unit, a graphics processing unit, etc., which can perform various appropriate actions and processes according to a computer program stored in a computer-readable storage medium. The computer-readable storage medium can be included in the above-mentioned edge control host or exist separately without being assembled into the edge control host. The size calculation module and the cargo allocation module are cloud computing systems, such as cloud servers, which can communicate with the edge control host using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol). The cargo allocation module can specifically be an intelligent conveying system or a robotic arm operating unit of a conveyor line, and the intelligent conveying system or robotic arm operating unit performs the operation of allocating cargo locations for materials.
[0096] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications are also within the scope of protection of the present invention.
Claims
1. A material size measurement method based on visual inspection, characterized in that: include: Use a depth camera to obtain images of the material to be tested and continuously capture depth image data; Convert the depth image data into three-dimensional spatial coordinate points, and aggregate the three-dimensional spatial coordinate points into point cloud data; Filter the point cloud data to remove non-target point clouds, and perform filtering on the remaining point cloud data to remove outliers in the remaining point cloud data; Analyze the remaining point cloud data and calculate the length, width and height of the materials; Allocate appropriate storage locations for materials based on their length, width, and height.
2. The material size measurement method based on visual inspection according to claim 1, characterized in that: The depth camera is set above the conveyor line in the warehouse, and the conveyor line is perpendicular to the depth camera; a measuring point is set on the conveyor line, which is directly below the depth camera. The materials to be measured are placed on the pallet of the conveyor line and transported to the measuring point through the conveyor line. A through-beam photoelectric sensor is also provided on the conveyor line. The transmitter and receiver of the through-beam photoelectric sensor are located on both sides of the measuring point to detect whether the pallet has arrived at the measuring point. When the pallet arrives at the measuring point, the through-beam photoelectric sensor sends an in-position signal to the control host. The function of the in-position signal is to trigger the depth camera to acquire images, and the depth camera continuously captures depth image data.
3. The material size measurement method based on visual inspection according to claim 1, characterized in that: The depth image data collected by the depth camera includes distance information, pixel coordinates, and depth values. The two-dimensional depth image data is converted into three-dimensional point coordinates through the camera focal length and optical center coordinates. The conversion formula is as follows: Z = Z, where (u, v) is the pixel coordinate in the depth image, u represents the column coordinate (horizontal position) of the pixel in the image, v represents the row coordinate (vertical position) of the pixel in the image, Z is the depth value corresponding to (u, v), (x, y, z) is the three-dimensional coordinate point, (cx, cy) is the coordinate of the optical center, and (fx, fy) is the focal length.
4. The material size measurement method based on visual inspection according to claim 1, characterized in that: Filter the point cloud data to remove non-target point clouds, and perform filtering on the remaining point cloud data to remove outliers in the remaining point cloud data, including: According to the set detection distance range, the point cloud data of the points whose Z coordinates in the three-dimensional point coordinates are not in the range are filtered out. According to the set width range, the point cloud data of the points whose X and Y coordinates in the three-dimensional point coordinates are not in the range are filtered out. The statistical filtering function is used to further process the remaining point cloud data to filter out outliers.
5. The material size measurement method based on visual inspection according to claim 4, characterized in that: The steps to filter out outliers are: Calculate each point P in the remaining point cloud data i The distance d to its nearest k points ij , and then calculate d according to the following formula ij The average value μ i : Among them, k represents the number of neighbor points, μ i represents the average value, d ij Represented as each point P in the remaining point cloud data i The distance to its nearest k points; Calculate the average distance μ and standard deviation σ of all points in the remaining point cloud data: Where N is the number of three-dimensional coordinates of the remaining point cloud data; The threshold t is determined according to the multiple α of the standard deviation. The threshold t is obtained by the following formula: t=μ+α×σ Here, α represents the multiple of the standard deviation and is used to determine the threshold t. Filter out all points whose average distance is less than the threshold, that is, retain the points that meet the following conditions: m i <t。 6. The material size measurement method based on visual inspection according to claim 1, characterized in that: Based on the remaining point cloud data, calculate the length, width and height of the material, including: Sort all points by Z coordinate from small to large, take the n points with the largest Z values from the sorted data, and calculate their average value as the maximum height d of the material; Subtract this distance d from the installation height of the depth camera to get the height h of the material; Project the filtered point cloud onto the two-dimensional plane of coordinates XY to obtain a two-dimensional point set, and calculate the minimum circumscribed rectangle of the point set. The length and width of this circumscribed rectangle are the length and width of the material.
7. The material size measurement method based on visual inspection according to claim 6, characterized in that: Projecting the filtered point cloud onto the two-dimensional plane of coordinates XY obtains a two-dimensional point set. Calculating the minimum bounding rectangle of the point set includes: Draw the outline of a two-dimensional point set. The traversal angle of rotation of each side length of the two-dimensional point set outline is θ∈[0°,180°). Rotate the point set by θ degrees and calculate the extreme values of the X and Y coordinates of the rotated points: Xmin(θ), Xmax(θ), Ymin(θ), Ymax(θ). The extreme values generate an initial bounding rectangle, whose area is calculated by the formula [Xmax(θ)-Xmin(θ)]×[Ymax(θ)-Ymin(θ)]. Record the areas of the initial bounding rectangles rotated at all angles and select the initial bounding rectangle with the smallest area as the minimum bounding rectangle. The length and width of the bounding rectangle are the length and width of the material.
8. A material size measurement system for visual inspection, characterized by The method for measuring material dimensions based on visual inspection according to any one of claims 1 to 7 comprises: Data acquisition module: obtains images of the material to be tested through a depth camera and continuously captures depth image data; Data processing module: converts the depth image data into three-dimensional spatial coordinate points, aggregates the three-dimensional spatial coordinate points into point cloud data, and performs filtering processing on the point cloud data to filter out non-target point clouds, and performs filtering processing on the remaining point cloud data to remove outliers in the remaining point cloud data; Size calculation module: Analyze the remaining point cloud data to calculate the length, width and height of the material; Cargo allocation module: allocates appropriate cargo locations for materials based on the calculated size information.
9. An electronic device comprising a storage medium and a processor; the storage medium is used to store instructions; characterized in that: The processor is configured to operate according to the instructions to execute the material size measurement method based on visual inspection according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed, the material size measurement method based on visual inspection according to any one of claims 1 to 7 is implemented.