CN118565330A - Parameter measurement method and device, electronic equipment and storage medium - Google Patents

Parameter measurement method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN118565330A
CN118565330A CN202410425621.8A CN202410425621A CN118565330A CN 118565330 A CN118565330 A CN 118565330A CN 202410425621 A CN202410425621 A CN 202410425621A CN 118565330 A CN118565330 A CN 118565330A
Authority
CN
China
Prior art keywords
coordinate system
reference coordinate
image
geometric
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410425621.8A
Other languages
Chinese (zh)
Inventor
朱松
尹昌顺
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikrobot Co Ltd
Original Assignee
Hangzhou Hikrobot Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikrobot Co Ltd filed Critical Hangzhou Hikrobot Co Ltd
Priority to CN202410425621.8A priority Critical patent/CN118565330A/en
Publication of CN118565330A publication Critical patent/CN118565330A/en
Pending legal-status Critical Current

Links

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The embodiment of the application provides a parameter measurement method, a parameter measurement device, electronic equipment and a storage medium. Wherein the method comprises the following steps: displaying a first image of the target workpiece; in response to a graphical instruction input for the first image, determining a geometry indicated by the graphical instruction; determining geometric parameters of the geometric figure in a target reference coordinate system, and displaying the determined geometric parameters; wherein the target reference coordinate system is a pre-configured reference coordinate system, and the reference coordinate system is determined in advance by the following ways: displaying a second image of the target workpiece; determining a straight line indicated by a straight line axis instruction in response to the straight line axis instruction input for the geometric structure of the target workpiece in the second image; a coordinate system with the determined straight line as a coordinate axis is constructed as a reference coordinate system. By adopting the embodiment, the convenience of the user for measuring and judging the workpiece parameters can be improved.

Description

