Object volume measurement method and device based on point cloud, equipment and storage medium
Through the point cloud-based object volume measurement method, image processing and SLAM algorithm are used to solve the problem of inaccurate measurement of cargo volume in freight, more accurate volume measurement is achieved, and freight cost errors are reduced.
Patent Information
- Application Number
- CN202411448995.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2025-01-03
AI Technical Summary
In the prior art, inaccurate measurement of cargo volume leads to large errors in freight costs, and the inability to accurately measure the volume of objects is a pain point in the freight field.
Using point cloud-based object volume measurement method, point cloud data processing is performed by acquiring multi-frame images, filtering out wrong point clouds, determining the volume of the target object, and using SLAM algorithm and linear conversion parameters of the inertial element coordinate system to achieve accurate Volume measurement.
It improves the accuracy of object volume measurement, can effectively reduce freight cost errors, is suitable for general electronic equipment, and expands measurement technical means.
Smart Images

Figure CN119251279A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of point cloud processing technology, and in particular to a point cloud-based object volume measurement method, device, equipment and storage medium. Background Art
[0002] In the freight field, cargo volume measurement is a painful demand. Users need to fill in the cargo volume in the freight order, and the freight platform calculates the freight cost based on information such as cargo volume and freight distance.
[0003] In the prior art, users can only estimate the volume of goods and then fill in the estimated volume of goods in the freight order. However, the estimated volume of goods is often inaccurate, which results in large errors in freight costs.
[0004] Therefore, how to accurately measure the volume of an object is a technical problem to be solved in this field. Summary of the invention
[0005] The main purpose of the present invention is to provide a method, device, computer equipment and storage medium for measuring the volume of an object based on point cloud, aiming to solve the technical problem of not being able to accurately measure the volume of an object.
[0006] To achieve the above object, the present invention provides a method for measuring the volume of an object based on a point cloud, the method comprising:
[0007] Acquire multiple frames of images obtained by shooting the target object;
[0008] Performing point cloud data processing on each frame of image to obtain point cloud data corresponding to each frame of image;
[0009] According to the coordinates of the point cloud in each frame of the image, filter out the erroneous point cloud in the point cloud data to obtain the target point cloud data;
[0010] Based on the target point cloud data corresponding to each frame of image, the volume corresponding to the target object is determined.
[0011] Optionally, filtering out erroneous point clouds in the point cloud data according to the coordinates of the point clouds in each frame of the image includes:
[0012] Obtaining the coordinates of all point clouds in the current frame image and the coordinates of all point clouds in the previous frame image; the previous frame image is adjacent to the current frame image;
[0013] Based on the coordinates of all point clouds in the current frame image and the coordinates of all point clouds in the previous frame image, a plurality of pairs of matching point clouds are determined; a pair of matching point clouds includes a first point cloud and a second point cloud, the first point cloud is a point cloud on the previous frame image, the second point cloud is a point cloud on the current frame image, and the coordinates of the first point cloud in the previous frame image are the same as the coordinates of the second point cloud in the current frame image;
[0014] Determine the similarity value corresponding to each pair of matching point clouds;
[0015] Determine, based on the similarity values corresponding to each pair of matching point clouds, erroneous point clouds in the multiple pairs of matching point clouds;
[0016] Filter out erroneous point clouds in the point cloud data.
[0017] Optionally, determining the similarity value corresponding to each pair of matching point clouds includes:
[0018] For any pair of matching point clouds, calculating a first similarity score corresponding to a first point cloud in the matching point clouds, and a second similarity score corresponding to a second point cloud in the matching point clouds;
[0019] calculating an absolute value of a difference between the first similarity score and the second similarity score, and determining a maximum value between the first similarity score and the second similarity score;
[0020] The ratio between the absolute value and the maximum value is determined as the similarity value corresponding to the matching point cloud.
[0021] Optionally, calculating a first similarity score corresponding to a first point cloud in the matching point cloud and a second similarity score corresponding to a second point cloud in the matching point cloud comprises:
[0022] Obtaining pixel values corresponding to each point cloud within a first range and pixel values corresponding to each point cloud within a second range; the first range is centered on the first point cloud, and the second range is centered on the second point cloud;
[0023] An average value of pixel values corresponding to each point cloud within the first range is determined as the first similarity score, and an average value of pixel values corresponding to each point cloud within the second range is determined as the second similarity score.
[0024] Optionally, determining the erroneous point clouds in the multiple pairs of matching point clouds based on the similarity values corresponding to each pair of matching point clouds includes:
[0025] The matching point cloud with a similarity value less than the similarity threshold is determined as an error point cloud.
[0026] Optionally, the method is applied to an electronic device, the electronic device comprising a camera, a first inertial element, and a second inertial element;
[0027] The step of performing point cloud data processing on each frame of image to obtain point cloud data corresponding to each frame of image includes:
[0028] For each frame of image, applying a preset SLAM algorithm based on the image, preset pre-integration parameters, the preset origin of the first inertial element coordinate system, the preset origin of the second inertial element coordinate system, the preset origin of the camera coordinate system, and linear transformation parameters, to obtain point cloud data corresponding to each frame of image;
[0029] The linear transformation parameters are used to characterize the linear transformation relationship between the first inertial element coordinate system and the camera coordinate system, and the linear transformation relationship between the second inertial element coordinate system and the camera coordinate system.
[0030] Optionally, the linear conversion parameter is determined by the following formula:
[0031]
[0032] Among them, p b is the coordinate of point P in the first inertial element coordinate system or the coordinate of point P in the second inertial element coordinate system, p c is the coordinate of point P in the camera coordinate system, is the external parameter of the camera relative to the first inertial element, is the external parameter of the camera relative to the second inertial element, and the first linear transformation parameters include and
[0033] In addition, to achieve the above-mentioned purpose, the present invention further provides a point cloud-based object volume measurement device, the point cloud-based object volume measurement device comprising:
[0034] An acquisition module, used to acquire multiple frames of images obtained by photographing a target object;
[0035] A processing module, used for performing point cloud data processing on each frame of image to obtain point cloud data corresponding to each frame of image;
[0036] A filtering module, used for filtering out erroneous point clouds in the point cloud data according to the coordinates of the point clouds in each frame of the image, to obtain target point cloud data;
[0037] The determination module is used to determine the volume corresponding to the target object based on the target point cloud data corresponding to each frame of image.
[0038] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0039] The computer device includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of any one of the point cloud-based object volume measurement methods proposed in the embodiments of the present application are implemented.
[0040] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0041] The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of any one of the point cloud-based object volume measurement methods proposed in the embodiments of the present application are implemented.
[0042] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0043] The embodiment of the present invention provides a method, device, equipment and storage medium for measuring the volume of an object based on point clouds, the method comprising: acquiring multiple frames of images obtained by photographing a target object; performing point cloud data processing on each frame of images to obtain point cloud data corresponding to each frame of images; filtering out erroneous point clouds in the point cloud data according to the coordinates of the point clouds in each frame of images to obtain target point cloud data; and determining the volume corresponding to the target object based on the target point cloud data corresponding to each frame of images. In the embodiment of the present invention, the volume corresponding to the target object is determined based on the target point cloud data corresponding to each frame of images, the target point cloud data filters out erroneous point clouds determined according to the coordinates of the point clouds in each frame of images, and the accuracy of the volume measurement result of the object is improved by filtering out erroneous point clouds that affect the accuracy of the volume measurement result. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0045] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0046] Figure 2 is a flow chart of a method for measuring object volume based on point cloud provided by an embodiment of the present invention;
[0047] Figure 3 is a schematic diagram of an image frame provided by an embodiment of the present invention;
[0048] Figure 4 is an application flow chart of the object volume measurement method based on point cloud provided by an embodiment of the present invention;
[0049] Figure 5 is a schematic structural diagram of an embodiment of a point cloud-based object volume measurement device according to the present application;
[0050] Figure 6 This is a basic structural block diagram of the computer device in this embodiment. DETAILED DESCRIPTION
[0051] The point cloud-based object volume measurement method provided by an embodiment of the present invention is applied to a point cloud-based object volume measurement device. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" in the specification and claims of the present application and the above-mentioned drawings and any variations thereof are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0052] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0053] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0054] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0055] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social online platform software, etc.
[0056] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, etc.
[0057] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .
[0058] It should be noted that the point cloud-based object volume measurement method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the point cloud-based object volume measurement device is generally set in the server / terminal device.
[0059] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0060] Please refer to Figure 2 , shows a flow chart of an embodiment of a method for measuring the volume of an object based on point cloud proposed in the present application. The embodiment of the present application can acquire and process relevant data based on artificial intelligence technology.
[0061] The object volume measurement method based on point cloud provided by the embodiment of the present invention comprises the following steps:
[0062] S210, acquiring multiple frames of images obtained by photographing the target object.
[0063] The target object mentioned above is the object to be measured.
[0064] In an optional freight scenario, the object volume measurement method based on point cloud provided by an embodiment of the present invention can be applied to an electronic device used by a user. In the freight scenario, a user can use a general electronic device to shoot a target object to obtain multiple frames of images, wherein the general electronic device includes but is not limited to non-professional point cloud measurement devices such as mobile phones and tablet computers.
[0065] S220, performing point cloud data processing on each frame of image to obtain point cloud data corresponding to each frame of image.
[0066] In this step, after obtaining multiple frames of images, point cloud data processing is performed on each frame of image to obtain point cloud data corresponding to each frame of image. For specific implementation methods, please refer to the subsequent embodiments.
[0067] S230, filtering out erroneous point clouds in the point cloud data according to the coordinates of the point clouds in each frame of the image, to obtain target point cloud data.
[0068] In this step, after determining the coordinates of the point cloud in each frame of the image, the obstructed point cloud or the point cloud that is not in the visible range is determined as an error point cloud, and then the error point cloud in the point cloud data is filtered out to obtain the target point cloud data. Among them, the above-mentioned point cloud that is not in the visible range can be understood as a point cloud that is not in the corresponding image obtained by shooting.
[0069] S240, determining a volume corresponding to the target object based on the target point cloud data corresponding to each frame of image.
[0070] In this step, after obtaining the target point cloud data corresponding to each frame of image, the volume corresponding to the target object can be determined based on the target point cloud data corresponding to each frame of image. A specific implementation method can be to fit the target point cloud data to obtain a hexahedron, and then calculate the volume of the hexahedron, and determine the volume as the volume corresponding to the target object.
[0071] In an embodiment of the present invention, the volume corresponding to the target object is determined based on the target point cloud data corresponding to each frame of the image. The above-mentioned target point cloud data filters out the erroneous point cloud determined according to the coordinates of the point cloud in each frame of the image. By filtering out the erroneous point cloud that affects the accuracy of the volume measurement result, the accuracy of the volume measurement result of the object is improved.
[0072] Optionally, filtering out erroneous point clouds in the point cloud data according to the coordinates of the point clouds in each frame of the image includes:
[0073] Obtaining the coordinates of all point clouds in the current frame image and the coordinates of all point clouds in the previous frame image; the previous frame image is adjacent to the current frame image;
[0074] Based on the coordinates of all point clouds in the current frame image and the coordinates of all point clouds in the previous frame image, a plurality of pairs of matching point clouds are determined; a pair of matching point clouds includes a first point cloud and a second point cloud, the first point cloud is a point cloud on the previous frame image, the second point cloud is a point cloud on the current frame image, and the coordinates of the first point cloud in the previous frame image are the same as the coordinates of the second point cloud in the current frame image;
[0075] Determine the similarity value corresponding to each pair of matching point clouds;
[0076] Determine, based on the similarity values corresponding to each pair of matching point clouds, erroneous point clouds in the multiple pairs of matching point clouds;
[0077] Filter out erroneous point clouds in the point cloud data.
[0078] In this embodiment, the coordinates of all the point clouds in the current frame image and the coordinates of all the point clouds in the previous frame image are obtained, wherein the previous frame image is adjacent to the current frame image.
[0079] It should be understood that if the coordinates of the first point cloud in the current frame image are the same as the coordinates of the second point cloud in the next frame image, it is determined that the first point cloud and the second point cloud have a matching relationship, and the first point cloud and the second point cloud are determined as a pair of matching point clouds. In other words, a pair of matching point clouds includes a first point cloud and a second point cloud, the first point cloud is a point cloud on the previous frame image, the second point cloud is a point cloud on the current frame image, and the coordinates of the first point cloud in the previous frame image are the same as the coordinates of the second point cloud in the current frame image.
[0080] A similarity value corresponding to each pair of matching point clouds is determined, and the similarity value corresponding to each pair of matching point clouds can represent the similarity between the first point cloud and the second point cloud in each pair of matching point clouds.
[0081] Further, based on the similarity values corresponding to each pair of matching point clouds, the erroneous point clouds in the multiple pairs of matching point clouds are determined, and the erroneous point clouds in the point cloud data are filtered out. It should be noted that the above-mentioned erroneous point clouds are obscured point clouds or point clouds that are not within the visible range.
[0082] For details on how to determine the similarity value corresponding to the matching point cloud and how to determine the specific implementation of the error point cloud, please refer to the subsequent embodiments.
[0083] See also Figure 3 , Figure 3 The current frame image and the previous frame image are shown, where Figure 3 It can be seen that the matching point cloud of the previous frame image and the current frame image is Figure 3 The matching points are shown.
[0084] In this embodiment, the matching point cloud is determined based on the coordinates of the point cloud in the current frame image and the coordinates of the point cloud in the previous frame image, and then the error point cloud is determined based on the similarity of the matching point cloud, and then the error point cloud is filtered out to improve the accuracy of the object volume measurement result.
[0085] Optionally, determining the similarity value corresponding to each pair of matching point clouds includes:
[0086] For any pair of matching point clouds, calculating a first similarity score corresponding to a first point cloud in the matching point clouds, and a second similarity score corresponding to a second point cloud in the matching point clouds;
[0087] calculating an absolute value of a difference between the first similarity score and the second similarity score, and determining a maximum value between the first similarity score and the second similarity score;
[0088] The ratio between the absolute value and the maximum value is determined as the similarity value corresponding to the matching point cloud.
[0089] In this embodiment, for any pair of matching point clouds, a first similarity score corresponding to the first point cloud in the matching point cloud and a second similarity score corresponding to the second point cloud in the matching point cloud are calculated, wherein the implementation method of calculating the similarity scores is described in the subsequent embodiments.
[0090] After determining the first similarity score corresponding to the first point cloud and the second similarity score corresponding to the second point cloud, the similarity values corresponding to the matching point clouds can be determined by the following formula:
[0091] s = abs(S1-S2) / max(S1, S2)
[0092] Among them, s represents the similarity value corresponding to the matching point cloud, S1 represents the first similarity score, S2 represents the second similarity score, abs() is the absolute value function; max(,) is the maximum value function of two parameters.
[0093] In this embodiment, a similarity value that can accurately represent the similarity between the first point cloud and the second point cloud is determined based on a first similarity score corresponding to the first point cloud in the matching point cloud and a second similarity score corresponding to the second point cloud.
[0094] Optionally, calculating a first similarity score corresponding to a first point cloud in the matching point cloud and a second similarity score corresponding to a second point cloud in the matching point cloud comprises:
[0095] Obtaining pixel values corresponding to each point cloud within a first range and pixel values corresponding to each point cloud within a second range; the first range is centered on the first point cloud, and the second range is centered on the second point cloud;
[0096] An average value of pixel values corresponding to each point cloud within the first range is determined as the first similarity score, and an average value of pixel values corresponding to each point cloud within the second range is determined as the second similarity score.
[0097] Optionally, a 3x3 pixel matrix may be established with the first point cloud as the center, and the range covered by the pixel matrix may be determined as the first range; a 3x3 pixel matrix may be established with the second point cloud as the center, and the range covered by the pixel matrix may be determined as the second range. In other embodiments, the specifications of the pixel matrix may be custom set.
[0098] Obtain pixel values corresponding to each point cloud within a first range, and determine the average value of the pixel values corresponding to each point cloud within the first range as a first similarity score; obtain pixel values corresponding to each point cloud within a second range, and determine the average value of the pixel values corresponding to each point cloud within the second range as a second similarity score.
[0099] Optionally, determining the erroneous point clouds in the multiple pairs of matching point clouds based on the similarity values corresponding to each pair of matching point clouds includes:
[0100] The matching point cloud with a similarity value less than the similarity threshold is determined as an error point cloud.
[0101] In this embodiment, a similarity threshold is preset. Optionally, the similarity threshold is 0.8.
[0102] In this embodiment, a matching point cloud whose similarity value is less than a similarity threshold is determined as an erroneous point cloud.
[0103] In other embodiments, the similarity values may be weighted and the error point cloud may be determined based on the weighted similarity values. For example, a matching point cloud whose weighted similarity value is less than a similarity threshold may be determined as an error point cloud.
[0104] Optionally, the method is applied to an electronic device, the electronic device comprising a camera, a first inertial element, and a second inertial element;
[0105] The step of performing point cloud data processing on each frame of image to obtain point cloud data corresponding to each frame of image includes:
[0106] For each frame of image, applying a preset SLAM algorithm based on the image, preset pre-integration parameters, the preset origin of the first inertial element coordinate system, the preset origin of the second inertial element coordinate system, the preset origin of the camera coordinate system, and linear transformation parameters, to obtain point cloud data corresponding to each frame of image;
[0107] The linear transformation parameters are used to characterize the linear transformation relationship between the first inertial element coordinate system and the camera coordinate system, and the linear transformation relationship between the second inertial element coordinate system and the camera coordinate system.
[0108] It should be noted that in the prior art, professional point cloud measurement equipment includes a camera and an inertial element, and the linear conversion relationship between the camera coordinate system and the inertial element coordinate system is known, so the target object can be photographed by the point cloud measurement equipment, and then the point cloud data corresponding to the target object can be determined based on the photographed image. Among them, the camera coordinate system is a coordinate system formed with the optical center of the camera as the origin, and the inertial element coordinate system is a coordinate system formed with the inertial element as the origin.
[0109] For general electronic devices, such as mobile phones, tablet computers and other devices, different electronic devices may include cameras and inertial elements of different specifications, which makes the linear conversion relationship between the camera coordinate system and the inertial element coordinate system unknown. Therefore, in the prior art, it is impossible to use general electronic devices to accurately measure the volume of objects.
[0110] In order to solve the above technical problems, in this embodiment, when the point cloud-based object volume measurement method is applied to an electronic device, the electronic device includes a camera, a first inertial element and a second inertial element, wherein the first inertial element may be an accelerometer and the second inertial element may be a gyroscope.
[0111] It should be noted that the Simultaneous Localization And Mapping (SLAM) algorithm is a technology used in the field of robotics and computer vision to achieve autonomous positioning and navigation of robots. The SLAM algorithm uses sensors to perceive the surrounding environment, and estimates the position and posture of the robot based on this perception information, and constructs an environmental map.
[0112] In this embodiment, the image, the preset pre-integration parameters, the preset origin of the first inertial element coordinate system, the preset origin of the second inertial element coordinate system, the preset origin of the camera coordinate system and the linear transformation parameters are input into the SLAM algorithm, and the point cloud data corresponding to each frame of the image is obtained through the SLAM algorithm.
[0113] The linear transformation parameters are used to characterize the linear transformation relationship between the first inertial element coordinate system and the camera coordinate system, and the linear transformation relationship between the second inertial element coordinate system and the camera coordinate system.
[0114] In this embodiment, by applying the SLAM algorithm, general electronic devices can also accurately measure the volume of objects, thereby expanding the technical means for measuring the volume of objects.
[0115] Optionally, the linear conversion parameter is determined by the following formula:
[0116]
[0117] Among them, p b is the coordinate of point P in the first inertial element coordinate system or the coordinate of point P in the second inertial element coordinate system, p c is the coordinate of point P in the camera coordinate system, is the external parameter of the camera relative to the first inertial element, is the external parameter of the camera relative to the second inertial element, and the first linear transformation parameters include and
[0118] To understand the overall technical solution, please refer to Figure 4 ,like Figure 4 As shown, the electronic device captures the target object in real time to obtain multiple frames of images; after receiving the user's measurement instructions, the SLAM algorithm is applied to obtain point cloud data based on the image data; a hexahedron is generated according to the point cloud data of the target object, and the volume of the hexahedron is used as the volume of the target object.
[0119] The user may send a measurement instruction by performing a touch operation on the electronic device.
[0120] Further references Figure 5 , as a response to the above Figure 2 In order to realize the method shown in the figure, the present application provides an embodiment of a point cloud-based object volume measurement device 500. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0121] An embodiment of the present invention provides a point cloud-based object volume measurement device 500, and the point cloud-based object volume measurement device 500 includes:
[0122] An acquisition module 510 is used to acquire multiple frames of images obtained by photographing a target object;
[0123] The processing module 520 is used to perform point cloud data processing on each frame of image to obtain point cloud data corresponding to each frame of image;
[0124] A filtering module 530 is used to filter out erroneous point clouds in the point cloud data according to the coordinates of the point clouds in each frame of the image, so as to obtain target point cloud data;
[0125] The determination module 540 is used to determine the volume corresponding to the target object based on the target point cloud data corresponding to each frame of image.
[0126] Optionally, the filtering module 530 is specifically configured to:
[0127] Obtaining the coordinates of all point clouds in the current frame image and the coordinates of all point clouds in the previous frame image; the previous frame image is adjacent to the current frame image;
[0128] Based on the coordinates of all point clouds in the current frame image and the coordinates of all point clouds in the previous frame image, a plurality of pairs of matching point clouds are determined; a pair of matching point clouds includes a first point cloud and a second point cloud, the first point cloud is a point cloud on the previous frame image, the second point cloud is a point cloud on the current frame image, and the coordinates of the first point cloud in the previous frame image are the same as the coordinates of the second point cloud in the current frame image;
[0129] Determine the similarity value corresponding to each pair of matching point clouds;
[0130] Determine, based on the similarity values corresponding to each pair of matching point clouds, erroneous point clouds in the multiple pairs of matching point clouds;
[0131] Filter out erroneous point clouds in the point cloud data.
[0132] Optionally, the filtering module 530 is further specifically configured to:
[0133] For any pair of matching point clouds, calculating a first similarity score corresponding to a first point cloud in the matching point clouds, and a second similarity score corresponding to a second point cloud in the matching point clouds;
[0134] calculating an absolute value of a difference between the first similarity score and the second similarity score, and determining a maximum value between the first similarity score and the second similarity score;
[0135] The ratio between the absolute value and the maximum value is determined as the similarity value corresponding to the matching point cloud.
[0136] Optionally, the filtering module 530 is further specifically configured to:
[0137] Obtaining pixel values corresponding to each point cloud within a first range and pixel values corresponding to each point cloud within a second range; the first range is centered on the first point cloud, and the second range is centered on the second point cloud;
[0138] An average value of pixel values corresponding to each point cloud within the first range is determined as the first similarity score, and an average value of pixel values corresponding to each point cloud within the second range is determined as the second similarity score.
[0139] Optionally, the filtering module 530 is further specifically configured to:
[0140] The matching point cloud with a similarity value less than the similarity threshold is determined as an error point cloud.
[0141] Optionally, the object volume measurement device 500 based on point cloud further includes: a camera, a first inertial element and a second inertial element;
[0142] The processing module 520 is specifically used for:
[0143] For each frame of image, applying a preset SLAM algorithm based on the image, preset pre-integration parameters, the preset origin of the first inertial element coordinate system, the preset origin of the second inertial element coordinate system, the preset origin of the camera coordinate system, and linear transformation parameters, to obtain point cloud data corresponding to each frame of image;
[0144] The linear transformation parameters are used to characterize the linear transformation relationship between the first inertial element coordinate system and the camera coordinate system, and the linear transformation relationship between the second inertial element coordinate system and the camera coordinate system.
[0145] Optionally, the linear conversion parameter is determined by the following formula:
[0146]
[0147] Among them, p b is the coordinate of point P in the first inertial element coordinate system or the coordinate of point P in the second inertial element coordinate system, p c is the coordinate of point P in the camera coordinate system, is the external parameter of the camera relative to the first inertial element, is the external parameter of the camera relative to the second inertial element, and the first linear transformation parameters include and
[0148] To solve the above technical problems, the present application also provides a computer device. Figure 6 , Figure 6This is a basic structural block diagram of the computer device in this embodiment.
[0149] The computer device 6 includes a memory 61, a processor 62, and a network interface 63 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 6 with components 61-63, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0150] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0151] The memory 61 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 61 can be an internal storage unit of the computer device 6, such as a hard disk or memory of the computer device 6. In other embodiments, the memory 61 can also be an external storage device of the computer device 6, such as a plug-in hard disk equipped on the computer device 6, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Of course, the memory 61 can also include both the internal storage unit of the computer device 6 and its external storage device. In this embodiment, the memory 61 is generally used to store the operating system and various application software installed on the computer device 6, such as the program code of the object volume measurement method based on point cloud, etc. In addition, the memory 61 can also be used to temporarily store various types of data that have been output or are to be output.
[0152] The processor 62 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 62 is generally used to control the overall operation of the computer device 6. In this embodiment, the processor 62 is used to run the program code stored in the memory 61 or process data, such as running the program code of the point cloud-based object volume measurement method.
[0153] The network interface 63 may include a wireless network interface or a wired network interface. The network interface 63 is generally used to establish a communication connection between the computer device 6 and other electronic devices.
[0154] The present application also provides another embodiment, namely, providing a computer-readable storage medium, which stores the point cloud-based object volume measurement program, and the point cloud-based object volume measurement program can be executed by at least one processor so that the at least one processor performs the steps of the point cloud-based object volume measurement method as described above.
[0155] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware online platform, and of course, by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0156] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0157] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A method for measuring the volume of an object based on point cloud, characterized in that: include: Acquire multiple frames of images obtained by shooting the target object; Performing point cloud data processing on each frame of image to obtain point cloud data corresponding to each frame of image; According to the coordinates of the point cloud in each frame of the image, filter out the erroneous point cloud in the point cloud data to obtain the target point cloud data; Based on the target point cloud data corresponding to each frame of image, the volume corresponding to the target object is determined.
2. The method according to claim 1, characterized in that The filtering out erroneous point clouds in the point cloud data according to the coordinates of the point clouds in each frame of the image includes: Obtaining the coordinates of all point clouds in the current frame image and the coordinates of all point clouds in the previous frame image; the previous frame image is adjacent to the current frame image; Based on the coordinates of all point clouds in the current frame image and the coordinates of all point clouds in the previous frame image, a plurality of pairs of matching point clouds are determined; a pair of matching point clouds includes a first point cloud and a second point cloud, the first point cloud is a point cloud on the previous frame image, the second point cloud is a point cloud on the current frame image, and the coordinates of the first point cloud in the previous frame image are the same as the coordinates of the second point cloud in the current frame image; Determine the similarity value corresponding to each pair of matching point clouds; Determine, based on the similarity values corresponding to each pair of matching point clouds, erroneous point clouds in the multiple pairs of matching point clouds; Filter out erroneous point clouds in the point cloud data.
3. The method according to claim 2, characterized in that Determining the similarity value corresponding to each pair of matching point clouds includes: For any pair of matching point clouds, calculating a first similarity score corresponding to a first point cloud in the matching point clouds, and a second similarity score corresponding to a second point cloud in the matching point clouds; calculating an absolute value of a difference between the first similarity score and the second similarity score, and determining a maximum value between the first similarity score and the second similarity score; The ratio between the absolute value and the maximum value is determined as the similarity value corresponding to the matching point cloud.
4. The method according to claim 3, characterized in that: The calculating a first similarity score corresponding to the first point cloud in the matching point cloud and a second similarity score corresponding to the second point cloud in the matching point cloud includes: Obtaining pixel values corresponding to each point cloud within a first range and pixel values corresponding to each point cloud within a second range; the first range is centered on the first point cloud, and the second range is centered on the second point cloud; An average value of pixel values corresponding to each point cloud within the first range is determined as the first similarity score, and an average value of pixel values corresponding to each point cloud within the second range is determined as the second similarity score.
5. The method according to claim 2, characterized in that: The determining, based on the similarity values corresponding to each pair of matching point clouds, erroneous point clouds in the plurality of pairs of matching point clouds comprises: The matching point cloud with a similarity value less than the similarity threshold is determined as an error point cloud.
6. The method according to claim 1, characterized in that The method is applied to an electronic device, the electronic device comprising a camera, a first inertial element and a second inertial element; The step of performing point cloud data processing on each frame of image to obtain point cloud data corresponding to each frame of image includes: For each frame of image, applying a preset SLAM algorithm based on the image, preset pre-integration parameters, the preset origin of the first inertial element coordinate system, the preset origin of the second inertial element coordinate system, the preset origin of the camera coordinate system, and linear transformation parameters, to obtain point cloud data corresponding to each frame of image; The linear transformation parameters are used to characterize the linear transformation relationship between the first inertial element coordinate system and the camera coordinate system, and the linear transformation relationship between the second inertial element coordinate system and the camera coordinate system.
7. The method according to claim 6, characterized in that The linear transformation parameter is determined by the following formula: Among them, p b is the coordinate of point P in the first inertial element coordinate system or the coordinate of point P in the second inertial element coordinate system, p c is the coordinate of point P in the camera coordinate system, is the external parameter of the camera relative to the first inertial element, is the external parameter of the camera relative to the second inertial element, and the first linear transformation parameters include and 8. A point cloud-based object volume measurement device, characterized in that: include: An acquisition module, used to acquire multiple frames of images obtained by photographing a target object; A processing module, used for performing point cloud data processing on each frame of image to obtain point cloud data corresponding to each frame of image; A filtering module, used for filtering out erroneous point clouds in the point cloud data according to the coordinates of the point clouds in each frame of the image, to obtain target point cloud data; The determination module is used to determine the volume corresponding to the target object based on the target point cloud data corresponding to each frame of image.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the object volume measurement method based on point cloud as described in any one of claims 1 to 7 are implemented.
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 by a processor, the steps of the object volume measurement method based on point cloud are implemented as described in any one of claims 1 to 7.
