A kind of high dynamic range 3 D measuring method of adaptive striped brightness
Technical field
The invention belongs to optical three-dimensional measurement fields, and in particular to a kind of application area-structure light automatic adjusument projection striped
Pattern intensity realize high dynamic range 3 D measuring method, can be used for the glossy surfaces such as metal or surface reflectivity variation compared with
The measuring three-dimensional morphology of big object.
Background technology
The advantages such as the fringe projection technology based on area-structure light is scanned with the non-contact, whole audience, precision is high, measuring speed is fast are wide
It is general to be applied to measuring three-dimensional morphology field, including product quality detection, reverse-engineering, historical relic's protection, biomedicine etc..But
This technology still has some problems in the application, for example ambient lighting when measurement is required to limit in a certain range, is tested
Object must be diffusing reflection surface, and surface reflectivity variation range is little.However, there is a large amount of workpiece with milling in industrial production
Based on processing, the surface of workpiece can become very bright after working process, if directly being measured to this glossy surface,
Then the light after mirror-reflection can be too strong, so that camera image sensor is saturated, loses the item of candy strip image highlight area
Line information, it is difficult to be normally carried out measurement;On the other hand, since the dynamic range of camera is limited, for the lower region of reflectivity,
It is excessively dark that it will cause stripeds, and measurement accuracy is greatly reduced.
For this problem, domestic and foreign scholars propose different solutions.One is be changed to use for traditional method
Contact type measurement such as uses three coordinate measuring machine, high certainty of measurement, but needs to measure point by point, and measuring speed is slower;It is another
Kind of method is to change the reflectivity properties on surface in the very thin anti-reflection coating of measurand surface spraying, so that it becomes diffusing reflection
Then surface measures again.This method needs spraying and coating cleaning, reduces measurement efficiency;In addition, the thickness of coating
The experience and technical ability that operator or staff are depended on uniformity coefficient, are also easy to bring measurement error.
For measuring three-dimensional morphology on strong reflection surface, patent CN101694375A disclose it is a kind of by bright dark fringe projection with
More time for exposure acquisition images are combined the method to synthesize high dynamic range candy strip image, can realize that metal etc. is strong anti-
Reflective surface measuring three-dimensional morphology.But this technology using multiple exposure, usually can not be straight at the initial stage of measurement for unknown scene
The time for determining required exposure frequency and exposing every time is connect, experience is commonly relied on or exposure as far as possible is multiple, have certain
Blindness, measurement efficiency is high.Patent CN104019767A is disclosed a kind of estimating measurand using grey level histogram
The method of required exposure frequency and optimum exposure time, is accordingly exposed measurand respectively, and obtains different
Then the image shot under optimum exposure time merges the image shot under different optimum exposure times, to extensive
The three-dimensional appearance of multiple measurand.Since grey level histogram only substantially reflects the frequency that each gray scale occurs in image, with this
Come the exposure frequency needed for evaluation of integrals measurand and optimum exposure time, some discrete pixels are then likely to occur
It omits.Patent CN103868472A discloses a kind of area-structure light three-dimensional measuring apparatus and method for high reflectance part.
It directly uses digital projector different from general fringe projection technology, devises a candy strip and generate system, projection
Striped brightness can be adjusted arbitrarily to adapt to the measurement of various reflective piece surfaces.This apparatus structure is complicated, and striped brightness
It cannot be according to measurand automatic adjusument.So at present in terms of high dynamic range measuring three-dimensional morphology there are no one compared with
For complete solution, can more be lacked according to the method that measurand carries out adaptive measuring.
Invention content
The present invention is intended to provide high dynamic range is realized in a kind of application area-structure light automatic adjusument projection candy strip brightness
Enclose 3 D measuring method.The uniform light pattern sequence that this method is acquired by analyzing camera, pixel-by-pixel automatic adjustment projection
The brightness of candy strip, bloom and dark caused by overcoming measurand surface reflectivity to change greatly, obtains clearly striped
Pattern image, to restore the three-dimensional appearance of measurand.
For this purpose, the present invention uses following technical scheme:
A kind of high dynamic range 3 D measuring method of adaptive striped brightness, using common digital projector,
Uniform light pattern sequence that is easy, quick, accurate, being acquired according to camera, automatically adjusts projection candy strip pixel-by-pixel
Brightness reduces the brightness of projection for the higher region of reflectivity, removes the bloom of candy strip image;On the other hand, for
The lower dark area of reflectivity, improves the brightness of projection, to obtain clearly candy strip image, to restore measurand
Three-dimensional appearance.
Preferably, a kind of high dynamic range 3 D measuring method of adaptive striped brightness, includes the following steps:
1), before projection scans candy strip, the different uniform light sequence of brightness is projected first Phase
Machine uses different gain k1、k2、...、knWith light exposure t1、t2、...、tnAcquire uniform light pattern sequence I1、I2、...、In,
Best candy strip gray value of image is solved, and calculates surface reflectivity, the environment of each pixel according to the image sequence
The mutual reflective light intensity of light and surface;
2), according to projecting apparatus-camera response function, the best projection gray value of each pixel of candy strip, pixel are calculated
Coordinate is camera image coordinate;
3), by camera-projector image coordinate mapping function, above-mentioned pixel coordinate is mapped as projector image and is sat
Mark;
4) candy strip, is projected according to the above-mentioned projector pixel coordinate being calculated, best projection gray value, is swept
Retouch operation;
5), the candy strip image for obtaining scanning carries out phase resolving and resurfacing, restores the three-dimensional of measurand
Pattern;
Preferably, in step 1), shown in effective uniformly light pattern sequence pixel computational methods such as formula (1), (x, y)
For camera image coordinate;
Effectively uniform light sequence is:
Camera acquisition best candy strip gray value of image be:
Calculate the surface reflectivity of each pixelThe mutual reflective light intensity of ambient light and surfaceAs shown in formula (4), wherein La(x, y) indicates ambient lighting directly in phase
The light intensity formed on machine imaging sensor, r (x, y) Li(x, y) indicates that other dough sheets from ambient lighting and measurand are logical
The light intensity that the light mutually reflected to form passes through the reflection of some dough sheet is crossed, as shown in Figure 2;
In step 2), the best projection gray value L of each pixel of candy stripP(x, y) computational methods such as formula (5) institute
Show;
In step 3), by above-mentioned required best projection gray value LP(x, y) is mapped as projector image coordinate (u, v),
According to structured light measurement system homography matrix H obtained by calibrating, camera-projector image coordinate mapping function is built;
S is scale factor, and it is L that the candy strip after being mapped according to formula (6), which most preferably projects gray value,P(u, v), u and v
For projector image coordinate.
Beneficial effects of the present invention:
(1) present invention can automatically adjust the projection of each pixel of candy strip according to factors such as measurand and ambient lightings
Brightness, compared with using the technology of multiple exposure, measurement efficiency is higher;
(2) present invention be calculated by analyzing uniform light pattern sequence the surface reflectivity of each pixel, ambient light and
The mutual reflective light intensity in surface, quantization is accurate, ensure that the high-precision of measurement;
(3) it is not necessarily to add additional hardware, cost of implementation is low, and method is easy, quick, accurate.
Description of the drawings
Fig. 1 is the measuring method flow chart of the present invention;
Fig. 2 is camera imaging schematic diagram;
Fig. 3 is using all light image of general fringe projection Technical camera acquisition, and position A and B are highlight area, i.e. quilt
Survey the larger region of subject surface reflectivity;
Fig. 4 is all light image of measurement method camera using the present invention acquisition, the bloom of corresponding diagram 3 position A and B by
Removal;
Fig. 5 is using the candy strip image of general fringe projection Technical camera acquisition, the height of corresponding diagram 3 position A and B
Light guide causes camera image sensor saturation, loses stripe information;
Fig. 6 is the candy strip image of measurement method camera using the present invention acquisition, the striped of corresponding diagram 3 position A and B
Clear and definite.
Specific implementation mode
Technical solution to further illustrate the present invention below with reference to the accompanying drawings and specific embodiments.
High dynamic range three-dimensional shaped is realized in a kind of application area-structure light automatic adjusument projection candy strip brightness of the present invention
Looks measurement method, by analyzing the uniform light pattern sequence of camera acquisition, the brightness of automatic adjustment projection candy strip pixel-by-pixel,
Bloom and dark caused by overcoming measurand surface reflectivity to change greatly, obtain clearly candy strip image, to extensive
The three-dimensional appearance of multiple measurand.Specific implementation step is as follows:
1) it, is influenced by gamma effects since common digital projector brightness is exported, the candy strip gray value of projection
Range is linear preferable between 40-220;Therefore, projection scan candy strip before, first project gray value be 40,70,100,
130,160,190,220 uniform light sequence In order to ensure the high-precision measured, when exposure
Between must be 1/ projecting apparatus frame frequency integral multiple, while to simplify the solution of projecting apparatus-camera response function, camera in the process
Gain is taken as k=1, i.e. 0dB, and the f-number of camera lens and time for exposure are fixed, and are taken as t=1, then acquire uniform light by camera
Image sequence I1、I2、I3、I4、I5、I6、I7;
2) best candy strip gray value of image, is solved, and each pixel is calculated according to above-mentioned uniform light pattern sequence
The surface reflectivity of point, the best projection gray value of the mutual reflective light intensity of ambient light and surface and each pixel of candy strip;
Since measurand is arbitrary, surface reflectivity is unknown, and by ambient lighting and complex surface structures
Influence (such as mutually reflection), therefore, the mutual reflected light in surface reflectivity, ambient light and surface of measurand should be calculated first
By force.For camera of every pixel using 8, gray value, which reaches 255 expression imaging sensors, to be saturated, preferably
Candy strip gray value should use projection brightness as big as possible, to reach maximum signal-to-noise ratio, while avoid image sensing
Device is saturated;For the highlight area of uniform light pattern sequence, it is contemplated that it is empty to reserve certain gray value for the noise of imaging sensor
Between, it avoids making imaging sensor reach saturation due to noise, then threshold value is taken as 248.For uniform light pattern 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) is camera image coordinate, removes the pixel of image highlight area, then effective uniform light figure
As sequence pixel point is:
Effectively uniform light sequence is:
Camera acquisition best candy strip gray value of image be:
Calculate the surface reflectivity of each pixelThe mutual reflective light intensity of ambient light and surfaceAs shown in formula (4), wherein La(x, y) indicates ambient lighting directly in camera
The light intensity formed on imaging sensor, r (x, y) Li(x, y) indicates that other dough sheets from ambient lighting and measurand pass through
The light mutually reflected to form passes through the light intensity of some dough sheet reflection, as shown in Figure 2;
The best projection gray value L of each pixel of candy stripPShown in (x, y) computational methods such as formula (5);
So using lower best projection gray value to the higher region of measurand reflectivity, camera image is avoided
Sensor is saturated;To the lower region of other reflectivity, then most preferably projection gray value takes 220, ensure that maximum signal-to-noise ratio.
3), due to above-mentioned required best projection gray value LP(x, y), x and y are camera image coordinate, need to be reflected
It penetrates and camera-projection is built according to structured light measurement system homography matrix H obtained by calibrating for projector image coordinate (u, v)
Instrument image coordinate mapping function;
S is scale factor.It is L that candy strip after being mapped according to formula (6), which most preferably projects gray value,P(u, v), u and v
For projector image coordinate.
4), according to above-mentioned best projection gray value LP(u, v) projects candy strip, is scanned operation.
5), phase resolves and resurfacing is all made of well known method;Three-dimensional point cloud is finally obtained, measurand is restored
Three-dimensional appearance.
The technical principle of the present invention is described above in association with specific embodiment.These descriptions are intended merely to explain the present invention's
Principle, and it cannot be construed to limiting the scope of the invention in any way.Based on the explanation herein, the technology of this field
Personnel would not require any inventive effort the other specific implementation modes that can associate the present invention, these modes are fallen within
Within protection scope of the present invention.