Parameter measurement method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer graphics, and in particular, to a method and apparatus for measuring parameters, an electronic device, and a storage medium.
Background
Measurement and positioning applications are the most widespread applications of machine vision in industry, and in order to determine whether a parameter of a workpiece meets the requirements of a production application, it is often necessary to measure the parameter of the workpiece by means of an image containing the workpiece. In the prior art, in order to measure parameter information of a workpiece, feature point coordinates in an image coordinate system of an image are usually converted into a physical coordinate system or a physical quantity through a hand-eye calibration matrix or camera single-pixel precision, and then coordinates, distances, position degrees and other information among feature points are obtained according to the physical quantity or by measuring in the physical coordinate system, wherein the camera single-pixel precision = camera single-direction view size/camera single-direction resolution. This solution only allows the conversion from the image coordinate system to the physical coordinate system, but since different references may be required when measuring different parameters of the object, the reference coordinate system used for measuring the different parameters is different. In the above measurement scheme, only the physical coordinate system can be used as the reference coordinate system to obtain the measurement result, so that the measurement scheme cannot set the reference coordinate system for the image containing the workpiece according to the requirement of the user for measuring the workpiece parameters, so that the user cannot set the reference coordinate system according to the requirement when performing parameter measurement, and the user cannot conveniently obtain the measurement result of the workpiece parameters.
Disclosure of Invention
The embodiment of the application aims to provide a parameter measurement method, a device, electronic equipment and a storage medium, so as to improve the convenience of a user for measuring workpiece parameters. The specific technical scheme is as follows:
the embodiment of the application provides a parameter measurement method, which comprises the following steps:
displaying a first image of the target workpiece;
in response to a graphical instruction input for the first image, determining a geometry indicated by the graphical instruction;
determining geometric parameters of the geometric figure in a target reference coordinate system, and displaying the determined geometric parameters;
Wherein the target reference coordinate system is a pre-configured reference coordinate system, and the reference coordinate system is determined in advance by the following ways:
displaying a second image of the target workpiece;
determining a straight line indicated by a straight line axis instruction in response to the straight line axis instruction input for the geometric structure of the target workpiece in the second image;
A coordinate system with the determined straight line as a coordinate axis is constructed as a reference coordinate system.
In one possible embodiment, the method further comprises: in response to a parameter input operation for the second image input, determining a numerical value input by the parameter input operation as a scaling factor between the reference coordinate system and an image coordinate system of the second image; the construction of a coordinate system with the determined straight line as a coordinate axis, as a reference coordinate system, includes: and constructing a coordinate system which takes the determined straight line as a coordinate axis and the scaling coefficient as a scaling scale as a reference coordinate system.
In one possible embodiment, the method further comprises: predetermining a plurality of reference coordinate systems as alternative reference coordinate systems; in response to a coordinate system selection instruction input for the first image, an alternative reference coordinate system indicated by the coordinate system selection instruction is determined as a target reference coordinate system.
In one possible embodiment, the method further comprises: determining, in response to an information selection operation input for the second image, preset coordinate system information selected by the information selection operation as target coordinate system information; displaying the reference coordinate system and the target coordinate system information in the second image;
Wherein the preset coordinate system information includes: the origin coordinate of the reference coordinate system, the coordinate system included angle of the reference coordinate system, the direction vector coordinate of the X axis of the reference coordinate system, the direction vector coordinate of the Y axis of the reference coordinate system, the included angle between the X axis of the reference coordinate system and the positive X axis direction of the image coordinate system of the second image, and the included angle between the Y axis of the reference coordinate system and the positive Y axis direction of the image coordinate system.
In a possible embodiment, the determining the geometric parameters of the geometric figure in the target reference coordinate system includes: according to the coordinate transformation relation between the target reference coordinate system and the image coordinate system of the first image, projecting the geometric parameters of the geometric figure in the image coordinate system into the target reference coordinate system to obtain the geometric parameters of the geometric figure in the target reference coordinate system;
the coordinate transformation relation is determined in advance by the following modes:
translating the target reference coordinate system to obtain an offset reference coordinate system, wherein the origin of the offset reference coordinate system coincides with the origin of the image coordinate system;
determining an included angle between a direction vector of an X axis of the offset reference coordinate system and an X axis positive direction of the image coordinate system as a first included angle, and determining an included angle between a direction vector of a Y axis of the offset reference coordinate system and the X axis positive direction of the image coordinate system as a second included angle;
According to the first included angle and the second included angle, determining a substrate in the X-axis direction of the offset reference coordinate system as a first substrate, and determining a substrate in the Y-axis direction of the offset reference coordinate system as a second substrate;
And determining a coordinate transformation relation according to the first substrate and the second substrate.
In one possible embodiment, the target workpiece is a tablet computer;
The determining, in response to a graphics instruction input for the first image, a geometry indicated by the graphics instruction, comprising:
Determining a geometric figure indicated by a graphic instruction in response to the graphic instruction input for the first image, wherein the geometric figure is two endpoints of a long side or a short side of an inner screen of the tablet computer screen;
The determining the geometric parameters of the geometric figure in the target reference coordinate system and displaying the determined geometric parameters comprises the following steps:
Determining geometric parameters of the geometric figure in a target reference coordinate system, and displaying the determined geometric parameters, wherein the geometric parameters are distances between two endpoints of a long side or a short side of an inner screen of the tablet personal computer screen in the target reference coordinate system;
Wherein the target reference coordinate system is a pre-configured reference coordinate system, and the reference coordinate system is determined in advance by the following ways:
Displaying a second image of the tablet computer;
Responding to a linear axis instruction input for the geometric structure of the tablet personal computer in the second image, and determining a straight line indicated by the linear axis instruction, wherein the straight line indicated by the linear axis instruction is a straight line where the long side of the screen in the tablet personal computer screen is located and a straight line where the short side of the screen in the tablet personal computer screen is located;
A coordinate system with the determined straight line as a coordinate axis is constructed as a reference coordinate system.
In one possible embodiment, the target workpiece is a mobile phone;
The determining, in response to a graphics instruction input for the first image, a geometry indicated by the graphics instruction, comprising:
responding to a graphic instruction input for the first image, and determining a geometric figure indicated by the graphic instruction, wherein the geometric figure is two endpoints of a long side or a short side of the outer edge of the charging hole of the mobile phone;
The determining the geometric parameters of the geometric figure in the target reference coordinate system and displaying the determined geometric parameters comprises the following steps:
Determining geometric parameters of the geometric figure in a target reference coordinate system, and displaying the determined geometric parameters, wherein the geometric parameters are distances between two endpoints of a long side or a short side of the outer edge of the mobile phone charging hole in the target reference coordinate system;
Wherein the target reference coordinate system is a pre-configured reference coordinate system, and the reference coordinate system is determined in advance by the following ways:
Displaying a second image of the mobile phone;
Responding to a linear axis instruction input for the geometric structure of the mobile phone in the second image, determining a straight line indicated by the linear axis instruction, wherein the straight line indicated by the linear axis instruction is a straight line where a long side of the outer edge of the mobile phone charging hole is located and a straight line where a short side of the outer edge of the mobile phone charging hole is located;
A coordinate system with the determined straight line as a coordinate axis is constructed as a reference coordinate system.
The embodiment of the application also provides a parameter measuring device, which comprises:
The first image display module is used for displaying a first image of the target workpiece;
A geometry determining module for determining, in response to a graphics instruction input for the first image, a geometry indicated by the graphics instruction;
the geometric parameter display module is used for determining geometric parameters of the geometric figure in a target reference coordinate system and displaying the determined geometric parameters;
Wherein the target reference coordinate system is a pre-configured reference coordinate system, and the reference coordinate system is determined in advance by the following ways:
displaying a second image of the target workpiece;
determining a straight line indicated by a straight line axis instruction in response to the straight line axis instruction input for the geometric structure of the target workpiece in the second image;
A coordinate system with the determined straight line as a coordinate axis is constructed as a reference coordinate system.
In one possible embodiment, the apparatus further comprises: a scaling factor determination module configured to determine, in response to a parameter input operation for the second image input, a numerical value input by the parameter input operation as a scaling factor between the reference coordinate system and an image coordinate system of the second image; the construction of a coordinate system with the determined straight line as a coordinate axis, as a reference coordinate system, includes: and constructing a coordinate system which takes the determined straight line as a coordinate axis and the scaling coefficient as a scaling scale as a reference coordinate system.
In one possible embodiment, the apparatus further comprises: an alternative reference coordinate system determining module, configured to determine a plurality of reference coordinate systems in advance, as alternative reference coordinate systems; and the target reference coordinate system determining module is used for responding to the coordinate system selection instruction input for the first image and determining an alternative reference coordinate system indicated by the coordinate system selection instruction as a target reference coordinate system.
In one possible embodiment, the apparatus further comprises: a target coordinate system information determining module configured to determine, in response to an information selection operation input for the second image, preset coordinate system information selected by the information selection operation as target coordinate system information; the target coordinate system information display module is used for displaying the reference coordinate system and the target coordinate system information in the second image;
Wherein the preset coordinate system information includes: the origin coordinate of the reference coordinate system, the coordinate system included angle of the reference coordinate system, the direction vector coordinate of the X axis of the reference coordinate system, the direction vector coordinate of the Y axis of the reference coordinate system, the included angle between the X axis of the reference coordinate system and the positive X axis direction of the image coordinate system of the second image, and the included angle between the Y axis of the reference coordinate system and the positive Y axis direction of the image coordinate system.
In a possible embodiment, the determining the geometric parameters of the geometric figure in the target reference coordinate system includes: according to the coordinate transformation relation between the target reference coordinate system and the image coordinate system of the first image, projecting the geometric parameters of the geometric figure in the image coordinate system into the target reference coordinate system to obtain the geometric parameters of the geometric figure in the target reference coordinate system;
the coordinate transformation relation is determined in advance by the following modes:
translating the target reference coordinate system to obtain an offset reference coordinate system, wherein the origin of the offset reference coordinate system coincides with the origin of the image coordinate system;
determining an included angle between a direction vector of an X axis of the offset reference coordinate system and an X axis positive direction of the image coordinate system as a first included angle, and determining an included angle between a direction vector of a Y axis of the offset reference coordinate system and the X axis positive direction of the image coordinate system as a second included angle;
According to the first included angle and the second included angle, determining a substrate in the X-axis direction of the offset reference coordinate system as a first substrate, and determining a substrate in the Y-axis direction of the offset reference coordinate system as a second substrate;
And determining a coordinate transformation relation according to the first substrate and the second substrate.
In one possible embodiment, the target workpiece is a tablet computer;
The determining, in response to a graphics instruction input for the first image, a geometry indicated by the graphics instruction, comprising:
Determining a geometric figure indicated by a graphic instruction in response to the graphic instruction input for the first image, wherein the geometric figure is two endpoints of a long side or a short side of an inner screen of the tablet computer screen;
The determining the geometric parameters of the geometric figure in the target reference coordinate system and displaying the determined geometric parameters comprises the following steps:
Determining geometric parameters of the geometric figure in a target reference coordinate system, and displaying the determined geometric parameters, wherein the geometric parameters are distances between two endpoints of a long side or a short side of an inner screen of the tablet personal computer screen in the target reference coordinate system;
Wherein the target reference coordinate system is a pre-configured reference coordinate system, and the reference coordinate system is determined in advance by the following ways:
Displaying a second image of the tablet computer;
Responding to a linear axis instruction input for the geometric structure of the tablet personal computer in the second image, and determining a straight line indicated by the linear axis instruction, wherein the straight line indicated by the linear axis instruction is a straight line where the long side of the screen in the tablet personal computer screen is located and a straight line where the short side of the screen in the tablet personal computer screen is located;
A coordinate system with the determined straight line as a coordinate axis is constructed as a reference coordinate system.
In one possible embodiment, the target workpiece is a mobile phone;
The determining, in response to a graphics instruction input for the first image, a geometry indicated by the graphics instruction, comprising:
responding to a graphic instruction input for the first image, and determining a geometric figure indicated by the graphic instruction, wherein the geometric figure is two endpoints of a long side or a short side of the outer edge of the charging hole of the mobile phone;
The determining the geometric parameters of the geometric figure in the target reference coordinate system and displaying the determined geometric parameters comprises the following steps:
Determining geometric parameters of the geometric figure in a target reference coordinate system, and displaying the determined geometric parameters, wherein the geometric parameters are distances between two endpoints of a long side or a short side of the outer edge of the mobile phone charging hole in the target reference coordinate system;
Wherein the target reference coordinate system is a pre-configured reference coordinate system, and the reference coordinate system is determined in advance by the following ways:
Displaying a second image of the mobile phone;
Responding to a linear axis instruction input for the geometric structure of the mobile phone in the second image, determining a straight line indicated by the linear axis instruction, wherein the straight line indicated by the linear axis instruction is a straight line where a long side of the outer edge of the mobile phone charging hole is located and a straight line where a short side of the outer edge of the mobile phone charging hole is located;
A coordinate system with the determined straight line as a coordinate axis is constructed as a reference coordinate system.
The embodiment of the application also provides electronic equipment, which comprises:
A memory for storing a computer program;
and the processor is used for realizing any one of the parameter measurement methods when executing the program stored in the memory.
The embodiment of the application also provides a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and the computer program realizes any one of the parameter measurement methods when being executed by a processor.
Embodiments of the present application also provide a computer program product comprising instructions which, when run on a computer, cause the computer to perform any of the above-described parameter measurement methods.
The embodiment of the application has the beneficial effects that:
According to the parameter measurement method, the parameter measurement device, the electronic equipment and the storage medium, a straight line indicated by a straight line axis instruction can be determined by inputting the straight line axis instruction for the geometric structure of a target workpiece in a second image, and a coordinate system taking the determined straight line as a coordinate axis is constructed and is used as a reference coordinate system, and the reference coordinate system is preset in the second image containing the target workpiece, so that a target reference coordinate system is obtained. And determining a geometric figure indicated by the graphic instruction through the graphic instruction input for the first image, determining geometric parameters of the geometric figure in a target reference coordinate system, and displaying the determined geometric parameters. The target reference coordinate system is set by a user according to the requirement of the user for the geometric structure of the workpiece, and the geometric figure is determined by an image instruction input by the user, so that the geometric parameter of the determined geometric figure in the target reference coordinate system is the parameter of the target workpiece required to be measured by the user, and the user can intuitively determine the required parameter information of the workpiece through the displayed geometric parameter, thereby improving the convenience of measuring and judging the workpiece parameter by the user.
Of course, it is not necessary for any one product or method of practicing the application to achieve all of the advantages set forth above at the same time.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the application, and other embodiments may be obtained according to these drawings to those skilled in the art.
Fig. 1 is a schematic diagram of an application scenario of a parameter measurement method according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a parameter measurement method according to an embodiment of the present application;
FIG. 3a is a schematic diagram of a measurement interface according to an embodiment of the present application;
FIG. 3b is a schematic diagram showing geometrical parameters according to an embodiment of the present application;
FIG. 3c is another schematic diagram showing geometrical parameters according to an embodiment of the present application;
FIG. 4a is a schematic diagram of an image coordinate system according to an embodiment of the present application;
FIG. 4b is a schematic diagram of a target reference coordinate system according to an embodiment of the present application;
FIG. 4c is a schematic diagram of an offset reference coordinate system according to an embodiment of the present application;
FIG. 5a is a schematic diagram of an interface of a coordinate system setting interface according to an embodiment of the present application;
FIG. 5b is a schematic diagram of a straight line indicated by a straight line axis command according to an embodiment of the present application;
FIG. 5c is another schematic diagram of a target reference coordinate system according to an embodiment of the present application;
FIG. 5d is a schematic diagram of a target reference coordinate system according to an embodiment of the present application;
fig. 5e is a schematic diagram of information display of a preset coordinate system according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an interface for inputting scaling parameters according to an embodiment of the present application;
FIG. 7 is a schematic flow chart of another method for measuring parameters according to an embodiment of the present application;
FIG. 8a is a schematic diagram of a first image according to an embodiment of the present application;
FIG. 8b is a schematic diagram of a target reference coordinate system according to an embodiment of the present application;
FIG. 8c is a schematic diagram showing measurement results according to an embodiment of the present application;
FIG. 8d is another schematic diagram showing the measurement results provided by the embodiment of the present application;
FIG. 9a is another schematic view of a first image according to an embodiment of the present application;
FIG. 9b is a schematic diagram of a target reference coordinate system according to an embodiment of the present application;
FIG. 9c is a schematic diagram showing a measurement result according to an embodiment of the present application;
FIG. 9d is a schematic diagram showing a measurement result according to an embodiment of the present application;
FIG. 10 is a schematic structural diagram of a parameter measurement device according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by the person skilled in the art based on the present application are included in the scope of protection of the present application.
For the sake of more clear explanation of the parameter measurement method provided by the present application, the following description will be given by way of example of possible application scenarios of the parameter measurement method provided by the present application, and it should be understood that the following examples are only possible application scenarios of the parameter measurement method provided by the present application, and in other possible embodiments, the parameter measurement method provided by the present application may also be applied to other possible application scenarios, and the following examples do not limit any limitation.
Referring to fig. 1, fig. 1 is a schematic view of a possible photographed workpiece, and the photographed image of the workpiece may be an oblique image of the workpiece, as shown in fig. 1, because the workpiece may not be properly placed or the photographed apparatus may be installed at an indefinite angle. The workpiece is provided with two circular elements, the circle centers of the two circular elements are respectively a circle center A and a circle center B, a line segment AB formed by connecting the circle centers of the two circular elements needs to be parallel to a straight line CD where the outer contour of the workpiece is located, and the length of the line segment AB, namely the distance between the circle centers of the two circular elements, also needs to meet the requirement of workpiece production. Therefore, the user needs to measure the included angle between the line segment AB and the straight line CD formed by connecting the circle centers of the two circular elements and the geometric parameters of the length of the line segment AB, so as to judge whether the two circular elements mounted on the workpiece meet the production requirement of the workpiece.
In the prior art, a user can only convert the coordinates of the point A and the point B in the image coordinate system into the physical coordinate system through the hand-eye calibration matrix, so that the coordinates of the point A and the point B in the physical coordinate system are obtained, the distance of the line segment AB also needs to be obtained through the coordinate calculation of the point A and the point B in the physical coordinate system, and the included angle between the line segment AB and the straight line CD also needs to be obtained through more complicated calculation. Therefore, in the scheme in the prior art, the physical coordinate system is only used as the reference coordinate system to measure the geometric parameters required by the user, the mode of obtaining the measurement result by the scheme is complex, and the user cannot directly set the reference coordinate system in the image according to the own requirement, so that the user cannot conveniently obtain the measurement result of the workpiece parameters.
Based on this, the present application provides a parameter measurement method, as shown in fig. 2, which specifically includes the following steps:
S201, displaying a first image of the target workpiece.
S202, responding to a graphic instruction input for a first image, and determining a geometric figure indicated by the graphic instruction.
S203, determining geometric parameters of the geometric figure in the target reference coordinate system, and displaying the determined geometric parameters.
The target reference coordinate system is a pre-configured reference coordinate system, and the reference coordinate system is determined in advance by the following modes: displaying a second image of the target workpiece; determining a straight line indicated by the straight line axis instruction in response to the straight line axis instruction input for the geometry of the target workpiece in the second image; a coordinate system with the determined straight line as a coordinate axis is constructed as a reference coordinate system.
In this embodiment, the reference coordinate system may be set in advance in the second image including the target workpiece by determining a straight line indicated by the straight line axis command with respect to the straight line axis command input to the geometry of the target workpiece in the second image, and constructing a coordinate system with the determined straight line as a coordinate axis as the reference coordinate system, to obtain the target reference coordinate system. And determining a geometric figure indicated by the graphic instruction through the graphic instruction input for the first image, determining geometric parameters of the geometric figure in a target reference coordinate system, and displaying the determined geometric parameters. The target reference coordinate system is set by a user according to the requirement of the user for the geometric structure of the workpiece, and the geometric figure is determined by an image instruction input by the user, so that the geometric parameter of the determined geometric figure in the target reference coordinate system is the parameter of the target workpiece required to be measured by the user, and the user can intuitively determine the required parameter information of the workpiece through the displayed geometric parameter, thereby improving the convenience of measuring and judging the workpiece parameter by the user.
The foregoing S201 to S203 will be exemplarily described below, respectively, in which:
In S201, the first image may be acquired by any image sensor (such as a camera) for capturing the target workpiece. The first image may include the entire target workpiece or only a part of the target workpiece. For example, if the target workpiece is a mobile phone, the first image may be obtained by photographing the front surface of the screen of the entire mobile phone, that is, the first image includes the entire mobile phone, or may be obtained by photographing a certain portion of the mobile phone, such as a volume key, a shutdown key, and a charging port, that is, the first image includes only a part of the mobile phone. If the target workpiece is a circuit board, the first image may include the entire circuit board, or may include only elements in a certain area of the circuit board.
In S202, the geometric figure indicated by the graphic instruction may refer to various figures such as a line, a point, a circle, and the like. The user can input a graphic instruction for the first image through the measurement interface, and can select different measurement interfaces according to different graphic instructions input as required. For example, if the geometric figure indicated by the graphic instruction is a point and a point, that is, the user needs to measure the distance between two points, the measurement interface may be an interface for measuring the point and the point; if the geometric figure indicated by the graphic instruction is a point and a line, that is, the distance from the point to the line needs to be measured by the user, the measurement interface may be an interface for measuring the point line.
For example, referring to fig. 3a, fig. 3a shows a measurement interface for point measurement, wherein an "0 image source 1" displayed after an input source in an image input refers to an identification of a first image, representing that the first image is an image with reference numeral 1 acquired by an image sensor with reference numeral 0. In this example, the geometric figure refers to a point, and the user may input a graphic instruction by inputting the point or inputting coordinates, thereby determining the point indicated by the graphic instruction. In the following, two input manners of the input point 1 and the input coordinate will be exemplified, and the manner of the input point 2 is the same as that of the input point 1 described below, which is not described herein again.
When the input mode is the input point, after clicking the link symbol in the input box after the input point 1, the user can directly draw the point to be selected in the first image through the drawing module as the input point 1, or can select the point required by the user from the list of the points in the first image output by each searching module as the input point 1. The search module may be a round search module, a rectangular search module, a linear search module and other search modules, each search module has a corresponding reference number, and the result output by a certain search module may be multiple, each result corresponds to a different reference number, the result output by each search module corresponds to a specific search mode of each search module, for example, the result output by the linear search module may include a straight line, and the result output by the round search module may include a circle, a center of a circle and the like.
In the example shown in fig. 3a, if the measurement of the point is required, the point required by the user needs to be selected from the search module where the output result can be the point. And under the condition that the input mode is an input point, a required point is required to be selected from various different types of points output by the search module, wherein the different types of points refer to various types of points such as circle centers, elliptic focuses, rectangular center points and the like.
For example, "7 circles find 2. Circle center" shown in fig. 3a may be used as an identifier corresponding to a point in the first image output by the find module, where the identifier represents the circle center of reference numeral 2 in the first image output by the reference numeral 7 circle find module. In other examples, the input point 1 may also be a center point of a rectangle in the first image output by the rectangle search module, that is, an intersection point of diagonal lines of the rectangle, if the label of the rectangle search module is 6 and the label of the center point of the rectangle is 1, the identifier corresponding to the point 1 may be "6 rectangle search 1.
When the input mode is the input coordinate, the user can directly input the coordinate of the point to be selected under the image coordinate system of the first image, or can select the point required by the user from the list of the points in the first image output by each search module as the input point 1 after clicking the link symbol in the input frame after clicking the input point 1. The input mode is input coordinates, so that the points output by the search module are displayed in the form of X coordinates of the points and Y coordinates of the points.
In S203, if the geometric figure indicated by the graphic instruction is a point, the geometric parameter may refer to the coordinates of the point in the target reference coordinate system. If the geometric figure indicated by the graphic instruction is two points, the geometric parameter may refer to a distance between the two points under the target reference coordinate system, or may refer to a distance between the two points in the X direction under the target reference coordinate system, or may refer to a distance between the two points in the Y direction under the target reference coordinate system. If the geometric pattern indicated by the graphic instruction is a point and a line, the geometric parameters may refer to the closest distance, the farthest distance, the average distance and the drop point coordinates between the point and the line under the target reference coordinate system. If the geometric figure indicated by the graphic instruction is two lines, the geometric parameter may refer to a distance between the two lines under the target reference coordinate system, or may refer to a distance between the two lines in the X direction under the target reference coordinate system, or may refer to a distance between the two lines in the Y direction under the target reference coordinate system, or may refer to an included angle and an intersection point coordinate of the two lines.
If the target workpiece is the workpiece shown in fig. 1, the first image may be as shown in fig. 3b, as described in the foregoing description of fig. 1, where the user needs to measure two geometric parameters, that is, the included angle between the line segment AB and the straight line CD, formed by connecting the centers of the two circular elements, and the length of the line segment AB, so as to determine whether the two circular elements mounted on the target workpiece meet the production requirement of the target workpiece. Therefore, the target reference coordinate system may be set by taking the straight line where the outer contour of the target workpiece is located as the X axis and the Y axis, respectively, and the specific setting of the target reference coordinate system will be described below, which will not be described herein. In this example, the target reference coordinate system may be as shown in the coordinate system in fig. 3 b.
Since the Y-axis of the target reference coordinate system shown in fig. 3B is on the same line as the straight line CD where the outer contour of the target workpiece is located, if the distance between the point a and the point B in the X-direction of the target reference coordinate system is 0, it can be considered that the line connecting the point a and the point B is parallel to the Y-axis of the target reference coordinate system, that is, parallel to the straight line CD where the outer contour of the target workpiece is located. Therefore, the user only needs to measure the distance between the point A and the point B in the X direction of the target reference coordinate system, and can judge whether the line segment AB formed by connecting the circle centers of the two circular elements on the target workpiece is parallel to the straight line CD of the outer contour of the target workpiece, and can judge whether the distance between the circle centers of the two circular elements on the target workpiece meets the production requirement of the target workpiece through the distance between the point A and the point B in the target reference coordinate system.
Therefore, the user needs to obtain the two geometric parameters of the distance between the geometric figure point A and the point B in the X direction of the target reference coordinate system and the distance between the two points, and the user can intuitively judge whether the two circular elements mounted on the target workpiece meet the production requirements of the target workpiece. After the user determines the geometric figure points a and B according to the measurement interface shown in fig. 3a, clicking an execution button in the measurement interface to obtain the measured geometric parameters, and displaying the geometric parameters in the first image, wherein the measured geometric parameters are shown as the numerical values displayed above fig. 3B. In the target reference coordinate system shown in fig. 3b, the distance in the X direction of two points is output according to the "output two points" shown in the upper side of fig. 3 b: 2.016602 "it is clear that the distance between the point A and the point B in the X direction is 2.016602mm; output two-point Y-direction distance according to the "output two-point Y-direction distance" shown above fig. 3 b: 538.769 "it is clear that the distance between point A and point B in the Y direction is 538.769mm; according to the "absolute distance" shown above fig. 3 b: 538.7728 "it is clear that the distance between the points A and B is 538.7728mm.
The target reference coordinate system may also be distinguished from fig. 3B only in that the direction of the Y-axis is reversed, as shown in fig. 3c, and the distances of the corresponding measured points a and B in the Y-direction of the target reference coordinate system are reversed. The distance of the point a and the point B in the Y direction is 538.769mm in the target reference coordinate system shown in fig. 3B, and the pixel distance of the point a and the point B in the Y direction is-538.7701 mm in the target reference coordinate system shown in fig. 3 c. In the target reference coordinate system shown in fig. 3c, the distance in the X direction of two points is output according to the "output two points" shown in the upper side of fig. 3 c: 0.6304932 "it is clear that the distance between the point A and the point B in the X direction is 0.6304932mm; according to the "output two-point Y-direction distance" shown above fig. 3 c: -538.7701 "it is known that the distance between point a and point B in the Y direction is-538.7701 mm; according to the "absolute distance" shown above fig. 3 c: 538.7704 "it is clear that the distance between the points A and B is 538.7704mm.
In one possible embodiment, for obtaining the geometric parameters of the geometric figure under the target reference coordinate system, the geometric parameters of the geometric figure in the image coordinate system may be projected into the target reference coordinate system according to the coordinate transformation relationship between the target reference coordinate system and the image coordinate system of the first image, so as to obtain the geometric parameters of the geometric figure in the target reference coordinate system.
The coordinate transformation relation is determined in advance by the following way: translating the target reference coordinate system to obtain an offset reference coordinate system, wherein the origin of the offset reference coordinate system coincides with the origin of the image coordinate system; determining an included angle between the direction vector of the X axis of the offset reference coordinate system and the positive direction of the X axis of the image coordinate system as a first included angle, and determining an included angle between the direction vector of the Y axis of the offset reference coordinate system and the positive direction of the X axis of the image coordinate system as a second included angle; according to the first included angle and the second included angle, determining a substrate in the X-axis direction of the offset reference coordinate system as a first substrate, and determining a substrate in the Y-axis direction of the offset reference coordinate system as a second substrate; and determining a coordinate transformation relation according to the first substrate and the second substrate.
In the following, an example will be described in which the geometric figure is taken as a point, the geometric parameter is taken as the coordinate of the point, and the geometric parameter of the geometric figure under the target reference coordinate system is determined.
Referring to fig. 4a, fig. 4a is a schematic diagram of an image coordinate system of the first image, where an origin O (0, 0) of the image coordinate system XOY is an upper left corner of the first image, an X-axis positive direction is horizontal to the right, a Y-axis positive direction is vertical to the bottom, and a coordinate of the geometric point P under the image coordinate system is (P x,Py).
Referring to fig. 4b, the coordinate system X ' O ' Y ' shown in fig. 4b is a target reference coordinate system, and the origin O ' of the target reference coordinate system X ' O ' Y ' in the image coordinate system is the coordinate (T x,Ty), that is, the offset of the origin coordinate of the target reference coordinate system from the origin of the image coordinate system is (T x,Ty). The two X and Y axes of the target reference coordinate system are X 'and Y', respectively, the directions being as shown in FIG. 4 b.
If the coordinates (P x',Py ') of the geometric point P in the target reference coordinate system need to be determined, the coordinate transformation relationship between the target reference coordinate system X' O 'Y' and the image coordinate system XOY of the first image needs to be determined in advance, and the coordinates of the geometric point P in the image coordinate system XOY are projected into the target reference coordinate system X 'O' Y 'according to the coordinate transformation relationship, so that the coordinates of the geometric point P in the target reference coordinate system X' O 'Y' can be obtained. The manner of determining the coordinate transformation relationship will be exemplarily described below.
The target reference coordinate system X ' O ' Y ' is translated to obtain an offset reference coordinate system X "OY" such that the origin of the offset reference coordinate system X "OY" coincides with the origin of the image coordinate system XOY, the offset reference coordinate system X "OY" being as shown in fig. 4 c. The direction vector of the X axis of the reference coordinate system X 'OY' will be shiftedAn included angle theta between the X-axis positive direction of the image coordinate system XOY is used as a first included angle, and the Y-axis direction vector of the reference coordinate system X 'OY' is offsetIncluded angle with positive X-axis direction of image coordinate system XOYAs a second included angle, the first included angle theta and the second included angleAs shown in fig. 4 c.
Then, the substrate of the image coordinate system XOY in the X-axis directionSubstrate in Y-axis directionAnd will shift the base of X axis direction of the reference coordinate system X' OYAs the first substrate, a substrate offset from the Y-axis direction of the reference coordinate system X "OY" is usedAs a second substrate. The coordinate conversion relationship may be described in various ways, and will be described below by taking the coordinate conversion relationship as a matrix as an example. Assume that the coordinate transformation relationship isThe coordinate transformation relation M can be obtained by the following formula (1):
The coordinate transformation relation M can be obtained by performing the gaussian elimination method on the formula (1), as shown in the following formula (2):
And projecting the coordinates of the geometric figure point P in the image coordinate system XOY into the target reference coordinate system X 'O' Y 'according to the coordinate transformation relation, and obtaining the coordinates of the geometric figure point P in the target reference coordinate system X' O 'Y'. Specifically, the coordinates of the point P in the offset reference coordinate system X "OY" can be obtained by the following formula (3):
Then, based on the offset amount (T x,Ty) of the origin coordinates of the target reference coordinate system with respect to the origin of the image coordinate system and the above formula (3), the coordinates of the point P in the target reference coordinate system X ' O ' Y ' can be obtained by the following formula (4):
If the geometric parameters of the geometric figure point P and the point Q under the target reference coordinate system are required to be calculated, the X-direction distance, the Y-direction distance and the two-point distance between the geometric parameter point Q and the point P under the target reference coordinate system are calculated, and the coordinates of the point Q under the target reference coordinate system X ' O ' Y ' are assumed to be The distance between the points Q and P in the X direction is dx, the distance between the points Y direction is dy, and the distance between the points is distance, so that the geometric parameters can be obtained through calculation according to the following formulas (5) and (6):
by adopting the embodiment, the geometric parameters of the geometric figure in the target reference coordinate system can be determined only through the coordinate conversion relation between the target reference coordinate system and the image coordinate system of the first image, and a user can intuitively judge whether the target workpiece meets the production requirement according to the geometric parameters of the geometric figure in the target reference coordinate system, so that a great amount of coordinate conversion tools can be avoided, the complexity of a parameter measurement scheme is reduced, the debugging efficiency is effectively improved, the development and maintenance cost is reduced, and the convenience of the user in measuring and judging the parameters of the workpiece is improved.
In the above embodiment, if the target reference coordinate system is a world coordinate system, the scaling between the image coordinate system of the first image and the target reference coordinate system is also required to be considered when calculating the geometric parameters of the geometric figure under the target reference coordinate system, where the world coordinate system may refer to a physical coordinate system of a motion mechanism, and may refer to a fixed reference physical coordinate system, which is not limited in the present application. Assuming that there are s pixels within 1mm in the X-direction or Y-direction of the target reference coordinate system, that is, the scale is s, the coordinate transformation relationship M is shown in the following formula (7):
since the target reference coordinate system is the world coordinate system, the first included angle θ and the second included angle Can be obtained by the decomposition of a hand-eye calibration matrix. The hand-eye calibration matrix refers to a coordinate system conversion matrix obtained by calibrating a camera and a motion mechanism. Assume that the hand-eye calibration matrix is a matrix of 3×3And the included angle between the X axis and the Y axis of the target reference coordinate system is 90 degrees, the first included angle θ can be calculated by the following formula (8):
Second included angle Can be calculated by the following formula (9):
The coordinates of the point P in the offset reference coordinate system X "OY" corresponding to the coordinate transformation relation M calculated by the foregoing formula (7) can be obtained by the following formula (10):
Correspondingly, the calculation formula (4) of the coordinates of the point P in the target reference coordinate system X ' O ' Y ' varies according to the variation of the coordinate conversion relation M.
The scaling of the target reference coordinate system X and Y may be different, for example, the scaling of the X direction is s x and the scaling of the Y direction is s y, and the coordinate transformation relationship M is shown in the following formula (11):
Wherein s x and s y can be obtained through hand-eye calibration matrix decomposition. Assume that the hand-eye calibration matrix is a matrix of 3×3 The scale s x of the target reference coordinate system in the X direction can be calculated by the following equation (12):
the scale s y of the target reference coordinate system in the Y direction can be calculated by the following equation (13):
The coordinates of the point P in the offset reference coordinate system X "OY" corresponding to the coordinate transformation relation M calculated by the foregoing formula (11) can be obtained by the following formula (14):
Correspondingly, the calculation formula (4) of the coordinates of the point P in the target reference coordinate system X ' O ' Y ' varies according to the variation of the coordinate conversion relation M.
The target reference coordinate system is a reference coordinate system that is arranged in advance, and therefore, the description of the specific arrangement of the reference coordinate system is the description of the specific arrangement of the target reference coordinate system. A specific arrangement of the reference coordinate system will be exemplarily described hereinafter. The reference coordinate system may be determined in advance by: displaying a second image of the target workpiece; determining a straight line indicated by the straight line axis instruction in response to the straight line axis instruction input for the geometry of the target workpiece in the second image; a coordinate system with the determined straight line as a coordinate axis is constructed as a reference coordinate system.
The first image and the second image may be the same image of the target workpiece, or may be different images of the target workpiece. For example, if the target workpiece is a circuit board of a relatively large device such as a television, one image may not be able to capture the entire target workpiece, and thus, multiple images including the target workpiece may be captured, where the first image and the second image may be different images of the target workpiece. The reference coordinate system is set in the second image as the target reference coordinate system, and when the first image is measured, the first image and the second image can be spliced, so that the target reference coordinate system set in the second image can be used in the first image.
In another possible example, the first image and the second image may be images of the target workpiece acquired by different image sensors, and assuming that the first image is acquired by the image sensor 1 and the second image is acquired by the image sensor 2, the reference coordinate system set in the second image may be taken as the target reference coordinate system, and the target reference coordinate system set in the second image may be mapped into the first image according to the mapping relationship between the image sensor 1 and the image sensor 2, so that the target reference coordinate system set in the second image may be used in the first image.
The linear axis command input by the user can be input through the coordinate system setting interface of the coordinate system module as shown in fig. 5a, see fig. 5a, wherein the "0 image source 1" displayed after the input source in the image input refers to the identification of the second image, which represents the second image is the image with the reference number 1 acquired by the image sensor with the reference number 0. Then in the example shown in fig. 5a the same image as in the example shown in fig. 3a the first image and the second image are the same image of the target workpiece. In this example, the user may input the straight line axis command by line-by-line or point-by-point or coordinate-by-coordinate input, thereby determining the straight line indicated by the straight line axis command. The line-by-line input manner will be exemplified by the input of an X-axis line, and the manner of inputting a Y-axis line is the same as the manner of inputting an X-axis line described below, and will not be described again here.
After clicking the link symbol in the input frame after clicking the line, the user can directly draw the required straight line in the second image through the drawing module according to the geometric structure of the target workpiece to be used as the input X-axis straight line, and can also select the required straight line from the list of the straight lines in the second image output by each searching module to be used as the input X-axis straight line. The search module may be a linear search module, a line measurement module, or any other type of search module, and as described above, each search module has a corresponding reference number, and the result output by a certain search module may be multiple, each result corresponds to a different reference number, and the result output by each search module corresponds to a specific search mode of each search module.
For example, "3-line measurement 1" shown in fig. 5a, measurement line 1 "may be used as a corresponding identifier for a line in the second image output by the search module, where the identifier represents measurement line 1 with reference numeral 1 in the first image output by the line measurement module with reference numeral 3. The "3-line measurement 1" displayed after the line in the Y-axis input, measurement straight line 2 "represents measurement straight line 2 numbered 1 in the first image output by the line measurement module numbered 3.
For example, if the target workpiece is the workpiece shown in fig. 1 and fig. 3b and 3c, the straight line indicated by the straight line axis command input by the user according to the geometry of the target workpiece may be as shown in fig. 5b, in this example, the straight line axis command input according to the outer contour of the target workpiece. The angle between the two straight lines shown in fig. 5b is 90.0 °.
After the user finishes inputting the linear axis command, the user can click on the execution in the coordinate system setting interface shown in fig. 5a, thereby constructing a coordinate system with the straight line determined by the linear axis command as a coordinate axis, as a reference coordinate system. The reference coordinate system may be displayed in the second image, and the reference coordinate system constructed from the straight line shown in fig. 5b may be as shown in fig. 5c or as shown in fig. 5d, and the reference coordinate systems shown in fig. 5c and 5d may differ only in the direction of the Y axis.
By adopting the embodiment, the setting process of the reference coordinate system can be interactive through the coordinate system setting interface, and the position and the direction of the reference coordinate system are visually displayed in the second image, so that a user can be helped to determine a more accurate reference coordinate system as a target reference coordinate system, and the accuracy of geometric parameters under the obtained target reference coordinate system is improved.
Also, in the example shown in fig. 5c, information of the reference coordinate system may be presented in the second image, and the information of the reference coordinate system presented in fig. 5c includes: origin X coordinate, origin Y coordinate and coordinate system included angle of the reference coordinate system. From the information shown in fig. 5c, it can be known that the origin X coordinate of the reference coordinate system in fig. 5c is 108.9481, the origin Y coordinate is 300.6497, and the coordinate system included angle is 90.0296 °; from the information shown in fig. 5d, it can be seen that the origin X coordinate of the reference coordinate system in fig. 5d is 112.1188, the origin Y coordinate is 323.0335, and the coordinate system included angle is 90.11784 °. Since the information of the reference coordinate system includes many other information in addition to the information illustrated in the example of fig. 5c, for example: the X-axis angle, Y-axis angle, etc. of the reference coordinate system, and therefore, the user may also need to view other information of the reference coordinate system in the second image, or the user may not want to view information of the reference coordinate system in the second image, and only need to display the reference coordinate system.
Based on this, in one possible embodiment, the parameter measurement method provided by the present application further includes: determining, in response to an information selection operation for the second image input, preset coordinate system information selected by the information selection operation as target coordinate system information; displaying the reference coordinate system and the target coordinate system information in the second image; the preset coordinate system information comprises: origin coordinates of the reference coordinate system, coordinate system included angles of the reference coordinate system, direction vector coordinates of an X axis of the reference coordinate system, direction vector coordinates of a Y axis of the reference coordinate system, included angles between the X axis of the reference coordinate system and an X axis positive direction of an image coordinate system of the second image, and included angles between the Y axis of the reference coordinate system and a Y axis positive direction of the image coordinate system.
The user can input the information selection operation through the "result display" in the coordinate system setting interface shown in fig. 5a, and display the reference coordinate system and the target coordinate system information in the second image with the preset coordinate system information selected by the information selection operation input by the user as the target coordinate system information. In addition, the user may select whether the reference coordinate system is displayed in the second image through "result display", and in practical applications, in order to facilitate the user in determining whether the created reference coordinate system is accurate, the reference coordinate system is generally displayed in the second image by default.
By adopting the embodiment, the user can select the reference coordinate system information displayed in the second image, so that the user can conveniently know the set reference coordinate system, and can conveniently help the user to determine a more accurate reference coordinate system as the target reference coordinate system, and further the accuracy of the geometric parameters under the obtained target reference coordinate system is improved.
For the presentation of the preset coordinate system information of the reference coordinate system, in one possible embodiment, the presentation may be performed under the second image, see fig. 5 e.
The user can set the coordinate system module through the coordinate system setting interface, so that the coordinate system module builds a reference coordinate system. Similar to the above-mentioned searching module, there may be a plurality of coordinate system modules, and a plurality of different reference coordinate systems may be constructed according to the plurality of coordinate system modules. In this embodiment, a plurality of reference coordinate systems may be predetermined as alternative reference coordinate systems; in response to a coordinate system selection instruction input for the first image, an alternative reference coordinate system indicated by the coordinate system selection instruction is determined as a target reference coordinate system.
The reference coordinate system constructed by a certain coordinate system module is generally one, and the reference coordinate system constructed by the coordinate system module is the same as the reference coordinate system of the coordinate system module.
When determining the target reference coordinate system based on which the first image measurement is performed, a coordinate system selection instruction may be input into the measurement interface shown in fig. 3a, and an alternative reference coordinate system indicated by the coordinate system selection instruction may be determined as the target reference coordinate system. The new coordinate system in the measurement interface shown in fig. 3a refers to the reference coordinate system constructed by the user through the coordinate system module. The reference coordinate system of the target selected by the measurement interface shown in fig. 3a is identified as "1 coordinate system module 1. Coordinate system module", representing the reference coordinate system of the target being the reference coordinate system of reference number 1 generated by the reference coordinate system of reference number 1 module.
In practical applications, there are many geometric parameters to be measured, and the target reference coordinate system used for measuring each geometric parameter may be different, so a plurality of measurement modules are generally also provided, and the measurement modules may display the measurement interface shown in fig. 3a, so that the measurement modules may measure and display the geometric parameters. Each measurement module may correspond to a coordinate system module to prevent frequent replacement of the target reference coordinate system that may occur due to the fact that the target reference coordinate systems used in the geometric parameter measurements may be different.
By selecting the embodiment, a plurality of reference coordinate systems can be preset as alternative reference coordinate systems, and a target reference coordinate system is determined in the alternative reference coordinate systems according to a coordinate system selection instruction input by a user during measurement, so that the setting of the reference coordinate system is decoupled from the measurement of the geometric parameters, and the selection of the target reference coordinate system during the measurement of the geometric parameters is more flexible and can be qualified for more complex scenes.
When the reference coordinate system is set, the reference coordinate system may be a coordinate system designated in the image or may be a world coordinate system. If the reference coordinate system is a world coordinate system, a numerical value input by a parameter input operation may be determined as a scaling coefficient between the reference coordinate system and an image coordinate system of the second image in response to the parameter input operation for the second image input; and constructing a coordinate system which takes a straight line determined by the straight line axis instruction as a coordinate axis and takes a scaling coefficient as a scaling scale as a reference coordinate system.
Specifically, the user may input the parameter input operation through the "operation parameter" in the coordinate system setting interface shown in fig. 5a, and the display interface of the operation parameter may be as shown in fig. 6. The user can input a numerical value to be set in an input box after the scaling coefficient as a scaling scale of the reference coordinate system. The user can click a file loading button after the scaling factor is input into the box, and select a camera calibration file corresponding to the camera for shooting to obtain the second image as a hand-eye calibration file by clicking a file selection interface displayed after the file loading button, so that the hand-eye calibration file can be loaded and analyzed, the required scaling factor can be calculated, and the scaling factor can be used as the scaling scale of the reference coordinate system. The manner of calculating the scaling by means of the hand-eye calibration file may be as shown in the aforementioned formulas (12), (13).
After the user finishes inputting the linear axis command and the parameter input operation, the user can click on the execution in the coordinate system setting interface shown in fig. 6, thereby constructing a coordinate system with the straight line determined by the linear axis command as a coordinate axis and the scaling factor as a scaling scale as a reference coordinate system.
By adopting the embodiment, a user can create a coordinate system in an image according to the geometric structure of the target workpiece, and can also create a world coordinate system as a reference coordinate system, so that the application range of the parameter measurement method is wider.
In practical application, when the first image and the second image are the same image, the flow chart of the parameter measurement method provided by the application may be as shown in fig. 7, and may include the following steps:
step 1: an image is input. The image is the first image of the target workpiece.
Step 2: two non-parallel lines (optionally scaled) are selected to generate a set coordinate system.
The setting coordinate system is the reference coordinate system, and the reference coordinate system is used as the target reference coordinate system, and the setting mode of the step 2 is consistent with that of the reference coordinate system, and is not repeated herein.
Step 3: a coordinate transformation matrix is generated using a spatial basis transformation.
The coordinate transformation matrix is a coordinate transformation relationship, and the description of step 3 is consistent with the description of the formulas (1), (2), (7) and (11), and will not be repeated here.
Step 4: and converting the pixel coordinates into a set coordinate system to obtain coordinates, distances, directions and the like to be positioned or measured.
The pixel coordinates are the coordinates of the feature points under the image coordinate system of the first image, and the information such as the coordinates, distance, direction, position degree and the like to be positioned or measured is the geometric parameters. Step 4 corresponds to the description related to the foregoing formulas (1) - (14), and is not repeated herein.
The above steps 2 and 3 can be regarded as setting the coordinate system of the first image, and the step 4 can be regarded as coordinate transformation to obtain the geometric parameters of the geometric figure under the target reference coordinate system.
The parameter measurement method provided by the present application will be described in the following with reference to a specific application scenario, and since in the examples shown below, the first image and the second image are the same image, they are all regarded as the first image hereinafter.
Example 1:
The target workpiece is a tablet computer, the first image is an image obtained by shooting the whole screen of the tablet computer, as shown in fig. 8a, the length and the width of the internal screen of the tablet computer need to be measured, the unit is mm, the size of each pixel is 0.1mm, and the size of each pixel is a factory nominal parameter value of a camera for shooting the first image. The long side of the inner screen of the tablet computer is shown by the broken line in fig. 8a, and the length of the long side of the inner screen of the tablet computer is the length of the inner screen of the tablet computer; the short side of the inner screen of the tablet computer is shown as a solid line in fig. 8a, and the length of the short side of the inner screen of the tablet computer is the width of the inner screen of the tablet computer.
When the reference coordinate system is set as the target reference coordinate system, the target reference coordinate system needs to be established by taking the left lower corner point of the inner screen of the tablet personal computer in the first image as the original point of the target reference coordinate system, taking the short side of the inner screen as the X axis of the target reference coordinate system and taking the long side of the inner screen as the Y axis of the target reference coordinate system. When the linear axis command is input, as described above, an interface may be set in the coordinate system of the coordinate system module, and a straight line is selected by the straight line searching module or a straight line is manually drawn as the input linear axis command, so that the coordinate system module determines two intersecting straight lines indicated by the linear axis command. Since the unit to be measured is mm and the size of each pixel is 0.1mm, the scaling factor needs to be set, and the scaling factor may be set to 1/0.1=10, where the scaling factor may be obtained by the user performing the above calculation, or may be obtained by the user clicking a load file button to load and parse the camera calibration file, where the interface for setting the scaling factor may be as shown in fig. 6, where the difference is only that in this embodiment, the scaling factor should be set to 10. And constructing a target reference coordinate system with a straight line indicated by the straight line axis instruction as a coordinate axis and a scaling coefficient as a scaling scale by a coordinate system module, wherein the construction result of the target reference coordinate system is shown in fig. 8 b. Referring to the coordinate system information shown in fig. 8b, the origin X coordinate of the target reference coordinate system is 1650.884, the origin Y coordinate is 2187.113, and the coordinate system included angle is 89.80272 °.
Then, the target reference coordinate system can be selected through a point measuring module shown in fig. 3a, two end points of the short side of the inner screen of the tablet personal computer in the first image are used as an input point 1 and an input point 2 to be measured, the distances of the input point 1 and the input point 2 under the target reference coordinate system are obtained, the inner screen width of the tablet personal computer is 114.2386mm, and the measurement result is displayed as shown in fig. 8 c. In the target reference coordinate system shown in fig. 8b, the "output two-point X-direction distance" shown in fig. 8 c: 114.2386 "it is clear that the distance between the input point 1 and the input point 2 in the X direction is 114.2386mm; the "output two-point Y-direction distance" shown in fig. 8 c: 1.525879E-05", it is clear that the distance between the input point 1 and the input point 2 in the Y direction is 1.525879 ×10 -5 mm; the "absolute distance" shown in accordance with fig. 8 c: 114.2386 "it is known that the distance between the input point 1 and the input point 2, i.e. the internal screen width of the tablet computer is 114.2386mm.
The target reference coordinate system can be selected through a point measuring module shown in fig. 3a, two end points of the long side of the inner screen of the tablet personal computer in the first image are used as an input point 1 and an input point 2 to be measured, the distance between the input point 1 and the input point 2 under the target reference coordinate system is obtained, the inner screen length of the tablet personal computer is 151.3715mm, and the measurement result is displayed as shown in fig. 8 d. In the target reference coordinate system shown in fig. 8b, the "output two-point X-direction distance" shown in fig. 8 d: 7.629395E-06 "it is clear that the distance between the input point 1 and the input point 2 in the X direction is 7.629395 ×10 -6 mm; the "output two-point Y-direction distance" shown in fig. 8 d: 151.3715 "it is known that the distance between the input point 1 and the input point 2 in the Y direction is 151.3715mm; the "absolute distance" shown in accordance with fig. 8 d: 151.3715 "it is known that the distance between the input point 1 and the input point 2, i.e. the length of the inner screen of the tablet computer is 151.3715mm. So far, the length and the width of the inner screen of the tablet personal computer are obtained.
Example 2:
The target workpiece is a mobile phone, the first image is an image obtained by shooting a charging hole of the mobile phone, as shown in fig. 9a, the length and the width of the outer edge of the charging hole of the mobile phone need to be measured, the unit is mm, the size of each pixel is 0.012mm, and the size of each pixel is a factory nominal parameter value of a camera for shooting the first image. The long edge of the outer edge of the mobile phone charging hole is shown by a dotted line in fig. 9a, and the length of the long edge of the outer edge of the mobile phone charging hole is the length of the outer edge of the mobile phone charging hole; the short edge of the outer edge of the mobile phone charging hole is shown as a solid line in fig. 9a, and the length of the short edge of the outer edge of the mobile phone charging hole is the width of the outer edge of the mobile phone charging hole.
When the reference coordinate system is set as the target reference coordinate system, the upper left corner of the charging hole of the mobile phone in the first image is required to be used as the original point of the target reference coordinate system, the long side of the charging hole is used as the X axis of the target reference coordinate system, and the short side of the charging hole is used as the Y axis of the target reference coordinate system, so as to establish the target reference coordinate system. When the linear axis command is input, as described above, an interface may be set in the coordinate system of the coordinate system module, and a straight line is selected by the straight line searching module or a straight line is manually drawn as the input linear axis command, so that the coordinate system module determines two intersecting straight lines indicated by the linear axis command. Since the unit to be measured is mm and the size of each pixel is 0.012mm, the scaling factor needs to be set, and the scaling factor may be set to 1/0.012= 83.333, where the scaling factor may be obtained by the user performing the above calculation, or may be obtained by the user clicking a load file button to load and parse a camera calibration file, where the interface for setting the scaling factor may be as shown in fig. 6, where the difference is only that in this embodiment, the scaling factor should be set to 83.33. The coordinate system module constructs a target reference coordinate system with a straight line indicated by the straight line axis instruction as a coordinate axis and a scaling factor as a scaling scale, and the construction result of the target reference coordinate system is shown in fig. 9 b. Referring to the coordinate system information shown in fig. 9b, the origin X coordinate of the target reference coordinate system is 201.2584, the origin Y coordinate is 327.5075, and the coordinate system included angle is 89.67474 °.
Then, the point measuring module shown in fig. 3a can select the target reference coordinate system, and measure two end points of the long edge of the outer edge of the mobile phone charging hole in the first image as an input point 1 and an input point 2, so as to obtain the distances between the input point 1 and the input point 2 in the target reference coordinate system, namely the length of the outer edge of the mobile phone charging hole is obtained, the length of the outer edge of the mobile phone charging hole is 9.059507mm, and the measurement result is displayed as shown in fig. 9 c. In the target reference coordinate system shown in fig. 9b, the "output two-point X-direction distance" shown in fig. 9 c: 9.059507 "it is clear that the distance between the input point 1 and the input point 2 in the X direction is 9.059507mm; the "output two-point Y-direction distance" shown in fig. 9 c: 4.768372E-07", it is known that the distance between the input point 1 and the input point 2 in the Y direction is 4.768372 ×10 -7 mm; the "absolute distance" shown in accordance with fig. 9 c: 9.059507 "it is known that the distance between the input point 1 and the input point 2, i.e. the length of the outer edge of the charging hole of the mobile phone is 9.059507mm.
The point measuring module shown in fig. 3a can select the target reference coordinate system, and measure two end points of the short edge of the outer edge of the mobile phone charging hole in the first image as the input point 1 and the input point 2, so as to obtain the distances between the input point 1 and the input point 2 in the target reference coordinate system, namely, obtain the width of the outer edge of the mobile phone charging hole, wherein the width of the outer edge of the mobile phone charging hole is 3.425601mm, and the measurement result is shown in fig. 9 d. In the target reference coordinate system shown in fig. 9b, the two-point X-direction distance is output according to the "output two-point X-direction distance" shown in fig. 9 d: 0", the distance between the input point 1 and the input point 2 in the X direction is 0mm; according to the "output two-point Y-direction distance" shown in fig. 9 d: 3.425601 "it is known that the distance between the input point 1 and the input point 2 in the Y direction is 3.425601mm; according to the "absolute distance" shown in fig. 9 d: 3.425601 "it is known that the distance between the input point 1 and the input point 2, i.e. the width of the outer edge of the charging hole of the mobile phone is 3.425601mm. So far, the length and the width of the outer edge of the charging hole of the mobile phone are obtained.
Corresponding to the foregoing parameter measurement method, the present application further provides a parameter measurement device, as shown in fig. 10, where the device includes:
A first image display module 1001 for displaying a first image of a target workpiece;
A geometry determining module 1002 for determining, in response to a graphics instruction input for a first image, a geometry indicated by the graphics instruction;
A geometric parameter display module 1003, configured to determine geometric parameters of the geometric figure in the target reference coordinate system, and display the determined geometric parameters;
the target reference coordinate system is a pre-configured reference coordinate system, and the reference coordinate system is determined in advance by the following modes:
Displaying a second image of the target workpiece;
determining a straight line indicated by the straight line axis instruction in response to the straight line axis instruction input for the geometry of the target workpiece in the second image;
A coordinate system with the determined straight line as a coordinate axis is constructed as a reference coordinate system.
In one possible embodiment, the apparatus further comprises:
A scaling factor determination module for determining, in response to a parameter input operation for the second image input, a numerical value input by the parameter input operation as a scaling factor between the reference coordinate system and an image coordinate system of the second image;
Constructing a coordinate system with the determined straight line as a coordinate axis as a reference coordinate system, comprising:
and constructing a coordinate system which takes the determined straight line as a coordinate axis and the scaling coefficient as a scaling scale as a reference coordinate system.
In one possible embodiment, the apparatus further comprises:
an alternative reference coordinate system determining module for determining a plurality of reference coordinate systems in advance as alternative reference coordinate systems;
And a target reference coordinate system determination module for determining, as a target reference coordinate system, an alternative reference coordinate system indicated by the coordinate system selection instruction in response to the coordinate system selection instruction input for the first image.
In one possible embodiment, the apparatus further comprises:
A target coordinate system information determining module for determining, in response to an information selecting operation for the second image input, preset coordinate system information selected by the information selecting operation as target coordinate system information;
The target coordinate system information display module is used for displaying a reference coordinate system and target coordinate system information in the second image;
The preset coordinate system information comprises: origin coordinates of the reference coordinate system, coordinate system included angles of the reference coordinate system, direction vector coordinates of an X axis of the reference coordinate system, direction vector coordinates of a Y axis of the reference coordinate system, included angles between the X axis of the reference coordinate system and an X axis positive direction of an image coordinate system of the second image, and included angles between the Y axis of the reference coordinate system and a Y axis positive direction of the image coordinate system.
In one possible embodiment, determining geometric parameters of the geometric figure in the target reference coordinate system includes:
According to the coordinate transformation relation between the target reference coordinate system and the image coordinate system of the first image, projecting the geometric parameters of the geometric figure in the image coordinate system into the target reference coordinate system to obtain the geometric parameters of the geometric figure in the target reference coordinate system;
The coordinate transformation relation is determined in advance by the following way:
Translating the target reference coordinate system to obtain an offset reference coordinate system, wherein the origin of the offset reference coordinate system coincides with the origin of the image coordinate system;
determining an included angle between the direction vector of the X axis of the offset reference coordinate system and the positive direction of the X axis of the image coordinate system as a first included angle, and determining an included angle between the direction vector of the Y axis of the offset reference coordinate system and the positive direction of the X axis of the image coordinate system as a second included angle;
according to the first included angle and the second included angle, determining a substrate in the X-axis direction of the offset reference coordinate system as a first substrate, and determining a substrate in the Y-axis direction of the offset reference coordinate system as a second substrate;
and determining a coordinate transformation relation according to the first substrate and the second substrate.
In one possible embodiment, the target workpiece is a tablet computer;
in response to a graphical instruction input for a first image, determining a geometry indicated by the graphical instruction, comprising:
Responding to a graphic instruction input for a first image, determining a geometric figure indicated by the graphic instruction, wherein the geometric figure is two endpoints of a long side or a short side of an inner screen of a tablet computer screen;
determining geometric parameters of geometric figures in a target reference coordinate system, and displaying the determined geometric parameters, wherein the method comprises the following steps:
Determining geometric parameters of the geometric figure in a target reference coordinate system, and displaying the determined geometric parameters, wherein the geometric parameters are distances between two endpoints of a long side or a short side of an inner screen of a tablet personal computer screen in the target reference coordinate system;
the target reference coordinate system is a pre-configured reference coordinate system, and the reference coordinate system is determined in advance by the following modes:
displaying a second image of the tablet computer;
responding to a linear axis instruction input for the geometric structure of the tablet personal computer in the second image, determining a straight line indicated by the linear axis instruction, wherein the straight line indicated by the linear axis instruction is a straight line where the long side of the screen of the tablet personal computer is located and a straight line where the short side of the screen of the tablet personal computer is located;
A coordinate system with the determined straight line as a coordinate axis is constructed as a reference coordinate system.
In one possible embodiment, the target workpiece is a cell phone;
in response to a graphical instruction input for a first image, determining a geometry indicated by the graphical instruction, comprising:
responding to a graphic instruction input for a first image, determining a geometric figure indicated by the graphic instruction, wherein the geometric figure is two endpoints of a long side or a short side of the outer edge of a charging hole of the mobile phone;
determining geometric parameters of geometric figures in a target reference coordinate system, and displaying the determined geometric parameters, wherein the method comprises the following steps:
Determining geometric parameters of the geometric figure in a target reference coordinate system, and displaying the determined geometric parameters, wherein the geometric parameters are distances between two endpoints of a long side or a short side of the outer edge of a mobile phone charging hole in the target reference coordinate system;
the target reference coordinate system is a pre-configured reference coordinate system, and the reference coordinate system is determined in advance by the following modes:
displaying a second image of the mobile phone;
Responding to a linear axis instruction input for the geometric structure of the mobile phone in the second image, determining a straight line indicated by the linear axis instruction, wherein the straight line indicated by the linear axis instruction is a straight line where a long side of the outer edge of the charging hole of the mobile phone is located and a straight line where a short side of the outer edge of the charging hole of the mobile phone is located;
A coordinate system with the determined straight line as a coordinate axis is constructed as a reference coordinate system.
The embodiment of the application also provides an electronic device, as shown in fig. 11, including:
A memory 1101 for storing a computer program;
The processor 1102 is configured to execute the program stored in the memory 1101, and implement the following steps:
displaying a first image of the target workpiece;
In response to a graphical instruction input for a first image, determining a geometry indicated by the graphical instruction;
Determining geometric parameters of the geometric figure in a target reference coordinate system, and displaying the determined geometric parameters;
the target reference coordinate system is a pre-configured reference coordinate system, and the reference coordinate system is determined in advance by the following modes:
Displaying a second image of the target workpiece;
determining a straight line indicated by the straight line axis instruction in response to the straight line axis instruction input for the geometry of the target workpiece in the second image;
A coordinate system with the determined straight line as a coordinate axis is constructed as a reference coordinate system.
And the electronic device may further include a communication bus and/or a communication interface, where the processor 1102, the communication interface, and the memory 1101 may communicate with each other via the communication bus.
The communication bus mentioned above for the electronic device may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but may also be a digital signal Processor (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), field-Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic device, discrete gate or transistor logic device, discrete hardware components.
In yet another embodiment of the present application, a computer readable storage medium is provided, in which a computer program is stored, which when executed by a processor implements the steps of any of the above-mentioned parameter measurement methods.
In a further embodiment of the present application, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the parameter measurement methods of the above embodiments.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, for example, by wired (e.g., coaxial cable, optical fiber, digital Subscriber Line (DSL)), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, tape), an optical medium (e.g., DVD), or a Solid state disk (Solid STATE DISK, SSD), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the apparatus, electronic device, computer readable storage medium, and computer program product embodiments, the description is relatively simple, as relevant to the method embodiments being referred to in the section of the description of the method embodiments.
The foregoing description is only of the preferred embodiments of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (11)

