A kind of HDR 3 D measuring method of self adaptation striped brightness
Technical field
The invention belongs to optical three-dimensional measurement field, it is specifically related to the projection candy strip brightness of a kind of application surface structured light Automatic adjusument and realizes HDR 3 D measuring method, can be used for the glossy surfaces such as metal or the measuring three-dimensional morphology of object that surface reflectivity changes greatly.
Background technology
Based on the fringe projection technology of area-structure light with noncontact, whole audience scanning, precision is high, measuring speed is fast etc., and advantage is widely used in measuring three-dimensional morphology field, including product quality detection, reverse-engineering, historical relic's protection, biomedicine etc. But, this technology yet suffers from some problems in the application, and when such as requiring to measure, ambient lighting limits within the specific limits, and measurand must be diffuse-reflectance surface, and surface reflectivity excursion is little. But, commercial production has a large amount of workpiece based on Milling Process, after processed, the surface of workpiece can become very bright, if directly this glossy surface being measured, then the light after direct reflection can be too strong, so that camera image sensor is saturated, lose the stripe information of candy strip image highlight area, it is difficult to be normally carried out measuring; On the other hand, owing to the dynamic range of camera is limited, for the region that reflectance is relatively low, then striped can be caused excessively dark, certainty of measurement is greatly reduced.
For this problem, Chinese scholars proposes different solutions. Traditional method one is to change employing contact type measurement into, as with three coordinate measuring machine, its certainty of measurement is high, but needs pointwise to measure, and measuring speed is slower; Another kind of method is to change the reflectivity properties on surface at the very thin ARC of measurand surface spraying so that it is becomes diffuse-reflectance surface, then measures again. This method needs spraying and coating cleaning, reduces measurement efficiency; It addition, the thickness of coating and uniformity coefficient depend on experience and the technical ability of operator or staff, also easily bring measurement error.
For measuring three-dimensional morphology on strong reflection surface, patent CN101694375A discloses a kind of method combining to synthesize HDR candy strip image by the projection of bright dark fringe with many time of exposure collection image, it is possible to realize the measuring three-dimensional morphology on strong reflection surface such as metal.But the technology of this employing multiexposure, multiple exposure is for unknown scene, generally cannot directly determine required exposure frequency and the time every time exposed at the measurement initial stage, commonly rely on experience or expose as far as possible repeatedly, there is certain blindness, measuring inefficient. Patent CN104019767A discloses and a kind of utilizes the grey level histogram method to estimate exposure frequency needed for measurand and optimum exposure time, accordingly measurand is exposed respectively, and obtain the image of shooting under different optimum exposure times, then the image of shooting under different optimum exposure times is merged, thus recovering the three-dimensional appearance of measurand. Simply substantially reflect the frequency that in image, every kind of gray scale occurs due to grey level histogram, come the exposure frequency needed for evaluation of integrals measurand and optimum exposure time with this, omission is then likely to occur for some discrete pixel. Patent CN103868472A discloses a kind of area-structure light three-dimensional measuring apparatus for high reflectance part and method. Directly adopting digital projector different from general fringe projection technology, it devises a candy strip and generates system, and projection striped brightness can arbitrarily regulate to adapt to the measurement of various reflective piece surface. This apparatus structure is complicated, and striped brightness can not according to measurand Automatic adjusument. So, at present but without a comparatively complete solution in HDR measuring three-dimensional morphology, it is possible to the method carrying out adaptive measuring according to measurand comparatively lacks.
Summary of the invention
It is desirable to provide a kind of application surface structured light Automatic adjusument projection candy strip brightness realizes HDR 3 D measuring method. The method is by analyzing the uniform light image sequence of collected by camera, it is automatically adjusted the brightness of projection candy strip pixel-by-pixel, measurand surface reflectivity is overcome to change greatly the high light and dark caused, it is thus achieved that candy strip image clearly, thus recovering the three-dimensional appearance of measurand.
For reaching this purpose, the present invention by the following technical solutions:
A kind of HDR 3 D measuring method of self adaptation striped brightness, adopt common digital projector, easy, quick, accurate, can according to the uniform light image sequence of collected by camera, it is automatically adjusted the brightness of projection candy strip pixel-by-pixel, for the region that reflectance is higher, reduce the brightness of projection, remove the Gao Guang of candy strip image; On the other hand, for the dark area that reflectance is relatively low, the brightness of projection is improved, to obtain candy strip image clearly, thus recovering the three-dimensional appearance of measurand.
Preferably, the HDR 3 D measuring method of a kind of self adaptation striped brightness, comprise the following steps:
1), before projection scanning candy strip, the uniform light sequence that first projection brightness is different Camera adopts different gain k1��k2��...��knWith light exposure t1��t2��...��tnGather uniform light image sequence I1��I2��...��In, solve the candy strip image intensity value of the best, and calculate the surface reflectivity of each pixel, the mutual reflective light intensity of environment light and surface according to this image sequence;
2), according to projector-camera response function, calculating the best projection gray value of each pixel of candy strip, pixel coordinate is camera image coordinate;
3), by camera-projector image coordinate mapping function, above-mentioned pixel coordinate is mapped as projector image coordinate;
4), according to above-mentioned calculated projector pixel coordinate, best projection gray value projection candy strip, it is scanned operation;
5), the candy strip image that scanning obtains is carried out phase place resolving and resurfacing, recover the three-dimensional appearance of measurand;
Preferably, step 1) in, shown in effective uniform light image sequence pixel computational methods such as formula (1), (x, y) for camera image coordinate;
Effective uniform light sequence is:
The best candy strip image intensity value of collected by camera is:
Calculate the surface reflectivity of each pixelThe mutual reflective light intensity of environment light and surfaceAs shown in formula (4), wherein, La(x y) represents the light intensity that ambient lighting is directly formed on camera image sensor, r (x, y) Li(x, y) represents that other dough sheet from ambient lighting and measurand passes through, by the light reflected to form mutually, the light intensity that certain dough sheet reflects, as shown in Figure 2;
Step 2) in, the best projection gray value L of each pixel of candy stripP(x, y) shown in computational methods such as formula (5);
Step 3) in, by above-mentioned required the best projection gray value LP(x, (u, v), demarcates the homography matrix H obtained, builds camera-projector image coordinate mapping function according to structured light measurement system y) to be mapped as projector image coordinate;
S is scale factor, and the candy strip the best projection gray value after mapping according to formula (6) is LP(u, v), u and v is projector image coordinate.
Beneficial effects of the present invention:
(1) present invention can be automatically adjusted the projection brightness of each pixel of candy strip according to the factor such as measurand and ambient lighting, compared with the technology adopting multiexposure, multiple exposure, measures efficiency higher;
(2) present invention obtains the surface reflectivity of each pixel, the mutual reflective light intensity of environment light and surface by analyzing the calculating of uniform light image sequence, quantifies accurately, it is ensured that the high accuracy of measurement;
(3) without adding additional hardware, it is achieved cost is low, method is easy, quick, accurate.
Accompanying drawing explanation
Fig. 1 is the measuring method flow chart of the present invention;
Fig. 2 is camera imaging schematic diagram;
Fig. 3 is all light image adopting general fringe projection Technical camera to gather, and position A and B is highlight area, the region that namely measurand surface reflectivity is bigger;
Fig. 4 is all light image of the measuring method collected by camera adopting the present invention, and the Gao Guangyi of corresponding diagram 3 position A and B is removed;
Fig. 5 is the candy strip image adopting general fringe projection Technical camera to gather, and the high light of corresponding diagram 3 position A and B causes that camera image sensor is saturated, loses stripe information;
Fig. 6 is the candy strip image of the measuring method collected by camera adopting the present invention, and the clear-cut texture of corresponding diagram 3 position A and B is clear and definite.
Detailed description of the invention
Technical scheme is further illustrated below in conjunction with accompanying drawing and by detailed description of the invention.
One application surface structured light Automatic adjusument of the present invention projection candy strip brightness realizes HDR 3 D measuring method, by analyzing the uniform light image sequence of collected by camera, it is automatically adjusted the brightness of projection candy strip pixel-by-pixel, measurand surface reflectivity is overcome to change greatly the high light and dark caused, obtain candy strip image clearly, thus recovering the three-dimensional appearance of measurand. It is embodied as step as follows:
1), owing to common digital projector brightness output is by the impact of gamma effect, the candy strip intensity value ranges of projection is better in the linearly of 40-220; Therefore, before projection scanning candy strip, first projection gray value is 40,70,100,130,160,190,220 uniform light sequences In order to ensure the high accuracy measured, time of exposure must be the integral multiple of 1/ projector frame frequency, simultaneously for simplifying solving of projector-camera response function, in process, the gain of camera is taken as k=1, i.e. 0dB, f-number and the time of exposure of camera lens are fixed, and are taken as t=1, then pass through collected by camera uniform light image sequence I1��I2��I3��I4��I5��I6��I7;
2), solve best candy strip image intensity value, and calculate the best projection gray value of the surface reflectivity of each pixel, the mutual reflective light intensity of environment light and surface and each pixel of candy strip according to above-mentioned uniform light image sequence;
Owing to measurand is arbitrary, its surface reflectivity is unknown, and is subject to the impact (such as reciprocal penetrate) of ambient lighting and complex surface structures, therefore, first should calculate the surface reflectivity of measurand, the mutual reflective light intensity of environment light and surface. For the camera that every pixel adopts 8, it is saturated by occurring that gray value reaches 255 expression imageing sensors, and desirable candy strip gray value should use projection brightness big as far as possible, to reach maximum signal to noise ratio, avoids imageing sensor saturated simultaneously; Highlight area for uniform light image sequence, it is contemplated that the noise of imageing sensor, reserved certain gray value space, it is to avoid owing to noise makes imageing sensor reach capacity, then threshold value is taken as 248. For uniform light image sequence I1��I2��I3��I4��I5��I6��I7, each pixel gray value corresponds to I1(x,y)��I2(x,y)��I3(x,y)��I4(x,y)��I5(x,y)��I6(x,y)��I7(x, y), wherein, (x, y) for camera image coordinate, removes the pixel of image highlight area, then effective uniform light image sequence pixel is:
Effective uniform light sequence is:
The best candy strip image intensity value of collected by camera is:
Calculate the surface reflectivity of each pixelThe mutual reflective light intensity of environment light and surfaceAs shown in formula (4), wherein, La(x y) represents the light intensity that ambient lighting is directly formed on camera image sensor, r (x, y) Li(x, y) represents that other dough sheet from ambient lighting and measurand passes through, by the light reflected to form mutually, the light intensity that certain dough sheet reflects, as shown in Figure 2;
The best projection gray value L of each pixel of candy stripP(x, y) shown in computational methods such as formula (5);
So, the region that measurand reflectance is higher is adopted relatively low the best projection gray value, it is to avoid camera image sensor is saturated; The region that other reflectance is relatively low, then best projection gray value takes 220, it is ensured that maximum signal to noise ratio.
3), due to above-mentioned required the best projection gray value LP(x, y), x and y is camera image coordinate, it is necessary to (u, v), demarcates the homography matrix H obtained, build camera-projector image coordinate mapping function according to structured light measurement system to be mapped as projector image coordinate;
S is scale factor. Candy strip the best projection gray value after mapping according to formula (6) is LP(u, v), u and v is projector image coordinate.
4), according to above-mentioned best projection gray value LP(u, v) projects candy strip, is scanned operation.
5), phase place resolving and resurfacing all adopt known method; Finally give three-dimensional point cloud, recover the three-dimensional appearance of measurand.
The know-why of the present invention is described above in association with specific embodiment. These descriptions are intended merely to explanation principles of the invention, and can not be construed to limiting the scope of the invention by any way. Based on explanation herein, those skilled in the art need not pay performing creative labour can associate other detailed description of the invention of the present invention, and these modes fall within protection scope of the present invention.