Dimension measurement method and device, computer equipment and computer readable storage medium
By establishing a two-dimensional reference coordinate system in a 2.5D depth image and determining the target position and coverage area of the virtual probe, extracting depth information and constructing a three-dimensional reference coordinate system, the existing dimension measurement methods are solved, and higher dimensional measurement accuracy is achieved.
Patent Information
- Application Number
- CN202411788887.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-06
AI Technical Summary
The existing dimensional measurement methods have problems such as slow speed, high environmental requirements, not suitable for soft materials or complex-shaped workpieces, low accuracy, and high requirements for surface characteristics of the objects to be tested.
By obtaining the 2.5D depth image of the surface of the object to be measured, a two-dimensional reference coordinate system is established in the 2.5D depth image, the target position and coverage area of the virtual probe are determined, the depth information is extracted and the three-dimensional point is determined, and a three-dimensional reference coordinate system is constructed based on the three-dimensional point and the two-dimensional reference coordinate system, and then the size measurement is performed.
Improve the accuracy of dimensional measurement, avoid the problem of low measurement accuracy caused by surface characteristics or material limitations of the object to be measured, and does not rely on mechanical probes or point cloud data.
Smart Images

Figure CN119714053A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of dimensional measurement technology, and in particular to a dimensional measurement method, apparatus, computer equipment, and computer-readable storage medium. Background Art
[0002] In industrial manufacturing and quality control processes, accurate dimensional measurement is a crucial step in ensuring product quality.
[0003] Traditional dimensional measurement methods mainly include contact measurement and non-contact measurement. Contact measurement involves using a mechanical probe to contact the workpiece surface and determining the workpiece's geometry and shape based on the probe's position. Non-contact measurement involves using a laser beam to scan the workpiece surface, calculating distances based on the time or phase difference of the reflected light, generating point cloud data, and then performing dimensional measurements based on this point cloud data.
[0004] However, these two dimensional measurement methods have certain shortcomings: dimensional measurement using mechanical probes is slow, requires a high level of environmental control, and is not suitable for soft materials or complex-shaped workpieces; dimensional measurement based on point cloud data has relatively low accuracy and requires high surface properties of the object being measured. Therefore, a new dimensional measurement method is urgently needed. Summary of the Invention
[0005] Therefore, it is necessary to provide a dimension measurement method, apparatus, computer equipment, computer-readable storage medium, and computer program product to address the aforementioned technical problems, thereby improving the accuracy of dimension measurement.
[0006] In a first aspect, this application provides a method for measuring dimensions, including:
[0007] Acquire a 2.5D depth image of the surface of the object to be measured, and establish a two-dimensional reference coordinate system in the 2.5D depth image; where the 2.5D depth image refers to a two-dimensional image that includes depth information.
[0008] In a two-dimensional reference coordinate system, determine the target position and coverage area of the virtual probe in the 2.5D depth image;
[0009] Using a virtual probe, depth information is extracted from pixels within the coverage area of a 2.5D depth image, and the three-dimensional point position is determined based on the depth information and the target position.
[0010] Construct a three-dimensional reference coordinate system based on three-dimensional points and a two-dimensional reference coordinate system;
[0011] Based on a three-dimensional reference coordinate system, the dimensions of the object under test are measured to obtain the measurement results.
[0012] Secondly, this application provides a size measuring device, comprising:
[0013] The acquisition module is used to acquire a 2.5D depth image of the surface of the object to be measured; wherein, the 2.5D depth image refers to a two-dimensional image including depth information;
[0014] The first coordinate system establishment module is used to establish a two-dimensional reference coordinate system in a 2.5D depth image;
[0015] The location determination module is used to determine the target location and coverage area of the virtual probe in a 2.5D depth image in a two-dimensional reference coordinate system.
[0016] The point calculation module is used to extract depth information from pixels within the coverage area in a 2.5D depth image using a virtual probe, and to determine the three-dimensional point location based on the depth information and the target location.
[0017] The second coordinate system establishment module is used to construct a three-dimensional reference coordinate system based on three-dimensional points and a two-dimensional reference coordinate system;
[0018] The measurement module is used to measure the size of the object under test based on a three-dimensional reference coordinate system and obtain the size measurement results.
[0019] Thirdly, this application provides a computer device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the method described above.
[0020] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method.
[0021] Fifthly, this application provides a computer program product comprising a computer program that, when executed by a processor, implements the steps of the method described above.
[0022] The aforementioned size measurement method, apparatus, computer equipment, computer-readable storage medium, and computer program product obtain three-dimensional points in the acquired 2.5D depth image through a virtual probe and combine them with a two-dimensional reference coordinate system established in the 2.5D depth image to construct a three-dimensional reference coordinate system. Size measurement is then performed based on the three-dimensional reference coordinate system. In this way, the size measurement of this application no longer relies on mechanical probes or point cloud data, avoiding the problem of low size measurement accuracy due to the surface characteristics or material limitations of the object to be measured. Attached Figure Description
[0023] Figure 1 An application environment diagram of a dimension measurement method provided in this application embodiment;
[0024] Figure 2 A schematic flowchart illustrating a dimension measurement method provided in an embodiment of this application;
[0025] Figure 3 A structural block diagram of a size measuring device provided in an embodiment of this application;
[0026] Figure 4 An internal structural diagram of a computer device provided in an embodiment of this application;
[0027] Figure 5 An internal structural diagram of another computer device provided in an embodiment of this application;
[0028] Figure 6 This is an internal structural diagram of a computer-readable storage medium provided in an embodiment of this application. Detailed Implementation
[0029] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0030] The dimension measurement method provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a communication network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or located on the cloud or other network servers. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart vehicle devices, image acquisition devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0031] like Figure 2 As shown, this application provides a size measurement method, which is applied to... Figure 1 The method will be illustrated using terminal 102 or server 104 as examples. It is understood that the computer device may include at least one of a terminal and a server. The method includes the following steps:
[0032] S201. Obtain a 2.5D depth image of the surface of the object to be measured, and establish a two-dimensional reference coordinate system in the 2.5D depth image.
[0033] A 2.5D depth image refers to a two-dimensional image that includes depth information. 2.5D depth images are obtained through line laser scanning or structured light projection. Specifically, the process of obtaining a 2.5D depth image using line laser scanning includes: aligning a line laser emitter with the object under test, so that the emitted laser line is projected perpendicularly onto the surface of the object. Due to the unevenness of the object's surface, the laser line will exhibit varying degrees of deformation on the surface. Simultaneously, an industrial camera captures an image of the laser line on the object's surface from a specific angle, obtaining 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 in the image, based on its position in the image and the pre-determined geometric relationship between the camera and the laser emitter (such as relative position and angle), the distance from the object's surface to the camera corresponding to that pixel is calculated; this distance is the depth value of that pixel. The above projection, imaging, and depth calculation process is repeated at different locations on the object's surface, gradually acquiring depth information for various parts of the object's surface through scanning. Finally, this depth information was integrated according to the pixel coordinates of the image to generate a 2.5D depth image of the surface of the object under test.
[0034] The process of obtaining a 2.5D depth image using structured light projection involves: a structured light projector projecting light of a specific pattern onto the surface of the object under test. When the light is projected onto the surface, the reflected structured light pattern is deformed due to the varying shapes of the object's surface. An industrial camera captures the reflected structured light pattern from a specific angle, obtaining an image containing the deformed pattern. By analyzing the deformed structured light pattern captured by the camera, and based on the pre-known original shape of the structured light pattern and the geometric relationship between the camera and the projector (including relative positions and angles), the depth information of each pixel on the object's surface is calculated. Similar to line laser scanning, multiple projection, imaging, and depth calculation operations are performed at different locations on the object's surface to obtain depth information for various parts of the surface. This depth information is then integrated according to the pixel coordinates of the image to generate a 2.5D depth image of the object's surface.
[0035] In this embodiment, after acquiring a 2.5D depth image of the surface of the object to be measured, a two-dimensional reference coordinate system is established in the 2.5D depth image. One way to establish the two-dimensional reference coordinate system is to measure the 2.5D depth image using different calipers, determine the origin position and coordinate axis directions based on the measurement results, and the scale of the coordinate axes can be determined according to the image resolution or measurement requirements, thus obtaining the two-dimensional reference coordinate system. Another way to establish the two-dimensional reference coordinate system is to extract corner points or edge points from the 2.5D depth image and use these corner points or edge points as the origin; determine the coordinate axis directions based on the horizontal and vertical directions, or adjust the horizontal or vertical coordinate axes according to the characteristics of the object to be measured in the image; the scale of the coordinate axes can be determined according to the image resolution or measurement requirements, thus obtaining the two-dimensional reference coordinate system.
[0036] S202. In the two-dimensional reference coordinate system, determine the target position and coverage area of the virtual probe in the 2.5D depth image.
[0037] A virtual probe is a tool that uses software to simulate functions similar to a physical probe in specific measurement, analysis, or processing scenarios. Virtual probes are mainly used to obtain information about specific locations on the surface of an object. For example, in applications that measure dimensions based on 2.5D depth maps, a virtual probe can select points on the image and obtain three-dimensional point data that can be used for subsequent measurement and analysis by processing the pixel information and depth information corresponding to these points.
[0038] In this embodiment, to select points from a 2.5D depth image using a virtual probe, the target location and coverage area of the virtual probe in the 2.5D depth image are first determined. The target location can be two-dimensional coordinates determined by a user (e.g., a surveyor) based on an interactive method provided by the virtual probe. This interactive method can include click-based interaction and coordinate input-based interaction. Furthermore, there can be multiple target locations. For each determined target location, an area centered on that location is determined based on the shape and size of the virtual probe, and this area is used as the coverage area of the virtual probe in the 2.5D depth image. That is, each target location corresponds to a separate coverage area.
[0039] S203. Using a virtual probe, extract depth information from pixels within the coverage area of the 2.5D depth image, and determine the three-dimensional point position based on the depth information and the target position.
[0040] In this embodiment, for any coverage area corresponding to a target location, depth information can be extracted from each pixel in the coverage area using a virtual probe. The average or weighted average depth information of each pixel in the coverage area is then calculated, and the result is used as the final depth information of the coverage area. Alternatively, the distribution of depth information of each pixel in the coverage area can be determined, and the final depth information can be extracted based on the distribution. Further, a three-dimensional point is constructed based on the two-dimensional coordinates of the target location and the final depth information extracted from the coverage area corresponding to the target location. For example, if the coordinates of the target location are (x, y) and the depth information of the coverage area corresponding to the target location is z, then the determined three-dimensional point is (x, y, z). It is understood that, for cases where there are multiple target locations, multiple three-dimensional point locations can be determined through the above process.
[0041] S204. Construct a three-dimensional reference coordinate system based on three-dimensional points and a two-dimensional reference coordinate system.
[0042] In this embodiment of the application, since there are multiple three-dimensional points, a plane fitting can be performed based on the multiple three-dimensional points to obtain the target plane; the two-dimensional reference coordinate system is projected onto the target plane to obtain the two-dimensional reference coordinate system of the target plane; the normal vector of the target plane is used as the Z-axis to obtain the three-dimensional reference coordinate system.
[0043] S205. Based on the three-dimensional reference coordinate system, the size of the object to be measured is measured to obtain the size measurement result.
[0044] After obtaining the three-dimensional reference coordinate system, points can be selected in the 2.5D depth image using virtual probes. Based on the three-dimensional coordinates of these points in the reference coordinate system, dimensions can be calculated to obtain the dimensional results. For geometric shapes requiring inspection, such as planes, cylinders, and spheres, a set of virtual probes can be placed in the corresponding region of the image, and the 3D points obtained from these virtual probes can be fitted. Similarly, if the flatness of a certain region needs to be calculated, an appropriate number of virtual probes are placed in that region, and the coplanarity of these 3D points is calculated.
[0045] In this embodiment, a three-dimensional point position is obtained by a virtual probe in the acquired 2.5D depth image and combined with the two-dimensional reference coordinate system established in the 2.5D depth image to construct a three-dimensional reference coordinate system. Then, the size measurement is performed based on the three-dimensional reference coordinate system. In this way, the size measurement of this application no longer depends on mechanical probes or point cloud data, avoiding the problem of low size measurement accuracy due to the surface characteristics or material limitations of the object to be measured.
[0046] In some embodiments, determining the target location and coverage area of the virtual probe in a 2.5D depth image in a two-dimensional reference coordinate system includes:
[0047] In a two-dimensional reference coordinate system, the target position of the virtual probe in the 2.5D depth image is determined; the target position is determined by the user based on the interaction method of the virtual probe.
[0048] Obtain the shape and size parameters of the virtual probe configured by the user;
[0049] Based on the target location, the shape and size parameters of the virtual probe, the coverage area of the virtual probe in the 2.5D depth image is determined.
[0050] Specifically, the interaction method of the virtual probe refers to the way the user configures the virtual probe's position. Thus, the user can determine the target position of the virtual probe in a 2.5D depth image through click-based interaction and / or coordinate input-based interaction, where the number of determined target positions can be multiple.
[0051] In this embodiment, while the user determines the target position of the virtual probe in the 2.5D depth image through click-based interaction and / or coordinate input-based interaction, the shape and size parameters of the virtual probe are configured; wherein, the shape may include a rectangle, a circle, or an ellipse; and the size parameters may be the radius of the circle, the length and width of the rectangle, or the major and minor axes of the ellipse.
[0052] In this embodiment, when determining the coverage area, a region can be determined from the 2.5D depth image with the target location as the center and based on the shape and size parameters of the virtual probe. This region is then used as the coverage area of the virtual probe corresponding to the target location. For example, if the virtual probe is circular with a radius R, a circular region with the target location as the center and a radius R is determined in the 2.5D depth image. This circular region is the coverage area of the virtual probe.
[0053] In this embodiment, the sampling area of the virtual probe can be defined by determining the coverage area, which provides a basis for the subsequent extraction of depth information.
[0054] In some embodiments, the interaction of the virtual probe includes click-based interaction; determining the target location of the virtual probe in a 2.5D depth image includes:
[0055] In response to a user's click action in the 2.5D depth image, the user's click position in the two-dimensional reference coordinate system is used as the target position of the virtual probe in the 2.5D depth image.
[0056] In this embodiment, the click operation performed by the user in the 2.5D depth image can be generated by the user through an input device, wherein the input device is exemplarily a mouse. Alternatively, if the computer device implementing this method supports touchscreen functionality, the click operation can also be generated by the user directly touching the 2.5D depth image displayed on the computer device. Thus, by identifying the coordinates of the click location in a two-dimensional reference coordinate system, the target location can be determined.
[0057] Understandably, click-based interaction makes it easier to determine the target location and improves the efficiency of doing so.
[0058] In some embodiments, the interaction of the virtual probe includes coordinate input-based interaction; determining the target position of the virtual probe in a 2.5D depth image includes:
[0059] Based on a 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's selection of coordinate-based input interaction, a coordinate input interface is displayed to the user, where the user can input multiple two-dimensional position coordinates; in response to the user triggering a batch import operation, multiple target locations are determined in the 2.5D depth image based on the multiple two-dimensional position coordinates input by the user.
[0061] Understandably, determining the target position of the virtual probe in the 2.5D depth image by directly inputting the position coordinates can ensure a more accurate target position.
[0062] In some embodiments, depth information is extracted from pixels within the coverage area of a 2.5D depth image using a virtual probe, including:
[0063] A virtual probe is used to filter pixels within the coverage area of a 2.5D depth image, and depth information is extracted from the filtered pixels.
[0064] Specifically, the virtual probe can filter the pixels within the coverage area using any of the mean filtering, median filtering, or Gaussian filtering methods to remove noise or interference. Then, depth information can be extracted from the filtered pixels. The extraction method can be: calculating the average or weighted average of the depth information of the filtered pixels within the coverage area and using the result as the final depth information for that area; or determining the distribution of the depth information of the filtered pixels within the coverage area and extracting the final depth information based on the distribution.
[0065] It is understandable that filtering can eliminate noise or interference within the coverage area, making the extracted depth information more accurate.
[0066] In some embodiments, a three-dimensional reference coordinate system is constructed based on three-dimensional points and a two-dimensional reference coordinate system, including:
[0067] Based on the determined three-dimensional points, fit the target plane in three-dimensional space;
[0068] Project the two-dimensional reference coordinate system onto the target plane and establish a three-dimensional reference coordinate system.
[0069] Specifically, since there are multiple 3D points, a preset fitting algorithm can be used to fit the multiple 3D points to a plane to obtain the target plane. The preset fitting algorithm can be the least squares algorithm, the random sampling consensus algorithm, or the principal component analysis algorithm. The 2D reference coordinate system is projected onto the target plane to obtain the 2D reference coordinate system of the target plane. The normal vector of the target plane is used as the Z-axis to obtain the 3D reference coordinate system.
[0070] It is understandable that establishing a three-dimensional reference coordinate system is the foundation for subsequent three-dimensional measurements.
[0071] In some embodiments, establishing a two-dimensional reference coordinate system in a 2.5D depth image includes:
[0072] Use a circular caliper and a linear caliper to determine the origin position and coordinate axis direction in a 2.5D depth image;
[0073] A two-dimensional reference coordinate system is constructed based on the origin position and the coordinate axis directions.
[0074] Specifically, circular features in the 2.5D depth image are measured using circular calipers, and the center of the circular feature is used as the origin of the two-dimensional reference coordinate system. In the 2.5D depth image, a reference line related to the object's shape, structure, or measurement requirements is determined, and this reference line is measured using a straight-line caliper. If the selected reference line is nearly parallel to the horizontal direction, its direction can be defined as the X-axis, and the Y-axis direction can be determined according to the right-hand rule (or other pre-agreed rules). Alternatively, if the reference line is nearly parallel to the vertical direction, its direction can be defined as the Y-axis, and the X-axis direction can be determined accordingly. Finally, the coordinate axis scales are marked according to the image resolution and measurement requirements.
[0075] It is understandable that a two-dimensional reference coordinate system is constructed based on calipers 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 of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.
[0077] Based on the same inventive concept, this application also provides a size measuring device. The solution provided by this device is similar to the solution described in the above method. Therefore, the specific limitations of one or more size measuring device embodiments provided below can be found in the limitations of the size measuring method above, and will not be repeated here.
[0078] like Figure 3 As shown, this application embodiment provides a size measuring device 300, including:
[0079] The acquisition module 301 is used to acquire a 2.5D depth image of the surface of the object to be measured; wherein, the 2.5D depth image refers to a two-dimensional image including depth information;
[0080] The first coordinate system establishment module 302 is used to establish a two-dimensional reference coordinate system in a 2.5D depth image;
[0081] The position determination module 303 is used to determine the target position and coverage area of the virtual probe in the 2.5D depth image in a two-dimensional reference coordinate system.
[0082] The point calculation module 304 is used to extract depth information from pixels within the coverage area in a 2.5D depth image using a virtual probe, and to determine the three-dimensional point position based on the depth information and the target position.
[0083] The second coordinate system establishment module 305 is used to construct a three-dimensional reference coordinate system based on three-dimensional points and a two-dimensional reference coordinate system;
[0084] The measurement module 306 is used to measure the size of the object to be measured based on a three-dimensional reference coordinate system and obtain the size measurement result.
[0085] In some embodiments, regarding determining the target position and coverage area of the virtual probe in a 2.5D depth image in a two-dimensional reference coordinate system, the position determination module 303 is specifically used for:
[0086] In a two-dimensional reference coordinate system, the target position of the virtual probe in the 2.5D depth image is determined; the target position is determined by the user based on the interaction method of the virtual probe.
[0087] Obtain the shape and size parameters of the virtual probe configured by the user;
[0088] Based on the target location, the shape and size parameters of the virtual probe, the coverage area of the virtual probe in the 2.5D depth image is determined.
[0089] In some embodiments, the interaction of the virtual probe includes click-based interaction:
[0090] In determining the target location of the virtual probe in a 2.5D depth image, the location determination module 303 is specifically used for:
[0091] In response to a user's click operation in the 2.5D depth image, the user's click position in the two-dimensional reference coordinate system is used as the target position of the virtual probe in the 2.5D depth image.
[0092] In some embodiments, the interaction of the virtual probe includes interaction based on coordinate input;
[0093] In determining the target location of the virtual probe in a 2.5D depth image, the location determination module 303 is specifically used for:
[0094] Based on a 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.
[0095] In some embodiments, in extracting depth information from pixels within the coverage area of a 2.5D depth image using a virtual probe, the point calculation module 304 is specifically used for:
[0096] A virtual probe is used to filter pixels within the coverage area of a 2.5D depth image, and depth information is extracted from the filtered pixels.
[0097] In some embodiments, in constructing a three-dimensional reference coordinate system based on three-dimensional points and a two-dimensional reference coordinate system, the second coordinate system establishment module 305 is specifically used for:
[0098] Based on the determined three-dimensional points, fit the target plane in three-dimensional space;
[0099] Project the two-dimensional reference coordinate system onto the target plane and establish a three-dimensional reference coordinate system.
[0100] In some embodiments, in establishing a two-dimensional reference coordinate system in a 2.5D depth image, the first coordinate system establishment module 302 is specifically used for:
[0101] Use a circular caliper tool and a straight caliper tool to determine the origin position and coordinate axis direction in a 2.5D depth image;
[0102] Construct a two-dimensional reference coordinate system based on the origin position and coordinate axis directions.
[0103] Each module in the aforementioned dimensional measuring device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0104] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data related to the implementation of the dimensional measurement method. The I / O interfaces are used for information exchange between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps in the aforementioned dimensional measurement method.
[0105] In some embodiments, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 5As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it performs the steps in the aforementioned dimensional measurement method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen; the input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs or touchpads set on the casing of the computer device, or external keyboards, touchpads or mice, etc.
[0106] Those skilled in the art will understand that Figure 4 or Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0107] In some embodiments, a computer device is provided, the computer device including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the steps in the above method embodiments.
[0108] In some embodiments, as Figure 6 The diagram shows the internal structure of a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the above-described method embodiments.
[0109] In some embodiments, a computer program product is provided, which includes a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0110] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0111] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0112] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0113] The above embodiments merely illustrate several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art may make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A size measurement method, characterized in that: include: Acquire a 2.5D depth image of the surface of the object to be measured, and establish a two-dimensional reference coordinate system in the 2.5D depth image; wherein the 2.5D depth image refers to a two-dimensional image including depth information; In the two-dimensional reference coordinate system, determining a target position and a coverage area of the virtual probe in the 2.5D depth image; Extracting depth information from pixels in the coverage area in the 2.5D depth image through the virtual probe, and determining a three-dimensional point position according to the depth information and the target position; Constructing a three-dimensional reference coordinate system based on the three-dimensional point position and the two-dimensional reference coordinate system; Based on the three-dimensional reference coordinate system, the size of the object to be measured is measured to obtain a size measurement result.
2. The method according to claim 1, characterized in that Determining the target position and coverage area of the virtual probe in the 2.5D depth image in the two-dimensional reference coordinate system includes: In the two-dimensional reference coordinate system, determining a target position of the 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; Acquire the shape and size parameters of the virtual probe configured by the user; The coverage area of the virtual probe in the 2.5D depth image is determined according to the target position, the shape and size parameters of the virtual probe.
3. The method according to claim 2, characterized in that The interaction mode of the virtual probe includes interaction based on click operation: The determining the target position of the virtual probe in the 2.5D depth image comprises: In response to a click operation performed by a user in the 2.5D depth image, a click position of the user in the two-dimensional reference coordinate system is used as a target position of the virtual probe in the 2.5D depth image.
4. The method according to claim 2, characterized in that: The interaction mode of the virtual probe includes interaction based on coordinate input; The determining the target position of the virtual probe in the 2.5D depth image comprises: Based on the two-dimensional reference coordinate system and according to the position coordinates input by the user, a target position of the virtual probe in the 2.5D depth image is determined.
5. The method according to claim 1, characterized in that: The extracting depth information from the pixel points in the 2.5D depth image within the coverage area by using the virtual probe includes: The virtual probe is used to filter the pixels in the coverage area in the 2.5D depth image, and extract depth information from the filtered pixels.
6. The method according to any one of claims 1 to 5, characterized in that The constructing of a three-dimensional reference coordinate system based on the three-dimensional point position and the two-dimensional reference coordinate system comprises: Fitting a target plane in the three-dimensional space according to the determined three-dimensional point positions; The two-dimensional reference coordinate system is projected onto the target plane, and a three-dimensional reference coordinate system is established.
7. The method according to any one of claims 1 to 5, characterized in that The step of establishing a two-dimensional reference coordinate system in the 2.5D depth image comprises: Determine the origin position and the coordinate axis direction in the 2.5D depth image by using a circular caliper tool and a linear caliper tool; A two-dimensional reference coordinate system is constructed based on the origin position and the coordinate axis directions.
8. A dimension measuring device, characterized in that: include: An acquisition module, used to acquire a 2.5D depth image of the surface of the object to be measured; wherein the 2.5D depth image refers to a two-dimensional image including depth information; A first coordinate system establishing module, used for establishing a two-dimensional reference coordinate system in the 2.5D depth image; A position determination module, used to determine the target position and coverage area of the virtual probe in the 2.5D depth image in the two-dimensional reference coordinate system; A point position calculation module, configured to extract depth information from pixels in the coverage area in the 2.5D depth image through the virtual probe, and determine a three-dimensional point position according to the depth information and the target position; A second coordinate system establishment module, used for constructing a three-dimensional reference coordinate system based on the three-dimensional point and the two-dimensional reference coordinate system; The measuring module is used to measure the size of the object to be measured based on the three-dimensional reference coordinate system to obtain a size measurement result.
9. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
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
Machine room camera plane online calibration method and system, computer equipment and medium
CN114972539A
Underwater dynamic fish form measurement method and device based on binocular vision
CN115082777A
Depth estimation post-processing method, three-dimensional model reconstruction method, device and equipment
CN118485701A
Cited By
Method for generating measuring program of image measuring instrument based on three-dimensional model
CN121048491A
Method for generating a measuring program for a three-dimensional model-based video measuring machine
CN121048491B