1. A method of measuring parameters, the method comprising:
displaying a first image of the target workpiece;
in response to a graphical instruction input for the first image, determining a geometry indicated by the graphical instruction;
determining geometric parameters of the geometric figure in a target reference coordinate system, and displaying the determined geometric parameters;
Wherein the target reference coordinate system is a pre-configured reference coordinate system, and the reference coordinate system is determined in advance by the following ways:
displaying a second image of the target workpiece;
determining a straight line indicated by a straight line axis instruction in response to the straight line axis instruction input for the geometric structure of the target workpiece in the second image;
A coordinate system with the determined straight line as a coordinate axis is constructed as a reference coordinate system.
2. The method according to claim 1, wherein the method further comprises:
In response to a parameter input operation for the second image input, determining a numerical value input by the parameter input operation as a scaling factor between the reference coordinate system and an image coordinate system of the second image;
the construction of a coordinate system with the determined straight line as a coordinate axis, as a reference coordinate system, includes:
and constructing a coordinate system which takes the determined straight line as a coordinate axis and the scaling coefficient as a scaling scale as a reference coordinate system.
3. The method according to claim 1, wherein the method further comprises:
Predetermining a plurality of reference coordinate systems as alternative reference coordinate systems;
In response to a coordinate system selection instruction input for the first image, an alternative reference coordinate system indicated by the coordinate system selection instruction is determined as a target reference coordinate system.
4. The method according to claim 1, wherein the method further comprises:
determining, in response to an information selection operation input for the second image, preset coordinate system information selected by the information selection operation as target coordinate system information;
displaying the reference coordinate system and the target coordinate system information in the second image;
Wherein the preset coordinate system information includes: the origin coordinate of the reference coordinate system, the coordinate system included angle of the reference coordinate system, the direction vector coordinate of the X axis of the reference coordinate system, the direction vector coordinate of the Y axis of the reference coordinate system, the included angle between the X axis of the reference coordinate system and the positive X axis direction of the image coordinate system of the second image, and the included angle between the Y axis of the reference coordinate system and the positive Y axis direction of the image coordinate system.
5. The method of claim 1, wherein said determining geometric parameters of said geometric figure in a target reference coordinate system comprises:
According to the coordinate transformation relation between the target reference coordinate system and the image coordinate system of the first image, projecting the geometric parameters of the geometric figure in the image coordinate system into the target reference coordinate system to obtain the geometric parameters of the geometric figure in the target reference coordinate system;
the coordinate transformation relation is determined in advance by the following modes:
translating the target reference coordinate system to obtain an offset reference coordinate system, wherein the origin of the offset reference coordinate system coincides with the origin of the image coordinate system;
determining an included angle between a direction vector of an X axis of the offset reference coordinate system and an X axis positive direction of the image coordinate system as a first included angle, and determining an included angle between a direction vector of a Y axis of the offset reference coordinate system and the X axis positive direction of the image coordinate system as a second included angle;
According to the first included angle and the second included angle, determining a substrate in the X-axis direction of the offset reference coordinate system as a first substrate, and determining a substrate in the Y-axis direction of the offset reference coordinate system as a second substrate;
And determining a coordinate transformation relation according to the first substrate and the second substrate.
6. The method of claim 1, wherein the target workpiece is a tablet computer;
The determining, in response to a graphics instruction input for the first image, a geometry indicated by the graphics instruction, comprising:
Determining a geometric figure indicated by a graphic instruction in response to the graphic instruction input for the first image, wherein the geometric figure is two endpoints of a long side or a short side of an inner screen of the tablet computer screen;
The determining the geometric parameters of the geometric figure in the target reference coordinate system and displaying the determined geometric parameters comprises the following steps:
Determining geometric parameters of the geometric figure in a target reference coordinate system, and displaying the determined geometric parameters, wherein the geometric parameters are distances between two endpoints of a long side or a short side of an inner screen of the tablet personal computer screen in the target reference coordinate system;
Wherein the target reference coordinate system is a pre-configured reference coordinate system, and the reference coordinate system is determined in advance by the following ways:
Displaying a second image of the tablet computer;
Responding to a linear axis instruction input for the geometric structure of the tablet personal computer in the second image, and determining a straight line indicated by the linear axis instruction, wherein the straight line indicated by the linear axis instruction is a straight line where the long side of the screen in the tablet personal computer screen is located and a straight line where the short side of the screen in the tablet personal computer screen is located;
A coordinate system with the determined straight line as a coordinate axis is constructed as a reference coordinate system.
7. The method of claim 1, wherein the target workpiece is a cell phone;
The determining, in response to a graphics instruction input for the first image, a geometry indicated by the graphics instruction, comprising:
responding to a graphic instruction input for the first image, and determining a geometric figure indicated by the graphic instruction, wherein the geometric figure is two endpoints of a long side or a short side of the outer edge of the charging hole of the mobile phone;
The determining the geometric parameters of the geometric figure in the target reference coordinate system and displaying the determined geometric parameters comprises the following steps:
Determining geometric parameters of the geometric figure in a target reference coordinate system, and displaying the determined geometric parameters, wherein the geometric parameters are distances between two endpoints of a long side or a short side of the outer edge of the mobile phone charging hole in the target reference coordinate system;
Wherein the target reference coordinate system is a pre-configured reference coordinate system, and the reference coordinate system is determined in advance by the following ways:
Displaying a second image of the mobile phone;
Responding to a linear axis instruction input for the geometric structure of the mobile phone in the second image, determining a straight line indicated by the linear axis instruction, wherein the straight line indicated by the linear axis instruction is a straight line where a long side of the outer edge of the mobile phone charging hole is located and a straight line where a short side of the outer edge of the mobile phone charging hole is located;
A coordinate system with the determined straight line as a coordinate axis is constructed as a reference coordinate system.
8. A parameter measurement device, the device comprising:
The first image display module is used for displaying a first image of the target workpiece;
A geometry determining module for determining, in response to a graphics instruction input for the first image, a geometry indicated by the graphics instruction;
the geometric parameter display module is used for determining geometric parameters of the geometric figure in a target reference coordinate system and displaying the determined geometric parameters;
Wherein the target reference coordinate system is a pre-configured reference coordinate system, and the reference coordinate system is determined in advance by the following ways:
displaying a second image of the target workpiece;
determining a straight line indicated by a straight line axis instruction in response to the straight line axis instruction input for the geometric structure of the target workpiece in the second image;
A coordinate system with the determined straight line as a coordinate axis is constructed as a reference coordinate system.
9. The apparatus of claim 8, wherein the apparatus further comprises:
A scaling factor determination module configured to determine, in response to a parameter input operation for the second image input, a numerical value input by the parameter input operation as a scaling factor between the reference coordinate system and an image coordinate system of the second image;
the construction of a coordinate system with the determined straight line as a coordinate axis, as a reference coordinate system, includes:
constructing a coordinate system which takes the determined straight line as a coordinate axis and the scaling coefficient as a scaling scale as a reference coordinate system;
The apparatus further comprises:
An alternative reference coordinate system determining module, configured to determine a plurality of reference coordinate systems in advance, as alternative reference coordinate systems;
a target reference coordinate system determining module, configured to determine, in response to a coordinate system selection instruction input for the first image, an alternative reference coordinate system indicated by the coordinate system selection instruction as a target reference coordinate system;
The apparatus further comprises:
A target coordinate system information determining module configured to determine, in response to an information selection operation input for the second image, preset coordinate system information selected by the information selection operation as target coordinate system information;
the target coordinate system information display module is used for displaying the reference coordinate system and the target coordinate system information in the second image;
Wherein the preset coordinate system information includes: the origin coordinate of the reference coordinate system, a coordinate system included angle of the reference coordinate system, a direction vector coordinate of an X axis of the reference coordinate system, a direction vector coordinate of a Y axis of the reference coordinate system, an included angle between the X axis of the reference coordinate system and an X axis positive direction of an image coordinate system of the second image, and an included angle between the Y axis of the reference coordinate system and a Y axis positive direction of the image coordinate system;
the determining geometric parameters of the geometric figure in the target reference coordinate system comprises the following steps:
According to the coordinate transformation relation between the target reference coordinate system and the image coordinate system of the first image, projecting the geometric parameters of the geometric figure in the image coordinate system into the target reference coordinate system to obtain the geometric parameters of the geometric figure in the target reference coordinate system;
the coordinate transformation relation is determined in advance by the following modes:
translating the target reference coordinate system to obtain an offset reference coordinate system, wherein the origin of the offset reference coordinate system coincides with the origin of the image coordinate system;
determining an included angle between a direction vector of an X axis of the offset reference coordinate system and an X axis positive direction of the image coordinate system as a first included angle, and determining an included angle between a direction vector of a Y axis of the offset reference coordinate system and the X axis positive direction of the image coordinate system as a second included angle;
According to the first included angle and the second included angle, determining a substrate in the X-axis direction of the offset reference coordinate system as a first substrate, and determining a substrate in the Y-axis direction of the offset reference coordinate system as a second substrate;
determining a coordinate transformation relation according to the first substrate and the second substrate;
The target workpiece is a tablet computer;
The determining, in response to a graphics instruction input for the first image, a geometry indicated by the graphics instruction, comprising:
Determining a geometric figure indicated by a graphic instruction in response to the graphic instruction input for the first image, wherein the geometric figure is two endpoints of a long side or a short side of an inner screen of the tablet computer screen;
The determining the geometric parameters of the geometric figure in the target reference coordinate system and displaying the determined geometric parameters comprises the following steps:
Determining geometric parameters of the geometric figure in a target reference coordinate system, and displaying the determined geometric parameters, wherein the geometric parameters are distances between two endpoints of a long side or a short side of an inner screen of the tablet personal computer screen in the target reference coordinate system;
Wherein the target reference coordinate system is a pre-configured reference coordinate system, and the reference coordinate system is determined in advance by the following ways:
Displaying a second image of the tablet computer;
Responding to a linear axis instruction input for the geometric structure of the tablet personal computer in the second image, and determining a straight line indicated by the linear axis instruction, wherein the straight line indicated by the linear axis instruction is a straight line where the long side of the screen in the tablet personal computer screen is located and a straight line where the short side of the screen in the tablet personal computer screen is located;
Constructing a coordinate system taking the determined straight line as a coordinate axis, and taking the coordinate system as a reference coordinate system;
The target workpiece is a mobile phone;
The determining, in response to a graphics instruction input for the first image, a geometry indicated by the graphics instruction, comprising:
responding to a graphic instruction input for the first image, and determining a geometric figure indicated by the graphic instruction, wherein the geometric figure is two endpoints of a long side or a short side of the outer edge of the charging hole of the mobile phone;
The determining the geometric parameters of the geometric figure in the target reference coordinate system and displaying the determined geometric parameters comprises the following steps:
Determining geometric parameters of the geometric figure in a target reference coordinate system, and displaying the determined geometric parameters, wherein the geometric parameters are distances between two endpoints of a long side or a short side of the outer edge of the mobile phone charging hole in the target reference coordinate system;
Wherein the target reference coordinate system is a pre-configured reference coordinate system, and the reference coordinate system is determined in advance by the following ways:
Displaying a second image of the mobile phone;
Responding to a linear axis instruction input for the geometric structure of the mobile phone in the second image, determining a straight line indicated by the linear axis instruction, wherein the straight line indicated by the linear axis instruction is a straight line where a long side of the outer edge of the mobile phone charging hole is located and a straight line where a short side of the outer edge of the mobile phone charging hole is located;
A coordinate system with the determined straight line as a coordinate axis is constructed as a reference coordinate system.
10. An electronic device, comprising:
A memory for storing a computer program;
A processor for carrying out the method steps of any one of claims 1-7 when executing a program stored on a memory.
11. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored therein a computer program which, when executed by a processor, implements the method steps of any of claims 1-7.
CN202410425621.8A 2024-04-09 2024-04-09 Parameter measurement method and device, electronic equipment and storage medium Pending CN118565330A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410425621.8A CN118565330A (en) 2024-04-09 2024-04-09 Parameter measurement method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410425621.8A CN118565330A (en) 2024-04-09 2024-04-09 Parameter measurement method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN118565330A true CN118565330A (en) 2024-08-30

