The present application is a U.S. National Stage application under 35 USC 371 of PCT Application Serial No. PCT/CN2016/097162, filed on 29 Aug. 2016; the entirety of which is incorporated herein by reference.
The present disclosure relates to the technical field of data processing, and particularly to a method and apparatus for processing three-dimensional vision measurement data.
Currently, a three-dimensional point cloud data format is generally used as a method for digitally describing the position and size of an object in three-dimensional space. Three-dimensional data collection devices corresponding to data in this format mainly include a three-dimensional scanner, a three-dimensional coordinate measuring instrument, remote sensing and aerial surveying devices, and so on. Three-dimensional point cloud data and its corresponding collection means are generally used for various aspects, such as engineering design, reverse engineering, geodetic survey, preservation of cultural relics and three-dimensional reconstruction. These point cloud data are commonly obtained by superposing data results of multiple multi-angle measurements, and these point cloud data are substantially processed by means of post processing; however, three-dimensional point cloud data processing software requires human intervention in performing each of the operations, such as background separation, data stitching, size measurement and three-dimensional reconstruction.
PCT Application No. PCT/CN2016/079274 (hereinafter referred to simply as Document 1) discloses a method of realizing three-dimensional machine vision measurement by use of a planar array of a group of four cameras, by which it is capable of realizing three-dimensional perception to the field of vision by processing two-dimensional images measured by the group of four cameras. The three-dimensional point cloud data obtained by this measurement method are data corresponding to the two-dimensional images. Besides three-dimensional coordinate information, these data include color or gray information of a view point on a viewed object. It is difficult for the prior three-dimensional point cloud data processing software and processing methods to meet requirements of such a three-dimensional machine vision measurement system.
The application for patent invention with Publication No. CN105678683A discloses a method for two-dimensionally storing a three-dimensional model. With this method, point cloud data are simply projected onto planes of a coordinate system, and then depth information of the model formed by the projection onto each plane is transformed into gray information of the corresponding two-dimensional plane. However, this method has the following problems: a) only coordinate information of the point cloud data is considered, without taking into account color value or gray value information of the point cloud data; b) the whole three-dimensional point cloud data are directly processed, which causes a large data process load and a relatively high complexity, and moreover, the adopted operations, such as interpolation and point adding, easily cause interference and distortion to the model; and c) the method does not specify corresponding relationship between the point cloud data and the two-dimensional projection data, fails to explicitly describe definition of the two-dimensional plane and stitching relationships among the six two-dimensional planes, and also fails to clearly describe a situation that multiple points in the point cloud data may be on a same projection line.
For the three-dimensional machine vision measurement system, what we expected is to perform rapid and accurate three-dimensional data description of the objective world just like human eyes. However, three-dimensional data handling and processing capabilities of the three-dimensional machine vision measurement systems we have come into contact with at present are far from the “WYSIWYG (what you see is what you get)” function of the human eyes. To sum up, for post data processing means and data processing methods of a set of three-dimensional machine vision measurement systems, the current problems are mainly reflected in the following aspects:
1. data collection and storage are substantially put on point cloud data, and these data are stored in a large amount with ununiform formats, meanwhile, the stored information is not complete enough;
2. a large amount of post processing and computation are required for the three-dimensional display of the distribution of the shape, size and depth space of the viewed object, and for the separation between the objects and the separation between the objects and the background, so as to reflect the detailed external features of the three-dimensional objects; and
3. current mainstream software requires human intervention in performing the above-mentioned operations, and there is almost no software and tool that directly generate or automatically calculate three-dimensional features of the viewed object by means of the three-dimensional machine vision measurement system.
In view of this, an objective of embodiments of the present disclosure is to provide a method and apparatus for processing three-dimensional vision measurement data. With the method and apparatus provided by the present disclosure, three-dimensional point cloud data measured by a three-dimensional machine vision measurement system are directly handled and processed to intuitively reflect the measured three-dimensional data information onto two-dimensional images. Therefore, it is able to reflect true features of the real world quickly and accurately, and the generated data are convenient for operations, such as storage, calling, size measurement, distance calculation, and subsequent stitching and superposition of multiple measurements, satisfying requirements of three-dimensional machine vision and realizing the three-dimensional display function.
In a first aspect, an embodiment of the present disclosure provides a method for processing three-dimensional vision measurement data, comprising:
Furthermore, the step 1 comprises: establishing a basic three-dimensional rectangular coordinate system OXYZ based on the three-dimensional machine vision measurement system, with the three-dimensional point cloud data represented by Iuv(i, j), where
where the three-dimensional point cloud data are a collection of data of a surface of a viewed object that is obtained from a measurement result of a single measurement by the three-dimensional machine vision measurement system, the collection of data corresponds to a multi-curved distributed spatial structure consisting of discrete points; u and v are the numbers of measurement points or pixel points in a width direction and a height direction of a two-dimensional measurement plane corresponding to the single measurement by the three-dimensional machine vision measurement system, respectively; i and j represent a position of a measurement point or pixel point in the two-dimensional measurement plane, where 0≤i≤u−1, 0≤j≤v−1, and each of i and j is an integer; x(i, j), y(i, j) and z(i, j) are spatial position coordinates of a view point corresponding to the measurement point or pixel point measured by the three-dimensional machine vision measurement system; R(i, j), G(i, j) and B(i, j) are color values of a surface of the view point corresponding to the measurement point or pixel point measured by the three-dimensional machine vision measurement system; and g(i, j) is a gray value of the surface of the view point corresponding to the measurement point or pixel point measured by the three-dimensional machine vision measurement system.
Furthermore, in the step 1, the three-dimensional machine vision measurement system refers to a system capable of measuring spatial position information of a viewed object in space and obtaining three-dimensional coordinates and color information or gray information of a view point on the viewed object, including a binocular vision three-dimensional measurement system and a four-camera vision three-dimensional measurement system.
Furthermore, the step 2 comprises: making the viewed space form a rectangular parallelepiped with a depth of L, a width of W and a height of H, based on the three-dimensional point cloud data, where
L=zmax−zmin+δl,
W=xmax−xmin+δw,
H=ymax−ymin+δh,
where zmax is a maximum depth coordinate in the three-dimensional point cloud data, zmin is a minimum depth coordinate in the three-dimensional point cloud data, xmax is a maximum width coordinate in the three-dimensional point cloud data, xmin is a minimum width coordinate in the three-dimensional point cloud data, ymax is a maximum height coordinate in the three-dimensional point cloud data, ymin is a minimum height coordinate in the three-dimensional point cloud data, δl is a depth adjustment value of the viewed space, δw is a width adjustment value of the viewed space, and δh is a height adjustment value of the viewed space.
Furthermore, the step 3 comprises: establishing a new three-dimensional rectangular coordinate system O1X1Y1Z1, with the new three-dimensional rectangular coordinate system taking a point O1 at a lower left corner of a face, facing directly the three-dimensional machine vision measurement system, of the rectangular parallelepiped corresponding to the viewed space as a coordinate origin; and in a case that coordinates of O1 in the basic three-dimensional rectangular coordinate system OXYZ are represented by (a, b, c), performing coordinate translation transformation on the three-dimensional point cloud data, to obtain the transformed three-dimensional point cloud data represented by Juv(i, j), where
Furthermore, the determining three basic observation planes corresponding to the viewed space in the step 4 comprises determining:
Furthermore, the step 5 comprises: projecting the transformed three-dimensional point cloud data onto the three basic observation planes, respectively, and performing coordinate value transformation, to obtain from the projection a front-view plane projection function represented by [F(x1, y1), 0≤x1≤W, 0≤y1≤H], a right-view plane projection function represented by [R(z1, y1), 0≤z1≤L, 0≤y1≤H] and a top-view plane projection function represented by [U(x1, z1), 0≤x1≤W, 0≤z1≤L], where for Juv(i, j),
Furthermore, in the step 6, the generating three depth value functions corresponding to the three plane projection functions based on the transformed three-dimensional point cloud data respectively, comprises generating a front-view depth value function represented by [FS(x1, y1), 0≤x1≤W, 0≤y1≤H], a right-view depth value function represented by [RS(z1, y1), 0≤z1≤L, 0≤y1≤H] and a top-view depth value function represented by [US(x1, z1), 0≤x1≤W, 0≤z1≤L],
Furthermore, the step 7 comprises: transforming each of the front-view plane projection function, the right-view plane projection function, the top-view plane projection function, the front-view depth value function, the right-view depth value function and the top-view depth value function into a two-dimensional image in a determined format having u×v pixel points, with the two-dimensional images in the determined format corresponding to the individual functions represented as a front-view plane projection image FT in the determined format, a right-view plane projection image RT in the determined format, a top-view plane projection image UT in the determined format, a front-view depth image FST in the determined format, a right-view depth image RST in the determined format and a top-view depth image UST in the determined format, respectively;
In a second aspect, an embodiment of the present disclosure provides an apparatus for processing three-dimensional vision measurement data, comprising:
Furthermore, the data reading module is configured to establish a basic three-dimensional rectangular coordinate system OXYZ based on the three-dimensional machine vision measurement system, with the three-dimensional point cloud data represented by IUv(i, j), where
where the three-dimensional point cloud data are a collection of data of a surface of a viewed object that is obtained from a measurement result of a single measurement by the three-dimensional machine vision measurement system, the collection of data corresponds to a multi-curved distributed spatial structure consisting of discrete points; u and v are the numbers of measurement points or pixel points in a width direction and a height direction of a two-dimensional measurement plane corresponding to the single measurement by the three-dimensional machine vision measurement system, respectively; i and j represent a position of a measurement point or pixel point in the two-dimensional measurement plane, where 0≤i≤u−1, 0≤j≤v−1, and each of i and j is an integer; x(i, j), y(i, j) and z(i, j) are spatial position coordinates of a view point corresponding to the measurement point or pixel point measured by the three-dimensional machine vision measurement system; R(i, j), G(i, j) and B(i, j) are color values of a surface of the view point corresponding to the measurement point or pixel point measured by the three-dimensional machine vision measurement system; and g(i, j) is a gray value of the surface of the view point corresponding to the measurement point or pixel point measured by the three-dimensional machine vision measurement system.
Furthermore, the three-dimensional machine vision measurement system refers to a system capable of measuring spatial position information of a viewed object in space and obtaining three-dimensional coordinates and color information or gray information of a view point on the viewed object, including a binocular vision three-dimensional measurement system and a four-camera vision three-dimensional measurement system.
Furthermore, the viewed space setting module is configured to form the viewed space into a rectangular parallelepiped with a depth of L, a width of W and a height of H, based on the three-dimensional point cloud data, where
L=zmax−zmin δl,
W=xmax−xmin δw,
H=ymax−ymin+δh,
where zmax is a maximum depth coordinate in the three-dimensional point cloud data, zmin is a minimum depth coordinate in the three-dimensional point cloud data, xmax is a maximum width coordinate in the three-dimensional point cloud data, xmin is a minimum width coordinate in the three-dimensional point cloud data, ymax is a maximum height coordinate in the three-dimensional point cloud data, ymin is a minimum height coordinate in the three-dimensional point cloud data, δl is a depth adjustment value of the viewed space, δw is a width adjustment value of the viewed space, and δh is a height adjustment value of the viewed space.
Furthermore, the coordinate transformation module is configured to establish a new three-dimensional rectangular coordinate system O1X1Y1Z1, with the new three-dimensional rectangular coordinate system taking a point O1 at a lower left corner of a face, facing directly the three-dimensional machine vision measurement system, of the rectangular parallelepiped corresponding to the viewed space as a coordinate origin; and in a case that coordinates of O1 in the basic three-dimensional rectangular coordinate system OXYZ are represented by (a, b, c), perform coordinate translation transformation on the three-dimensional point cloud data, to obtain the transformed three-dimensional point cloud data represented by Juv(i, j), where
Furthermore, the basic observation plane setting module is configured to determine the three basic observation planes corresponding to the viewed space as:
Furthermore, the projection function generating module is configured to project the transformed three-dimensional point cloud data onto the three basic observation planes, respectively, and perform coordinate value transformation, to obtain form the projection a front-view plane projection function represented by [F(x1, y1), 0≤x1≤W, 0≤y1≤H], a right-view plane projection function represented by [R(z1, y1), 0≤z1≤L, 0≤y1≤H] and a top-view plane projection function represented by [U(x1, z1), 0≤x1≤W, 0≤z1≤L],
Furthermore, the depth value function generating module is configured to generate, based on the transformed three-dimensional point cloud data, three depth value functions corresponding to the three plane projection functions, respectively, which are a front-view depth value function represented by [FS(x1, y1), 0≤x1≤W, 0≤y1≤H], a right-view depth value function represented by [RS(z1, y1), 0≤z1≤L, 0≤y1≤H] and a top-view depth value function represented by [US(x1, z1), 0≤x1≤W, 0≤z1≤L],
Furthermore, the two-dimensional image generating module is configured to transform each of the front-view plane projection function, the right-view plane projection function, the top-view plane projection function, the front-view depth value function, the right-view depth value function and the top-view depth value function into a two-dimensional image in a determined format having u×v pixel points, with the two-dimensional images in the determined format corresponding to the individual functions represented as a front-view plane projection image FT in the determined format, a right-view plane projection image RT in the determined format, a top-view plane projection image UT in the determined format, a front-view depth image FST in the determined format, a right-view depth image RST in the determined format and a top-view depth image UST in the determined format, respectively;
the two-dimensional image generating module is further configured to firstly determine pixel sizes of the two-dimensional images in the determined format, respectively,
the two-dimensional image generating module is further configured to digitize coordinates of the pixel points in a format of u×v after the pixel sizes are determined, where in the following computations, coordinates i or j of the pixel points, when being decimals, each are rounded to a positive integer no more than u or v,
so as to for Juv(i, j) generate:
the two-dimensional image generating module is further configured to digitize depth values according to 0 to (N−1) gray values when generating the depth images in the determined format, where N is the number of the gray values, and in the following computations, depth values, when being decimals, each are rounded to a positive integer no more than (N−1),
where the depth images in the determined format are as follows:
The present disclosure has at least the following several beneficial effects:
1. The method and apparatus provided by the present disclosure restore the three-dimensional point cloud data collected at a time by the three-dimensional machine vision measurement system onto rectangular coordinate planes perpendicular to one another, to obtain six two-dimensional images FT, RT, UT, FST, RST and UST, in which the three-dimensional information of the measured space is completely expressed, to make the description of the three-dimensional space intuitive and easily understandable; from the individual two-dimensional images, the three-dimensional size and spatial position of a viewed object can be obtained, and the gray value or color value information of any point can be obtained, which is convenient for subsequent use by machine intelligence; and moreover, various processing and computations, such as stitching, compression and storage, can be performed on the six images by use of the prior two-dimensional image processing technology, so that the operational data are called quickly and conveniently, the computation speed is significantly accelerated, and the occupied storage space is reduced.
2. Unlike the prior two-dimensional images, the FT, RT, UT, FST, RST and UST images do not follow the principle of perspective, the position of any pixel point in each of the images uniquely corresponds to an actual spatial position of a view point corresponding to the pixel point, and the spatial position coordinates of a view point corresponding to each pixel point in all the images can be obtained by combining the FT, RT, UT, FST, RST and UST images. During computation of other positions and sizes, a corresponding distance between the individual pixel points can be obtained by directly calculating the number of points by which the individual pixel points are spaced and then multiplying the same by the pixel size.
3. The method and apparatus of the present disclosure are suitable for processing results obtained from a single measurement by the three-dimensional machine vision measurement system, and then storing and displaying them. When the same measurement system carries out continuous measurements, two-dimensional images in a determined format which are continuous over time can be obtained; and if the measured two-dimensional images are displayed continuously, a continuous three-dimensional vision is achieved, generating a dynamic effect like a movie. Three-dimensional data or images corresponding to a viewed object can be measured from multiple angles, by moving or rotating the viewed object; and different sides of the same viewed object can be reflected from different angles, if the measurement system is moved.
4. For storage of the measurement data, only a front-view plane projection image in the determined format and a front-view depth image in the determined format are needed for completely storing data from a single measurement. A right-view plane projection image in the determined format, a right-view depth image in the determined format, a top-view plane projection image in the determined format and a top-view depth image in the determined format can be derived from the front-view plane projection image in the determined format and the front-view depth image in the determined format, and they are used for the purpose of further facilitating three-dimensional computations such as separation of the background and the object.
5. For three-dimensional measurement systems, such as a three-dimensional laser scanner and a three-dimensional radar detector, point cloud data measured by such systems contain neither color information nor gray information, however, a depth image in a determined format corresponding to such point cloud data can be obtained directly according to the above-mentioned method or apparatus, also obtaining many benefits described above.
In order to make the above objectives, features and advantages of the present disclosure more apparent and easily understandable, preferred embodiments will be particularly described in detail below with reference to the accompanying drawings.
For illustrating technical solutions of embodiments of the present disclosure more clearly, drawings required for the embodiments will be introduced briefly below. It would be understood that the drawings below are merely illustrative of some embodiments of the present disclosure, and therefore should not to be considered as limiting the scope of the present disclosure. For those skilled in the art, other relevant drawings can also be obtained from these drawings, without any inventive effort.
Technical solutions of the embodiments of the present disclosure will be described below clearly and completely with reference to the drawings of the embodiments of the present disclosure. Apparently, the described embodiments are only some but not all of the embodiments of the present disclosure. Thus, the following detailed description of the embodiments of the present disclosure, as represented in the figures, is not intended to limit the scope of protection of the present disclosure, but is merely representative of selected embodiments of the present disclosure. All the other embodiments obtained by those skilled in the art without any inventive effort, in light of the embodiments of the present disclosure, will fall within the scope of protection of the present disclosure.
In the description of the present disclosure, it would be understood that orientation or positional relations indicated by the terms, such as “origin”, “center”, “longitudinal”, “horizontal”, “length”, “width”, “depth” and “height”, are based on the orientation or positional relations as shown in the drawings, and these terms are only used to describe the present disclosure and simplify the description, but not used to indicate or imply that the device or element referred to must have a particular orientation or must be constructed or operated in the particular orientation, and therefore should not be construed as limiting the present disclosure.
It should be noted that in the present disclosure, the three-dimensional machine vision measurement system refers to a system capable of measuring spatial position information of a viewed object in space and obtaining three-dimensional coordinates and color information or gray information of a view point on the viewed object, including a known binocular vision three-dimensional measurement system, a four-camera vision three-dimensional measurement system (i.e., the measurement system in Document 1) and the like. Those skilled in the art may obtain three-dimensional point cloud data information by use of a variety of three-dimensional machine vision measurement systems.
As shown in
Step 1: acquiring three-dimensional point cloud data measured by a three-dimensional machine vision measurement system.
As shown in
Iu,v(i, j) is defined as three-dimensional point cloud data measured by a three-dimensional machine vision measurement system, and Iuv(i, j) is represented by a collection of spatial three-dimensional coordinates and corresponding color values of points:
or represented by a collection of spatial three-dimensional coordinates and corresponding gray values of points:
where u and v are the numbers of measurement points or pixel points in a width direction and a height direction of the two-dimensional measurement plane corresponding to the single measurement by the three-dimensional machine vision measurement system, respectively; i and j represent a position of a measurement point or pixel point in the two-dimensional measurement plane, where 0≤i≤u−1, 0≤j≤v−1, and each of i and j is an integer; x(i, j), y(i, j) and z(i, j) are spatial position coordinates of a view point corresponding to the measurement point or pixel point measured by the three-dimensional machine vision measurement system; R(i, j), G(i, j) and B(i, j) are color values of a surface of the view point corresponding to the measurement point or pixel point measured by the three-dimensional machine vision measurement system; and g(i, j) is a gray value of the surface of the view point corresponding to the measurement point or pixel point measured by the three-dimensional machine vision measurement system.
Step 2: establishing a viewed space based on the three-dimensional point cloud data.
Based on the three-dimensional point cloud data obtained by different three-dimensional machine vision measurement systems, a viewed space can be established as a rectangular parallelepiped shown in
For Iuv(i, j), the corresponding maximum and minimum values of the three-dimensional point cloud data in three coordinate axes perpendicular to one another can be obtained, respectively, based on the measurement results of the three-dimensional machine vision measurement system; and based on these maximum and minimum values, the viewed space corresponding to the point cloud data from a single measurement of the three-dimensional machine vision measurement system can be defined as follows.
For Iuv(i, j), a viewed space with a depth of L, a width of W and a height of H is defined to satisfy the following conditions:
L=zmax−zmin+δl,
W=xmax−xmin+δw,
H=ymax−Ymin+δh,
where zmax is a maximum depth coordinate in the three-dimensional point cloud data, zmin is a minimum depth coordinate in the three-dimensional point cloud data, xmax is a maximum width coordinate in the three-dimensional point cloud data, xmin is a minimum width coordinate in the three-dimensional point cloud data, ymax is a maximum height coordinate in the three-dimensional point cloud data, ymin is a minimum height coordinate in the three-dimensional point cloud data, δl is a depth adjustment value of the viewed space, δw is a width adjustment value of the viewed space, and δh is a height adjustment value of the viewed space. The depth adjustment value, the width adjustment value and the height adjustment value of the viewed space are set for the purpose that these adjustment values make the values of W, H and L be slightly larger than the actual size of the viewed object, thereby ensuring the viewed object is contained in the viewed space, and facilitating subsequent computation or processing.
Step 3: establishing a new three-dimensional rectangular coordinate system corresponding to the viewed space, and performing coordinate translation transformation on the three-dimensional point cloud data.
As shown in
For the above-mentioned viewed space, a new three-dimensional rectangular coordinate system O1X1Y1Z1 is further defined separately, as shown in
or represented by a collection of the spatial three-dimensional coordinates and corresponding gray values:
Step 4: determining three basic observation planes corresponding to the viewed space and a rectangular coordinate system corresponding to the three basic observation planes.
As shown in
The three observation planes are sequentially spread out, as shown in
With reference to
the front-view observation plane (F), for which the observation direction is a direction indicated by a Z1-axis arrow, where the front-view observation plane has a coordinate origin located at O1(a, b, c), an abscissa axis corresponding to the front-view observation plane is an X1 axis, and an ordinate axis corresponding to the front-view observation plane is a Y1 axis;
the right-view observation plane (R), for which the observation direction is a direction opposite to that indicated by an X1-axis arrow, where the right-view observation plane has a coordinate origin located at O2(a+W, b, c), an abscissa axis corresponding to the right-view observation plane is a Z1 axis, and an ordinate axis corresponding to the right-view observation plane is the Y1 axis; and
the top-view observation plane (U), for which the observation direction is a direction opposite to that indicated by a Y1-axis arrow, where the top-view observation plane has a coordinate origin at O3(a, b+H, c), an abscissa axis corresponding to the top-view observation plane is the X1 axis, and an ordinate axis corresponding to the top-view observation plane is the Z1 axis.
The names of the coordinate axes of the three observation planes, the names of the three-dimensional coordinate axes of the viewed space and the names of the three-dimensional coordinate axes of the three-dimensional machine vision measurement system are consistent with one another, so as to facilitate subsequent computation and understanding.
Step 5: projecting the transformed three-dimensional point cloud data onto the three basic observation planes, respectively, to obtain three plane projection functions.
The data of Juv(i, j) are projected onto the three planes F, R and U, respectively, to obtain three plane projection functions. Data corresponding to these projection functions are the same as results obtained by perpendicularly observing the measured three-dimensional object in the above-mentioned three observation directions, which is exactly the same as the principle of three-view drawings of mechanical drawing.
As shown in
The following numerical transformations are performed on each point in Juv(i, j).
The projection functions corresponding to the three observation planes are defined as follows:
Step 6: generating three depth value functions corresponding to the three plane projection functions based on the transformed three-dimensional point cloud data, respectively.
The data of Juv(i, j) are projected perpendicularly onto the three observation planes F, R and U, respectively. In this case, the projected image may represent the planar projection size of the viewed object, but the depth value is lost, which makes it inconvenient to perform correlation computation on the three projection functions during the calculation of the three-dimensional information. For this reason, it is also necessary to generate corresponding depth value functions, in addition to generating the plane projection functions for the measured data. The depth value function may be in a form of pseudo color, so that a pseudo color image of the depth value can be generated when there is a need to display. In order to be distinguished from the plane projection functions, three depth value functions are defined, which are a front-view depth value function FS(x1, y1), a right-view depth value function RS(z1, y1) and a top-view depth value function US(x1, z1), respectively. The three depth value functions have various parameters therein defined in a same manner as those of the corresponding plane projection functions, and they are generated as follows.
The following numerical transformations are performed on each point in Juv(i, j):
Step 7: digitizing the three plane projection functions and the three depth value functions, respectively, and transforming them into two-dimensional images in a determined format.
For facilitating the storage and displaying, each of the front-view plane projection function, the right-view plane projection function, the top-view plane projection function, the front-view depth value function, the right-view depth value function and the top-view depth value function is transformed into a two-dimensional image in a determined format having u×v pixel points. The two-dimensional images in the determined format corresponding to the individual functions are represented as a front-view plane projection image FT in the determined format, a right-view plane projection image RT in the determined format, a top-view plane projection image UT in the determined format, a front-view depth image FST in the determined format, a right-view depth image RST in the determined format and a top-view depth image UST in the determined format.
Resolutions of the two-dimensional images requiring to be stored are defined according to the image measurement accuracy and the requirement for clear display. If the three-dimensional machine vision measurement system has a measurement resolution of u×v, the resolution of each of the two-dimensional images in the determined format is set to be u×v.
The following are pixel sizes of the two-dimensional images in the determined format, respectively:
Meanwhile, all of the following computation processes for generating the two-dimensional images in the determined format involve transforming the three-dimensional coordinate values measured by the three-dimensional machine vision measurement system into coordinate values corresponding to the pixel points of the two-dimensional images in the determined format. During the transformation between the two coordinate values, it is necessary to convert real numbers into specified discrete positive integers, and there is a problem of rounding operation in the conversion. Since there are different accuracy requirements for different measured data, correlation operation is not taken into consideration here. Omission of relevant operations relating to the rounding and significant digits and of symbols related therewith from formulas does not affect the understanding of the following formulas, and thus relevant mathematical operation symbols are omitted from the expressions of the following formulas.
After the pixel sizes are determined, each of the front-view plane projection function, the right-view plane projection function, the top-view plane projection function, the front-view depth value function, the right-view depth value function and the top-view depth value function is converted into a two-dimensional image in a determined format having u×v pixel points, and coordinates of the pixel points are digitized in a format of u×v. In the following computations, coordinates i or j of the pixel points, when being decimals, each are rounded to a positive integer no more than u or v.
The FT image is generated by the following process:
The RT image is generated by the following process:
The UT image is generated by the following process:
When generating the depth images in the determined format, it is necessary to digitize depth values according to a certain number of 0 to N−1 (e.g., 256) of gray values, where N is the number of the gray values. Taking 0 to 255 gray values as an example, in the following computations, depth values, when being decimals, each are rounded to a positive integer no more than 255.
The FST image is generated by the following process:
The RST image is generated by the following process:
The UST image is generated by the following process:
A set of three-dimensional point cloud data obtained by the three-dimensional machine vision measurement system can be converted into six two-dimensional images through the above coordinate transformation. However, after the conversion is finished, the u×v pixel points in each two-dimensional image in the determined format may not all have a corresponding pixel value. Therefore, it is possible to assign initial values to all the pixel points of the two-dimensional images before the generation of the six images, and then assign the calculated pixel values, so that the assigned initial value is reserved for the pixel point having a calculated pixel value being null. For gray values, the initial value is generally selected to be 0 or N−1 (e.g., 255); and for color values, black, white or other colors can be selected as the initial value, and these initial values can be regarded as a background gray or background color of the pixel points having the calculated pixel values being non-null.
In addition, since pinhole imaging has a problem of having high density in the vicinity and low density in the distance, there will also be a problem that multiple view points in the vicinity, after the digitalization, may correspond to the same pixel point. After the processing in accordance with the above steps, the finally assigned value will override the previously assigned value and serve as a final pixel value. The occurrence of this case means that the measurement resolution of nearby objects is reduced. If a higher resolution is required, then before each of the two-dimensional images in the determined format is generated, the resolution u×v of the image can be scaled up or similarly can also be scaled down, in order not to lose measurement accuracy. The two-dimensional images with different measurement resolutions can be obtained by performing the above operations according to the above steps.
Further, since the problem of uniformity of display scales in different directions of the image is not taken into account in the calculation of the pixel sizes in the width, height, and depth directions, uniformization processing can further be performed by increasing or decreasing the adjustment values δl, δw and δh, in order to equalize the pixel sizes in different directions to achieve the uniformity of the display scales in different directions.
Finally, the pixel coordinates and pixel values of the six two-dimensional images are described as follows:
and as to the top-view depth image in the determined format—UST:
In the embodiment of the present disclosure, the six two-dimensional images in the determined format can be generated in accordance with the coordinates of the pixel points and the color values or gray values corresponding to the points as described in the above-mentioned formulas. The generated images can be stored, compressed or displayed directly, or the generated images may be subjected to operations, such as storage, compression or display, after being converted into an appropriate image format. The image formats available for the conversion include but not limited to image formats of BMP, JIF, JPEG, JPEG2000, TIFF, PSD, PNG, SWF and SVG.
As shown in
a data reading module, configured to acquire three-dimensional point cloud data measured by a three-dimensional machine vision measurement system;
a viewed space setting module, configured to establish a viewed space based on the three-dimensional point cloud data;
a coordinate transformation module, configured to establish a new three-dimensional rectangular coordinate system corresponding to the viewed space, and perform coordinate translation transformation on the three-dimensional point cloud data;
a basic observation plane setting module, configured to determine three basic observation planes corresponding the viewed space and a rectangular coordinate system corresponding to the three basic observation planes;
a projection function generating module, configured to project the transformed three-dimensional point cloud data onto the three basic observation planes, respectively, to obtain three plane projection functions;
a depth value function generating module, configured to generate three depth value functions corresponding to the three plane projection functions based on the transformed three-dimensional point cloud data, respectively;
a two-dimensional image generating module, configured to digitize the three plane projection functions and the three depth value functions, respectively, and transform them into two-dimensional images in a determined format;
In addition, the above-mentioned apparatus further includes a compression module (not shown), a storage module (not shown) and a display module (not shown), configured to perform compression, storage and display operations on the generated two-dimensional images, respectively.
The method and apparatus provided by the present disclosure restore the three-dimensional point cloud data collected at a time by the three-dimensional machine vision measurement system onto rectangular coordinate planes perpendicular to one another, to obtain six two-dimensional images FT, RT, UT, FST, RST and UST, in which the three-dimensional information of the measured space is completely expressed, to make the description of the three-dimensional space intuitive and easily understandable; from the individual two-dimensional images, the three-dimensional size and spatial position of a viewed object can be obtained, and the gray value or color value information of any point can be obtained, which is convenient for subsequent use by machine intelligence; and moreover, various processing and computations, such as stitching, compression and storage, can be performed on the six images by use of the prior two-dimensional image processing technology, so that the operational data are called quickly and conveniently, the computation speed is significantly accelerated, and the occupied storage space is reduced.
Unlike the prior two-dimensional images, the FT, RT, UT, FST, RST and UST images do not follow the principle of perspective, the position of any pixel point in each of the images uniquely corresponds to an actual spatial position of a view point corresponding to the pixel point, and the spatial position coordinates of a view point corresponding to each pixel point in all the images can be obtained by combining the FT, RT, UT, FST, RST and UST images. During computation of other positions and sizes, a corresponding distance between the individual pixel points can be obtained by directly calculating the number of points by which the individual pixel points are spaced and then multiplying the same by the pixel size.
The method and apparatus of the present disclosure are suitable for processing results obtained from a single measurement by the three-dimensional machine vision measurement system, and then storing and displaying them. When the same measurement system carries out continuous measurements, two-dimensional images in a determined format which are continuous over time can be obtained; and if the measured two-dimensional images are displayed continuously, a continuous three-dimensional vision is achieved, generating a dynamic effect like a movie. Three-dimensional data or images corresponding to a viewed object can be measured from multiple angles, by moving or rotating the viewed object; and different sides of the same viewed object can be reflected from different angles, if the measurement system is moved.
For storage of the measurement data, only a front-view plane projection image in the determined format and a front-view depth image in the determined format are needed for completely storing data from a single measurement. A right-view plane projection image in the determined format, a right-view depth image in the determined format, a top-view plane projection image in the determined format and a top-view depth image in the determined format can be derived from the front-view plane projection image in the determined format and the front-view depth image in the determined format, and they are used for the purpose of further facilitating three-dimensional computations such as separation of the background and the object.
For three-dimensional measurement systems, such as a three-dimensional laser scanner and a three-dimensional radar detector, point cloud data measured by such systems contain neither color information nor gray information, however, a depth image in a determined format corresponding to such point cloud data can be obtained directly according to the above-mentioned method or apparatus, also obtaining many benefits described above.
It should be understood that, in the embodiments provided herein, the disclosed method and apparatus may be implemented in other ways. The apparatus embodiment described above is merely illustrative in nature. For example, the division of the units is only a division of logical functions, and additional division modes may be adopted in practical implementation. For another example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not executed. In addition, the mutual coupling, or direct coupling or communication connection illustrated or discussed herein may be implemented through indirect coupling or communication connection between some communication interfaces, apparatuses or units, which may be electronic, mechanical or in other forms.
The units described as separate components may be separated physically or not, and the components illustrated as units may be physical units or not, namely, they may be located at one place or may also be distributed onto multiple network units. Some or all of the units may be selected as actually required to fulfill the objectives of the technical solutions of the present embodiments. Besides, the individual functional units in each embodiment of the present disclosure may be integrated into one processing unit, or may be physically stand-alone, or two or more of the units may be integrated into one unit.
When being implemented in the form of a software functional unit and sold or used as a stand-alone product, the functions may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present disclosure in essence, or a part thereof contributing to the prior art, or any part of the technical solution, may be embodied in the form of a software product. The computer software product is stored in a storage medium, and incorporates several instructions for allowing a computer device (which may be personal computer, server, network device or the like) to execute all or some of the steps of the method described in each embodiment of the present disclosure. The aforesaid storage medium includes various media capable of storing program codes, such as a USB flash disk, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk.
The above description is merely illustrative of particular embodiments of the present disclosure, but not intended to limit the scope of protection of the present disclosure. Any modifications or alternations, that would readily occur to those skilled in the art without departing from the technical scope disclosed in the present disclosure, shall fall within the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure is subject to the appended claims.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2016/097162 | 8/29/2016 | WO | 00 |
Publishing Document | Publishing Date | Country | Kind |
---|---|---|---|
WO2018/039871 | 3/8/2018 | WO | A |
Number | Name | Date | Kind |
---|---|---|---|
20110187704 | Chen et al. | Aug 2011 | A1 |
Number | Date | Country |
---|---|---|
103006228 | Apr 2013 | CN |
104007444 | Aug 2014 | CN |
104484852 | Apr 2015 | CN |
105574905 | May 2016 | CN |
105574933 | May 2016 | CN |
105678683 | Jun 2016 | CN |
105809615 | Jul 2016 | CN |
Entry |
---|
International Search Report and Written Opinion, with English translation thereof, dated May 27, 2017 for corresponding International Application No. PCT/CN2016/097162. |
Number | Date | Country | |
---|---|---|---|
20190195616 A1 | Jun 2019 | US |