Summary of the invention
The invention provides a kind of motion vector generation method of laser speckle image, first image adaptive pre-service is carried out to the input speckle pattern projected on target object (depth information is unknown), again using the standard speckle pattern as benchmark (depth distance information is known) through identical image preprocessing for reference, input speckle pattern is carried out block-based motion estimation by a certain size image block, namely find in the search window of image block in standard speckle pattern centered by correspondence position by certain search strategy and similarity measurement index and find blocks and optimal matching blocks, obtain the side-play amount between this image block and match block, be the motion vector of this image block.This motion vector can by the displacement of X, Y direction (
,
) represent, starting point is the image block in standard speckle pattern, and terminal is the image block of input speckle pattern, and its precision can reach sub-pixel-level.
According to the motion vector generation method of a kind of laser speckle image of the present invention, implementation step comprises:
The acquisition of step one, standard speckle image and input speckle image, wherein, projects fixing speckle pattern with the central axis of speckle grenade instrumentation and in plane apart from described grenade instrumentation gauged distance, catches the standard speckle image in described plane; The input speckle image that seizure projects target object region and obtains;
The image adaptive pre-service of step 2, speckle pattern, wherein, standard speckle image and input speckle image, after the image adaptive pre-service of the same manner, generate pretreated standard speckle image and input speckle image;
Step 3, input speckle image and standard speckle image between block-based motion estimation, wherein, in conjunction with described pretreated standard speckle image and input speckle image, obtain the motion vector on input speckle image regional with Algorithm for Block Matching Motion Estimation.
The beneficial effect of technical solution of the present invention is adopted the elaboration by following examples to be obtained concrete embodiment.
Embodiment
Below in conjunction with accompanying drawing, the present invention is described in further detail.
Fig. 1 schematically illustrates the overall flow figure that embodiment of the present invention laser speckle image motion vector generates.In order to clearly demonstrate, hereinafter the method is described for composition graphs 2 and Fig. 3.
When generating the motion vector of laser speckle image, first carry out step one, acquisition standard speckle pattern and input speckle pattern, wherein, fixing speckle pattern projected with the central axis of speckle grenade instrumentation and in plane apart from described grenade instrumentation gauged distance, catch the standard speckle image in described plane; The input speckle image that seizure projects target object region and obtains.
The system catching speckle image mainly contains speckle grenade instrumentation and imageing sensor.Speckle grenade instrumentation can be coherent source and pattern maker, and coherent light is projected on object by pattern maker and forms speckle pattern.Speckle grenade instrumentation and imageing sensor have substantially equal distance to object.The space that this system is inswept be the light source optical path visual angle of propagating and imageing sensor for the space that intersects to form, visual angle, thus enable the distance apart from pattern maker be greater than the object imaging of Rayleign distance.
The acquisition of standard speckle pattern laser beam (infrared, visible ray, ultraviolet, invisible light) is projected through the speckle pattern that pattern maker is formed the plane that and known location distance perpendicular with the central shaft of laser beam generating device (Z axis) is d (this plane can be made up of projection cloth, flat board etc., for presenting steady and audible speckle point diagram, this plane can be referred to as standard flat) on, the speckle pattern that plane is formed is standard speckle pattern.
In above process, distance d is the vertical range of standard flat and speckle grenade instrumentation.In another preferred embodiment, standard flat, namely the position of described plane is chosen and is met following constraint condition: the central axis of (1) described plane and grenade instrumentation; (2) d value must be irradiated within the scope of coverage at speckle; (3) speckle pattern in described plane is the view picture speckle image containing fixed pattern formation as far as possible, and the speckle pattern in described plane can be captured.Such as, imageing sensor can catch the speckle pattern in described plane in its angular field of view.
The acquisition methods of input speckle pattern and standard speckle pattern is basically identical, is inputted frame by frame by identical imageing sensor, the target object containing the information that will fathom in speckle pattern, within the scope of the coverage that namely target object must irradiate at speckle.
Before image sensor apparatus catches standard speckle pattern and input speckle pattern, need device after filtering, the function of wave filter be only allow in coherent source wave band or close to the light wave of light source wave band normal through (being all suppressed of other wave band), then through imageing sensor collection.
The standard speckle pattern gathered after filtering and input speckle pattern need through the pre-service of step 2 image adaptive, wherein, standard speckle image and input speckle image, after the image adaptive pre-service of the same manner, generate pretreated standard speckle image and input speckle image.Image adaptive pre-service comprises one or more in following process as shown in Figure 2: Bayer format conversion (depending on the output video form of imageing sensor), color space convert (such as, RGB to YUV), gray level image self-adaptive solution and enhancing etc.Bayer format conversion is a kind of conversion method between gray level image and color image format.Gray level image self-adaptive solution method is used for the elimination of noise, and image enchancing method comprises histogram enhancement, gray scale linearly strengthens, binary conversion treatment etc., but is not limited to these traditional Enhancement Method.Make speckle pattern can carry out block-based motion estimation more accurately by denoising and enhancing.
Pretreated standard speckle pattern and input speckle pattern, enter step 3, carry out block-based motion estimation, in conjunction with described pretreated standard speckle image and input speckle image, obtain the motion vector on input speckle image regional with Algorithm for Block Matching Motion Estimation.Block-based motion estimation specific embodiment as shown in Figure 3.With standard speckle pattern for reference data, in input speckle pattern, extract a certain size image block
,
,
for the size of image block, can be equal, also can be unequal.In standard speckle pattern, with image block
the search window of the certain limit centered by corresponding position
in, find the blocks and optimal matching blocks of this image block with certain search strategy and similarity measurement index, obtain side-play amount between this image block and match block (
,
), be the motion vector of this image block, wherein
,
for the size of search window, can be equal, also can be unequal.Exemplarily, search strategy and similarity measurement index can adopt and use in conventional block matching process, such as three step search algorithm (TSS) and absolute error and (SAD), but also can adopt search strategy and the similarity measurement index of other various improvement.
To input speckle pattern, image block is by identical size from left to right, extracts from top to bottom by certain step-length.In the process asking for motion vector, suppose that the displacement of all pixels in image block is all identical.Choosing of the corresponding search window of image block is centered by the corresponding region of this image block in standard speckle pattern, expands identical pixel radius up and down respectively
.Preferably, if only pay close attention to the side-play amount of image block X-direction
, choosing of search window can the left and right directions of an expanded images block, can reduce a large amount of calculated amount like this, improve travelling speed.In like manner the Y-direction of image block is as the same.
The block matching motion estimation method that the present invention obtains input speckle pattern motion vector is different from traditional block matching algorithm.In the matching process, the step-length of traditional its match block of estimation matching algorithm equals the size of match block, and the step-length of the image block extracted from input speckle pattern in the present invention also can be less than the size of match block.As shown in Figure 3, match block represent just middle with the motion vector of pixel in the shadow region of slash mark through the motion vector that estimation is asked for, shadow region can be made up of one or more pixel, obtains the accuracy rate of motion vector and the compromise of small objects motion vector error hiding phenomenon in this approach.
In the present invention, search strategy is that match block is searched for one by one, and therefore precision can reach Pixel-level, even sub-pixel-level.For subpixel accuracy, for the ease of hardware implementing, H.264 scrambler sub-pixel method for estimating can be adopted, mainly comprise two parts: asking for of interpolation arithmetic and sub-pixel-level motion vector is carried out to pixel.The position of sub-pixel is often with 1/2
nfor unit, exemplarily, below in conjunction with Fig. 4, asking for of 1/4 pixel precision motion vector is described.
The first step, asking for of 1/2 pixel precision motion vector.First 1/2 pixel interpolation is carried out to input speckle pattern and standard speckle pattern, the calculating of 1/2 pixel is obtained through filtering by 6 pixels adjacent in horizontal or vertical direction, two kinds of situations are divided into: if 1/2 pixel position is adjacent with integer pixel point according to whether adjacent with integer pixel point, as the i pixel in Fig. 4, computing formula is such as formula (1); If 1/2 pixel position and integer pixel point non-conterminous, as the j pixel in Fig. 4, calculate with 1/2 pixel of 6 in horizontal direction or vertical direction, computing formula is such as formula (2) or formula (3).5 (>>5) expression that moves to right in formula only intercepts integral parts calculating after 32.
(1)
(2)
(3)
After 1/2 pixel calculates, around each integer pixel point, there are 8 1/2 pixels, as shown in Figure 4, terminal pointed to the motion vector of C point
wherein, suppose that C point is a certain summit of image block, motion vector is the corresponding vertex pointing to blocks and optimal matching blocks from image block summit: according to described similarity measurement index, Integer Pel point C point and around it 8 1/2 pixels be respectively in 9 1/2 pixel precision match block of summit composition and find blocks and optimal matching blocks, obtain the motion vector of pixel C to 1/2 pixel around it
, then in conjunction with vector
, obtain the motion vector of described 1/2 pixel precision between this image block and match block
.
Second step, after trying to achieve the motion vector of 1/2 pixel precision, the motion vector of 1/4 pixel precision draws by linear interpolation and with computing method like a upper dry goods.Concrete calculating is also divided into two kinds of situations: if the position of 1/4 pixel and integer pixel point or 1/2 pixel adjacent, as aa and the cc pixel in Fig. 4, computing formula is such as formula (4); If the position of 1/4 pixel and integer pixel point and 1/2 pixel all non-conterminous, as the bb pixel in Fig. 4, calculated by 1/2 pixel of 2 on diagonal line, computing formula is such as formula (5).Move to right 1 (>>1) expression divided by the 2 rear calculating only intercepting integral parts in formula (4) and (5).
(4)
(5)
After 1/4 pixel interpolation, around each 1/2 pixel, there are 8 1/4 pixels, as shown in Figure 4, terminal pointed to the motion vector of i point
, according to described similarity measurement index 1/2 pixel i point and around it 8 1/4 pixels be respectively in 9 1/4 pixel precision match block of summit composition and find blocks and optimal matching blocks, obtain the motion vector of pixel i to 1/4 pixel around it
, then in conjunction with vector
, obtain the motion vector of described 1/4 pixel precision between this image block and match block
.
In the present invention, the input speckle image of seizure comprises a series of test patterns caught in described object moving process, and can according to the motion of object in estimated tracking target region, position.
Although the above embodiments complete in specific system, so itself and non-limiting the present invention, what the present invention can be similar is applied in similar pattern projection and image sensor system.Thus amendment without departing from the spirit and scope of the present invention and perfect, all should be included in above-mentioned right.