Family

ID=92464318

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410425621.8A Pending CN118565330A (en) 2024-04-09 2024-04-09 Parameter measurement method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN118565330A (en)

Similar Documents

Publication Publication Date Title
CN108304119B (en) Object measuring method, intelligent terminal and computer readable storage medium
US12112503B2 (en) Method and apparatus for calibrating external parameters of image acquisition device, device and storage medium
CN111127422B (en) Image labeling method, device, system and host
CN111445533B (en) Binocular camera calibration method, device, equipment and medium
JP5122948B2 (en) Apparatus and method for detecting a pointer corresponding to a touch surface
US10578426B2 (en) Object measurement apparatus and object measurement method
CN111311671B (en) Workpiece measuring method and device, electronic equipment and storage medium
CN115797467A (en) Method, device and equipment for detecting calibration result of vehicle camera and storage medium
CN113840695B (en) Calibration inspection assembly, robot system, inspection method and calibration method
CN118565330A (en) Parameter measurement method and device, electronic equipment and storage medium
CN114546740A (en) Touch screen testing method, device and system and storage medium
CN114543669B (en) Mechanical arm calibration method, device, equipment and storage medium
CN115937069B (en) Part detection method, device, electronic equipment and storage medium
CN111442756B (en) Method and device for measuring unmanned aerial vehicle shaking angle based on laser array
CN117115233B (en) Dimension measurement method and device based on machine vision and electronic equipment
CN109872368B (en) Image processing method, device and test system
CN115408770A (en) Method and device for generating size data report template of vehicle
CN117974599A (en) Keyboard cap height detection method and device and electronic equipment
CN113643358A (en) External parameter calibration method, device, storage medium and system of camera
CN115268674A (en) Laser pen indication data marking method, device, equipment and computer storage medium
CN117450937A (en) Method, system, computer and storage medium for detecting glue height of device
CN117325160A (en) Mechanical arm calibration method and device, electronic equipment and storage medium
CN115423883A (en) Method and device for calibrating contourgraph camera and electronic equipment
JP2024068012A (en) Analog meter reading system and method
CN116878825A (en) Calibration method, device, equipment and storage medium of 3D imaging system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination