Size measurement method and device, computer device and computer readable storage medium
By using a virtual probe to construct a three-dimensional reference coordinate system for dimensional measurement in a 2.5D depth image, the problems of insufficient speed, accuracy and applicability in traditional methods are solved, and high-precision measurement of workpieces of various materials and complex shapes is achieved.
Patent Information
- Application Number
- CN202411788887.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2044-12-06
AI Technical Summary
Existing contact and non-contact dimensional measurement methods have shortcomings in terms of speed, accuracy, and applicability, especially for measuring soft materials and complex-shaped workpieces.
A virtual probe is used to determine the target location and coverage area in a 2.5D depth image. A three-dimensional reference coordinate system is constructed by extracting depth information for size measurement, avoiding dependence on mechanical probes and point cloud data.
It improves the accuracy and applicability of dimensional measurement, is suitable for workpieces of various materials and complex shapes, and reduces dependence on the environment.
Smart Images

Figure CN119714053B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of size measurement, in particular to a size measurement method and device, computer equipment and a computer readable storage medium. BACKGROUND
[0002] In the industrial manufacturing and quality control process, accurate size measurement is an important link to ensure product quality.
[0003] Traditional size measurement methods mainly include contact measurement and non-contact measurement. Among them, contact measurement refers to using a mechanical probe to contact the surface of a workpiece, and determining the geometric size and shape of the workpiece through the position of the probe. Non-contact measurement refers to scanning the surface of a workpiece with a laser beam, calculating the distance through the time or phase difference of the reflected light, generating point cloud data, and then performing size measurement according to the point cloud data.
[0004] However, these two size measurement methods have certain disadvantages: when size measurement is performed by a mechanical probe, the speed is slow, the environmental requirements are high, and it is not suitable for soft materials or complex-shaped workpieces; when size measurement is performed based on point cloud data, the accuracy is relatively low and the surface characteristics of the measured object are required to be high. Therefore, a new size measurement method is urgently needed. SUMMARY
[0005] Therefore, it is necessary to provide a size measurement method, device, computer equipment, computer readable storage medium and computer program product to improve the accuracy of size measurement.
[0006] In a first aspect, the present application provides a size measurement method, comprising:
[0007] Obtaining a 2.5D depth image of a surface of a measured object, and establishing a two-dimensional reference coordinate system in the 2.5D depth image; wherein the 2.5D depth image is a two-dimensional image including depth information;
[0008] In the two-dimensional reference coordinate system, determining a target position and a coverage area of a virtual probe in the 2.5D depth image;
[0009] Through the virtual probe, extracting depth information from the pixel points in the 2.5D depth image within the coverage area, and determining a three-dimensional point based on the depth information and the target position;
[0010] Based on the three-dimensional point and the two-dimensional reference coordinate system, constructing a three-dimensional reference coordinate system;
[0011] Based on the three-dimensional reference coordinate system, performing size measurement on the measured object to obtain a size measurement result.
[0012] In a second aspect, the present application provides a size measurement device, comprising:
[0013] an acquisition module configured to acquire a 2.5D depth image of a surface of an object to be measured; wherein the 2.5D depth image refers to a two-dimensional image comprising depth information;
[0014] a first coordinate system establishment module configured to establish a two-dimensional reference coordinate system in the 2.5D depth image;
[0015] a position determination module configured to determine a target position and a coverage area of a virtual probe in the 2.5D depth image under the two-dimensional reference coordinate system;
[0016] a point calculation module configured to extract depth information from pixel points in the 2.5D depth image within the coverage area by the virtual probe, and determine a three-dimensional point based on the depth information and the target position;
[0017] a second coordinate system establishment module configured to construct a three-dimensional reference coordinate system based on the three-dimensional point and the two-dimensional reference coordinate system;
[0018] a measurement module configured to perform size measurement on the object to be measured based on the three-dimensional reference coordinate system, and obtain a size measurement result.
[0019] In a third aspect, the present application provides a computer device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the steps in the above method when executing the computer program.
[0020] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps in the above method when executed by a processor.
[0021] In a fifth aspect, the present application provides a computer program product, which comprises a computer program, and the computer program implements the steps in the above method when executed by a processor.
[0022] The above size measurement method, device, computer device, computer readable storage medium and computer program product obtain a three-dimensional point in the collected 2.5D depth image by a virtual probe, construct a three-dimensional reference coordinate system in combination with a two-dimensional reference coordinate system established in the 2.5D depth image, and then perform size measurement based on the three-dimensional reference coordinate system. Thus, the size measurement of the present application no longer depends on a mechanical probe or point cloud data, and avoids the problem of low size measurement accuracy caused by the surface characteristics or material of the object to be measured. BRIEF DESCRIPTION OF DRAWINGS
[0023] Figure 1 An application environment diagram of a size measurement method provided by an embodiment of the present application;
[0024] Figure 2 A flowchart of a size measurement method provided for an embodiment of the present application is shown in the figure;
[0025] Figure 3 A structural block diagram of a size measurement device provided for an embodiment of the present application is shown in the figure;
[0026] Figure 4 An internal structure diagram of a computer device provided for an embodiment of the present application is shown in the figure;
[0027] Figure 5 An internal structure diagram of another computer device provided for an embodiment of the present application is shown in the figure;
[0028] Figure 6 An internal structure diagram of a computer readable storage medium provided for an embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application will be further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.
[0030] The size measurement method provided by the embodiments of the present application can be applied in the application environment as shown in Figure 1 . Among them, the terminal 102 communicates with the server 104 through the communication network. The data storage system can store the data required to be processed by the server 104. The data storage system can be integrated on the server 104, or placed on the cloud or other network servers. Among them, the terminal 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices, and the Internet of Things devices can be smart speakers, smart televisions, smart air conditioners, smart vehicle devices, image acquisition devices, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The server 104 can be realized by an independent server or a server cluster composed of multiple servers.
[0031] As shown in Figure 2 , the present application provides a size measurement method. Taking the terminal 102 or the server 104 in Figure 1 as an example to illustrate the method. It can be understood that the computer device can include at least one of the terminal and the server. The method includes the following steps:
[0032] S201, obtaining a 2.5D depth image of a surface of an object to be measured, and establishing a two-dimensional reference coordinate system in the 2.5D depth image.
[0033] The 2.5D depth image is a two-dimensional image including depth information, and is obtained by a line laser scanning method or a structured light projection method. Specifically, the process of obtaining the 2.5D depth image by the line laser scanning method includes: aiming a line laser emitter at the object to be measured, so that the laser line emitted by the line laser emitter is vertically projected onto the surface of the object to be measured. At this time, due to the ups and downs of the surface of the object to be measured, the laser line on the surface of the object to be measured will present different degrees of deformation. At the same time, an industrial camera captures the laser line on the surface of the object to be measured from a specific angle to obtain an image containing the laser line projection. By analyzing the image captured by the camera, the position of the laser line in the image is determined. For each pixel point in the image, according to its position in the image and the pre-determined geometric relationship (such as relative position, angle, etc.) between the camera and the laser emitter, the distance from the surface of the object to be measured corresponding to the pixel point to the camera is calculated, which is the depth value of the pixel point. The above projection, shooting and depth calculation process is repeated for different positions on the surface of the object to be measured, and the depth information of each part of the surface of the object to be measured is gradually obtained by scanning. Finally, the depth information is integrated according to the pixel coordinates of the image to generate a 2.5D depth image of the surface of the object to be measured.
[0034] The process of obtaining the 2.5D depth image by the structured light projection method includes: a structured light projector projects a specific pattern of light onto the surface of the object to be measured. When the light is projected onto the surface of the object to be measured, due to the different shapes of the surface of the object to be measured, the reflected structured light pattern will be deformed. An industrial camera captures the reflected structured light pattern on the surface of the object to be measured from a specific angle to obtain an image containing the deformed structured light pattern. By analyzing the deformed structured light pattern captured by the camera, according to the pre-known original shape of the structured light pattern and the geometric relationship (including relative position, angle, etc.) between the camera and the projector, the depth information of each pixel point on the surface of the object to be measured is calculated. Like the line laser scanning method, by performing multiple projection, shooting and depth calculation operations on different positions on the surface of the object to be measured, the depth information of each part of the surface of the object to be measured is obtained, and then the depth information is integrated according to the pixel coordinates of the image to generate a 2.5D depth image of the surface of the object to be measured.
[0035] In the embodiments of the present application, after the 2.5D depth image of the surface of the object to be measured is acquired, a two-dimensional reference coordinate system is established in the 2.5D depth image. One way to establish the two-dimensional reference coordinate system can be to measure the 2.5D depth image by using different caliper tools, to determine the origin position and the coordinate axis direction according to the measurement results, and to determine the scale of the coordinate axis according to the resolution of the image or the measurement requirement, so as to obtain the two-dimensional reference coordinate system. Another way to establish the two-dimensional reference coordinate system can be to extract a corner point or an edge point from the 2.5D depth image, and to take the corner point or the edge point as the origin; to determine the coordinate axis direction according to the horizontal direction and the vertical direction, or to further adjust the coordinate axis of the horizontal direction or the vertical direction according to the characteristics of the object to be measured in the image; and to determine the scale of the coordinate axis according to the resolution of the image or the measurement requirement, so as to obtain the two-dimensional reference coordinate system.
[0036] S202, determining the target position and the coverage area of the virtual probe in the 2.5D depth image under the two-dimensional reference coordinate system.
[0037] The virtual probe is a tool that has a function similar to that of an actual physical probe and is realized by software simulation in a specific measurement, analysis or processing scenario. The virtual probe is mainly used to acquire information of a specific position of an object, such as in an application of size measurement based on a 2.5D depth image, the virtual probe can select a point on the image, and acquire three-dimensional point data that can be used for subsequent measurement and analysis by processing pixel information and depth information corresponding to the point.
[0038] In the embodiments of the present application, to select a point from the 2.5D depth image by using the virtual probe, the target position and the coverage area of the virtual probe in the 2.5D depth image are first determined. The target position can be a two-dimensional coordinate determined by a user (for example, a measurement personnel) based on an interactive mode provided by the virtual probe, and the interactive mode can include a click-based interaction and a coordinate input-based interaction. In addition, the number of target positions can be multiple. For the case that the number of target positions is multiple, after each target position is determined, a region centered at the target position is determined according to the shape and size of the virtual probe, and the region is taken as the coverage area of the virtual probe in the 2.5D depth image. That is, each target position corresponds to a coverage area.
[0039] S203, extracting depth information from the pixel points in the coverage area in the 2.5D depth image by using the virtual probe, and determining a three-dimensional point according to the depth information and the target position.
[0040] In the embodiments of the present application, for the coverage area corresponding to any target position, depth information can be extracted from each pixel point in the coverage area by a virtual probe, and then the average or weighted average of the depth information of each pixel point in the coverage area is calculated, and the calculation result is taken as the final depth information of the coverage area. Alternatively, the distribution of the depth information of each pixel point in the coverage area is determined, and the final depth information is extracted according to the distribution. Further, a three-dimensional point is constructed according to the two-dimensional coordinates of the target position and the final depth information extracted from the coverage area corresponding to the target position. For example, the coordinates of the target position are (x, y), and the depth information of the coverage area corresponding to the target position is z, and then the determined three-dimensional point is (x, y, z). It can be understood that for the case of multiple target positions, multiple three-dimensional points can be determined through the above process.
[0041] In S204, a three-dimensional reference coordinate system is constructed based on the three-dimensional point and the two-dimensional reference coordinate system.
[0042] In the embodiments of the present application, since the number of determined three-dimensional points is multiple, plane fitting can be performed based on the multiple three-dimensional points to obtain a target plane. The two-dimensional reference coordinate system is projected into the target plane to obtain the two-dimensional reference coordinate system of the target plane. The normal vector of the target plane is taken as the Z axis, and thus the three-dimensional reference coordinate system is obtained.
[0043] In S205, a size measurement is performed on the object to be measured based on the three-dimensional reference coordinate system, and a size measurement result is obtained.
[0044] After obtaining the three-dimensional reference coordinate system, a point can be selected in the 2.5D depth image by a virtual probe, and a size calculation is performed according to the three-dimensional coordinates of the point in the three-dimensional reference coordinate system to obtain a size result. For some geometric shapes to be detected, such as a plane, a cylinder, a sphere, etc., a group of virtual probes can be placed in the corresponding region of the image, and fitting is performed according to the 3D points obtained by the virtual probes. Similarly, if the planeness of a region needs to be calculated, an appropriate number of virtual probes are placed in the region, and the coplanarity of the group of 3D points is calculated.
[0045] In the embodiments of the present application, a three-dimensional reference coordinate system is constructed by obtaining three-dimensional points in the collected 2.5D depth image by a virtual probe and combining the two-dimensional reference coordinate system established in the 2.5D depth image, and then a size measurement is performed based on the three-dimensional reference coordinate system. Therefore, the size measurement of the present application no longer depends on mechanical probes or point cloud data, and the problem of low size measurement accuracy caused by the surface characteristics or material of the object to be measured is avoided.
[0046] In some embodiments, under the two-dimensional reference coordinate system, the target position and the coverage area of the virtual probe in the 2.5D depth image are determined, comprising:
[0047] determine a target position of the virtual probe in the 2.5D depth image under a two-dimensional reference coordinate system; the target position is determined by the user according to an interaction mode of the virtual probe;
[0048] obtain a shape and a size parameter of the virtual probe configured by the user;
[0049] determine a coverage area of the virtual probe in the 2.5D depth image according to the target position, the shape and the size parameter of the virtual probe.
[0050] Specifically, the interaction mode of the virtual probe refers to a manner in which the user configures a position of the virtual probe. In this way, the user can determine the target position of the virtual probe in the 2.5D depth image through click operation-based interaction and / or coordinate input-based interaction, where the number of the determined target positions can be multiple.
[0051] In this embodiment, the user determines the target position of the virtual probe in the 2.5D depth image through click operation-based interaction and / or coordinate input-based interaction, and configures the shape and the size parameter of the virtual probe at the same time; where the shape can include a rectangle, a circle, and an ellipse; in this way, the size parameter can be a radius of the circle, a length and a width of the rectangle, and a major axis and a minor axis of the ellipse.
[0052] In this embodiment, when determining the coverage area, a region can be determined from the 2.5D depth image according to the target position, the shape and the size parameter of the virtual probe, and the region can be taken as the coverage area of the virtual probe corresponding to the target position. For example, if the virtual probe is a circle and the size parameter is a radius R, a circular region with the target position as the center and R as the radius can be determined in the 2.5D depth image, and the circular region is the coverage area of the virtual probe.
[0053] In this embodiment, the coverage area of the virtual probe can be determined to limit a point-taking area of the virtual probe, which provides a basis for subsequent extraction of depth information.
[0054] In some embodiments, the interaction mode of the virtual probe includes click operation-based interaction; and determining the target position of the virtual probe in the 2.5D depth image includes:
[0055] in response to a click operation performed by the user in the 2.5D depth image, taking a click position of the user in the two-dimensional reference coordinate system as the target position of the virtual probe in the 2.5D depth image.
[0056] In this embodiment, the clicking operation performed by the user in the 2.5D depth image can be generated by the user through an input device, for example, a mouse device. In addition, if the computer device implementing the method of the present application supports touch screen function, the clicking operation can also be generated by the user directly touching the 2.5D depth image displayed on the computer device. In this way, the target position can be determined by identifying the coordinates of the clicking position in the two-dimensional reference coordinate system.
[0057] It can be understood that, by using the interaction mode based on the clicking operation, the determination of the target position is more convenient, and the efficiency of determining the target position can be improved.
[0058] In some embodiments, the interaction mode of the virtual probe includes a coordinate input-based interaction; and determining the target position of the virtual probe in the 2.5D depth image includes:
[0059] Based on the two-dimensional reference coordinate system, the target position of the virtual probe in the 2.5D depth image is determined according to the position coordinates input by the user.
[0060] Specifically, in response to the user selecting the coordinate input-based interaction, a coordinate input interface is displayed to the user, and the user can input a plurality of two-dimensional position coordinates in the coordinate input interface; and in response to the user triggering a batch import operation, a plurality of target positions are determined in the 2.5D depth image according to the plurality of two-dimensional position coordinates input by the user.
[0061] It can be understood that, by determining the target position of the virtual probe in the 2.5D depth image through the directly input position coordinates, the determined target position can be more accurate.
[0062] In some embodiments, the depth information is extracted from the pixel points in the 2.5D depth image within the coverage area by the virtual probe, including:
[0063] The pixel points in the 2.5D depth image within the coverage area are filtered by the virtual probe, and the depth information is extracted from the filtered pixel points.
[0064] Specifically, the virtual probe can filter the pixel points within the coverage area based on any one of mean filtering, median filtering, and Gaussian filtering, to remove noise or interference within the coverage area; and then extract the depth information from the filtered pixel points; wherein the way of extracting the depth information can be: calculating the average value or weighted average value of the depth information of the filtered pixel points within the coverage area, and taking the calculation result as the final depth information of the coverage area; or determining the distribution of the depth information of the filtered pixel points within the coverage area, and extracting the final depth information according to the distribution.
[0065] It can be understood that, through the filtering operation, the noise or interference in the coverage area can be eliminated, so that the extracted depth information is more accurate.
[0066] In some embodiments, based on the three-dimensional point position and the two-dimensional reference coordinate system, a three-dimensional reference coordinate system is constructed, including:
[0067] According to the determined three-dimensional point position, a target plane is fitted in the three-dimensional space;
[0068] The two-dimensional reference coordinate system is projected onto the target plane, and a three-dimensional reference coordinate system is established.
[0069] Specifically, since the number of determined three-dimensional point positions is multiple, a preset fitting algorithm can be used to perform plane fitting on the multiple three-dimensional point positions to obtain a target plane; wherein the preset fitting algorithm can be a least squares algorithm, a random sample consensus algorithm or a principal component analysis algorithm; the two-dimensional reference coordinate system is projected into the target plane to obtain a two-dimensional reference coordinate system of the target plane; the normal vector of the target plane is taken as the Z axis, and thus a three-dimensional reference coordinate system is obtained.
[0070] It can be understood that the establishment of the three-dimensional reference coordinate system is the basis for subsequent three-dimensional measurement.
[0071] In some embodiments, a two-dimensional reference coordinate system is established in a 2.5D depth image, including:
[0072] Through the circle caliper tool and the straight line caliper tool, the origin position and the coordinate axis direction are determined in the 2.5D depth image;
[0073] Based on the origin position and the coordinate axis direction, a two-dimensional reference coordinate system is constructed.
[0074] Specifically, the circular feature in the 2.5D depth image is measured by the circle caliper tool, and the center position of the circular feature is taken as the origin of the two-dimensional reference coordinate system; in the 2.5D depth image, a reference straight line related to the shape, structure or measurement requirement of the object is determined, and the selected reference straight line is measured using the straight line caliper tool; if the selected reference straight line is approximately parallel to the horizontal direction, the direction of the reference straight line can be determined as the X axis direction, and the Y axis direction can be determined according to the right-hand rule (or other predetermined rules). Or, if the reference straight line is approximately parallel to the vertical direction, the direction of the reference straight line can be determined as the Y axis direction, and the X axis direction can be determined accordingly. Finally, the scale of the coordinate axis can be marked according to the resolution of the image and the measurement requirement.
[0075] It can be understood that, based on the caliper tool, the two-dimensional reference coordinate system is constructed, so that the constructed two-dimensional reference coordinate system can closely fit the actual shape and structure of the object in the image.
[0076] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, the steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, the execution of the steps is not strictly limited in sequence, and the steps can be executed in other sequences. Moreover, at least some of the steps in the flowcharts involved in the above-described embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of the steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least part of other steps or steps or stages in other steps.
[0077] Based on the same inventive concept, the embodiments of the present application also provide a size measurement device. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more size measurement device embodiments provided below can refer to the limitations of the size measurement method in the above text, which will not be repeated here.
[0078] As shown in Figure 3 The embodiments of the present application provide a size measurement device 300, which comprises:
[0079] The acquisition module 301 is configured to acquire a 2.5D depth image of the surface of the object to be measured; wherein the 2.5D depth image is a two-dimensional image including depth information;
[0080] The first coordinate system establishing module 302 is configured to establish a two-dimensional reference coordinate system in the 2.5D depth image;
[0081] The position determining module 303 is configured to determine a target position and a coverage area of a virtual probe in the 2.5D depth image under the two-dimensional reference coordinate system;
[0082] The point position calculating module 304 is configured to extract depth information from pixel points in the 2.5D depth image within the coverage area by the virtual probe, and determine a three-dimensional point position according to the depth information and the target position;
[0083] The second coordinate system establishing module 305 is configured to construct a three-dimensional reference coordinate system based on the three-dimensional point position and the two-dimensional reference coordinate system;
[0084] The measurement module 306 is configured to perform size measurement on the object to be measured based on the three-dimensional reference coordinate system, and obtain a size measurement result.
[0085] In some embodiments, in terms of determining a target position and a coverage area of a virtual probe in a 2.5D depth image under a two-dimensional reference coordinate system, the position determining module 303 is specifically configured to:
[0086] determine a target position of the virtual probe in the 2.5D depth image under a two-dimensional reference coordinate system; the target position is determined by the user according to an interaction mode of the virtual probe;
[0087] obtain a shape and size parameter of the virtual probe configured by the user;
[0088] determine a coverage area of the virtual probe in the 2.5D depth image according to the target position, the shape and size parameter of the virtual probe.
[0089] In some embodiments, the interaction mode of the virtual probe includes an interaction based on a click operation:
[0090] In determining the target position of the virtual probe in the 2.5D depth image, the position determining module 303 is specifically configured to:
[0091] in response to a click operation performed by the user in the 2.5D depth image, take a click position of the user in the two-dimensional reference coordinate system as the target position of the virtual probe in the 2.5D depth image.
[0092] In some embodiments, the interaction mode of the virtual probe includes an interaction based on coordinate input;
[0093] In determining the target position of the virtual probe in the 2.5D depth image, the position determining module 303 is specifically configured to:
[0094] determine the target position of the virtual probe in the 2.5D depth image according to a position coordinate input by the user based on the two-dimensional reference coordinate system.
[0095] In some embodiments, in extracting depth information from pixel points in the 2.5D depth image within the coverage area by the virtual probe, the point calculating module 304 is specifically configured to:
[0096] filter the pixel points in the 2.5D depth image within the coverage area by the virtual probe, and extract the depth information from the filtered pixel points.
[0097] In some embodiments, in constructing a three-dimensional reference coordinate system based on the three-dimensional point and the two-dimensional reference coordinate system, the second coordinate system establishing module 305 is specifically configured to:
[0098] fit a target plane in a three-dimensional space according to the determined three-dimensional point;
[0099] project the two-dimensional reference coordinate system to the target plane, and establish the three-dimensional reference coordinate system.
[0100] In some embodiments, in establishing the two-dimensional reference coordinate system in the 2.5D depth image, the first coordinate system establishing module 302 is specifically configured to:
[0101] The origin position and the coordinate axis direction are determined in the 2.5D depth image through the circle caliper tool and the straight line caliper tool;
[0102] The two-dimensional reference coordinate system is constructed according to the origin position and the coordinate axis direction.
[0103] Each module in the size measuring device can be realized by software, hardware and a combination thereof in whole or in part. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so as to call and execute the operation corresponding to each module by the processor.
[0104] In some embodiments, a computer device is provided, which can be a server, and an internal structure diagram thereof can be as shown in Figure 4 The computer device includes a processor, a memory, an input / output interface (I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store data related to the size measurement method. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals through a network connection. The computer program is executed by the processor to implement the steps of the size measurement method.
[0105] In some embodiments, a computer device is provided, which can be a terminal, and an internal structure diagram thereof can be as shown in Figure 5As shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through the system bus, the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control ability. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program in the non-volatile storage medium to run. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with the external terminal in a wired or wireless manner. The wireless manner can be realized through WIFI, mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by the processor to realize the steps in the above size measurement method. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen; The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the shell of the computer device, or an external keyboard, touchpad or mouse, etc.
[0106] Those skilled in the art can understand that, Figure 4 Or Figure 5 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.
[0107] In some embodiments, a computer device is provided, which includes a memory and a processor, the memory stores a computer program, and the processor executes the computer program to realize the steps in each of the above method embodiments.
[0108] In some embodiments, as Figure 6 A block diagram of the internal structure of a computer readable storage medium is provided, which stores a computer program. The computer program is executed by the processor to realize the steps in each of the above method embodiments.
[0109] In some embodiments, a computer program product is provided, which includes a computer program. The computer program is executed by the processor to realize the steps in each of the above method embodiments.
[0110] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of the country and region.
[0111] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of each method can be included. Any reference to a memory, database or other medium used in the embodiments provided by the present application can include at least one of a non-volatile and volatile memory. The non-volatile memory can include a read-only memory (Read-Only Memory, ROM), a magnetic tape, a floppy disk, a flash memory, an optical storage, a high-density embedded non-volatile memory, a resistive memory (ReRAM), a magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), a ferroelectric memory (Ferroelectric Random Access Memory, FRAM), a phase change memory (Phase Change Memory, PCM), a graphene memory, etc. The volatile memory can include a random access memory (Random Access Memory, RAM) or an external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in the embodiments provided by the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided by the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0112] The technical features of the above embodiments can be combined in any way. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictory, they should be considered as the scope of the present disclosure.
[0113] The above embodiments only express several implementation ways of the present application, and the description is specific and detailed, but it should not be understood as a limitation to the patent scope of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A method of size measurement, characterized by, The method comprises: acquiring a 2.5D depth image of a surface of a to-be-measured object, and establishing a two-dimensional reference coordinate system in the 2.5D depth image; wherein the 2.5D depth image refers to a two-dimensional image comprising depth information; determining a target position and a coverage area of a virtual probe in the 2.5D depth image under the two-dimensional reference coordinate system; extracting depth information from pixel points in the 2.5D depth image within the coverage area by the virtual probe, and determining a three-dimensional point based on the depth information and the target position; constructing a three-dimensional reference coordinate system based on the three-dimensional point and the two-dimensional reference coordinate system; performing size measurement on the to-be-measured object based on the three-dimensional reference coordinate system to obtain a size measurement result; wherein the determining the target position and the coverage area of the virtual probe in the 2.5D depth image under the two-dimensional reference coordinate system comprises: determining the target position of the virtual probe in the 2.5D depth image under the two-dimensional reference coordinate system; the target position is determined by a user according to an interaction mode of the virtual probe; acquiring shape and size parameters of the virtual probe configured by the user; determining the coverage area of the virtual probe in the 2.5D depth image according to the target position, the shape and size parameters of the virtual probe; the extracting depth information from pixel points in the 2.5D depth image within the coverage area by the virtual probe comprises: filtering pixel points in the 2.5D depth image within the coverage area by the virtual probe, and extracting depth information from the filtered pixel points.
2. The method of claim 1, wherein, The interaction mode of the virtual probe comprises click operation-based interaction: the determining the target position of the virtual probe in the 2.5D depth image comprises: in response to a click operation performed by the user in the 2.5D depth image, taking a click position of the user in the two-dimensional reference coordinate system as the target position of the virtual probe in the 2.5D depth image.
3. The method of claim 1, wherein, The interaction mode of the virtual probe comprises coordinate input-based interaction; the determining the target position of the virtual probe in the 2.5D depth image comprises: determining the target position of the virtual probe in the 2.5D depth image according to a position coordinate input by the user based on the two-dimensional reference coordinate system.
4. The method according to any one of claims 1-3, characterized in that, the constructing a three-dimensional reference coordinate system based on the three-dimensional point and the two-dimensional reference coordinate system comprises: fitting a target plane in a three-dimensional space according to the determined three-dimensional point; projecting the two-dimensional reference coordinate system to the target plane, and establishing a three-dimensional reference coordinate system.
5. The method according to any one of claims 1-3, characterized in that, The establishing a two-dimensional reference coordinate system in the 2.5D depth image comprises: determining an origin position and a coordinate axis direction in the 2.5D depth image by a circle caliper tool and a straight line caliper tool; constructing a two-dimensional reference coordinate system based on the origin position and the coordinate axis direction.
6. A size measuring device characterized by, The method comprises: an acquisition module, configured to acquire a 2.5D depth image of a surface of a to-be-measured object; wherein the 2.5D depth image refers to a two-dimensional image comprising depth information; The first coordinate system establishing module is configured to establish a two-dimensional reference coordinate system in the 2.5D depth image. The position determining module is configured to determine, in the two-dimensional reference coordinate system, a target position and a coverage area of a virtual probe in the 2.5D depth image. The point position calculating module is configured to extract, by the virtual probe, depth information from pixel points in the 2.5D depth image that are within the coverage area, and determine a three-dimensional point position according to the depth information and the target position. The second coordinate system establishing module is configured to construct a three-dimensional reference coordinate system based on the three-dimensional point position and the two-dimensional reference coordinate system. The measuring module is configured to perform size measurement on the object to be measured based on the three-dimensional reference coordinate system, and obtain a size measurement result. In the determination of the target position and the coverage area of the virtual probe in the 2.5D depth image in the two-dimensional reference coordinate system, the position determining module is specifically configured to: determine, in the two-dimensional reference coordinate system, a target position of a virtual probe in the 2.5D depth image; the target position is determined by a user according to an interaction mode of the virtual probe; obtain shape and size parameters of the virtual probe configured by the user; determine, according to the target position, the shape and the size parameters of the virtual probe, a coverage area of the virtual probe in the 2.5D depth image; In the extraction of the depth information from the pixel points in the 2.5D depth image that are within the coverage area by the virtual probe, the point position calculating module is specifically configured to: perform filtering processing on the pixel points in the 2.5D depth image that are within the coverage area by the virtual probe, and extract the depth information from the pixel points after the filtering processing.
7. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method of any one of claims 1 to 5.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Object measurement method and device
CN106813568A
Target object 3D measurement parameter acquisition method and system based on depth image, and storage medium
CN110349195A