Object size measuring and calculating method, device and equipment and storage medium
By acquiring and processing point cloud data and image data, using image segmentation model and point cloud technology, the problem of inaccurate cargo size estimation is solved, accurate measurement of object size is achieved, and vehicle and cargo matching is improved during transportation. .
Patent Information
- Application Number
- CN202411162313.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2024-11-19
AI Technical Summary
During the cargo transportation process, due to the lack of dimensional measurement tools, the cargo size estimate is not accurate enough, which in turn leads to the problem of mismatch between the vehicle and the cargo.
By acquiring point cloud data and image data, the image segmentation model is used to segment the image area of the target object from the image data, and the target point cloud is obtained from the point cloud data, and the size information of the target object is determined based on the target point cloud, so as to realize the object's size information based on the target point cloud, Accurate measurement of dimensions.
Improves the accuracy and convenience of object size measurement, simplifies user interaction, and is suitable for a variety of electronic devices such as mobile terminals and tablets.
Smart Images

Figure CN118982569A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an object size measurement method, device, equipment and storage medium. Background Art
[0002] In life, we often need to estimate the size of objects. For example, when there is a need to transport goods, we need to estimate the size of the goods in order to determine the type of vehicle to call. However, due to the lack of size measurement tools, the estimated size is not accurate enough, resulting in a mismatch between the vehicle and the goods. Summary of the invention
[0003] The embodiments of the present application provide a method, device, equipment and storage medium for measuring the size of an object to achieve convenient and accurate measurement of the size of an object.
[0004] In order to solve the above technical problems, this application is implemented as follows: In a first aspect, an embodiment of the present application provides a method for measuring the size of an object, comprising: Acquire point cloud data and image data; Upon receiving a first input of image data, obtaining target coordinate data corresponding to the first input; Based on the image segmentation model, a target image region of the target object corresponding to the target coordinate data is segmented from the image data; Obtaining a target point cloud corresponding to a target image area from the point cloud data; The size information of the target object is determined based on the target point cloud.
[0005] In a second aspect, an embodiment of the present application further provides an object size measurement device, including: A first acquisition module, used for acquiring point cloud data and image data; A second acquisition module, upon receiving a first input of image data, acquires target coordinate data corresponding to the first input; A segmentation module, used for segmenting a target image region of a target object corresponding to the target coordinate data from the image data based on an image segmentation model; A third acquisition module is used to acquire a target point cloud corresponding to the target image area from the point cloud data; The determination module is used to determine the size information of the target object based on the target point cloud.
[0006] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the above method is implemented when the processor executes the computer program.
[0007] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program implements the above method when executed by a processor.
[0008] The object size measurement method provided in the embodiment of the present application obtains point cloud data and image data, and when receiving a first input of the image data, obtains the target coordinate data corresponding to the first input, and based on the image segmentation model, segments the target image area of the target object corresponding to the target coordinate data from the image data, obtains the target point cloud corresponding to the target image area from the point cloud data, and determines the size information of the target object based on the target point cloud. The embodiment of the present application is based on the image segmentation model, and can accurately segment the target image area of the target object according to the first input, and can calculate the size information of the target object from the spatial level based on the target point cloud corresponding to the target image area, thereby improving the measurement accuracy of the target object size information. At the same time, the user interaction is simple and the size measurement convenience is high. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 A schematic diagram of a flow chart of an object size measurement method provided in an embodiment of the present application; Figure 2 A flowchart of an application example of the object size measurement method; Figure 3 A flowchart diagram of another application example of the object size measurement method; Figure 4 A schematic diagram of the structure of an object size measurement device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0010] In order to make the technical problems, technical solutions and advantages to be solved by the application clearer, the following will be described in detail in conjunction with the accompanying drawings and specific embodiments. In the following description, specific details such as specific configurations and components are provided only to help fully understand the embodiments of the application. Therefore, it should be clear to those skilled in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the application. In addition, for clarity and brevity, the description of known functions and structures has been omitted.
[0011] Unless otherwise defined, the technical terms or scientific terms used in this application shall have the usual meanings understood by persons with ordinary skills in the field to which this application belongs. The words "first", "second" and similar words used in this application do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, the words "one" or "an" and similar words do not indicate a quantitative limitation, but indicate the presence of at least one.
[0012] like Figure 1As shown, the object size measurement method provided in the embodiment of the present application includes: Step 101, obtaining point cloud data and image data; Step 102, when receiving a first input of image data, obtaining target coordinate data corresponding to the first input; Step 103, based on the image segmentation model, segmenting the target image area of the target object corresponding to the target coordinate data from the image data; Step 104, obtaining a target point cloud corresponding to the target image area from the point cloud data; Step 105: Determine the size information of the target object based on the target point cloud.
[0013] The object size measurement method provided in the embodiment of the present application can be applied to electronic devices such as mobile terminals, wearable devices, tablet computers, etc., and this embodiment does not specifically limit it. Of course, in some feasible implementations, there may be a process in which the mobile terminal interacts with the server to implement the logic of the entire method. To simplify the description, it can be considered that the topology of the mobile terminal and the server together constitute an electronic device. The following will describe the embodiment of the present application using the electronic device as the executor of the method.
[0014] In step 101, the electronic device can obtain point cloud data and image data. For example, the electronic device may include a camera, through which image data can be obtained, and based on the augmented reality (AR) module built into the electronic device, the image data can be processed into point cloud data. The AR module can be implemented by existing technologies. For example, for electronic devices equipped with an Android system, the AR module may be an AR Core, etc., and for electronic devices equipped with an iOS system, the AR module may be an AR Kit, etc. Of course, it is easy to understand that the above are some examples of AR modules, and do not represent specific limitations on application programs that can implement related functions.
[0015] In some other examples, the electronic device may include a depth camera or a binocular camera. Through these types of cameras, on the one hand, image data can be directly acquired, and on the other hand, the image data can also be converted into point cloud data.
[0016] Of course, in some feasible implementations, the electronic device may include a camera for collecting image data and a radar device for directly collecting point cloud data, such as a laser radar or a millimeter wave radar, etc. The camera and the radar device may be pre-calibrated so that the acquired image data and point cloud data can correspond in different coordinate systems.
[0017] Alternatively, the electronic device may include a radar device to collect point cloud data and convert the point cloud data into a dense point cloud map through point cloud densification technology, and the dense point cloud map may correspond to the above-mentioned image data.
[0018] Generally speaking, point cloud data can carry three-dimensional coordinate information, so the acquired point cloud data can be referred to as 3D point cloud in the following text; while image data is mainly composed of pixels, each pixel has two-dimensional coordinate information in the image coordinate system, and this two-dimensional coordinate information can be referred to as 2D coordinates in the following text.
[0019] In some embodiments, the electronic device may include a display device, and image data may be displayed on the display device, and the user may input the displayed image data, for example, by clicking, double-clicking, or long pressing the image data, or in enhanced display glasses, the user may complete interactive input with the image data through the eyes, etc.
[0020] In some application scenarios, the image data may be presented to the user in the form of a picture, and the user needs to measure the size of an object in the image data. At this time, the user may click on the object in the image data to select the object, and the click input may be considered as the first input. Of course, in actual applications, the form of the first input may not be specifically limited.
[0021] In step 102, when the electronic device receives the first input of the image data, it can obtain the target coordinate data corresponding to the first input. As shown above, each pixel in the image data can have a 2D coordinate in the image coordinate system, and the image data may have image regions of multiple object objects. The 2D coordinates of the image regions of these object objects in the image coordinate system can be considered to be fixed to a certain extent. When the user selects the first input of the object object in the image data, it can be considered as an input of the image region at the corresponding coordinate position from the perspective of the electronic device. Accordingly, the electronic device can obtain the target coordinate data corresponding to the first input.
[0022] It is easy to understand that when the user performs the first input of selecting an object, the clicked object may be some representative points or some parts of the object, not the entire image area of the object. In these cases, the electronic device may need to extract the entire image area of the object clicked by the user in order to obtain accurate size information of the object.
[0023] In step 103, the electronic device may segment a target image region of the target object corresponding to the target coordinate data from the image data based on the image segmentation model.
[0024] In this step, the target object may correspond to an object selected by the user, and the electronic device needs to segment the target image area where the target object is located according to the target coordinate data. Specifically, the electronic device may use an image segmentation model to achieve this purpose.
[0025] In some implementations, the image segmentation model may be a Segment Anything Model (SAM), which can segment various objects in image data and has good universality.
[0026] Of course, in some specific scenarios, such as when only certain types of objects need to be segmented, a dedicated image segmentation model can also be used. For example, in freight, it may be necessary to segment the image of the box, then the target detection model can be used to obtain the image area of the box, and based on the target coordinate data, determine the image area of the box selected by the user, that is, the target image area of the above-mentioned target object, and the electronic device can further segment the target image area. In this case, it can be considered that the image segmentation model includes the target detection model and the segmentation module for image segmentation.
[0027] In step 104 , the electronic device may obtain a target point cloud corresponding to the target image area from the point cloud data.
[0028] There may be a correspondence between the point cloud data and the image data. Specifically, there is a correspondence in coordinates. For example, when point cloud data is obtained based on image data, the correspondence can be directly obtained through the conversion from image data to point cloud data. For another example, when image data and point cloud data are obtained through different sensors, the correspondence between the image data and the point cloud data can be obtained based on the calibration results of the sensor's intrinsic parameters and the extrinsic parameters between different sensors.
[0029] The target image area may include multiple pixels, and the 2D coordinates of each pixel can be obtained. According to the 2D coordinates and the above coordinate correspondence, the target point cloud corresponding to the 3D coordinates of the target image area 2D coordinates can be determined from the point cloud data. Generally speaking, the target point cloud can be considered as the point cloud data of the target object selected by the user.
[0030] When the target point cloud is obtained, the electronic device may determine size information of the target object based on the target point cloud.
[0031] The size information may refer to information such as length, width, height, diameter, etc., or may refer to information such as volume and capacity, and may be set as needed and is not specifically limited here.
[0032] Generally speaking, each point cloud point in the target point cloud can have a corresponding 3D coordinate. In some embodiments, the size information can be determined based on the maximum difference of the target point cloud on each coordinate axis; in other embodiments, a bounding box can be generated for the target point cloud, and the size information can be determined based on the bounding box. Of course, in practical applications, point cloud filtering, clustering or other means can also be combined to improve the efficiency or accuracy of determining size information, which will not be explained one by one here.
[0033] The object size measurement method provided in the embodiment of the present application obtains point cloud data and image data, and when receiving a first input of the image data, obtains the target coordinate data corresponding to the first input, and based on the image segmentation model, segments the target image area of the target object corresponding to the target coordinate data from the image data, obtains the target point cloud corresponding to the target image area from the point cloud data, and determines the size information of the target object based on the target point cloud. The embodiment of the present application is based on the image segmentation model, and can accurately segment the target image area of the target object according to the first input, and can calculate the size information of the target object from the spatial level based on the target point cloud corresponding to the target image area, thereby improving the measurement accuracy of the target object size information. At the same time, the user interaction is simple and the size measurement convenience is high.
[0034] In one example, the image segmentation model may be a SAM, which may be located on the server side. Accordingly, based on the image segmentation model, a target image area of a target object corresponding to target coordinate data is segmented from the image data. For example, an electronic device such as a mobile terminal sends the image data and target coordinate data to the server where the SAM is located, and the server segments a target image area of the target object corresponding to the target coordinate data from the image data, and sends information related to the target image area to the mobile terminal.
[0035] Segmenting image data based on SAM can achieve segmentation of image regions of various objects. It is convenient and easy to use and has a wide range of applications.
[0036] Optionally, step 101, obtaining point cloud data and image data, includes: Get image data; Based on the augmented reality module, point cloud data is generated from the image data.
[0037] In this embodiment, the electronic device may include a camera for collecting image data, and the electronic device may have a built-in AR module for generating point cloud data from the image data. As shown above, the AR model may be AR Core or AR Kit, etc., which is not specifically limited here.
[0038] In some embodiments, the electronic device may include a gyroscope, a positioning sensor, etc. When the camera is turned on, the electronic device collects multiple pictures through the camera and obtains the posture information of the electronic device when collecting the pictures. The AR model can create point cloud data based on the multiple pictures or posture information. The above multiple pictures can correspond to image data, and the electronic device can select a picture as image data for user interaction input.
[0039] In other embodiments, the AR module may obtain point cloud data from the image data based on environmental understanding.
[0040] In this embodiment, the electronic device can acquire image data and generate point cloud data in combination with the augmented reality module. That is, the acquisition of point cloud data can be achieved based on conventional camera sensors, which reduces the requirements for setting sensors in the electronic device and reduces the cost of the electronic device.
[0041] As some alternative implementation schemes, the electronic device may include sensors such as a binocular camera or a depth camera. Taking the binocular camera as an example, the electronic device may obtain image data through the binocular camera and obtain point cloud data based on the image data.
[0042] In order to improve the segmentation accuracy or application range of the target image area, in some optional embodiments, the electronic device may allow the user to make multiple first inputs on the image data, and the electronic device determines the target image area according to the multiple first inputs.
[0043] Specifically, in some optional embodiments, step 102, upon receiving a first input of image data, obtaining target coordinate data corresponding to the first input, includes: When receiving multiple first inputs of image data, obtaining multiple target coordinate data corresponding to the multiple first inputs; Accordingly, step 103, based on the image segmentation model, segmenting the target image area of the target object corresponding to the target coordinate data from the image data includes: Based on the image segmentation model, a plurality of image sub-regions corresponding to the plurality of target coordinate data are segmented from the image data; Aggregate multiple image sub-regions to obtain a target image region of the target object.
[0044] In this embodiment, the electronic device can receive multiple first inputs from the user, and corresponding target coordinate data can be obtained for each first input, thereby generating multiple target coordinate data.
[0045] The image segmentation model can segment the corresponding image sub-regions according to each target coordinate data sequentially or in parallel. That is, the first input, the target coordinate data and the image sub-regions can correspond to each other sequentially, and multiple first inputs can obtain multiple image sub-regions.
[0046] The electronic device may aggregate multiple image sub-regions to obtain a target image region of the target object. In some embodiments, the electronic device may simply perform a union operation on multiple image sub-regions to obtain the target image region. Alternatively, in other embodiments, the electronic device may further combine image processing methods such as image filling to obtain the target image region. The specific implementation methods will not be described one by one.
[0047] In combination with some application scenarios, users may need to measure the size of objects such as guitars and floor fans. The features of different parts of these objects may differ greatly. Image segmentation based on the target coordinate data obtained from a single first input may result in the segmented target image area including partial areas of the object. The method of receiving multiple first inputs provided in this embodiment allows the user to input multiple positions of the object in the image data. For objects with large feature differences in each part, the user can select and input these parts at the same time, which helps the electronic device to completely segment the object selected by the user, that is, the target image area of the target object, and improves the accuracy of segmentation.
[0048] In combination with other application scenarios, the user needs to measure the total size of multiple objects. Through multiple first inputs, multiple objects can be selected. The electronic device divides the image sub-regions of each object according to the multiple target coordinate data corresponding to the multiple first inputs, and obtains the target image region of the target object composed of multiple objects after aggregation. It can be seen that based on the implementation of this embodiment, the electronic device can complete the measurement of the total size of multiple objects quickly and efficiently, meeting the user's needs for personalized selection of objects.
[0049] In some implementations, based on the image segmentation model, segmenting a plurality of image sub-regions corresponding to a plurality of target coordinate data from the image data includes: When the number of times the first input is received reaches a preset value, a plurality of image sub-regions corresponding to the plurality of target coordinate data are segmented from the image data based on the image segmentation model.
[0050] In this embodiment, the electronic device can determine whether to enter the image segmentation stage based on the number of first inputs from the user, that is, when the number of first inputs received reaches a preset value, it enters the image segmentation stage and uses the image segmentation model to segment the image sub-areas corresponding to the target coordinate data of each first input.
[0051] The above-mentioned preset value may be a default value, or may be obtained in response to a setting operation of a user, which is not specifically limited here.
[0052] As some alternative technical solutions, preset controls can be displayed on the electronic device. When the user selects an ideal number of image positions through multiple first inputs, the user can make a second input to the preset control, thereby ending the step of making the first input on the image data. In response to the second input, the electronic device transmits multiple target coordinate data corresponding to the multiple first inputs to the image segmentation model for image segmentation. In this way, the user can decide the number of first inputs based on the selection requirements for the object, thereby improving the user experience.
[0053] Optionally, step 105, determining size information of the target object based on the target point cloud, includes: When the point cloud quantity of the target point cloud is greater than or equal to the quantity threshold, size information of the target object is determined based on the target point cloud.
[0054] In some application scenarios, the target image area may be small in size or the point cloud data may be sparsely distributed, resulting in a small number of target point clouds mapped from the target image area. At this time, the target point cloud may not be able to reflect the size information of the target object well.
[0055] Based on the above application scenarios, this embodiment can analyze the number of point clouds of the target point cloud. When the number of point clouds is greater than or equal to the quantity threshold, it is considered that the target point cloud can better reflect the spatial information of the target object, and then determine the size information of the target object based on the target point cloud. In this way, the reliability of the output of the target object size measurement result is ensured.
[0056] In some feasible implementations, when the number of point clouds is less than a number threshold, the electronic device may prompt that the size measurement has failed, or further output a suggestion message, for example, suggesting that the user re-shoot, or re-select the object in the image data, etc.
[0057] Optionally, step 105, determining size information of the target object based on the target point cloud, includes: Generate a bounding box for the target point cloud; Based on the bounding box, determine the size information of the target object.
[0058] In this embodiment, the electronic device can generate a bounding box for the target point cloud, and the bounding box can be an AABB bounding box or an OBB bounding box, etc., which is not specifically limited here. In some embodiments, the electronic device can also further combine algorithms such as clustering to achieve more accurate bounding box generation, etc., which are not illustrated one by one here.
[0059] Through the bounding box, a cubic enclosing structure that is more consistent with the appearance of the target object in different postures can be generated, thereby obtaining a more ideal length, width and height size, and achieving more accurate measurement of the target object size.
[0060] Of course, in some feasible solutions, the bounding box may not be limited to a cubic shape, but may also be a spherical or cylindrical shape, etc., which is not specifically limited here.
[0061] As shown above, the size information of the target object may be length, width, and height, or volume or capacity obtained based on the length, width, and height, and may be set according to actual needs.
[0062] The object size measurement method provided in the embodiment of the present application is described below with reference to several specific application examples.
[0063] like Figure 2 As shown, in an application example, the implementation process of the object size measurement method may include: 1. Open the camera and generate 3D point cloud (corresponding point cloud data): There are many 3D point cloud generation technologies to choose from. In this application example, the 3D information of the real object is obtained through the camera; 2. Save the point cloud and its 3D coordinates: through a Map set of fixed size (the first added node will be deleted after exceeding the size), the key is the coordinate id, the value is the 3D coordinate (x, y, z), and save it in memory; 3. User clicks to select an object: The user can select any object in the camera image; 4. Record the click 2D coordinates (corresponding to the target coordinate data): obtain the 2D coordinates of the Android system by monitoring Android input; 5. Capture the current frame and convert the captured image into MAT format: When step 4 is clicked, a frame capture operation is performed synchronously to obtain the current frame and convert it into MAT format for OpenCV to modify the image; 6. Input the 2D coordinates of the click point and the 3D coordinates of the point cloud: Aggregate the data of step 2 and step 4 for input of step 7; 7. SAM segmentation: SAM is a 2D image segmentation technique. The segmentation area (corresponding to the target image area) is specified in step 4, and then the 3D coordinates corresponding to the segmentation area (corresponding to the target point cloud) are output; 8. Return 3D point cloud: Return the output of step 7; 9. Whether the current point meets the minimum generation box: The minimum generation box requires at least n points (configurable) for spatial matrix generation. Only when the conditions are met can step 10 be performed; 10. Through the output of step 8, a rectangular box (corresponding to the bounding box) surrounding all 3D point clouds is generated.
[0064] like Figure 3 As shown, in another application example, the implementation process of the object size measurement method may include: 1. Turn on the camera and generate 3D point cloud: There are many 3D point cloud generation technologies to choose from. In this patent, this is the first step to obtain 3D information of real objects through the camera; 2. Save the point cloud and its 3D coordinates: through a Map set of fixed size (the first added node will be deleted after exceeding the size), the key is the coordinate id, the value is the 3D coordinate (x, y, z), and save it in memory; 3. User enters edit mode: User enters edit mode, which means locking on the current frame. The user can select multiple objects in the current frame; 4. Capture the current frame, save the current frame, and display the current page: After entering the editing mode, the frame is fixed, that is, the user sees the page in the form of a picture; 5. The user selects multiple key points on the current page: The user selects multiple key points on the page in the form of an image; 6. Record multiple selected 2D coordinates: By monitoring Android input, obtain the 2D coordinates of the Android system. One click corresponds to one 2D coordinate and is stored in a list; 7. Whether the selection limit is reached: The upper limit can be customized. When the number of clicks is equal to the upper limit, go to step 8; 8. Exit the edit mode and notify the background thread to perform SAM: the edit mode is exited, the user resumes camera browsing, and the background thread is started to perform SAM; 9. Input the currently selected multiple 2D coordinates and point cloud 3D coordinates: aggregate the data of step 2 and step 6 for input of step 10; 10. Multiple SAM segmentation: SAM is a 2D image segmentation technology. According to the number of 2D points input in step 6, SAM segmentation is performed in sequence; 11. Result aggregation: Aggregate the results of multiple SAM segmentations for the output of step 12; 12. Return aggregated 3D point cloud: Return the coordinates of the entire 3D point cloud; 13. Whether the current point meets the minimum generation box: The minimum generation box requires at least n points (configurable) for spatial matrix generation. Only when the conditions are met can step 14 be performed; 14. Through the output of step 12, a rectangular box is generated that encloses all 3D point clouds.
[0065] Based on the above application examples, it can be seen that the embodiments of the present application utilize point cloud and SAM technology to segment objects to achieve the measurement of object volume; through the SAM point selection method to segment the area, one click can directly segment the area of the object, and then convert it into the corresponding 3D coordinates, which is fast and efficient; through the SAM point selection method to segment the area, multiple clicks can directly segment the objects corresponding to multiple points, and then the areas are aggregated together, which is fast and efficient, meeting the user's personalized selection of objects.
[0066] Based on the implementation of the above two application examples, by combining point cloud with the technology of single-click SAM object segmentation, the volume measurement of objects is achieved with low interaction cost; by combining point cloud with the technology of multiple-click SAM object segmentation, the effect is better under mixed objects, and the volume measurement of objects can be achieved.
[0067] like Figure 4 As shown, the embodiment of the present application also provides an object size measurement device, including: A first acquisition module 401 is used to acquire point cloud data and image data; The second acquisition module 402, upon receiving a first input of image data, acquires target coordinate data corresponding to the first input; The segmentation module 403 is used to segment a target image region of the target object corresponding to the target coordinate data from the image data based on the image segmentation model; The third acquisition module 404 is used to acquire a target point cloud corresponding to the target image area from the point cloud data; The determination module 405 is used to determine the size information of the target object based on the target point cloud.
[0068] Optionally, the first acquisition module 401 may be specifically used for: Get image data; Based on the augmented reality module, point cloud data is generated from the image data.
[0069] Optionally, the second acquisition module 402 may be specifically configured to: When receiving multiple first inputs of image data, obtaining multiple target coordinate data corresponding to the multiple first inputs; Accordingly, the segmentation module 403 may be specifically used for: Based on the image segmentation model, a plurality of image sub-regions corresponding to the plurality of target coordinate data are segmented from the image data; Aggregate multiple image sub-regions to obtain a target image region of the target object.
[0070] Optionally, the segmentation module 403 may be specifically used for: When the number of times the first input is received reaches a preset value, a plurality of image sub-regions corresponding to the plurality of target coordinate data are segmented from the image data based on the image segmentation model.
[0071] Optionally, the determination module 405 may be specifically configured to: When the point cloud quantity of the target point cloud is greater than or equal to the quantity threshold, size information of the target object is determined based on the target point cloud.
[0072] Optionally, the determination module 405 may be specifically configured to: Generate a bounding box for the target point cloud; Based on the bounding box, determine the size information of the target object.
[0073] Optionally, the image segmentation model is a segmentation-everything model.
[0074] The object size measurement device provided in the embodiment of the present application is a device authority corresponding to the object size measurement method in the above embodiment. The method embodiment can be applied to the device embodiment and achieve the same technical effect, which will not be repeated here.
[0075] An embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned object size measurement method when executing the computer program.
[0076] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned object size measurement method is implemented.
[0077] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0078] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0079] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0080] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0081] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0082] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0083] If the integrated module / 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 present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. Computer-readable media may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc.
[0084] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for measuring object size, characterized in that: include: Acquire point cloud data and image data; Upon receiving a first input of the image data, acquiring target coordinate data corresponding to the first input; Based on the image segmentation model, segmenting a target image region of the target object corresponding to the target coordinate data from the image data; Acquire a target point cloud corresponding to the target image area from the point cloud data; The size information of the target object is determined based on the target point cloud.
2. The method according to claim 1, characterized in that The step of acquiring point cloud data and image data comprises: Get image data; Based on the augmented reality module, point cloud data is generated for the image data.
3. The method according to claim 1, characterized in that The step of, upon receiving a first input of the image data, obtaining target coordinate data corresponding to the first input, comprises: When receiving multiple first inputs of the image data, acquiring multiple target coordinate data corresponding to the multiple first inputs; The step of segmenting a target image region of the target object corresponding to the target coordinate data from the image data based on the image segmentation model includes: Based on the image segmentation model, a plurality of image sub-regions corresponding to the plurality of target coordinate data are segmented from the image data; The multiple image sub-regions are aggregated to obtain a target image region of the target object.
4. The method according to claim 3, characterized in that The step of segmenting the image data into a plurality of image sub-regions corresponding to the plurality of target coordinate data based on the image segmentation model comprises: When the number of times the first input is received reaches a preset value, a plurality of image sub-regions corresponding to the plurality of target coordinate data are segmented from the image data based on an image segmentation model.
5. The method according to claim 1, characterized in that The determining the size information of the target object based on the target point cloud includes: When the number of point clouds of the target point cloud is greater than or equal to a number threshold, size information of the target object is determined based on the target point cloud.
6. The method according to claim 1, characterized in that The determining the size information of the target object based on the target point cloud includes: Generating a bounding box for the target point cloud; Based on the bounding box, size information of the target object is determined.
7. The method according to claim 1, characterized in that The image segmentation model is a segmentation model.
8. An object size measuring device, characterized in that: include: A first acquisition module, used for acquiring point cloud data and image data; A second acquisition module, upon receiving a first input of the image data, acquires target coordinate data corresponding to the first input; A segmentation module, used for segmenting a target image region of a target object corresponding to the target coordinate data from the image data based on an image segmentation model; A third acquisition module, used to acquire a target point cloud corresponding to the target image area from the point cloud data; A determination module is used to determine the size information of the target object based on the target point cloud.
9. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
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 method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Dimension feature-oriented binocular vision retest guiding method
CN122415604A
A size feature-oriented binocular vision re-measurement guiding method
CN122415604B
