A kind of water regime monitoring system
Technical field
The present invention relates to a kind of electronic surveying field, particularly relate to a kind of water regime monitoring system.
Background technology
In the water level measurement method of prior art, float type level meter application in water regime monitoring is the most universal.Will
Float line is vertically hung on a pulley, and float is placed on the water surface, will produce upper and lower displacement along with the height of water level.
By float and the distance of specified point in pipe, then by certain calculating, it is possible to obtain current water level.Float gauge
Needing special well logging, its shortcoming is installed more complicated exactly, if current are heavier, through fortune after a while containing silt simultaneously
OK, the water inlet pipe of well logging will produce the phenomenon of alluvial, is easily formed artifical water height.
Pressure type water gauge is the hydrostatic pressure principle proportional according to pressure and the depth of water, uses pressure cell to pass
Sensor, produces corresponding electric current at different depth of water sensing different pressures and measures the height of equivalent water level, and this mode solves
The shortcoming of float type level meter, but it is unable to reach the highest precision, and easily affected by ambient temperature and liquid density variation.
The principle of aerosphere type or liquid Jie's formula ultrasonic type water-level gauge application ultrasonic reflections measures water level.Ultrasound wave is being situated between
Propagating with certain speed in matter, when running into the dielectric interface of different densities, ultrasound wave reflects immediately.Liquid Jie's formula be by
Transducer is arranged on river bed, vertically launches ultrasound wave to the water surface;Aerosphere type is that transducer is fixed the most a certain eminence, to
The water surface launches ultrasound wave.Two kinds of forms are all not required to build well logging.Liquid Jie's formula is easily by outstanding particle concentration shadow floating in water temperature, hydraulic pressure and water
Ringing, aerosphere type is easily affected by temperature, and its advantage is not affected by pasture and water, silt etc. in water.This method has it advanced, but becomes
This is higher.
And existing Level monitor often can only single sensed water level, it is impossible to detection water quality, needs additionally to adopt
Realize with water monitoring device, how to realize measuring water level simultaneously and water quality is the technical barrier of this area.
Summary of the invention
The technical problem to be solved in the present invention is to provide a kind of water regime monitoring system being adapted for water quality measurement, this water
Feelings monitoring system uses gray scale detection principle to carry out water quality monitoring, i.e. the water surface image shot is carried out gray proces and obtains this water
The gray value of face picture is to obtain water quality situation.
The invention provides a kind of water regime monitoring system, including: longitudinally disposed measurement pipe, its lower port is entered in use
Upstream face, measures and sets a camera head at the upper port of pipe, and this camera head is suitable to shoot the water surface image in described measurement pipe;
Video acquisition module, is connected with described camera head, is suitable to the image of collection is transformed to digital picture;With described video acquisition
The image processing module that module is connected, this image processing module storage has the first sample data, described first sample data to be suitable to
Record the gray value (water quality is the poorest, and gray value is the highest) of various water quality;Described first sample data is by described water regime monitoring system
Water known, different quality is measured and is obtained by system one by one;Described image processing module is suitable to described digital picture
Carry out gray proces, compare to obtain water outlet obtaining the gray value of described water surface image, this gray value and the first sample data
Matter situation, finally by the LCD being connected with described image processing module or Computer display water quality situation.
Described image processing module preferably connects the arm processor having memory element.
Further, in order to avoid the ambient light impact on water surface image during shooting, the inwall of described measurement pipe is provided with
Be suitable to light-absorbing black coating.
Further, in order to avoid the ambient light impact on water surface image in bottom during shooting, and water is kept when not shooting
Smooth logical so that the water quality in described measurement pipe is consistent with actual water quality, described measurement pipe be positioned at below the water surface in use
Tube wall on multiple through hole is distributed, sheathed sleeve on the body below the water surface;Described sleeve pipe and one is suitable to drive this set
Pipe along described measurement pipe upper and lower displacement displacement drive mechanism driving connect, this displacement drive mechanism by one with described camera head
The controller being connected controls;When filming surface image, control described displacement drive mechanism and drive sleeve pipe to shift up, so that institute
State and described in sleeve covers, measure each through hole on pipe, manage to prevent extraneous light from entering described measurement;At not filming surface image
Time, control described sleeve pipe to bottom offset, and make described sleeve pipe not cover each through hole on described measurement pipe so that current be suitable to into
Go out described measurement to manage.Described displacement drive mechanism be located at cylinder on described measurement pipe, that be connected with described sleeve pipe, oil cylinder or
Linear electric motors etc. are adapted for carrying out the device of straight-line displacement.
Further, in order to realize the level measuring to described water regime monitoring system, described measurement pipe is fixedly installed;Shooting dress
Put employing focusing wide angle camera lens, or tight shot.Described image processing module has also stored the second sample data, this second sample
Data are suitable to corresponding table or the meter of the pixel value recording the water surface image in described measurement pipe and camera head distance water surface elevation
Formula;Described image processing module is further adapted for calculating the pixel value of the water surface image in the described measurement pipe of current shooting, and
The height of the current camera head distance water surface is drawn, then by the installation of described camera head by described second sample data
Highly deduct the height of the described camera head distance water surface, i.e. obtain water level value.
As further preferred embodiment, described camera head is fixed on described measurement pipe, and makes this measurement pipe
Upper port close, to avoid extraneous light to enter this measurement pipe from upper port.
Further, in order to realize the level measuring to described water regime monitoring system, the periphery of described measurement pipe is provided with and is suitable to
Make the float that this measurement pipe is bubbled through the water column;Described water regime monitoring system also includes: flexible scale, and one end of this flexible scale is fixed
At the bottom, the other end and be suitable to rolling, strain this flexible scale wrap-up be connected, this wrap-up is fixed on described survey
On buret;Directive wheel, is located on the inwall of described measurement pipe, and on the inwall of this measurement pipe, neighbouring described directive wheel is upper and lower
Side is respectively equipped with the upper and lower guide post parallel with the wheel shaft of described directive wheel, and described flexible scale is suitable to respectively from described upper and lower
Guide post and the gap of the inwall measuring pipe pass and be fitted on the inner side wheel face of described directive wheel, the top of described directive wheel
Portion is in above the water surface.Use flexible scale, be suitable to make measurement pipe vertically bubble through the water column on float, the parts such as directive wheel, make
Described water environment monitoring device can swim on the water surface, and described video camera obtains the flexible mark at the top of neighbouring described directive wheel
The reading of chi, after image recognition, error correction, it is thus achieved that actual water level value.The method of described error correction is: will pass through image
Identify the reading of the described flexible scale obtained, subtract each other with default corrected value, i.e. obtain actual water level value.Described default school
On the occasion of being obtained by experiment.
Present invention also offers a kind of measuring method being suitable to water level and water quality monitoring, the method to solve the technical problem that
Be the water surface image utilizing camera head to shoot carry out respective handling with obtain the gray value of water surface image and area pixel value with
Obtain corresponding water quality and water level conditions.
The method of work of above-mentioned water regime monitoring system, comprises the steps:
(1) being fixed with measurement pipe on the water surface, its lower port is adapted to enter into the water surface, sets a camera head at upper port, and this is taken the photograph
As device shoots the water surface image in described measurement pipe;
(2) described water surface image is converted to digital picture by video acquisition module;
(3) in the image processing module being connected with described video acquisition module, storage has first, second sample data, described
First sample data is suitable to record the gray value of various water quality, and described second sample data is suitable to record the water in described measurement pipe
The corresponding table of the pixel value of face picture and camera head distance water surface elevation or calculating formula;
(4) described image processing module carries out gray proces to described digital picture, to obtain the ash of described water surface image
Angle value, this gray value and the first sample data are compared, and draw water quality situation;
(5) pixel value of the water surface image in described image processing module calculates the described measurement pipe of current shooting, and
The height of the current camera head distance water surface is drawn, then by the installation of described camera head by described second sample data
Highly deduct the height of the described camera head distance water surface, i.e. obtain water level value.
Further, in order to more easily extract the area pixel value of water surface image, described step (5) including:
A: described digital picture, after gray proces, uses MATLAB function to carry out Threshold segmentation and processes to extract water surface shadow
The edge of picture;
B: Calling MATLAB built-in function bwarea, to calculate the area pixel value of the water surface image after edge extracting.
Compared with prior art, present invention have the advantage that the water regime monitoring system of (1) present invention is by water surface image
To obtain the corresponding situation of water quality, simple in construction, it is simple to carry out just in the case of carrying out water quality test in the wild or unconditionally
Prompt formula water quality detection, it is not necessary to tedious steps;(2) present invention passes through coating, and illuminator is suitable to make the upper port of this measurement pipe to seal
Closing, so that the water surface image of shooting is difficult to receive the impact of ambient, it is more accurate to detect;(3) present invention is by measuring
Being positioned on the tube wall below the water surface of pipe arranges multiple through hole, with when not filming surface image, is beneficial to current circulation;Clapping
When taking the photograph water surface image, control described displacement drive mechanism and drive sleeve pipe to shift up, so that measuring pipe described in described sleeve covers
On each through hole, with prevent extraneous light enter described measure pipe;The combination of above-mentioned parts makes, when carrying out water quality and judging, to keep away
Having exempted from the impact of light under water, the water surface image making shooting is more accurate, with the precision of monitoring of increasing water quality further;Measure pipe
Bottom end closure, can avoid further extraneous light enter measure pipe in.(4) the visual pattern treatment technology of the present invention, will figure
As vision technique application and water regime monitoring field, while obtaining water quality information, by image vision commercial measurement video
The pixel value that has of water surface image, be converted into the water surface spacing with camera head to obtain water according to the size of this pixel value
Position, because water level is the biggest with the spacing of camera head, the area shared by water surface image in the picture that shooting obtains is the least, phase
The pixel value answered is the least;Otherwise, the area shared by water surface image in the picture that obtains of shooting is the biggest, then water surface image
Pixel value is the biggest;The present invention can also obtain water quality information simultaneously, it is not necessary to expensive level sensor and loaded down with trivial details water quality prison
Survey, easy to use;(5) it is provided with by the periphery of flexible scale, described measurement pipe and is suitable to make this measurement pipe vertically bubble through the water column
The parts such as float, directive wheel, make described water regime monitoring system can swim on the water surface and carry out level measuring, more accurate to obtain
True water level value.Camera head can directly obtain the reading of flexible scale, and then quickly draws water level value.
Accompanying drawing explanation
In order to make present disclosure be more likely to be clearly understood, below according to specific embodiment and combine accompanying drawing,
The present invention is further detailed explanation, wherein
The structural representation of the water regime monitoring system of Fig. 1 present invention.
The structural representation for water level detection part of the water level detecting system of Fig. 2 present invention.
Wherein, measure pipe 1, the water surface 2, water surface image 2-1, float 3, flexible scale 4, wrap-up 5, directive wheel 6, on lead
To bar 7-1, lower guide post 7-2.
Detailed description of the invention
Below in conjunction with the accompanying drawings and embodiment the present invention is described in detail:
Embodiment 1
Embodiment one
Such as Fig. 1, a kind of water regime monitoring system, including: measuring pipe 1, its lower port this lower port in use is suitable to entirety
Entering the water surface 2, set a camera head at upper port, this camera head is suitable to the water surface image 2-1 shooting in described measurement pipe 1;
Video acquisition module, is connected with described camera head and is suitable to collection image is transformed to digital picture;With described video acquisition mould
The image processing module that block is connected, this image processing module storage has the first sample data, described first sample data to be suitable to note
Record the gray value of various water quality;Described first sample data is to known, the water of different quality by described water regime monitoring system
Measure one by one and obtain;Described image processing module is suitable to described digital picture is carried out gray proces, described to obtain
The gray value of water surface image 2-1, this gray value and the first sample data are compared and are drawn water quality situation.
Water quality detection principle is the gray value utilizing different quality corresponding gray value sample with water surface image to be detected
Compare, i.e. image processing module storage has each gray value sample of different quality, the i.e. first sample data.
Using MATLAB built-in function that described water surface image 2-1 is carried out corresponding gray value process, step is as follows:
I=imread(‘image.jpg’);% opens pending picture (8 gray scales)
imshow(I);% shows this picture
C=mean2(I);% calculates the meansigma methods of image pixel matrix
The gray value of described water surface image 2-1 just can be calculated by mean2 function.
Table 1 is the average gray value of various water quality, the i.e. first sample data:
According to common sense, the water quality quality of these water samples may be arranged such that: pure water > green tea water > swimming-pool water >
River > it is mixed with the water of mud > by the water of dye discoloration > industrial wastewater ≈ prepared Chinese ink water, when water body sampled images gray value (brightness
Value) more hour, it is believed that its water quality is the poorest, and vice versa.Thus when water quality detection, can be by water body overall gray level
Calculate corresponding water quality conclusion, it is also possible to by the process hands of the higher levels such as sample extraction, neutral net, pattern recognition
Section, accomplishes to detect the water quality index that turbidity etc. more refines.Such as, if the gray scale of the water surface image 2-1 detected is 85, then draw
This water quality is suitable with the water quality of river.
In order to avoid the ambient impact on water surface image 2-1, described camera head is tightly connected with upper port, to keep away
Exempt from extraneous light and enter this measurement pipe from upper port;The inwall of described measurement pipe 1 is provided with and is suitable to light-absorbing black coating,
The camera lens of described camera head is formed around illuminator.
The technical scheme carrying out level measuring is as follows:
Described measurement pipe 1 is fixedly installed, and described camera head is fixedly installed in the upper port of described measurement pipe 1;Described figure
Also stored the second sample data as processing module, this second sample data be suitable to record the pixel value of each water surface image 2-1 with
The corresponding table of camera head distance water surface elevation or calculating formula;Described image processing module is further adapted for calculating described water surface image
The pixel value of 2-1, this pixel value and the second sample data are compared, draw camera head distance the water surface 2 height, described in take the photograph
As the setting height(from bottom) of device deducts the height of the described camera head distance water surface 2, i.e. obtain water level value.
The setting height(from bottom) of described camera head can be known and be pre-stored in described image processing module in advance, it is also possible to logical
Cross the instruments such as scale of the prior art to measure and draw.Described corresponding table or calculating formula, can be obtained by the experiment of limited number of time
?.
Level measuring ultimate principle is according to object image-forming principle in eye;That is, target is the most remote, look at the least, right
In camera head, the video of photographing unit shooting, picture, it is such equally.So, camera head is fixed on measurement pipe 1 upper end
Water surface image 2-1 in the mouth pipe 1 of shooting measurement vertically downward.Phase along with the change up and down of water level, i.e. water level with camera head
Adjusting the distance and there occurs change, this change is presented as that picture area shared by water surface image 2-1 is big in the water surface image 2-1 clapped
Little change.Therefore, by calculating the size of water surface image 2-1 in image, it can be determined that go out the water surface 2 and camera head
Relative distance, owing to camera head position is fixing, thus can converse water level.
This invention and application number 200910232679.6, entitled " water level measurement system based on image vision and side
Method ".Scheme compare, have the following advantages (1) structure simpler, it is not necessary to can be carried out water stage measurement by float;(2)
Error is little, because float is being bubbled through the water column, therefore when shooting, the height of the projection of the float of shooting is not actual water level
Highly, slightly higher than actual water level, this has existed for error, and various water quality density is different, causes float and floats on water
The height in face is different, needs to carry out error revision, brings trouble to level measuring, but the present invention is directly by water surface image
2-1 carries out level measuring, overcomes drawbacks described above.
Also including managing interior float in described measurement pipe 1, in this pipe, float is the column of the center through hole with vertical setting
Structure, described image mechanism is suitable to the water surface image shooting in described center through hole, and in this pipe, float is suitable to the water surface in institute
Fluctuate in stating measurement pipe 1;The edge of this water surface image 2-1 is made more by the water surface image 2-1 in float in shooting pipe
Clearly, it is simple to extract the area of this water surface image 2-1.
Embodiment two
On the basis of embodiment one, the another kind of technical scheme carrying out level measuring is as follows:
Being installed with a camera head at the upper port of described measurement pipe 1, the periphery of described measurement pipe 1 is provided with and is suitable to make
This measurement pipe 1 vertically bubble through the water column 2 float 3, and measurement pipe 1 can be made to bubble through the water column by this float 3, it is not necessary to additionally solid
Fixed.
Described water regime monitoring system also includes:
Flexible scale 4, and one end is fixed on the bottom, and the other end and is suitable to wrap-up 5 phase of this flexible scale 4 of rolling
Even, this wrap-up 5 is fixed on the top of described measurement pipe 1;
Directive wheel 6, is located on the inwall of described measurement pipe 1, on the inwall of this measurement pipe 1 on neighbouring described directive wheel,
Being respectively arranged below with guide post 7-1, lower guide post 7-2, described flexible scale 4 is suitable to from described upper guide post 7-1, lower guiding
Bar 7-2 and the gap of the inwall measuring pipe pass and be fitted on the inner side wheel face of described directive wheel 6, described directive wheel 6
Top is in above the water surface.The little directive wheel that described upper and lower guide post can use volume to be less than described directive wheel 6 substitutes.
The principle that this embodiment six carries out level measuring is to utilize camera head when filming surface image 2-1, claps simultaneously
Taking the photograph and be directed to take turns the scale on 6 flexible scale 4 propped up, the scale of flexible scale 4 is easy to after being propped up be photographed, and just obtains
Actual water level.
Owing to directive wheel 6 is the least, carry out water quality detection time, the water surface image 2-1 of shooting carries out leading during gray proces
Being negligible to parts such as wheel, scales, the gray value that can't have influence on water surface image 2-1 calculates.
And described flexible scale 4 stretches into the bottom and has no effect on the bottom end closure of described measurement pipe 1.
Embodiment three
See Fig. 1, the method for work of a kind of water regime monitoring system on the basis of embodiment one, comprise the steps:
(1) being fixed with measurement pipe 1 on the water surface 2, its lower port is adapted to enter into the water surface 2, sets a camera head at upper port, should
Camera head shoots the water surface image 2-1 in described measurement pipe 1;
(2) described water surface image 2-1 is converted to digital picture by video acquisition module;
(3) image processing module being connected with described video acquisition module, this image processing module storage has first, second
Sample data, described first sample data is suitable to record the gray value of various water quality, and described second sample data is suitable to record water
Face is as respective heights (that is, each area pixel value and the camera head of each area pixel value and the camera head distance water surface of 2-1
And the corresponding relation between the spacing of the water surface 2);
(4) described image processing module carries out gray proces to described digital picture, to obtain described water surface image 2-1's
Gray value, this gray value and the first sample data are compared, and draw water quality situation;
(5) pixel value of the water surface image in described image processing module calculates the described measurement pipe of current shooting, and
The height of the current camera head distance water surface is drawn by described second sample data, then that the installation of described camera head is high
Degree deducts the height of the described camera head distance water surface, i.e. obtains water level value.
Described step (5) including:
A: after described water surface image 2-1 carries out gray proces, uses MATLAB function to carry out Threshold segmentation and processes to extract
The edge of water surface image 2-1;
B: Calling MATLAB built-in function bwarea, to calculate the area pixel value of the water surface image 2-1 after edge extracting.
The concrete grammar of water quality detection is shown in the water quality monitoring step in embodiment 1.
The concrete grammar that water level calculates
The water surface image 2-1 using MATLAB function to shoot described camera head carries out Threshold segmentation process, its step
As follows:
I=imread(‘image.jpg’);% opens pending picture
imshow(I);% shows this picture
Inew=im2bw(I,x/255);% carries out image binaryzation according to threshold value x, divides target and background
Figure;imshow(Inew);Result after % display binaryzation
Obtained the area of water surface image 2-1 by above-mentioned steps, such as, this water surface image 2-1 is white, and background is black
Color.Can certainly be arranged as required to different colors, such as water surface image 2-1 is black, and background is white.
Here with water surface image 2-1 as white, as a example by background is black, in order to calculate the area of white portion, adjustable
With MATLAB built-in function bwarea.The number of the non-zero pixel of Bwarea function not simple computation, different pixels is also given not by it
Same authority, to compensate owing to representing, by discrete data, the error that consecutive image is brought.As 50 long diagonal are wanted
The horizontal line length longer than 50, therefore, 50 long horizontal line areas that bwarea function returns are 50, and 50 long diagonal angles
What line area returned is 62.5.
The step that employing bwarea carries out areal calculation is as follows:
Number=bwarea(Inew);
Number
Calculate the pixel of white portion, the area pixel of the most described water surface image 2-1, and be stored in image procossing
Each area pixel value (i.e. pixel) of the second sample data in module, i.e. record water surface image 2-1 and camera head distance
The corresponding relation list of the respective heights of the water surface compares, as shown in table 2:
Such as, if Number is 54116, i.e. 54116 elemental areas.Then the water surface 2 is 19cm with the spacing of camera head,
I.e. the height of the camera head distance water surface 2 is 19cm, therefore 54116 these distances of elemental area and 19cm produce mapping relations.
The height of the described camera head distance water surface is the most linear, but the curve delayed by abrupt change, i.e. a water
Identity distance camera head is the nearest, identical SEA LEVEL VARIATION, and water surface image changes the most greatly.Thus the precision of this water level measurement method is also
Inconstant, the suitable precision of guarantee when the scope of measurement is less, therefore it is applicable to the little waters of SEA LEVEL VARIATION (such as flowing
The lake that property is little, the cistern of limited height).
The present invention can also use Canny detective operators to carry out edge extracting for gray component, to obtain water surface image
Each area pixel value of 2-1, concrete steps see patent of invention, application number 200910232679.6, entitled " regard based on image
The water level measurement system felt and method ".
Periodical " computer and modernization " 06 phase in 2006, paper " the gray level image limit based on CNN of Huang Lei, Liu Wenbo
The research of template parameter in edge extraction algorithm " in gray-scale edges extract also be described in detail, the present invention can use too
This algorithm.
Periodical " Nanjing Aero-Space University " 2006, " image border based on cell neural network carries the paper of Huang Lei
Take algorithm research " in use neutral net method that image is carried out edge extracting to describing, the method is applied equally to
The present invention.
Obtain from table 2 camera head distance the water surface 2 height after, the setting height(from bottom) of described camera head deduct described in take the photograph
As the height of the device distance water surface 2 is to obtain water level value.
Obviously, above-described embodiment is only for clearly demonstrating example of the present invention, and not to the present invention
The restriction of embodiment.For those of ordinary skill in the field, can also be made it on the basis of the above description
The change of its multi-form or variation.Here without also cannot all of embodiment be given exhaustive.And these belong to this
What bright spirit was extended out obviously changes or changes among still in protection scope of the present invention.