A three-dimensional image-based measurement programming method and electronic device
Patent Information
- Application Number
- CN202611520544.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-29
- Publication Date
- 2026-10-30
AI Technical Summary
[0003]随着生产模式向多产品、短交期、快速换型方向发展,传统的在线编程方式已难以满足快速迭代的生产需求
[0018]本申请的其中一个实施例的有益效果为:通过3D影像编程方式,通过基于工件模型与虚拟相机模型之间的坐标位置关系进行系统化移动仿真,并通过拍摄状态检测自动筛选候选拍摄位置,实现拍摄位置的智能化生成,提高了测量覆盖率和编程效率。
Smart Images

Figure CN123015651A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image measurement programming technology, and in particular to a measurement programming method and electronic device based on three-dimensional images. Background Technology
[0002] With the rapid development of industrial automation and precision manufacturing, the requirements for measurement efficiency and accuracy in product quality inspection are increasing. Image measurement equipment (such as 2D / 3D image measuring instruments and coordinate measuring machines) are important quality inspection tools in modern manufacturing, widely used in workpiece dimensional measurement and geometric tolerance inspection. Traditional image measurement programming methods typically employ online programming, where the actual workpiece is clamped on a physical machine, the measurement software is connected to the equipment, and images of the workpiece are acquired by adjusting hardware parameters such as the light source and camera. Then, the operator manually pulls the inspection frame, corrects the measurement parameters, and finally generates an executable measurement program.
[0003] As production models evolve towards multi-product, short-lead-time, and rapid changeover, traditional online programming methods are no longer sufficient to meet the demands of rapid iteration. The programming process requires equipment usage time, and changeover debugging interrupts normal production, severely impacting equipment utilization and overall production efficiency. Furthermore, online programming relies entirely on physical workpieces, light sources, cameras, and other hardware environments, making it impossible to predict mechanical collision risks during the programming phase, posing significant safety hazards. Summary of the Invention
[0004] Therefore, it is necessary to provide a measurement programming method and electronic device based on three-dimensional images to solve at least one of the above-mentioned technical problems.
[0005] To achieve the above objectives, this application provides the following technical solution: In a first aspect, this application provides a measurement programming method based on three-dimensional images, the method comprising: Obtain workpiece model parameters and image measurement equipment information and import them into 3D software to generate workpiece model and virtual camera model; By utilizing the positional relationship between the workpiece model and the virtual camera model, and combining the virtual camera model to perform motion simulation, the virtual shooting position can be identified. Based on the virtual shooting position and image measurement equipment information, the workpiece model is virtually photographed to generate multiple virtual camera images. The system captures workpiece features from virtual camera images and performs dimensional measurements based on the capture results to obtain workpiece feature measurement data. Multiple corresponding measurement subroutines are then generated based on the workpiece feature measurement data and workpiece model parameters. The measurement subroutine is integrated with the movement sequence corresponding to the virtual shooting position to generate the overall measurement program.
[0006] Optionally, the step of acquiring workpiece model parameters and image measurement device information and importing them into 3D software includes: Obtain the three-dimensional model parameters corresponding to the workpiece to be tested, import the three-dimensional model parameters into 3D software, and establish the corresponding workpiece model based on the three-dimensional model parameters; Obtain image measurement equipment information and build a corresponding virtual camera model based on the image measurement equipment information.
[0007] Optionally, the step of utilizing the positional relationship between the workpiece model and the virtual camera model, combined with the virtual camera model, to perform motion simulation includes: The initial shooting position of the virtual camera model is determined based on the positional relationship between the workpiece model and the virtual camera model. Based on the initial shooting position, the virtual camera model is moved to positions corresponding to different shooting directions to generate multiple candidate shooting positions; At each candidate shooting position, shooting status detection is performed based on the workpiece model and the virtual camera model to obtain shooting status data; The candidate shooting locations are filtered by shooting status data to identify virtual shooting locations.
[0008] Optionally, the positional relationship between the workpiece model and the virtual camera model is determined by the coordinate information in the workpiece model and the coordinate information in the virtual camera model.
[0009] Optionally, in each candidate shooting position, the shooting state detection based on the workpiece model and the virtual camera model includes: Adjust the relative position between the virtual camera model and the workpiece model based on the candidate shooting positions to generate the corresponding camera position parameters; Based on the camera position parameters, determine the shooting range corresponding to the virtual camera model and the shooting area corresponding to the workpiece model; The system determines whether the candidate shooting location is within the reasonable shooting range of the virtual camera model by using the shooting area, and generates shooting status data.
[0010] Optionally, the virtual shooting processing of the workpiece model based on the virtual shooting position and image measurement device information includes: Based on the virtual shooting position, determine the shooting angle corresponding to the workpiece model and generate shooting angle data; By combining shooting angle data and shooting parameters from image measurement equipment information as constraints, a simulated imaging environment for a single virtual shooting is constructed, and virtual shooting parameters under the corresponding angle are generated. The workpiece model is simulated and imaged according to the virtual shooting parameters to generate a virtual camera image. Repeat the above steps to obtain multiple virtual camera images.
[0011] Optionally, the step of performing simulated imaging processing on the workpiece model based on the virtual shooting parameters includes: Determine the projection direction, projection range, and image parameters of the workpiece model based on the virtual shooting parameters; The workpiece model is transformed into a two-dimensional projection based on the projection direction and projection range, and a virtual camera image from the corresponding viewpoint is generated according to the image parameters.
[0012] Optionally, the step of capturing workpiece features from a virtual camera image and performing dimensional measurement based on the capture result includes: Based on preset edge-finding parameters, the workpiece image region in the virtual camera image is located to obtain workpiece feature location data; Based on the workpiece feature positioning data, the corresponding measurement boundary is determined, and workpiece feature boundary data is generated. The dimensional parameters corresponding to the workpiece features are calculated based on the workpiece feature boundary data, and the workpiece feature measurement data is obtained.
[0013] Optionally, the step of generating multiple corresponding measurement subroutines based on workpiece feature measurement data and workpiece model parameters includes: The workpiece feature measurement data is compared with the workpiece model parameters to determine the measurement object corresponding to the workpiece feature measurement data. Based on the geometric type of the object being measured and the workpiece feature measurement data, configure the measurement action parameters for the image measurement device when measuring the object; The measurement action parameters are compiled and encapsulated into control instructions, generating multiple corresponding measurement subroutines.
[0014] Optionally, the integration of the measurement subroutine with the movement sequence corresponding to the virtual shooting position includes: The calling relationship between measurement subroutines is determined based on the order of virtual shooting positions corresponding to multiple measurement subroutines; The measurement subroutines are sorted and combined according to the calling relationship to generate the total measurement program.
[0015] Secondly, embodiments of this application provide a measurement programming device based on three-dimensional images, the device comprising: The acquisition unit is used to acquire workpiece model parameters and image measurement equipment information and import them into 3D software to generate workpiece model and virtual camera model. The control unit is used to utilize the positional relationship between the workpiece model and the virtual camera model, combined with the virtual camera model, to perform motion simulation and identify the virtual shooting position; The control unit is also used to perform virtual shooting processing on the workpiece model based on the virtual shooting position and image measurement equipment information to generate multiple virtual camera images; The calculation unit is used to capture workpiece features from virtual camera images, perform dimensional measurements based on the capture results, and obtain workpiece feature measurement data; it also generates multiple corresponding measurement subroutines based on the workpiece feature measurement data and workpiece model parameters. The calculation unit is also used to integrate the movement sequence corresponding to the measurement subroutine and the virtual shooting position to generate a total measurement program.
[0016] Thirdly, this embodiment provides an image measuring instrument, the image measuring instrument comprising: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the measurement programming method based on three-dimensional images as described in the first aspect.
[0017] Fourthly, a computer-readable storage medium storing an executable program that is executed by a processor to implement the measurement programming method based on three-dimensional images as described in the first aspect.
[0018] One of the beneficial effects of this application is that, through 3D image programming, a systematic movement simulation is performed based on the coordinate position relationship between the workpiece model and the virtual camera model, and candidate shooting positions are automatically filtered through shooting state detection, thereby realizing the intelligent generation of shooting positions and improving measurement coverage and programming efficiency. Attached Figure Description
[0019] Figure 1 This is a flowchart illustrating the steps of a measurement programming method based on 3D images. Figure 2 for Figure 1 A detailed flowchart illustrating the implementation steps of step S100. Figure 3 for Figure 1 A detailed flowchart illustrating the implementation steps of step S200. Figure 4 for Figure 3 A detailed flowchart illustrating the implementation steps of step S230. Figure 5 A schematic diagram of a measurement and programming device based on three-dimensional images provided in an embodiment of this application; Figure 6This is a schematic diagram of the structure of an image measuring instrument provided in an embodiment of this application; Figure 7 This is a structural block diagram of a computer-readable storage medium provided in an embodiment of this application.
[0020] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0021] The technical methods of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. Based on the optional embodiments, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0022] Furthermore, the accompanying drawings are merely illustrative of this application and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor methods and / or microcontroller methods.
[0023] It should be understood that although the terms "first," "second," etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are used merely to distinguish one unit from another. For example, without departing from the scope of the exemplary embodiments, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0024] Please see Figure 1 , Figure 1 This is a flowchart illustrating a measurement programming method based on 3D images provided in an embodiment of this application. Figure 1 As shown, the measurement programming method based on three-dimensional images includes steps S100 to S500.
[0025] Step S100: Obtain workpiece model parameters and image measurement equipment information and import them into 3D software to generate workpiece model and virtual camera model; Step S200: Utilize the positional relationship between the workpiece model and the virtual camera model, and combine the virtual camera model to perform motion simulation to identify the virtual shooting position; Step S300: Based on the virtual shooting position and image measurement equipment information, perform virtual shooting processing on the workpiece model to generate multiple virtual camera images; Step S400: Capture the workpiece features in the virtual camera image and perform dimensional measurements based on the capture results to obtain workpiece feature measurement data; generate multiple corresponding measurement subroutines based on the workpiece feature measurement data and workpiece model parameters; Step S500: Integrate the measurement subroutine with the movement sequence corresponding to the virtual shooting position to generate the overall measurement program.
[0026] Optionally, the workpiece model parameters and image measurement equipment information corresponding to the workpiece to be measured are obtained, and the workpiece model parameters and image measurement equipment information are imported into 3D software. A corresponding workpiece model is generated according to the workpiece model parameters, and a corresponding virtual camera model is generated according to the image measurement equipment information.
[0027] Optionally, the workpiece model parameters are used to describe the three-dimensional structural information of the workpiece to be measured, including the workpiece outline information, structural composition information, positional relationship information between each structure, and model data corresponding to the area to be measured; the image measurement equipment information is used to describe the shooting status of the actual image measurement equipment, including camera parameters, light source parameters, and lens magnification parameters.
[0028] Optionally, the 3D software establishes the three-dimensional geometric structure corresponding to the workpiece based on the spatial coordinate information in the workpiece model parameters, and constrains the structural dimensions in the workpiece model based on the dimensional information in the workpiece model parameters, so that the generated workpiece model maintains a correspondence with the actual workpiece to be measured; at the same time, the 3D software establishes a virtual camera model based on the camera parameters, light source parameters and lens magnification parameters in the image measurement equipment information, so that the virtual camera model corresponds to the shooting conditions of the actual image measurement equipment.
[0029] Furthermore, the 3D software acquires the spatial coordinate information corresponding to the workpiece model and the virtual camera model, determines the initial shooting position of the virtual camera model based on the positional relationship between the workpiece model and the virtual camera model, and performs motion simulation on the virtual camera model based on the initial shooting position to identify the virtual shooting position.
[0030] Optionally, the positional relationship between the workpiece model and the virtual camera model includes the spatial distance, orientation, and viewing angle between them. The 3D software adjusts the relative position between the virtual camera model and the workpiece model based on the location of the area to be measured corresponding to the workpiece model and the current spatial position of the virtual camera model, so that the virtual camera model faces the area to be measured corresponding to the workpiece model, and determines the position that meets the shooting conditions as the initial shooting position.
[0031] Optionally, after determining the initial shooting position, the 3D software adjusts the position of the virtual camera model in three-dimensional space according to the spatial distribution of different areas to be measured in the workpiece model, so that the virtual camera model is positioned according to different shooting directions. After each adjustment of the virtual camera model's position, the current position coordinates and shooting direction information of the virtual camera model are recorded, and the position coordinates and shooting direction information are used as the corresponding candidate shooting positions.
[0032] Optionally, for multiple candidate shooting positions, the 3D software performs shooting status detection on each candidate shooting position according to the shooting range corresponding to the virtual camera model and the area to be tested corresponding to the workpiece model, determines whether the current candidate shooting position can cover the corresponding area to be tested, and detects whether there is spatial interference between the virtual camera model and the workpiece model, and generates corresponding shooting status data based on the detection results.
[0033] Optionally, the 3D software filters multiple candidate shooting positions based on the shooting status data. When the shooting range corresponding to the candidate shooting position covers the area to be measured in the workpiece model, and there is no spatial interference between the virtual camera model and the workpiece model, the corresponding candidate shooting position is determined as the virtual shooting position, and finally multiple virtual shooting positions that meet the shooting requirements are obtained.
[0034] After obtaining multiple virtual shooting positions, the workpiece model is subjected to virtual shooting processing based on the virtual shooting positions and image measurement equipment information to generate multiple virtual camera images.
[0035] Optionally, the 3D software determines the shooting direction of the virtual camera model to observe the workpiece model based on the spatial coordinate information corresponding to each virtual shooting position, and generates virtual shooting parameters for the corresponding virtual shooting position by combining the camera parameters, light source parameters and lens magnification parameters in the image measurement equipment information.
[0036] Optionally, the 3D software determines the projection direction, projection range, and image parameters corresponding to the workpiece model based on the virtual shooting parameters, and performs a two-dimensional projection transformation on the workpiece model in three-dimensional space based on the projection direction and projection range, converting the spatial structure information corresponding to the workpiece model into two-dimensional image data; further, it processes the two-dimensional image data based on the image parameters and lighting parameters to generate a virtual camera image corresponding to the virtual shooting position.
[0037] Optionally, the 3D software sequentially performs simulated imaging processing on the workpiece model based on the virtual shooting parameters corresponding to multiple virtual shooting positions, and establishes the correlation between the generated virtual camera images and the corresponding virtual shooting positions, ultimately obtaining virtual camera images corresponding to multiple shooting directions.
[0038] Furthermore, workpiece features are captured from multiple generated virtual camera images, and size measurements are performed based on the capture results to obtain workpiece feature measurement data.
[0039] Optionally, the computer calls preset edge-finding parameters for each virtual camera image to perform positioning processing on the workpiece features in the virtual camera image, wherein the edge-finding parameters are used to limit the search area of the workpiece features and the edge recognition conditions.
[0040] Optionally, the target measurement area in the virtual camera image is determined based on the edge-finding parameters, and the edge positions corresponding to the workpiece features are identified within the target measurement area. The measurement boundary corresponding to the workpiece features is determined based on multiple edge positions.
[0041] Optionally, the dimensional parameters corresponding to the workpiece features are calculated based on the measurement boundary to generate workpiece feature measurement data. For example, when the workpiece feature is a hole structure, the hole contour is determined based on the edge position corresponding to the hole structure, and the hole diameter is calculated based on the hole contour; when the workpiece feature is an edge structure, the corresponding dimensional parameters are calculated based on the distance between the edge positions. After obtaining the workpiece feature measurement data, multiple corresponding measurement subroutines are generated based on the workpiece feature measurement data and the workpiece model parameters.
[0042] Optionally, the computer matches the workpiece feature measurement data with the workpiece model parameters, and determines the measurement object corresponding to the workpiece feature measurement data based on the structural information in the workpiece model parameters.
[0043] Optionally, based on the geometric type of the object being measured and the workpiece feature measurement data, the measurement action parameters corresponding to the actual measurement performed by the image measuring device are determined. The measurement action parameters include the measurement position, measurement direction, and feature acquisition parameters.
[0044] Optionally, the measurement action parameters are converted into control commands that the image measurement device can recognize, and a measurement subroutine is generated in combination with the corresponding virtual shooting position, so that each measurement subroutine corresponds to a measurement process under a virtual shooting position.
[0045] Furthermore, multiple measurement subroutines are integrated with the movement sequence corresponding to the virtual shooting positions to generate a total measurement program.
[0046] Optionally, the computer acquires virtual shooting position information corresponding to multiple measurement subroutines, and determines the execution order of the multiple measurement subroutines based on the generation order of each virtual shooting position during the virtual camera model movement simulation.
[0047] Optionally, multiple measurement subroutines can be sorted and combined according to a determined execution order, and the movement instructions, feature measurement instructions and corresponding execution relationships in each measurement subroutines can be integrated to generate a total measurement program.
[0048] Optionally, the overall measurement program includes multiple movement instructions and measurement instructions corresponding to virtual shooting positions, used to control the actual image measurement device to move to the corresponding measurement position in a preset order and perform corresponding workpiece feature dimension measurement operations.
[0049] In the embodiments of this application, see the following: Figure 2 , Figure 2 This is a flowchart illustrating step S100. In this example, step S100 includes steps S110 to S120.
[0050] Step S110: Obtain the three-dimensional model parameters corresponding to the workpiece to be tested, import the three-dimensional model parameters into 3D software, and establish the corresponding workpiece model according to the three-dimensional model parameters. Step S120: Obtain image measurement equipment information and establish a corresponding virtual camera model based on the image measurement equipment information.
[0051] Optionally, the three-dimensional model parameters corresponding to the workpiece to be measured are obtained, the three-dimensional model parameters are imported into 3D software, and a corresponding workpiece model is established based on the three-dimensional model parameters; the image measurement equipment information is obtained, and a corresponding virtual camera model is established based on the image measurement equipment information.
[0052] Optionally, the three-dimensional model parameters are used to describe the spatial structure information of the workpiece to be tested, including the workpiece outline information, structural composition information, positional relationship information between each structure, and corresponding size information. The three-dimensional model parameters may be derived from the three-dimensional design file, three-dimensional scanning data, or pre-stored workpiece model data corresponding to the workpiece to be tested.
[0053] Optionally, when the three-dimensional model parameters are derived from a three-dimensional design file, the 3D software reads the spatial coordinate data and dimension data from the three-dimensional design file, parses the spatial coordinate data, establishes the geometric structure corresponding to the workpiece based on the positional relationship between each spatial coordinate point, and constrains the length, width, height, and feature positions in the workpiece model based on the dimension data, so that the generated workpiece model maintains a corresponding relationship with the actual workpiece to be measured.
[0054] Optionally, the 3D software determines the outer boundary of the workpiece model based on the contour information in the 3D model parameters, determines the connection relationship between different structures in the workpiece model based on the structural position relationship, and adjusts the proportional relationship between each structure based on the size information to generate a 3D workpiece model containing the overall structural information of the workpiece.
[0055] Optionally, when the workpiece to be tested contains hole structures, edge structures, step structures, or other features to be tested, the 3D software determines the spatial position of the corresponding feature in the workpiece model based on the feature position data in the three-dimensional model parameters, generates the corresponding feature structure based on the feature size data, and combines multiple feature structures according to a preset positional relationship to form a workpiece model corresponding to the actual workpiece to be tested.
[0056] Optionally, the workpiece model is used as a three-dimensional object in the subsequent virtual shooting process. The workpiece model contains spatial coordinate information, structural size information, and feature position information corresponding to the workpiece to be tested, so as to facilitate the determination of the positional relationship between the virtual camera model and the workpiece model based on the workpiece model.
[0057] Optionally, the image measurement equipment information is used to describe the shooting state corresponding to the actual image measurement equipment, including camera parameters, light source parameters, lens magnification parameters, and the shooting range parameters corresponding to the image measurement instrument.
[0058] Optionally, the camera parameters are used to describe the image acquisition characteristics of the actual image measurement device, including image acquisition size, resolution, field of view, and imaging parameters; the light source parameters are used to describe the illumination conditions corresponding to the actual image measurement device when performing image acquisition; and the lens magnification parameters are used to describe the magnification ratio corresponding to the lens in the actual image measurement device when observing the workpiece under test.
[0059] Optionally, the 3D software creates a virtual camera model based on the image measurement equipment information, and configures the image acquisition parameters corresponding to the virtual camera model according to the camera parameters, so that the virtual camera model has the image acquisition capability corresponding to the actual image measurement equipment.
[0060] Optionally, the 3D software adjusts the observation scale of the virtual camera model according to the lens magnification parameter, so that when the virtual camera model observes the workpiece model in virtual space, the display scale of the workpiece model corresponds to the lens magnification in the actual image measuring device.
[0061] Optionally, the 3D software configures the lighting conditions in the virtual space according to the light source parameters, so that when the virtual camera model takes a virtual picture of the workpiece model, the display state of the corresponding area of the workpiece model matches the shooting environment of the actual image measurement equipment.
[0062] Optionally, the 3D software establishes a corresponding virtual shooting environment based on the equipment parameters in the image measurement equipment information, loads the workpiece model and the virtual camera model into the same three-dimensional space, so that the virtual camera model can perform virtual shooting processing on the workpiece model according to different spatial positions.
[0063] Optionally, the virtual camera model includes spatial position parameters, shooting parameters, and imaging parameters corresponding to the actual image measuring device. The virtual camera model is used for subsequent movement simulation based on the positional relationship between the workpiece model and the virtual camera model, and to generate virtual camera images corresponding to different shooting positions.
[0064] In the embodiments of this application, see the following: Figure 3 This is a flowchart illustrating step S200, as shown below. Figure 3 As shown, step S200 includes steps S210 to S240.
[0065] Step S210: Determine the initial shooting position of the virtual camera model based on the positional relationship between the workpiece model and the virtual camera model; Step S220: Based on the initial shooting position, move the virtual camera model to positions corresponding to different shooting directions to generate multiple candidate shooting positions; Step S230: At each candidate shooting position, shooting status detection is performed based on the workpiece model and the virtual camera model to obtain shooting status data; Step S240: Filter the candidate shooting positions through shooting status data to identify the virtual shooting position.
[0066] Optionally, the initial shooting position of the virtual camera model is determined based on the positional relationship between the workpiece model and the virtual camera model; the virtual camera model is moved to positions corresponding to different shooting directions based on the initial shooting position to generate multiple candidate shooting positions; in each candidate shooting position, shooting state detection is performed based on the workpiece model and the virtual camera model to obtain shooting state data; the candidate shooting positions are filtered through the shooting state data to identify the virtual shooting position.
[0067] Optionally, the computer acquires the spatial coordinate information corresponding to the completed workpiece model and the virtual camera model in 3D software. The spatial coordinate information corresponding to the workpiece model is used to represent the position state of the workpiece model in three-dimensional space, and the spatial coordinate information corresponding to the virtual camera model is used to represent the current position state of the virtual camera model in three-dimensional space.
[0068] Optionally, the 3D software determines the reference position of the workpiece model based on the spatial coordinate information corresponding to the workpiece model. The reference position can be determined based on the overall spatial range, center position, and position of the area to be measured of the workpiece model, and is used as a reference benchmark when adjusting the position of the virtual camera model.
[0069] Optionally, the 3D software obtains the current spatial coordinate information of the virtual camera model, and determines the current observation direction of the virtual camera model based on the spatial distance and directional relationship between the virtual camera model and the workpiece model, and judges whether the virtual camera model can face the area to be measured corresponding to the workpiece model based on the observation direction.
[0070] Optionally, the 3D software adjusts the position of the virtual camera model based on the workpiece model position data and the virtual camera model position data, so that the virtual camera model is located in a spatial position that meets the shooting requirements, and determines the position corresponding to the adjusted virtual camera model as the initial shooting position.
[0071] Optionally, the initial shooting position is used as the starting position for subsequent virtual camera model movement simulation. After determining the initial shooting position, the 3D software simulates the process of the camera moving and adjusting relative to the workpiece in the actual image measurement device based on this position.
[0072] Optionally, the 3D software determines multiple shooting directions based on the spatial distribution of the area to be measured in the workpiece model, and adjusts the position of the virtual camera model according to the spatial positional relationship corresponding to each shooting direction, so that the virtual camera model is in the spatial position corresponding to different shooting directions.
[0073] Optionally, the position adjustment of the virtual camera model is achieved by changing the coordinate position of the virtual camera model in three-dimensional space, including adjusting the distance relationship, orientation relationship and viewing angle between the virtual camera model and the workpiece model, so that the virtual camera model simulates the state of the actual image measuring equipment taking pictures of the workpiece at different positions.
[0074] Optionally, when the workpiece model contains multiple areas to be measured, the 3D software adjusts the position of the virtual camera model according to the spatial position of each area to be measured, so that the virtual camera model moves to different positions on different sides, at different heights or in different directions of the workpiece model, in order to obtain the shooting state covering different areas to be measured.
[0075] Optionally, after each adjustment of the virtual camera model's position, the 3D software records the spatial coordinates and shooting direction information corresponding to the current virtual camera model, and associates the spatial coordinates and shooting direction information to generate corresponding candidate shooting positions.
[0076] Optionally, the 3D software repeatedly performs the position adjustment process of the virtual camera model until the position traversal corresponding to the preset shooting direction is completed, and multiple candidate shooting positions corresponding to different shooting directions are obtained.
[0077] Optionally, for each candidate shooting position, the 3D software detects the shooting status corresponding to the current candidate shooting position based on the spatial position of the virtual camera model and the spatial position of the workpiece model corresponding to the candidate shooting position.
[0078] Optionally, the 3D software determines the current shooting direction and observation area of the virtual camera model based on the position parameters of the virtual camera model corresponding to the candidate shooting position, and determines the shooting area corresponding to the current candidate shooting position based on the positional relationship between the observation area of the virtual camera model and the spatial range of the workpiece model.
[0079] Optionally, the 3D software performs spatial position matching between the observation area corresponding to the virtual camera model and the area to be tested in the workpiece model. When the area to be tested is located within the observation area corresponding to the virtual camera model, it determines that the current candidate shooting position can cover the corresponding area to be tested and records the corresponding shooting range detection result.
[0080] Optionally, when the area to be tested is not located within the observation area corresponding to the virtual camera model, it is determined that the current candidate shooting position cannot complete the shooting of the corresponding area, and the corresponding shooting range detection result is recorded.
[0081] Optionally, the 3D software can detect the positional relationship between the virtual camera model and the workpiece model based on the spatial range of the virtual camera model and the spatial range of the workpiece model, and determine whether there is spatial interference between them.
[0082] Optionally, when there is no spatial overlap between the virtual camera model and the workpiece model, the current candidate shooting position is determined to meet the spatial position requirements, and the corresponding spatial interference detection result is recorded; when there is spatial interference between the virtual camera model and the workpiece model, the corresponding invalid state is recorded.
[0083] Optionally, the 3D software generates corresponding shooting status data based on the shooting range detection results and spatial interference detection results for each candidate shooting position, wherein the shooting status data is used to indicate whether the candidate shooting position meets the virtual shooting requirements.
[0084] Optionally, the 3D software acquires shooting status data corresponding to multiple candidate shooting locations, and filters the multiple candidate shooting locations based on the shooting range detection results and spatial interference detection results in the shooting status data.
[0085] Optionally, when the virtual camera model corresponding to the candidate shooting position can cover the area to be measured in the workpiece model, and there is no spatial interference between the virtual camera model and the workpiece model, the current candidate shooting position is determined as the valid shooting position.
[0086] Optionally, when the candidate shooting position cannot cover the area to be measured in the workpiece model, or when there is spatial interference between the virtual camera model and the workpiece model, the current candidate shooting position is determined as an invalid shooting position and removed from the set of candidate shooting positions.
[0087] Optionally, after completing the screening of all candidate shooting positions, the 3D software will determine the remaining valid shooting positions as virtual shooting positions. These virtual shooting positions are used to perform virtual shooting processing on the workpiece model based on the image measurement equipment information, and generate corresponding virtual camera images.
[0088] In this embodiment, the positional relationship between the workpiece model and the virtual camera model is determined by the coordinate information in the workpiece model and the coordinate information in the virtual camera model.
[0089] Optionally, the 3D software acquires the workpiece coordinate information corresponding to the creation of the workpiece model and the camera coordinate information corresponding to the creation of the virtual camera model, transforms the two into the same three-dimensional coordinate system, and determines the positional relationship between the workpiece model and the virtual camera model by calculating the distance and direction relationship between the workpiece model coordinates and the virtual camera model coordinates, which is used for subsequent adjustment of the shooting position of the virtual camera model.
[0090] Optionally, see Figure 4 This is a flowchart illustrating step S230, as shown below. Figure 4 As shown, step S230 includes steps S231 to S233.
[0091] Step S231: Adjust the relative position between the virtual camera model and the workpiece model according to the candidate shooting positions, and generate the corresponding camera position parameters; Step S232: Determine the shooting range corresponding to the virtual camera model and the shooting area corresponding to the workpiece model based on the camera position parameters; Step S233: Determine whether the candidate shooting position is within the reasonable shooting range of the virtual camera model based on the shooting area, and generate shooting status data.
[0092] Optionally, the 3D software obtains the position coordinates corresponding to the current candidate shooting position, and adjusts the spatial position of the virtual camera model in three-dimensional space according to the position coordinates, so that the virtual camera model is in the shooting state corresponding to the candidate shooting position. The adjustment process is based on the positional relationship between the workpiece model coordinate information and the virtual camera model coordinate information. According to the coordinate data corresponding to the candidate shooting position, the spatial distance and directional relationship between the virtual camera model and the workpiece model are calculated, and the calculated spatial distance and directional relationship are used as camera position parameters.
[0093] It should be explained that the camera position parameters are used to describe the relative position between the virtual camera model and the workpiece model at the current candidate shooting position, including the distance information between the virtual camera model and the workpiece model and the shooting direction information, so as to obtain the camera position parameters corresponding to each candidate shooting position.
[0094] Optionally, the 3D software calculates the observation range of the virtual camera model at the current candidate shooting position based on the virtual camera model's position and shooting direction information in the camera position parameters. Based on the virtual camera model's position coordinates, shooting direction, and preset camera field of view parameters, it determines the spatial range in which the virtual camera model can acquire images at the current position, generates the shooting range corresponding to the virtual camera model, and matches the shooting range of the virtual camera model with the spatial coordinates of the workpiece model to determine the workpiece model area within the shooting range as the shooting area.
[0095] Optionally, the 3D software determines the position of the spatial coordinates of the workpiece model and the shooting range corresponding to the virtual camera model. When the area coordinates of the workpiece model are within the shooting range coverage area, the corresponding area is taken as the shooting area under the current candidate shooting position, thus obtaining the shooting range corresponding to each candidate shooting position and the shooting area corresponding to the workpiece model.
[0096] Optionally, the 3D software determines whether the candidate shooting location meets the shooting requirements based on the shooting area corresponding to the current candidate shooting location.
[0097] Furthermore, the camera-capable area is matched with the area to be measured in the workpiece model. When the camera-capable area covers the feature area to be measured in the workpiece model, the current candidate camera position is determined to meet the camera range requirements. When the camera-capable area does not cover the area to be measured, the current candidate camera position is determined to not meet the camera range requirements. Based on the positional relationship between the camera range corresponding to the candidate camera position and the workpiece model, it is determined whether there is spatial occlusion between the virtual camera model and the workpiece model that affects the camera capture.
[0098] Optionally, after the judgment is completed, the area coverage result and the shooting range judgment result corresponding to the current candidate shooting position are recorded to generate shooting status data. The shooting status data is used to indicate whether the current candidate shooting position meets the virtual shooting requirements. Based on the shooting status data, candidate shooting positions that meet the conditions are filtered to generate multiple virtual shooting positions for virtual shooting processing.
[0099] In some embodiments, step S300 includes steps S310 to S340: Step S310: Determine the shooting angle corresponding to the workpiece model based on the virtual shooting position, and generate shooting angle data; Step S320: Combining the shooting angle data and the shooting parameters in the image measurement equipment information as constraints, construct a simulation imaging environment for a single virtual shooting and generate virtual shooting parameters under the corresponding angle. Step S330: Perform simulated imaging processing on the workpiece model according to the virtual shooting parameters to generate a virtual camera image; Step S340: Repeat the above steps to obtain multiple virtual camera images.
[0100] Optionally, the 3D software acquires multiple virtual shooting positions generated in the preceding steps, and determines the observation direction of the virtual camera model relative to the workpiece model based on the spatial coordinates corresponding to each virtual shooting position and the spatial coordinates of the workpiece model.
[0101] Optionally, the spatial coordinate information in the virtual shooting position is read, and the reference position coordinates corresponding to the workpiece model are obtained. Based on the spatial positional relationship between the virtual shooting position and the reference position of the workpiece model, the direction vector when the virtual camera model observes the workpiece model is calculated.
[0102] Optionally, the shooting direction corresponding to the current virtual shooting position is determined based on the direction vector, and the shooting direction and the corresponding virtual shooting position are associated to generate shooting perspective data.
[0103] It should be explained that the shooting angle data represents the orientation of the virtual camera model when observing the workpiece model from the current virtual shooting position.
[0104] Optionally, the shooting angle data is acquired, and the shooting parameters in the image measurement equipment information are read. The simulation imaging conditions corresponding to the current virtual shooting position are determined based on the two together. The shooting parameters include the camera parameters, light source parameters, and lens magnification parameters in the actual image measurement equipment.
[0105] Optionally, the direction in which the virtual camera model observes the workpiece model is determined based on the shooting angle data, and the image acquisition parameters during the virtual shooting process are set according to the camera parameters in the image measurement equipment information.
[0106] Optionally, the display ratio of the workpiece model in the virtual shooting image is set according to the lens magnification parameter, the lighting conditions corresponding to the workpiece model are configured according to the light source parameter, and the shooting angle data is combined with the shooting parameters to generate the virtual shooting parameters corresponding to the current virtual shooting position.
[0107] It should be explained that the virtual shooting parameters are used to describe the shooting state of the virtual camera model during a single virtual shooting process, including shooting direction, image acquisition parameters, lighting parameters, and magnification parameters.
[0108] Optionally, the workpiece model can be subjected to simulated imaging processing based on virtual shooting parameters to generate a virtual camera image that corresponds to the shooting effect of the actual image measuring device.
[0109] Optionally, the projection direction of the workpiece model in the virtual space is determined according to the shooting direction in the virtual shooting parameters, the display size of the workpiece model in the image is determined according to the camera parameters and lens magnification parameters, and the workpiece model is transformed into a two-dimensional projection to obtain the workpiece projection image under the corresponding shooting perspective.
[0110] Optionally, the projected workpiece image is processed with lighting effects according to the light source parameters to make the brightness and darkness distribution in the workpiece image correspond to the actual shooting conditions of the equipment, thereby generating a virtual camera image corresponding to the current virtual shooting position. The virtual camera image is an image obtained by simulating the imaging of the workpiece model according to the camera parameters, light source parameters and lens magnification parameters in the actual image measuring equipment.
[0111] Optionally, virtual shooting parameters corresponding to multiple virtual shooting positions are read sequentially, and the workpiece model is simulated and imaged according to each virtual shooting parameter. After each simulation and imaged imaged process is completed, a virtual camera image corresponding to the virtual shooting position is generated, and the association between the virtual camera image and the corresponding virtual shooting position is established. The above process of determining the shooting angle, generating virtual shooting parameters, and simulating and imaged imaged is repeated until all virtual shooting positions are processed, resulting in multiple virtual camera images corresponding to different shooting directions. The multiple virtual camera images are used to cover the visual information of different areas of the workpiece model.
[0112] Optionally, step S330 includes steps S331 to S332: Step S331: Determine the projection direction, projection range, and image parameters corresponding to the workpiece model based on the virtual shooting parameters; Step S332: Perform two-dimensional projection transformation on the workpiece model based on the projection direction and projection range, and generate a virtual camera image from the corresponding viewpoint according to the image parameters.
[0113] In some embodiments, the shooting direction, camera parameters, light source parameters, and lens magnification parameters in the current virtual shooting parameters are read, and the imaging conditions corresponding to the workpiece model in the current virtual shooting state are determined based on the parameters.
[0114] Optionally, the observation direction of the workpiece model relative to the virtual camera model is determined according to the shooting direction in the virtual shooting parameters, and the observation direction is used as the projection direction of the workpiece model.
[0115] Optionally, based on the position of the virtual camera model and the field of view in the camera parameters, the spatial area that the virtual camera model can cover the workpiece model is determined, and this spatial area is used as the projection range corresponding to the workpiece model.
[0116] Optionally, the display ratio, image size, and pixel distribution parameters of the workpiece model in the generated image are determined based on the lens magnification parameters and image acquisition parameters, and corresponding image parameters are generated to obtain the projection direction, projection range, and image parameters corresponding to the current virtual shooting state.
[0117] Furthermore, based on the generated projection direction and projection range, a two-dimensional projection transformation is performed on the workpiece model, mapping the workpiece model in three-dimensional space to a two-dimensional image plane.
[0118] Optionally, a mapping relationship between the workpiece model and the virtual image plane is established according to the projection direction, and the surface coordinates of the workpiece model located within the projection range are converted into two-dimensional image coordinates.
[0119] Optionally, the size of the two-dimensional projected workpiece image is adjusted according to the image size, pixel resolution, and display ratio in the image parameters so that it corresponds to the imaging size of the actual image measuring device at the current lens magnification.
[0120] Optionally, the brightness distribution of the two-dimensional projection image is processed according to the light source parameters in the virtual shooting parameters to generate a workpiece image with corresponding lighting effects, thereby obtaining a virtual camera image corresponding to the current virtual shooting position. This virtual camera image is used to simulate the workpiece image obtained by the actual image measuring equipment under the corresponding shooting conditions.
[0121] Optionally, the step of capturing workpiece features from a virtual camera image and performing dimensional measurement based on the capture result includes: Based on preset edge-finding parameters, the workpiece image region in the virtual camera image is located to obtain workpiece feature location data; Based on the workpiece feature positioning data, the corresponding measurement boundary is determined, and workpiece feature boundary data is generated. The dimensional parameters corresponding to the workpiece features are calculated based on the workpiece feature boundary data, and the workpiece feature measurement data is obtained.
[0122] In some embodiments, feature recognition is performed on the workpiece image region in the virtual camera image based on pre-set edge-finding parameters.
[0123] It should be explained that the edge-finding parameters are used to limit the search conditions for the edge features of the workpiece in the virtual camera image, including the edge search direction, the edge search area, and the edge determination conditions. The corresponding workpiece image area in the virtual camera image is determined according to the workpiece model parameters, and the image pixel changes are detected in the workpiece image area according to the search direction set by the edge-finding parameters.
[0124] Optionally, the edge change position in the image is determined by comparing the grayscale difference between adjacent pixels. When a pixel change position that meets the edge determination condition is detected, the position is taken as the workpiece feature edge point. Multiple consecutive edge points are combined to obtain the corresponding workpiece feature position and edge distribution information. All the obtained workpiece feature positions and edge distribution information are integrated as workpiece feature positioning data.
[0125] Optionally, based on the edge point positions and edge distribution information in the workpiece feature positioning data, the workpiece feature boundaries in the virtual camera image are determined, multiple edge points in the workpiece feature positioning data are connected, and continuous edge lines are generated according to the distribution order of the edge points in the virtual camera image.
[0126] Optionally, the measurement boundary corresponding to the workpiece feature is determined based on the continuous edge line, and the position coordinates and boundary shape information of the measurement boundary are recorded to generate workpiece feature boundary data, wherein the workpiece feature boundary data represents the boundary position of the workpiece feature to be measured in the virtual camera image.
[0127] In some embodiments, the dimensional parameters corresponding to the workpiece features are calculated based on the boundary position and boundary shape information in the workpiece feature boundary data, the measurement boundary points corresponding to the workpiece features to be measured are determined based on the workpiece feature boundary data, and the corresponding geometric dimensional parameters are calculated based on the positional relationship between the measurement boundary points.
[0128] Optionally, for example, when the feature of the workpiece to be measured is a straight edge, the corresponding length dimension is calculated based on the distance between two sets of boundary points. When the feature of the workpiece to be measured is a hole, arc, or other features, the corresponding contour is obtained by fitting the boundary points, and the corresponding diameter, radius, and other dimension parameters are calculated. The dimension parameters corresponding to each workpiece feature are summarized to generate workpiece feature measurement data, where the workpiece feature measurement data represents the workpiece dimension information obtained based on virtual camera image measurement.
[0129] In some embodiments, generating multiple corresponding measurement subroutines based on workpiece feature measurement data and workpiece model parameters includes: The workpiece feature measurement data is compared with the workpiece model parameters to determine the measurement object corresponding to the workpiece feature measurement data. Based on the geometric type of the object being measured and the workpiece feature measurement data, configure the measurement action parameters for the image measurement device when measuring the object; The measurement action parameters are compiled and encapsulated into control instructions, generating multiple corresponding measurement subroutines.
[0130] In some embodiments, feature correspondence matching is performed on the workpiece feature measurement data and the workpiece model parameters obtained during import, and the geometric feature information corresponding to the workpiece model is extracted from the workpiece model parameters.
[0131] Furthermore, the geometric feature information may include the positional relationships and dimensional information of structural features such as edges, holes, and contours in the workpiece model.
[0132] Optionally, the dimensional parameters and feature positions in the workpiece feature measurement data are compared with the geometric feature information in the workpiece model parameters. By judging the consistency of the size range, spatial position and feature type, the workpiece model measurement object corresponding to the workpiece feature measurement data is determined, and the measurement object matching result is generated after the matching is completed.
[0133] It should be explained that the measurement object matching result represents the specific workpiece structure corresponding to the current workpiece feature measurement data.
[0134] Optionally, the geometric type of the corresponding measurement object is determined based on the measurement object matching result, and the measurement action parameters of the image measurement device are configured to perform the corresponding measurement operation in combination with the workpiece feature measurement data, and the geometric type corresponding to the measurement object is obtained based on the measurement object matching result.
[0135] Furthermore, the geometric type includes, for example, straight line features, circular features, or contour features.
[0136] Optionally, based on the measurement method corresponding to different geometric types, the measurement position, size parameters, and feature boundary information in the workpiece feature measurement data can be converted into measurement action parameters corresponding to the image measurement device.
[0137] Optionally, when the object being measured is a straight line feature, the edge-finding position and measurement direction of the image measuring device are determined based on the boundary position in the workpiece feature measurement data; when the object being measured is a circular feature, the measurement range of the circular area and the feature acquisition position are determined based on the boundary data corresponding to the circular feature.
[0138] Optionally, after processing, measurement action parameters corresponding to each measurement object are generated. These measurement action parameters can describe the measurement position, measurement direction, and feature acquisition method that the image measuring equipment needs to perform when actually measuring the workpiece.
[0139] In some embodiments, measurement action parameters corresponding to multiple measurement objects are extracted, and the measurement action parameters are processed into instructions according to the measurement order corresponding to the virtual shooting position, so as to convert the measurement action parameters corresponding to each measurement object into control instructions that the image measurement device can recognize.
[0140] Optionally, the control instructions are used to control the image measurement device to perform corresponding feature capture and size measurement operations. An independent measurement execution process is established according to the control instructions corresponding to each measurement object, and the control instructions are combined and encapsulated in the execution order to generate corresponding measurement subroutines. Each measurement subroutine corresponds to a workpiece feature measurement process under a virtual shooting position.
[0141] In this embodiment, step S500 includes steps S510 to S520: Step S510: Determine the calling relationship between the measurement subroutines according to the order of the virtual shooting positions corresponding to the multiple measurement subroutines; Step S520: Sort and combine the measurement subroutines according to the calling relationship to generate the total measurement program.
[0142] In some embodiments, all measurement subroutines and the virtual shooting position and movement sequence information corresponding to each measurement subroutine are extracted. The execution order of multiple measurement subroutines is determined according to the sequential relationship between the virtual shooting positions, and the virtual shooting position information associated with each measurement subroutine is read.
[0143] Furthermore, the sequence number identifier corresponding to each virtual shooting position is obtained. Based on the order in which the virtual camera model generates virtual shooting positions during the motion simulation, multiple measurement subroutines are matched sequentially, and the measurement subroutines corresponding to each virtual shooting position are associated according to the order in which they need to be executed during the actual shooting process.
[0144] Optionally, for example, if the virtual camera model sequentially passes through the first virtual shooting position, the second virtual shooting position, and the third virtual shooting position to complete the workpiece model shooting, then the corresponding first measurement subroutine, second measurement subroutine, and third measurement subroutine are established in the above order for calling relationships. After matching is completed, measurement subroutine calling relationship data is generated. Optionally, the measurement subroutine call relationship data represents the execution order of multiple measurement subroutines.
[0145] In some embodiments, multiple measurement subroutines are sorted and combined according to measurement subroutines call relationship data to form a complete measurement process that can be executed by the image measurement device.
[0146] Optionally, the execution order of each measurement subroutine is read according to the call relationship data, and the measurement subroutines are arranged in order. The sorted measurement subroutines are then spliced together to combine the measurement instructions, measurement object information and execution order information in each measurement subroutine to form a continuous measurement control flow. After the combination is completed, the total measurement program is generated.
[0147] It should be explained that the overall measurement program retains the execution order and corresponding measurement action parameters between multiple measurement subroutines, which can be directly loaded into the image measurement equipment, enabling the image measurement equipment to complete the size measurement of different positions and features in sequence according to the pre-generated measurement process.
[0148] Please see Figure 5 , Figure 5 This is a schematic diagram of a measurement programming structure based on three-dimensional images provided in an embodiment of this application, such as... Figure 5 As shown, the measurement programming device 600 includes an acquisition unit 610, a control unit 620, and a control unit 620.
[0149] The acquisition unit 610 is used to acquire workpiece model parameters and image measurement equipment information and import them into 3D software to generate workpiece model and virtual camera model. The control unit 620 is used to perform motion simulation by utilizing the positional relationship between the workpiece model and the virtual camera model, combined with the virtual camera model, and to identify the virtual shooting position. The control unit 620 is also used to perform virtual shooting processing on the workpiece model based on the virtual shooting position and image measurement equipment information to generate multiple virtual camera images; The calculation unit 630 is used to capture workpiece features from virtual camera images and perform dimensional measurements based on the capture results to obtain workpiece feature measurement data; it also generates multiple corresponding measurement subroutines based on the workpiece feature measurement data and workpiece model parameters. The calculation unit 630 is also used to integrate the movement sequence corresponding to the measurement subroutine and the virtual shooting position to generate a total measurement program.
[0150] Optionally, the acquisition unit 610 is used to acquire workpiece model parameters and image measurement device information, and import the workpiece model parameters and image measurement device information into 3D software to generate a workpiece model and a virtual camera model.
[0151] Specifically, the acquisition unit 610 establishes a workpiece model corresponding to the workpiece to be measured based on the workpiece model parameters, and establishes a corresponding virtual camera model based on the image measurement equipment information, so that the virtual camera model corresponds to the shooting parameters of the actual image measurement equipment. The control unit 620 is used to utilize the positional relationship between the workpiece model and the virtual camera model, combined with the virtual camera model, to perform motion simulation, identify the virtual shooting position; and perform virtual shooting processing on the workpiece model based on the virtual shooting position and the image measurement equipment information to generate multiple virtual camera images.
[0152] Specifically, the control unit 620 adjusts the position of the virtual camera model according to the positional relationship between the workpiece model and the virtual camera model, and generates corresponding virtual shooting positions according to different shooting states; further, it performs simulated imaging processing on the workpiece model based on the virtual shooting positions and shooting parameters in the image measurement equipment information to obtain virtual camera images corresponding to multiple shooting perspectives. The calculation unit 630 is used to capture workpiece features in the virtual camera images, and perform size measurement based on the capture results to obtain workpiece feature measurement data; it generates multiple corresponding measurement subroutines based on the workpiece feature measurement data and workpiece model parameters.
[0153] Specifically, the calculation unit 630 locates the workpiece features in the virtual camera image according to preset edge-finding parameters, calculates the workpiece feature dimensions based on the positioning results, and generates workpiece feature measurement data; further, based on the correspondence between the workpiece feature measurement data and the workpiece model parameters, it generates measurement subroutines corresponding to each virtual shooting position. The calculation unit 630 is also used to integrate the measurement subroutines with the movement sequence corresponding to the virtual shooting positions to generate a total measurement program.
[0154] Specifically, the calculation unit 630 determines the execution order of each measurement subroutine based on the movement order between multiple virtual shooting positions, and combines multiple measurement subroutines to generate a general measurement program for controlling the image measurement equipment to perform measurement operations.
[0155] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of an image measuring instrument provided in an embodiment of this application, as shown below. Figure 6 As shown, the image measuring instrument 700 includes one or more processors 710 and a memory 720.
[0156] At least one processor 710; and, A memory 720 is communicatively connected to the at least one processor 710; wherein, The memory 720 stores instructions that can be executed by the at least one processor 710 to enable the at least one processor 710 to perform the measurement programming method based on three-dimensional images as described herein.
[0157] Optionally, the processor 710 and the memory 720 can be connected via a bus or other means. Optionally, the processor 710 is used to process and import the workpiece model parameters and image measurement equipment information into 3D software to generate a workpiece model and a virtual camera model; utilize the positional relationship between the workpiece model and the virtual camera model, and combine the virtual camera model to perform motion simulation to identify the virtual shooting position; perform virtual shooting processing on the workpiece model based on the virtual shooting position and the image measurement equipment information to generate multiple virtual camera images; capture the workpiece features in the virtual camera images, and perform size measurement based on the capture results to obtain workpiece feature measurement data; generate multiple corresponding measurement subroutines based on the workpiece feature measurement data and workpiece model parameters; integrate the measurement subroutines with the movement sequence corresponding to the virtual shooting position to generate a total measurement program.
[0158] Optionally, the memory 720, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions / modules of the measurement programming method based on three-dimensional images in the embodiments of this application. The processor 710 executes various functional applications and data processing of the image measuring instrument by running the non-volatile software programs, instructions, and modules stored in the memory 720, thereby implementing the measurement programming method based on three-dimensional images in the above-described method embodiments.
[0159] Optionally, the memory 720 may include a program storage area and a data storage area, wherein the program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the programming device, etc. Furthermore, the memory 720 may include high-speed random access memory 720, and may also include non-volatile memory 720, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 720 may optionally include memory 720 remotely located relative to the processor 710, and these remote memories can be connected to the controller via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0160] Optionally, one or more modules are stored in memory 720 and, when executed by one or more processors 710, perform the measurement programming method based on three-dimensional images in any of the above method embodiments.
[0161] Please refer to the following: Figure 7 , Figure 7 This is a structural block diagram of a computer-readable storage medium provided in an embodiment of this application, such as... Figure 7 As shown, a computer-readable storage medium 800 stores an executable program 810, which is executed by a processor to implement the measurement programming method based on three-dimensional images as described in any of the above embodiments.
[0162] Optionally, the computer-readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium includes a non-volatile computer-readable medium. The computer-readable storage medium 800 has storage space for program code that performs any of the method steps of the control method described above. These executable programs 810 can be read from or written to one or more computer program products. The program code may, for example, be compressed in a suitable form.
[0163] Therefore, the embodiments should be regarded as exemplary and non-limiting in all respects, and the scope of this application is defined by the appended claims rather than the foregoing description. Thus, it is intended to encompass all variations that fall within the meaning and scope of the equivalents of the application.
[0164] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features of the invention herein.
Claims
1. A measurement programming method based on three-dimensional images, characterized in that, Includes the following steps: Obtain workpiece model parameters and image measurement equipment information and import them into 3D software to generate workpiece model and virtual camera model; By utilizing the positional relationship between the workpiece model and the virtual camera model, and combining the virtual camera model to perform motion simulation, the virtual shooting position can be identified. Based on the virtual shooting position and image measurement equipment information, the workpiece model is virtually photographed to generate multiple virtual camera images. The system captures workpiece features from virtual camera images and performs dimensional measurements based on the capture results to obtain workpiece feature measurement data. Multiple corresponding measurement subroutines are then generated based on the workpiece feature measurement data and workpiece model parameters. The measurement subroutine is integrated with the movement sequence corresponding to the virtual shooting position to generate the overall measurement program.
2. The measurement programming method based on three-dimensional images according to claim 1, characterized in that, The method of utilizing the positional relationship between the workpiece model and the virtual camera model, combined with the virtual camera model, to perform motion simulation includes: The initial shooting position of the virtual camera model is determined based on the positional relationship between the workpiece model and the virtual camera model. Based on the initial shooting position, the virtual camera model is moved to positions corresponding to different shooting directions to generate multiple candidate shooting positions; At each candidate shooting position, shooting status detection is performed based on the workpiece model and the virtual camera model to obtain shooting status data; The candidate shooting locations are filtered by shooting status data to identify virtual shooting locations.
3. The measurement programming method based on three-dimensional images according to claim 2, characterized in that, In each candidate shooting position, the shooting state detection based on the workpiece model and the virtual camera model includes: Adjust the relative position between the virtual camera model and the workpiece model based on the candidate shooting positions to generate the corresponding camera position parameters; Based on the camera position parameters, determine the shooting range corresponding to the virtual camera model and the shooting area corresponding to the workpiece model; The system determines whether the candidate shooting location is within the reasonable shooting range of the virtual camera model by using the shooting area, and generates shooting status data.
4. The measurement programming method based on three-dimensional images according to claim 1, characterized in that, The virtual shooting process of the workpiece model based on the virtual shooting position and image measurement equipment information includes: Based on the virtual shooting position, determine the shooting angle corresponding to the workpiece model and generate shooting angle data; By combining shooting angle data and shooting parameters from image measurement equipment information as constraints, a simulated imaging environment for a single virtual shooting is constructed, and virtual shooting parameters under the corresponding angle are generated. The workpiece model is simulated and imaged according to the virtual shooting parameters to generate a virtual camera image. Repeat the above steps to obtain multiple virtual camera images.
5. The measurement programming method based on three-dimensional images according to claim 4, characterized in that, The step of performing simulated imaging processing on the workpiece model based on the virtual shooting parameters includes: Determine the projection direction, projection range, and image parameters of the workpiece model based on the virtual shooting parameters; The workpiece model is transformed into a two-dimensional projection based on the projection direction and projection range, and a virtual camera image from the corresponding viewpoint is generated according to the image parameters.
6. The measurement programming method based on three-dimensional images according to claim 1, characterized in that, The process of capturing workpiece features from virtual camera images and performing dimensional measurements based on the capture results includes: Based on preset edge-finding parameters, the workpiece image region in the virtual camera image is located to obtain workpiece feature location data; Based on the workpiece feature positioning data, the corresponding measurement boundary is determined, and workpiece feature boundary data is generated. The dimensional parameters corresponding to the workpiece features are calculated based on the workpiece feature boundary data, and the workpiece feature measurement data is obtained.
7. The measurement programming method based on three-dimensional images according to claim 1, characterized in that, The step of generating multiple corresponding measurement subroutines based on workpiece feature measurement data and workpiece model parameters includes: The workpiece feature measurement data is compared with the workpiece model parameters to determine the measurement object corresponding to the workpiece feature measurement data. Based on the geometric type of the object being measured and the workpiece feature measurement data, configure the measurement action parameters for the image measurement device when measuring the object; The measurement action parameters are compiled and encapsulated into control instructions, generating multiple corresponding measurement subroutines.
8. The measurement programming method based on three-dimensional images according to claim 1, characterized in that, The integration of the measurement subroutine with the movement sequence corresponding to the virtual shooting position includes: The calling relationship between measurement subroutines is determined based on the order of virtual shooting positions corresponding to multiple measurement subroutines; The measurement subroutines are sorted and combined according to the calling relationship to generate the total measurement program.
9. The measurement programming method based on three-dimensional images according to claim 1, wherein the detailed implementation steps of acquiring workpiece model parameters and image measurement equipment information and importing them into 3D software include: Obtain the three-dimensional model parameters corresponding to the workpiece to be tested, import the three-dimensional model parameters into 3D software, and establish the corresponding workpiece model based on the three-dimensional model parameters; Obtain image measurement equipment information and build a corresponding virtual camera model based on the image measurement equipment information.
10. An image measuring instrument, characterized in that, The image measuring instrument includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the measurement programming method based on three-dimensional images as described in any one of claims 1 to 9.
