Summary of the invention
The present invention proposes a kind of visualization measurement and three-dimensional rebuilding method of the landform of model under water based on B ultrasonic imaging, utilize underwater topography imaging and disposal system based on tank, B ultrasonic instrument, three-dimensional travelling platform, computing machine, carry out the rapid extraction of the self-adaptation underwater topography based on B ultrasonic image and underwater topography visualization measurement and three-dimensional reconstruction based on formline; Specifically comprise the following steps,
The probe of step 1, B ultrasonic instrument contacts and carries out the video image of imaging acquisition underwater topography with the water surface in tank; The three-dimensional travelling platform of computer control drives Ultrasonic-B probe to carry out the motion on the three-dimensional of top to bottom, left and right, front and rear on tank;
There is a mutation process to the imaging of underwater topography in step 2, B ultrasonic instrument, form the landform bright band that a horizontal direction is extended continuously, adopt gray scale amplitude and the gradient sum basis for estimation as landform boundary, again according to landform continuity in the horizontal direction, carry out Continuous Tracking search, extract successively underwater topography boundary line, adaptive tracing and the rapid extraction of disposable realization list pixel formline;
Step 3, demarcate the actual range of single pixel representative, and underwater topography line is converted into true coordinate distance; Between many formlines, carry out again Cubic Spline Interpolation, realize visualization measurement and the three-dimensional reconstruction of model landform under water.
Described step 2 comprises following content:
Step 2.1, according to mutation process and gray scale and gradient, determine and follow the tracks of starting point O (I
o, J
o);
Step 2.2, in conjunction with the continuity of the horizontal direction of bright band, extract landform boundary line to from left to right Continuous Tracking;
Step 2.3, formline carry out Wavelet Denoising Method smoothing processing.
In described step 2.1, determine and follow the tracks of starting point O (I
o, J
o) adopt formula (1) to realize:
Wherein, the gray-scale value of the pixel (i, j) in f (i, j) presentation video, i is horizontal ordinate, j is ordinate; In the time that h (i, j) is maximum, represent to have found one and follow the tracks of starting point O (I
o, J
o), now i=I
o, j=J
o; M, n, k are independents variable.
In described step 2.2, extract frontier point to from left to right Continuous Tracking and adopt formula (2), formula (3) and formula (4) to realize:
Wherein, the gray-scale value of the pixel (i, j) in f (i, j) presentation video, wherein, i is horizontal ordinate, j is ordinate; Work as g
upwhen (i, j) is maximum, is illustrated in and on bright band, has found coboundary point (i, a J
up), now j=J
up; Work as g
downwhen (i, j) is maximum, is illustrated in and on bright band, has found relative central point (i, a J
down), now j=J
down; y
ifor current coordinate points (i, the y of Continuous Tracking formline
i) ordinate, y
i-1for the ordinate of a upper point; δ is the pixel distance of further surveying forward; M, n are independents variable.
In described step 3, dimensional topography data obtain the one adopting in fractional scanning and two kinds of scan modes of continuous sweep.
Compared with prior art, the present invention has the following advantages and beneficial effect:
1, the present invention directly utilizes B ultrasonic instrument to carry out imaging to water body and underwater topography thereof, obtains underwater topography video image, extracts formline, carries out visualization measurement and the three-dimensional reconstruction of image-type.This is that a kind of non-contacting line formula is measured and topography measurement is before all that single-point type is measured substantially.
2, the present invention has good penetrability to liquid and solid, be applicable to the various existing model landform such as plastic sand, natural sand, coal dust ash, phenolic moulding powder, self-adaptation is acted charitably, practical, and the feculent water body that can cannot realize optical means carries out direct visualization measurement and 3-d reproduction.
3, the present invention proposes the extracting method of the bed configuration under water based on B ultrasonic image, can disposablely realize the wide landform boundary line of single pixel and extract, and has effectively ignored the interference of suspended particle noise and pseudomorphism in B ultrasonic image, leaching process simple and fast.While processing with 100 frame B ultrasonic terrain graph on same computer, what methods described herein obtained is all the formline of a single pixel simultaneously, and be 16 milliseconds average calculating operation time; And what directly call that original canny scheduling algorithm obtains is all mixed and disorderly broken string and irrelevant or false border, average operating time is but more than 150 milliseconds.Therefore speed of the present invention is fast, real-time is good, can meet rapid extraction and the analysis to measure requirement of hydraulic model experiment mesorelief.
4, the precision of visualization measurement of the present invention and three-dimensional reconstruction is relatively high, at calibration coefficient accurately in situation, measuring error is generally less than 1 millimeter, meet the topographic General Requirements of river model test, and analyzed demonstration a kind of efficient new way is provided for the alluvial of washing away of model test mesorelief.
Embodiment
Implementation process of the present invention mainly comprises the following steps:
Step 1, connect system and device of the present invention according to Fig. 1;
Step 2, fix Ultrasonic-B probe, adjust wireless network, connect computing machine;
Step 3, three-dimensional travelling platform drive walk position to be measured make the Ultrasonic-B probe contact water surface of B ultrasonic instrument;
Step 4, open B ultrasonic instrument and adjust, make B ultrasonic instrument better to the imaging of underwater topography;
Step 5, control B ultrasonic instrument model landform is under water carried out to continuous video image acquisition;
Step 6, will collect video image and send computing machine to by wireless network; Computing machine completes successively: receiver, video image also resolves to continuous single frames B ultrasonic image; Extract the underwater topography line of single frames B ultrasonic image; According to the relation of image pixel distance and actual range, all formlines are converted into real terrain coordinate; Carry out Cubic Spline Interpolation according to real terrain coordinate, obtain dimensional topography data, rebuild dimensional topography; Washing away alluvial and related application analysis thereof shows.
Particular content of the present invention and technical scheme thereof mainly comprise three parts, as follows:
1. the imaging of underwater topography B ultrasonic and disposal system (realizing hardware configuration of the present invention)
In order to realize real-time monitored and three-dimensional reconstruction under water, the imaging of a underwater topography B ultrasonic and disposal system are built for this method, for obtaining the line correlation processing of going forward side by side of the video image of underwater topography.This system comprises current and model tank, B ultrasonic instrument, three-dimensional travelling platform, the remote computer of model landform is under water housed, and the program that realizes this method is installed in computing machine.Travelling platform is placed on the top of model tank, and itself and model tank are for being slidably connected; B ultrasonic instrument is fixed on travelling platform and by wireless network Wi-Fi and connects remote computer; Probe on B ultrasonic instrument is arranged on travelling platform by carriage, and travelling platform coordinates the probe making on B ultrasonic instrument to move in all around, upper and lower three dimensions with carriage; When work, Ultrasonic-B probe keeps contacting with the water surface, slides and drive B ultrasonic instrument to carry out underwater topography data acquisition in travelling platform edge on tank.
Three-dimensional travelling platform is provided with the driving circuit being connected with remote computer, and remote computer drives travelling platform to drive B ultrasonic instrument edge on tank to slide by driving circuit, carries out underwater topography data acquisition.
Three-dimensional travelling platform comprises platform body, pulley, stepper motor three, motor-drive circuit three, platform body is fixed on pulley, pulley, stepper motor three, motor-drive circuit three connect successively, and motor-drive circuit three is connected with remote computer by wireless network Wi-Fi.
Three-dimensional travelling platform carries B ultrasonic instrument and fixes Ultrasonic-B probe, walks on tank, and can control Ultrasonic-B probe and carry out the running fix of horizontal direction, vertical direction and above-below direction by pulley and Electric Machine Control; Wherein, Ultrasonic-B probe is fixed on the sliding bar on three-dimensional travelling platform, in order to realize the movement of vertical direction and above-below direction, and ensures that Ultrasonic-B probe contacts with the water surface in the time carrying out the video image acquisition of underwater topography; Three-dimensional travelling platform is connected remote computer with B ultrasonic instrument by wireless network, realizes the transmission of video image and the control of three-dimensional walking instruction.
As shown in Fig. 1 (a), in figure, Ultrasonic-B probe is placed in tank and contacts the water surface, three-dimensional travelling platform carries B ultrasonic instrument, and control Ultrasonic-B probe to measured zone position walking with underwater topography imaging, obtain the video signal of model landform under water and send computing machine to, carrying out on computers the relevant calculation such as visualization measurement and three-dimensional reconstruction and the processing of underwater topography.
As shown in Fig. 1 (b), carriage comprises geometrical clamp, band tooth slide bar one, band tooth slide bar two, stepper motor one, stepper motor two, toothed timing belt one, toothed timing belt two; Stepper motor two is fixed on travelling platform; Toothed timing belt two is connected with stepper motor two, by stepper motor two pulling motions; Band tooth slide bar two is connected with stepper motor two; Toothed timing belt one, stepper motor one are all arranged on band tooth slide bar two; Toothed timing belt one is connected with stepper motor one, by stepper motor one pulling motion; Band tooth slide bar one is connected with stepper motor one, and the probe of B ultrasonic instrument is connected with band tooth slide bar one by geometrical clamp; Stepper motor one, stepper motor two are respectively by driving circuit and remote computer wireless connections separately.
2. the underwater topography extracting method based on B ultrasonic image (obtaining of two dimensional terrain line)
Existing methodical drawback: classical boundary extraction method is to utilize the interior single order of gray scale of neighborhood or the Changing Pattern of Second order directional to carry out detection boundaries, as Sobel operator, Laplacian operator and canny operator etc.Directly utilize these operators and the Boundary Extraction side based on these operators to carry out the image that treatments B over-extraction collection returns and also have following defect: the interference ratio to noise is more responsive, causes testing result unstable, easily occur a lot of irrelevant or false borders; The border obtaining is that isolate or interrupted, cannot obtain the wide landform boundary line of the continuous single pixel of a whole piece.
The present invention is directly from the feature of B ultrasonic imaging, find that B ultrasonic instrument exists a mutation process to the imaging of underwater topography, be that in image, gray scale amplitude changes and substantially reaches at the soonest maximal value at the coboundary point of landform, as shown in Figures 2 and 3, B ultrasonic instrument is a landform bright band along horizontal direction continuous distribution to the imaging of underwater topography.Therefore the present invention utilizes this characteristic, adopt gray scale amplitude and the gradient sum basis for estimation (border that the maximal value place that is gray scale amplitude and gradient sum is landform) as landform boundary, again according to landform continuity in the horizontal direction, carry out Continuous Tracking search, extract successively underwater topography boundary line.Extraction step is as shown in the FB(flow block) of Fig. 4.
2.1 according to mutation process and gray scale and gradient, determines and follows the tracks of starting point
Because the boundary characteristic of picture centre region landform bright band is outstanding, therefore start from central area to carry out from top to down rectilinear scanning, find the some starting point that also conduct is followed the tracks of on landform bright band.Consider that landform bright band occupies certain width from top to bottom, thus in judging landform border also immediately following under border with it suitable gray scale amplitude also include consideration in, can obtain more accurately like this in formline a bit.If the upper left corner of B ultrasonic image is pixel coordinate starting point, the coordinate of pixel successively from left to right from top to bottom.In note original image, the gray scale amplitude of pixel is along with the function that x axle y axle changes is f (x, y).So, judge that the computing formula of landform boundary line starting point is:
Wherein, function h (x, y) process that is illustrated in picture centre region and searches for from top to down landform bright band, h (i, j) is the result that in scanning process, (i, j) locates pixel gray scale amplitude, its corresponding template as shown in Figure 5, in figure, indicate the position of current process points (i, j), the gray scale amplitude of bottom three behavior auxiliary judgment.
So, determine that the starting point on landform border is the maximal value h (x, y) that determines function h (x, y)
max.Scan from top to down wherein a row pixel during in central area, suppose at an O (I
o, J
o) search maximal value, represent to have searched for the point on landform border, be tracking starting point.
In order to ensure that the current trace point finding has navigated on boundary line really, thus herein in the time determining first, not only scanned row or several row of central area, also interval scan simultaneously several row in two regions, left and right put O as auxiliary judgment
1and O
2.Ensureing maximal value h (x, y)
max, h
1(x, y)
maxand h
2(x, y)
maxin close situation, just determine the real starting point O (I that follows the tracks of
o, J
o).
The continuity of 2.2 horizontal directions in conjunction with bright band, follows the tracks of landform boundary line to from left to right
B ultrasonic is a bright band changing along x direction of principal axis to the imaging of underwater topography, and the process of following the tracks of landform boundary line is at definite starting point O (I
o, J
o) situation under, by current known point successively to the right (or left) judgement determine next consecutive point.Determination methods is according to the continuity of the gray feature of landform bright band and horizontal direction thereof, determines successively ordinate (y axle) the offset Δ y of the relatively previous point of next point, i.e. point (I
o+ 1, J
o+ Δ y).The like, in succession obtain the coordinate of next point with respect to previous point, until complete the track and extract of whole landform.In order to take into account metastable bright band center and to hold labile landform coboundary, reducing under topographical surface movement of particles disturbed condition as far as possible, consider the weights when prostatitis, operator masterplate becomes as shown in Figure 6, and current operation is divided into and upwards searches and search two parts downwards.
Upwards search is that upwards (direction that ordinate reduces) searches the width d of k bright band, i.e. kd pixel on the basis of the ordinate of upper consecutive point.Wherein the value of k is according to the fluctuating quantity of landform, generally value 3.In the scope of this kd pixel, search when the gray scale amplitude in prostatitis and the maximum of points of gradient sum, be defaulted as when the coboundary in prostatitis point, calculation expression is suc as formula shown in (2), and corresponding template is as shown in Fig. 6 (a).
Wherein, function g
up(x, y) represents: in seek scope, and involved all pixels in the process that at every turn upwards (ordinate reduces direction) searches.Suppose g
up(i, y) is at point (i, J
up) obtain maximal value, i.e. g
up(i, J
up)=g
up(i, y)
maxtime, coboundary point (i, the J of the landform of i row found in expression
up).
The process of searching downwards too, only not in compute gradient, and is only concerned about maximum gradation value point, and object is to find the center of bright band, thus locking landform bright band.Calculation expression is suc as formula shown in (3), and corresponding template is as shown in Fig. 6 (b).
Wherein, function g
down(x, y) represents: in seek scope, and involved all pixels in each (ordinate augment direction) search procedure downwards.Suppose g
down(i, y) is at point (i, J
down) locate to obtain maximal value, i.e. g
down(i, J
down)=g
down(i, y)
maxtime, the central point of the landform bright band of i row has been found in expression.
In the husky environment of water of dynamic high flow rate, in landform, indivedual regions sand grain may move in a large number, thereby causes the Relative Fuzzy of B ultrasonic to terrain imaging.In order to reduce this impact, when further surveying landform on the basis in prostatitis forward, catch following metastable landform and feed back.Carry out same operation at the front δ row (being i+ δ row) of current i row, find point (i, J'
up) and point (i, J'
down), be then multiplied by weights
be weighted to when (δ >3, general value 5) gone in prostatitis.So the point on formline determines that method is suc as formula shown in (4), y
ibe the ordinate of i row, y
i-1it is the ordinate of i-1 row.
Adopt above-mentioned method of operating, find out successively starting point O (I
o, J
o) the right all landform frontier points.And then from starting point O (I
o, J
o) the left side start, adopt and use the same method, contrary direction (left) finds all landform frontier points on the left side.Finally O (I
o, J
o) point on starting point left side the right all links up, and so just formed underwater topography line.
2.3 formlines carry out Wavelet Denoising Method smoothing processing
The formline being obtained by above operation, substantially smooth in the mild landform of static state, meet the actual conditions of landform; In dynamic sag and swell, due to the impact of water flow sediment movement, extract indivedual coordinate points in formline and depart to some extent, there is fluctuation to a certain degree, therefore need to carry out smoothing processing to a certain degree to extracting result.Adopt the method for Wavelet Denoising Method to carry out formline smooth treatment herein, wherein as shown in Figure 7, in figure, curve represents the formline extracting to two formlines.The pixel coordinate of the formline extracting is multiplied by the actual range that each pixel is corresponding can obtain real actual landform curve, and this curve is a continuous wide curve of single pixel, can follow the fluctuations of landform, coincide better with actual landform, extract error and be less than 1mm.
3. underwater topography visualization measurement and three-dimensional reconstruction thereof (step 3 in right is further explained)
According to the boundary line of the underwater topography of extracting, demarcate the actual actual distance that single pixel is corresponding, landform boundary line data are all converted into real three-dimensional terrain coordinate.Under the help of three-dimensional localization travelling platform, Ultrasonic-B probe can carry out the motion of top to bottom, left and right, front and rear, can be used for underwater topography to carry out fractional scanning and continuous sweep.Fractional scanning is that a landform is divided into several sections, three-dimensional localization walking is controlled platform the Ultrasonic-B probe assigned address of walking, obtain the data of current section landform, then move to next position and scan successively, more each section landform is pieced together to formation dimensional topography.As shown in Figure 8, in figure, be that 3 relatively continuous section landform form, X-axis is 3 analyzing spots, and Y-axis is the point on the landform boundary line extracting, and Z axis is the depth of water, and YZ plane forms section landform.The data that lack between section are carried out Cubic Spline Interpolation.Can see clearly by Fig. 8 the three-dimensional underwater topography that 3 section landform form, but because the section spacing gathering is larger, section is also fewer, therefore three dimensional terrain reconstruction effect is relatively poor.
In order to reproduce more really underwater topography, B ultrasonic instrument can carry out continuous profile scanning under the help of three-dimensional localization walking control platform.During as the about 300mm of the depth of water, Ultrasonic-B probe sends high-frequency ultrasonic, just can receive echoed signal after 0.5ms.In the time that probe horizontal sweep speed is 100mm/s, within each ultrasonic imaging time, the mobile distance of probe is only 0.05mm.If give the imaging disposing time of reserved 10 times of B ultrasonic instrument, in the time that horizontal sweep speed is 10mm/s, Ultrasonic-B probe also mobile 0.05mm only within each ultrasonic imaging time.Therefore can think when Ultrasonic-B probe is when walking compared with low velocity (being less than 10mm/s), substantially not affect quality and the precision of B ultrasonic imaging and can obtain continuously whole landform.Wherein after one-time continuous scanning, extract continuously a dimensional topography that landform boundary line three-dimensional reconstruction obtain as shown in Figure 9.Three-dimensional reconstruction is based on MFC and OpenGL environment, and rotation, cutting and circle of equal altitudes analysis and the landform that can realize underwater topography are washed away the functions such as the demonstration of alluvial situation.