CN112066893B - Method and device for measuring height of key cap of keyboard - Google Patents

Method and device for measuring height of key cap of keyboard Download PDF

Info

Publication number
CN112066893B
CN112066893B CN202010820255.8A CN202010820255A CN112066893B CN 112066893 B CN112066893 B CN 112066893B CN 202010820255 A CN202010820255 A CN 202010820255A CN 112066893 B CN112066893 B CN 112066893B
Authority
CN
China
Prior art keywords
keyboard
point cloud
cloud data
registration
scanning
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.)
Active
Application number
CN202010820255.8A
Other languages
Chinese (zh)
Other versions
CN112066893A (en
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.)
Suzhou Jieruisi Intelligent Technology Co ltd
Original Assignee
Suzhou Jieruisi Intelligent Technology 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 Suzhou Jieruisi Intelligent Technology Co ltd filed Critical Suzhou Jieruisi Intelligent Technology Co ltd
Priority to CN202010820255.8A priority Critical patent/CN112066893B/en
Publication of CN112066893A publication Critical patent/CN112066893A/en
Application granted granted Critical
Publication of CN112066893B publication Critical patent/CN112066893B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/02Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness
    • G01B11/04Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness specially adapted for measuring length or width of objects while moving
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/24Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures

Abstract

The invention discloses a method and a device for measuring the height of a key cap of a keyboard, wherein the method comprises the following steps: a. scanning the surface of the keyboard containing the keycap by using a contourgraph to obtain point cloud data of the surface of the keyboard; b. and calculating the height of the keycap of the keyboard according to the point cloud data on the surface of the keyboard. The method and the device for measuring the height of the key caps of the keyboard can automatically measure the height of each key cap on various keyboards such as a PC (personal computer), a notebook computer and the like, can accurately output the height value of each key cap only by scanning each key cap of the keyboard once in sequence by using the contourgraph, can be completely automatic in the whole process, does not need manual intervention, and solves the problems of low measuring efficiency, low precision and the like of the key caps in the prior art.

Description

Method and device for measuring height of key cap of keyboard
Technical Field
The invention relates to a measurement technology for measuring a keyboard keycap, in particular to a method and a device for measuring the height of the keyboard keycap.
Background
In order to ensure the factory quality of the keyboard, the keyboard must be subjected to consistency measurement on each keycap after assembly to determine whether the height of each keycap is consistent with the design parameters. When the difference between the actual height of the keycap and the design value is larger than the threshold value, the keyboard is judged to be an NG (No good) product and needs to be processed and assembled again.
For the height measurement of the key caps of the keyboards, most manufacturers still adopt manual visual observation at present, and the measurement result is often related to the working experience of measuring personnel, so that great uncertainty exists. In addition, some companies have proposed automatic or semi-automatic methods, such as a slide bar method disclosed in the chinese utility model patent publication No. CN202204432U, a line camera scanning method disclosed in the chinese invention patent application publication No. CN103727883A, a laser camera joint observation method disclosed in the chinese invention patent application publication No. CN104792266A, and a three-dimensional method.
The traditional technology has the following technical problems:
(1) the detection speed is slow. No matter it is the manual work measurement of visualing, or cubic method, slide bar method measurement, all need manual operation physical machinery, stay the detection for a long time on every key cap, can not accomplish real-time, influence measurement of efficiency. The linear array camera scanning method is time-consuming in image data processing, and the working efficiency of the linear array camera scanning method and the laser camera combined observation method is also influenced.
(2) The detection precision is low. Because the three-dimensional coordinate data of the key cap of the keyboard is not directly acquired, the height value of the key cap can only be indirectly acquired by adopting a human engineering method and a linear array camera scanning method, errors may exist in data processing, detection precision is inaccurate, and the requirements of customers are difficult to completely meet.
Disclosure of Invention
The invention aims to provide a method and a device for measuring the height of a key cap of a keyboard, which have high detection speed and high detection precision.
In order to solve the technical problem, the invention provides a method for measuring the height of a keycap of a keyboard, which comprises the following steps:
a. scanning the surface of the keyboard containing the keycap by using a contourgraph to obtain point cloud data of the surface of the keyboard;
b. and calculating the height of the keycap of the keyboard according to the point cloud data on the surface of the keyboard.
In one embodiment, the step a of scanning the surface of the keyboard containing the keycaps by using a profiler comprises:
the profiler is made perpendicular to the surface of the keyboard containing the keycaps, scanning from one end of the keyboard until the other end of the keyboard is reached.
In one embodiment, the step a of scanning the surface of the keyboard containing the keycaps by using a profiler comprises:
a1. scanning the contourgraph from a first end of the keyboard along a first direction relative to the keyboard until reaching a second end of the keyboard to finish a first scanning band, wherein the contourgraph is vertical to the surface of the keyboard containing the keycaps;
a2. moving the profiler relative to the keyboard along a second direction perpendicular to the first direction by a distance that is less than the scan width of the profiler, wherein the second direction is also parallel to a surface of the keyboard containing the keycaps;
a3. scanning the profiler relative to the keyboard in a direction opposite to the first direction from the second end of the keyboard until the first end of the keyboard is reached, and completing a second scanning band;
a4. judging whether the scanning is finished on the surface of the keyboard containing the keycap or not, if so, finishing the scanning; if not, the profiler is moved a distance in a second direction relative to the keyboard, and the process returns to step a1 until the scanning of the surface of the keyboard containing the keycaps is completed.
In one embodiment, a registration ball is arranged at one end of the keyboard, the registration ball is arranged in a scanning area of the profiler, and the point cloud data of a plurality of scanning bands are combined into the point cloud data of the keyboard surface according to the point cloud data of the registration ball in the plurality of scanning bands.
In one embodiment, merging the point cloud data of the plurality of scan bands into the point cloud data of the keyboard surface according to the point cloud data of the registration sphere at the plurality of scan bands comprises:
(1) extracting point cloud data of the registration sphere;
(2) calculating registration parameters between adjacent scanning bands according to the point cloud data of the registration sphere;
(3) sequentially merging the point cloud data of the adjacent scanning bands into point cloud data of the keyboard surface according to the registration parameters;
wherein, step (2) includes:
(21) defining a first direction as an X axis, a second direction as a Y axis, and a direction of a scanning optical axis of the contourgraph as a Z axis to form a right-hand rectangular coordinate system;
(22) defining the coordinate form of the center of the registration sphere on the first scanning band as
Figure BDA0002634202000000031
On the adjacent second scanning band, the coordinate form is
Figure BDA0002634202000000032
In which the coordinate form
Figure BDA0002634202000000033
Coordinates of the jth registration sphere in the ith scanning strip are shown, and translation registration parameters of the registration sphere in the X, Y, Z axis and rotation registration parameters of a rotation angle of the scanning point cloud relative to the X, Y, Z axis are respectively delta x, delta y, delta z, alpha, beta and kappa,
for an arbitrary registration sphere j, its coordinate transformation equation in two adjacent scan bands is in the form of
X1=M·X2
Wherein the content of the first and second substances,
Figure BDA0002634202000000034
Figure BDA0002634202000000035
Figure BDA0002634202000000041
m and delta are respectively a rotation matrix and a translation matrix formed by rotation parameters and translation parameters;
substituting the central coordinates of each registration ball in different scanning zones into the formula, and using a classical least square method
Figure BDA0002634202000000042
Calculating six parameter values to obtain registration parameters between adjacent scanning bands;
the step (3) comprises the following steps:
substituting the obtained translation parameters and the rotation parameters delta x, delta y, delta z, alpha, beta and kappa into the point cloud obtained by the adjacent strips, and calculating the point cloud coordinate after registration
P1′=M·P1
Wherein, P1And P1' point cloud coordinates before and after registration respectively;
and sequentially combining the point cloud data of the adjacent scanning bands into the point cloud data of the keyboard surface according to the registered point cloud coordinates.
In one embodiment, step (1) is implemented by one of the following methods:
the method comprises the steps that a high-reflectivity sphere is used as the registration sphere, point cloud data are extracted by utilizing the gray value difference between the high-reflectivity sphere and a keyboard, and if the difference between the gray value of a certain point and the gray value of the keyboard is larger than a preset threshold value, the point cloud data of the point are extracted as the point cloud data of the registration sphere;
using a high-reflectivity sphere as the registration sphere, extracting point cloud data by using the point cloud echo intensity value difference between the high-reflectivity sphere and the keyboard, and if the difference between the echo intensity value of a certain point and the echo intensity value of the keyboard is greater than a preset threshold value, extracting the point cloud data of the point as the point cloud data of the registration sphere;
extracting a sphere point cloud according to the position of the registration sphere, and if the point cloud data is positioned at the edge of the scanning area and is discontinuous with other point cloud data, extracting the point cloud data into registration sphere point cloud data;
and extracting the point cloud data of the registration sphere according to the height difference of the registration sphere and the keyboard.
In one embodiment, the step b includes:
b1. extracting background point clouds of the keycaps;
b2. constructing a plane equation, taking points in the background point cloud of the keycap as input values, calculating each coefficient of the plane equation according to a classical least square method to obtain a mathematical expression equation of the background plane, and fitting the background point cloud of the keycap into the background plane;
b3. and calculating the distance from the central point of the keycap to the background plane to obtain the height of the keycap of the keyboard.
In one embodiment, the step b3, calculating the distance from the center point of the keycap to the background plane includes:
extracting edge point clouds of the keycaps;
calculating two-dimensional barycentric coordinates (x) of all points on the edge of the keycap0,y0) Then searching barycentric coordinates (x)0,y0) Neighborhood point P (x, y, z) in the region xi, the neighborhood points searched for satisfy:
(|x-x0|2+|y-y0|2)1/2<ξ
calculating the gravity centers of the searched adjacent points to obtain the coordinate mean values of all the adjacent points in all directions;
the distance of the coordinate mean to the background plane is calculated.
In one embodiment, the method for extracting the background point cloud and the edge point cloud of the keycap comprises the following steps:
(1) counting the distribution number of each height interval of the measured point cloud data according to the Z-axis direction by utilizing the histogram, and calculating the minimum statistic position between the maximum statistic and the second maximum statistic to obtain the height segmentation threshold lambda of the key cap of the keyboard and the background surface of the keyboard;
(2) sequentially judging whether the Z-axis coordinate of each point in the point cloud data is larger than a height segmentation threshold lambda or not, and if so, judging that the point is a point on the keycap; if not, judging that the point is a point on the background plane of the keycap;
(3) and sequentially judging the gradient values of each point and adjacent points in the point cloud data in the plane coordinate range of the keyboard, if the gradient values are greater than a threshold value, judging the point as an edge point of the keycap, otherwise, judging the point as a non-edge point of the keycap.
Based on the same inventive concept, the invention also provides a device for executing the method for measuring the height of the key cap of the keyboard.
The method and the device for measuring the height of the key caps of the keyboard can automatically measure the height of each key cap on various keyboards such as a PC (personal computer), a notebook computer and the like, can accurately output the height value of each key cap only by scanning each key cap of the keyboard once in sequence by using the contourgraph, can be completely automatic in the whole process, does not need manual intervention, and solves the problems of low measuring efficiency, low precision and the like of the key caps in the prior art.
Drawings
FIG. 1 is a schematic diagram of keyboard detection in the method for measuring the height of key caps of a keyboard.
FIG. 2 is a schematic diagram of point cloud data collection of key caps of a keyboard according to the method for measuring the height of the key caps of the keyboard of the present invention.
FIG. 3 is a flow chart of a method for measuring the height of a key cap of a keyboard according to the present invention.
FIG. 4 is a schematic diagram of the edge of a key cap of a keyboard according to the method for measuring the height of the key cap of the keyboard of the present invention.
FIG. 5 is a histogram for keyboard key cap and background extraction for the method of measuring keyboard key cap height of the present invention.
Detailed Description
The present invention is further described below in conjunction with the following figures and specific examples so that those skilled in the art may better understand the present invention and practice it, but the examples are not intended to limit the present invention.
First, in order to better describe and understand the method for measuring the height of the key cap of the keyboard of the present invention, an embodiment of a possible apparatus for measuring the height of the key cap of the keyboard, which is used in conjunction with the method for measuring the height of the key cap of the keyboard of the present invention, is described below. Referring to fig. 1 and 2, firstly, the contourgraph 2 is fixed above the keyboard 4 by the fixing bracket 1, the keyboard 4 is arranged on the keyboard carrier 3, the keyboard carrier 3 is fixed on the linear motion platform 6, and can move with the linear motion platform 6 along the horizontal and vertical directions at a constant speed, and the horizontal axes of the keyboard and the carrier are consistent with the horizontal movement direction. At least 3 high-reflectivity spheres for registering upper and lower point clouds of adjacent scanning bands, namely point cloud registration spheres 7, are respectively arranged in the areas close to two sides of the carrier close to the edge of the keyboard, the height of the spheres is selected according to experience, the requirement that the point clouds of the spheres and the point clouds of the key caps of the keyboard can be clearly separated is met, and generally, the height of the spheres is at least 0.5cm larger than the average height of the key caps. It is understood that, besides the fixing bracket 1 is used to fix the profiler 2 below the keyboard, other fixing manners may be used, which are not important in the present invention and will not be described herein again.
The method for measuring the height of the key cap of the keyboard described below can be implemented by the system for measuring the height of the key cap of the keyboard described above, or can be implemented without the system for measuring the height of the key cap of the keyboard described above.
Referring to fig. 3, an embodiment of the method for measuring the height of the key cap of the keyboard according to the present invention includes:
a. scanning the surface of the keyboard containing the keycap by using a contourgraph to obtain point cloud data of the surface of the keyboard;
b. and calculating the height of the keycap of the keyboard according to the point cloud data on the surface of the keyboard.
It can be understood that during the scanning process of the keyboard by the profiler, the profiler and the keyboard only need to move relatively, for example, the keyboard is moved alone and the profiler is not moved, or both the profiler and the keyboard are moved. In addition, the placing position of the keyboard can be selected at will, and only the scanning axis of the contourgraph is ensured to be vertical to the plane where the keycap of the keyboard is located. For example, the keyboard is horizontally arranged, or vertically arranged, or inclined at a certain angle. As a preferable scheme, as shown in the embodiment shown in fig. 1 and fig. 2, the keyboard can be horizontally arranged, which is more beneficial to taking and placing operations and scanning. And the scanning operation by driving the profiler to move by using the device is easier to realize and more stable than the operation of moving a keyboard.
It will be appreciated that the keyboard of the present invention may be a small width keyboard such as a portable folding bluetooth keyboard. Or a keyboard with a relatively wide width, such as a computer keyboard. When the width of the keyboard is small enough, namely smaller than the scanning width of the contourgraph, the scanning can be finished at one time; when the width of the keyboard is larger than the scanning width of the profiler, the profiler cannot complete the scanning of the whole keyboard at one time due to the limitation of the scanning width, and a wide keyboard needs to be scanned for multiple times to form a plurality of scanning bands to be spliced so as to cover the whole keyboard.
In the following, specific methods for scanning the surface of the key cap of the profiler for the keyboard with the smaller width and the keyboard with the larger width will be described.
Wherein, utilize the profilometer to contain the surface of key cap to the less keyboard of width and scan the process as follows:
the scanning axis of the profiler is perpendicular to the surface of the keyboard containing the keycaps, and the scanning is started from one end of the keyboard until the other end of the keyboard is reached. Because the width of the keyboard is smaller than the scanning width of the profiler, the scanning can be completed by one time.
Wherein, utilize the profilometer to contain the surface of key cap to the great keyboard of width and scan the process as follows:
a1. scanning the contourgraph from a first end of the keyboard along a first direction relative to the keyboard until reaching a second end of the keyboard to finish a first scanning band, wherein the contourgraph is vertical to the surface of the keyboard containing the keycaps;
a2. moving the profiler relative to the keyboard along a second direction perpendicular to the first direction by a distance that is less than the scan width of the profiler, wherein the second direction is also parallel to a surface of the keyboard containing the keycaps;
a3. scanning the profiler relative to the keyboard in a direction opposite to the first direction from the second end of the keyboard until reaching the first end of the keyboard to complete a second scan band;
a4. judging whether the scanning is finished on the surface of the keyboard containing the keycaps or not, if so, finishing the scanning; if not, the profiler is moved a distance in a second direction relative to the keyboard, and the process returns to step a1 until the scanning of the surface of the keyboard containing the keycaps is completed.
In this embodiment, since the width of the keyboard is greater than the scanning width of the profiler, the scanning cannot be completed once per pass, and the scanning can be completed once or even many times in a round trip according to the width of the keyboard. In this embodiment, the profiler moves relative to the keyboard to complete the scanning, and the invention is not limited to this, as long as the keyboard is kept still and the profiler is driven to move, or the profiler is kept still and the keyboard is driven to move, or the profiler and the keyboard are driven to move at the same time.
After step a3 is completed, the scanning is completed in one round trip, and two scanning bands are obtained. The two scan bands need to have overlapping portions in order to splice adjacent scan bands in a subsequent step. Therefore, after a single pass of the scan has completed a scan band, the profiler needs to be moved relative to the keyboard in the second direction by a distance that is less than the scan width of the profiler. Then, in step a4, it is determined whether the scanning of the whole keyboard is completed after two scanning bands are obtained by the one-time scanning, and if not, the scanning is continued by moving the profiler relative to the keyboard by a distance along the second direction. And whether the scanning of the whole keyboard is finished or not is judged every time the scanning is finished until the scanning of the surface of the keyboard containing the keycaps is finished.
In order to more conveniently and accurately merge the point cloud data of a plurality of scanning bands into the point cloud data of the keyboard surface. A registration sphere may be disposed at one end of the keyboard, wherein the registration sphere is disposed within the scanning area of the profiler, and then the point cloud data of the plurality of scan bands is merged into point cloud data of the keyboard surface according to the point cloud data of the registration sphere at the plurality of scan bands.
Specifically, in this embodiment, merging the point cloud data of multiple scan bands into the point cloud data of the keyboard surface according to the point cloud data of the registration ball in the multiple scan bands includes:
step (1): and extracting point cloud data of the registration sphere.
Wherein, the step (1) can be realized by one of the following methods:
the method comprises the following steps: and a high-reflectivity sphere is adopted as the registration sphere, and the point cloud data can be extracted by utilizing the gray value difference between the high-reflectivity sphere and the keyboard. That is, if the gray value of a certain point is much greater than the threshold between the reflectivity sphere and the keyboard, the point cloud data of the point is extracted as the point cloud data of the registration sphere. The high reflectivity is greater than the reflectivity of the keyboard by a threshold value, which makes the computer easily identify the two and is not easy to be identified.
The second method comprises the following steps: and if the echo intensity value of a certain point is greater than a preset threshold value, the point cloud data of the point is extracted as the point cloud data of the registration sphere. The high reflectivity is greater than the reflectivity of the keyboard by a threshold value, which makes the computer easily identify the two and is not easy to be identified.
That is to say that the temperature of the molten steel is,
Figure BDA0002634202000000091
wherein, PareaRepresenting the point cloud corresponding to the area, PballRepresenting registered sphere regions,
Figure BDA0002634202000000092
Representing non-registered spherical regions, p0Representing a preset threshold.
It will be appreciated that the preset threshold ρ is0Depending on the specific model of the profiler, it may be obtained empirically.
The third method comprises the following steps: and extracting the point cloud data of the sphere according to the position of the registration sphere, and if the point cloud data is positioned at the edge of the scanning area and is discontinuous with other point cloud data, extracting the point cloud data into the point cloud data of the registration sphere.
That is to say, since the registration sphere and the keyboard are not a continuous whole, the point cloud data of the registration sphere and the keyboard are necessarily discontinuous, and the point cloud data of the keyboard and the registration sphere can be distinguished from all the point cloud data according to the characteristic.
The method four comprises the following steps: and extracting the point cloud data of the registration sphere according to the height difference of the registration sphere and the keyboard.
For the registration sphere with the height larger than that of the keyboard, the height of the sphere is at least 0.5cm larger than the average height of the keycaps, and thus, the height of point cloud data of the registration sphere is higher than that of the point cloud data of the keyboard. That is, if the height value, i.e., the Z coordinate, of a certain point is smaller than a preset threshold, the point cloud data of the point is extracted as the point cloud data of the registration sphere.
That is to say that the position of the first electrode,
Figure BDA0002634202000000101
wherein, PareaRepresenting a point cloud corresponding to the area; z is a radical ofareaThe Z coordinate of the point cloud of the region to be determined is represented as the higher the position is (the direction of the scanning optical axis of the contourgraph is the Z axis); z is a radical of0The threshold for distinguishing the registration ball from the keyboard according to the Z coordinate is determined by the model number and experience of the registration ball.
Step (2): and calculating registration parameters between adjacent scanning bands according to the point cloud data of the registration sphere.
Specifically, the step (2) includes:
(21) defining a first direction as an X axis, a second direction as a Y axis, and a direction of a scanning optical axis of the contourgraph as a Z axis to form a right-hand rectangular coordinate system;
(22) defining the coordinate form of the center of the registration sphere on the first scanning band as
Figure BDA0002634202000000102
On the adjacent second scanning band, the coordinate form is
Figure BDA0002634202000000103
In which the coordinate form
Figure BDA0002634202000000104
Coordinates of the jth registration sphere in the ith scanning strip are shown, and translation registration parameters of the registration sphere in the X, Y, Z axis and rotation registration parameters of a rotation angle of the scanning point cloud relative to the X, Y, Z axis are respectively delta x, delta y, delta z, alpha, beta and kappa,
for an arbitrary registration sphere j, its coordinate transformation equation in two adjacent scan bands is in the form of
X1=M·X2
Wherein the content of the first and second substances,
Figure BDA0002634202000000105
Figure BDA0002634202000000111
Figure BDA0002634202000000112
m and delta are respectively a rotation matrix and a translation matrix formed by rotation parameters and translation parameters;
and substituting the central coordinates of each registration ball in different scanning zones into the formula, and calculating six parameter values by using a classical least square method to obtain registration parameters between adjacent scanning zones.
It can be understood that since each registration sphere center point contains three coordinate values of x, y and z, six parameters are calculated, at least two points are needed, and in order to implement the least square adjustment algorithm, at least three spheres for registration need to be designed for adjacent scan bands.
It is understood that the term adjacent swaths refers to the immediately preceding and succeeding swaths formed with the two-dimensional profiler offset by a distance. It will be appreciated how many adjacent scan bands will be assigned registration spheres according to the least squares adjustment algorithm, where the corresponding number and corresponding positions of the registration spheres are the same.
And (3): and sequentially combining the point cloud data of the adjacent scanning bands into point cloud data of the keyboard surface according to the registration parameters.
Specifically, the step (3) includes:
Figure BDA0002634202000000113
substituting the obtained translation parameters and rotation parameters delta x, delta y, delta z, alpha, beta and kappa into the point cloud obtained by the adjacent strips, and calculating the point cloud coordinate after registration
P1′=M·P1
Wherein, P1And P1' point cloud coordinates before and after registration respectively; m and delta are respectively a rotation matrix and a translation matrix formed by rotation parameters and translation parameters;
and sequentially combining the point cloud data of the adjacent scanning bands into the point cloud data of the keyboard surface according to the registered point cloud coordinates.
In the above description, a contourgraph is used to scan the surface of the keyboard containing the key caps to obtain point cloud data of the surface of the keyboard, and in the following description, how to calculate the heights of the key caps of the keyboard according to the point cloud data of the surface of the keyboard is specifically described.
It will be appreciated that once the point cloud data is acquired, the calculation of the heights of the key caps of the keyboard from the point cloud data on the surface of the keyboard is consistent for both a keyboard with a smaller width (by which is meant the scan width of the profiler is greater than the width of the keyboard) and a keyboard with a wider width (by which is meant the scan width of the profiler is greater than the width of the keyboard), i.e., the following method is applicable for both a keyboard with a smaller width and a keyboard with a wider width.
Calculating the height of a keycap of the keyboard according to the point cloud data on the surface of the keyboard, and specifically comprising the following steps:
b1. and extracting background point clouds of the keycaps.
b2. And constructing a plane equation, taking points in the background point cloud of the keycap as input values, calculating each coefficient of the plane equation according to a classical least square method to obtain a mathematical expression equation of the background plane, and fitting the background point cloud of the keycap into the background plane.
b3. And calculating the distance from the central point of the keycap to the background plane to obtain the height of the keycap of the keyboard.
In step b3, calculating the distance from the center point of the keycap to the background plane, specifically including:
extracting the edge point cloud of the keycap;
calculating two-dimensional barycentric coordinates (x) of all points on the edge of the keycap0,y0) Then searching for barycentric coordinates (x)0,y0) Neighborhood point P (x, y, z) in the region xi, the neighborhood points searched for satisfy:
(|x-x0|2+|y-y0|2)1/2<ξ
calculating the gravity centers of the searched adjacent points to obtain the coordinate mean values of all the adjacent points in all directions;
the distance of the coordinate mean to the background plane is calculated.
Generally, the number of searched neighbor points is 3-10.
Referring to fig. 4 and 5, the method for extracting the background point cloud and the edge point cloud of the keycap specifically includes:
(1) and counting the distribution number of each height interval by utilizing the histogram to the measured point cloud data according to the Z-axis direction, calculating the minimum statistic position between the maximum statistic and the second maximum statistic, and obtaining the height segmentation threshold lambda of the key cap of the keyboard and the background surface of the keyboard.
(2) Sequentially judging whether the Z-axis coordinate of each point in the point cloud data is larger than a height segmentation threshold lambda or not, and if so, judging that the point is a point on the keycap; if not, the point is judged to be a point on the background plane of the keycap.
That is, the height difference between the key cap and its background and the keyboard position range are used to determine the point cloud of the key cap and the key cap background, and the calculation formula is
Figure BDA0002634202000000131
Where P represents a certain undetermined point in the point cloud, P1And P0Respectively representing a point on the keycap and a keycap background point. x is the number ofp,yp,zpRespectively is the three-dimensional coordinate, pi, of the registered P pointx,yIs the keyboard plane coordinate range, and λ is the height threshold of the keyboard keycap and the keyboard background surface.
(3) And sequentially judging gradient values of each point and adjacent points in the point cloud data in the plane coordinate range of the keyboard, if the gradient values are greater than a threshold value, judging the point as an edge point of the keycap, and otherwise, judging the point as a non-edge point of the keycap.
That is to say, calculate the gradient value of each point in the point cloud on the key cap at first, the concrete formula is:
Figure BDA0002634202000000132
wherein +1Is a certain point P on the keycap1Gradient value of (x)1And z1Are each P1Coordinate values in the x-and z-directions, x1' and z1' is the sum of P in the point cloud1Adjacent point P1' coordinate values in x-direction and z-direction.
The calculation formula of the edge of the keycap is as follows:
Figure BDA0002634202000000133
in the above formula, η is a threshold parameter, generally between 0.5 and 2, and is determined empirically, PedgePointIs representative of a keycap edge point, PotherPointsRepresenting non-edge points.
Based on the same inventive concept, the invention also provides a device for executing the method for measuring the height of the key cap of the keyboard.
The above-mentioned embodiments are merely preferred embodiments for fully illustrating the present invention, and the scope of the present invention is not limited thereto. The equivalent substitution or change made by the technical personnel in the technical field on the basis of the invention is all within the protection scope of the invention. The protection scope of the invention is subject to the claims.

Claims (7)

1. A method of measuring the height of a key cap of a keyboard, the method comprising:
a. scanning the surface of the keyboard containing the keycap by using a contourgraph to obtain point cloud data of the surface of the keyboard;
b. calculating the height of a keycap of the keyboard according to the point cloud data on the surface of the keyboard;
wherein, in the step a, scanning the surface of the keyboard containing the keycap by using the contourgraph comprises:
a1. scanning the contourgraph from a first end of the keyboard along a first direction relative to the keyboard until reaching a second end of the keyboard to finish a first scanning band, wherein the contourgraph is vertical to the surface of the keyboard containing the keycaps;
a2. moving the profiler relative to the keyboard along a second direction perpendicular to the first direction by a distance that is less than the scan width of the profiler, wherein the second direction is also parallel to a surface of the keyboard containing the keycaps;
a3. scanning the profiler relative to the keyboard in a direction opposite to the first direction from the second end of the keyboard until the first end of the keyboard is reached, and completing a second scanning band;
a4. judging whether the scanning is finished on the surface of the keyboard containing the keycap or not, if so, finishing the scanning; if not, moving the profiler relative to the keyboard by a distance along the second direction, and returning to the step a1 until the surface of the keyboard containing the keycaps is scanned;
a registration ball is arranged at one end of the keyboard, the registration ball is arranged in a scanning area of the profiler, and the point cloud data of the plurality of scanning bands are combined into point cloud data of the keyboard surface according to the point cloud data of the registration ball in the plurality of scanning bands;
merging the point cloud data of the plurality of scan bands into the point cloud data of the keyboard surface according to the point cloud data of the registration sphere in the plurality of scan bands comprises:
(1) extracting point cloud data of the registration sphere;
(2) calculating registration parameters between adjacent scanning bands according to the point cloud data of the registration sphere;
(3) sequentially merging the point cloud data of the adjacent scanning bands into point cloud data of the keyboard surface according to the registration parameters;
wherein, step (2) includes:
Figure FDA0003591737330000021
(21) defining a first direction as an X axis, a second direction as a Y axis and a direction of a scanning optical axis of the contourgraph as a Z axis to form a right-hand rectangular coordinate system;
(22) defining the coordinate form of the center of the registration sphere on the first scanning band as
Figure FDA0003591737330000022
On the adjacent second scanning band, the coordinate form is
Figure FDA0003591737330000023
In which the coordinate form
Figure FDA0003591737330000024
Indicating the j-th registration sphereAt the coordinates of the ith scanning strip, the translation registration parameters of the registration sphere at the X, Y, Z axis and the rotation registration parameters of the rotation angle of the scanning point cloud relative to the X, Y, Z axis are respectively Δ x, Δ y, Δ z, α, β, κ,
for an arbitrary registration sphere j, its coordinate transformation equation in two adjacent scan bands is in the form of
X1=M·X2
Wherein the content of the first and second substances,
Figure FDA0003591737330000025
Figure FDA0003591737330000026
Figure FDA0003591737330000027
m and delta are respectively a rotation matrix and a translation matrix formed by rotation parameters and translation parameters;
substituting the central coordinates of each registration ball in different scanning zones into the formula, and calculating six parameter values by using a classical least square method to obtain registration parameters between adjacent scanning zones;
the step (3) comprises the following steps:
substituting the obtained translation parameters and rotation parameters delta x, delta y, delta z, alpha, beta and kappa into the point cloud obtained by the adjacent strips, and calculating the point cloud coordinate after registration
P1′=M·P1
Wherein, P1And P1' point cloud coordinates before and after registration respectively;
and sequentially combining the point cloud data of the adjacent scanning bands into the point cloud data of the keyboard surface according to the registered point cloud coordinates.
2. The method for measuring the height of the key caps of the keyboard according to claim 1, wherein the step a of scanning the surface of the keyboard containing the key caps by using a profiler comprises the following steps:
the profilometer is made to scan from one end of the keyboard to the other end of the keyboard, perpendicular to the surface of the keyboard containing the keycaps.
3. The method of measuring the height of a key cap of a keyboard of claim 1, wherein step (1) is performed by one of the following methods:
the method comprises the steps that a high-reflectivity sphere is used as the registration sphere, point cloud data are extracted by utilizing the gray value difference between the high-reflectivity sphere and a keyboard, and if the difference between the gray value of a certain point and the gray value of the keyboard is larger than a preset threshold value, the point cloud data of the point are extracted as the point cloud data of the registration sphere;
using a high-reflectivity sphere as the registration sphere, extracting point cloud data by using the point cloud echo intensity value difference between the high-reflectivity sphere and the keyboard, and if the difference between the echo intensity value of a certain point and the echo intensity value of the keyboard is greater than a preset threshold value, extracting the point cloud data of the point as the point cloud data of the registration sphere;
extracting a sphere point cloud according to the position of the registration sphere, and if the point cloud data is positioned at the edge of the scanning area and is discontinuous with other point cloud data, extracting the point cloud data into registration sphere point cloud data;
and extracting the point cloud data of the registration sphere according to the height difference of the registration sphere and the keyboard.
4. The method of measuring the height of a key cap of a keyboard of claim 1, wherein step b comprises:
b1. extracting background point clouds of the keycaps;
b2. constructing a plane equation, taking points in the background point cloud of the keycap as input values, calculating each coefficient of the plane equation according to a classical least square method to obtain a mathematical expression equation of the background plane, and fitting the background point cloud of the keycap into the background plane;
b3. and calculating the distance from the central point of the keycap to the background plane to obtain the height of the keycap of the keyboard.
5. The method of claim 4, wherein the step b3 of calculating the distance from the center point of the key cap to the background plane comprises:
extracting edge point clouds of the keycaps;
calculating two-dimensional barycentric coordinates (x) of all points on the edge of the keycap0,y0) Then searching barycentric coordinates (x)0,y0) Neighborhood point P (x, y, z) in the region xi, the neighborhood points searched for satisfy:
(|x-x0|2+|y-y0|2)1/2<ξ
calculating the gravity centers of the searched adjacent points to obtain the coordinate mean values of all the adjacent points in all directions;
the distance of the coordinate mean to the background plane is calculated.
6. The method of measuring keyboard key cap height of claim 5, wherein the method of extracting background point clouds and edge point clouds of key caps comprises:
(1) counting the distribution number of each height interval by utilizing the histogram to the measured point cloud data according to the Z-axis direction, and calculating the minimum statistic position between the maximum statistic and the second maximum statistic to obtain the height segmentation threshold lambda of the key cap of the keyboard and the background surface of the keyboard;
(2) sequentially judging whether the Z-axis coordinate of each point in the point cloud data is larger than a height segmentation threshold lambda or not, and if so, judging that the point is a point on the keycap; if not, judging that the point is a point on the background plane of the keycap;
(3) and sequentially judging gradient values of each point and adjacent points in the point cloud data in the plane coordinate range of the keyboard, if the gradient values are greater than a threshold value, judging the point as an edge point of the keycap, and otherwise, judging the point as a non-edge point of the keycap.
7. An apparatus for performing the method of measuring the height of a key cap of a keyboard of any of claims 1-6.
CN202010820255.8A 2020-08-14 2020-08-14 Method and device for measuring height of key cap of keyboard Active CN112066893B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010820255.8A CN112066893B (en) 2020-08-14 2020-08-14 Method and device for measuring height of key cap of keyboard

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010820255.8A CN112066893B (en) 2020-08-14 2020-08-14 Method and device for measuring height of key cap of keyboard

Publications (2)

Publication Number Publication Date
CN112066893A CN112066893A (en) 2020-12-11
CN112066893B true CN112066893B (en) 2022-06-07

Family

ID=73661764

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010820255.8A Active CN112066893B (en) 2020-08-14 2020-08-14 Method and device for measuring height of key cap of keyboard

Country Status (1)

Country Link
CN (1) CN112066893B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107289908A (en) * 2016-04-12 2017-10-24 苏州杰锐思自动化设备有限公司 Keyboard appearance automatic detection device
CN108107444A (en) * 2017-12-28 2018-06-01 国网黑龙江省电力有限公司检修公司 Substation's method for recognizing impurities based on laser data
CN207882161U (en) * 2018-02-01 2018-09-18 苏州杰锐思自动化设备有限公司 Laptop appearance detecting device
CN109099861A (en) * 2018-09-19 2018-12-28 苏州歌德尔自动化有限公司 A kind of novel key cap detection machine
CN111027010A (en) * 2019-11-14 2020-04-17 武汉天恒信息技术有限公司 Steel member cylinder fitting algorithm

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6996641B2 (en) * 2002-10-30 2006-02-07 Intel Corporation Apparatus and methods for keyboard data normalization
CN101387494B (en) * 2008-10-06 2010-08-25 天津大学 Geometrical dimensional measurement apparatus and method for large-sized tunnel tunnel segment component
US8760413B2 (en) * 2009-01-08 2014-06-24 Synaptics Incorporated Tactile surface
CN111046878B (en) * 2019-12-30 2022-02-08 合肥联宝信息技术有限公司 Data processing method and device, computer storage medium and computer

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107289908A (en) * 2016-04-12 2017-10-24 苏州杰锐思自动化设备有限公司 Keyboard appearance automatic detection device
CN108107444A (en) * 2017-12-28 2018-06-01 国网黑龙江省电力有限公司检修公司 Substation's method for recognizing impurities based on laser data
CN207882161U (en) * 2018-02-01 2018-09-18 苏州杰锐思自动化设备有限公司 Laptop appearance detecting device
CN109099861A (en) * 2018-09-19 2018-12-28 苏州歌德尔自动化有限公司 A kind of novel key cap detection machine
CN111027010A (en) * 2019-11-14 2020-04-17 武汉天恒信息技术有限公司 Steel member cylinder fitting algorithm

Also Published As

Publication number Publication date
CN112066893A (en) 2020-12-11

Similar Documents

Publication Publication Date Title
CN101499168B (en) Structured light strip center extraction method based on ridge line tracing and Hessian matrix
CN104567727B (en) Global unified calibration method for linear structured light profile sensor through three-dimensional target
US8103376B2 (en) System and method for the on-machine 2-D contour measurement
CN113538671B (en) Map generation method, map generation device, storage medium and processor
CN105783786B (en) Part chamfering measuring method and device based on structured light vision
Tian et al. An experimental evaluation method for the performance of a laser line scanning system with multiple sensors
US7893947B2 (en) Method for extracting edge in photogrammetry with subpixel accuracy
Yuan et al. Automatic evaluation of rebar spacing using LiDAR data
Cabaleiro et al. A case study of measurements of deformations due to different loads in pieces less than 1 m from lidar data
CN105627935A (en) Product material thickness three-dimensional analysis system and method
CN109556533B (en) Automatic extraction method for multi-line structured light stripe image
CN111336947A (en) Mirror surface object line laser scanning method based on binocular point cloud fusion
CN112066893B (en) Method and device for measuring height of key cap of keyboard
Yan et al. Multi-line laser structured light fast visual positioning system with assist of TOF and CAD
CN108053485B (en) Potato three-dimensional modeling method based on contour image
CN114234819A (en) Automatic detection method for quality of steel bar part based on three-dimensional laser scanning
CN110017770A (en) A kind of vision-based detection scaling method applied to three coordinate measuring machine
Shan et al. Stereovision-based surface deformation detection of offshore wind turbine model under ship impact
CN116399241B (en) Patch type inductance geometric parameter measurement method and system
Shen et al. A review of terrestrial laser scanning (TLS)-based technologies for deformation monitoring in engineering
CN115980063A (en) Workpiece surface flaw detection method and device
CN105783782B (en) Surface curvature is mutated optical profilometry methodology
CN113267122A (en) Industrial part size measurement method based on 3D vision sensor
Puri et al. ’Dimensional quality control of precast concrete slabs using3D laser scan point clouds’
Aoyama et al. Autonomous measurement of physical model shape for reverse engineering

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
GR01 Patent grant
GR01 Patent grant
CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: 215101 No. 9, Zhufeng Road, Mudu Town, Wuzhong District, Suzhou City, Jiangsu Province

Patentee after: Suzhou jieruisi Intelligent Technology Co.,Ltd.

Address before: 215000 No.15, Mudu Town, Wuzhong District, Suzhou City, Jiangsu Province

Patentee before: Suzhou jieruisi Intelligent Technology Co.,Ltd.