Summary of the invention
It is an object of the present invention to provide a kind of water level recognition methods based on virtual water gauge, are identified by waters
To the current level of natural water area, water level recognition accuracy can be improved.It is another object of the present invention to provide one kind to be based on
The water level identifying system of virtual water gauge.It is yet a further object of the present invention to provide a kind of computer equipments.Of the invention also one
It is a to be designed to provide a kind of readable medium.
In order to reach the goals above, one aspect of the present invention discloses a kind of water level recognition methods based on virtual water gauge, packet
It includes:
Choose natural water area in known physical location two initial points and two initial points with the natural water area
Image coordinate in corresponding waters image;
The waters region in the waters image is identified by Watershed segmentation model;
The Natural Water is determined according to the physical location and image coordinate in the waters region and described two initial points
The water level elevation of the current water surface in domain.
Preferably, described two initial points are the cope level and initial water level elevation of practical water gauge in the natural water area
Two points.
Preferably, the method further includes forming the Watershed segmentation model.
Preferably, the formation Watershed segmentation model specifically includes:
It forms image water area and divides network model;
Multiple waters images are trained by image segmentation algorithm according to the network model to obtain the waters point
Cut model.
Preferably, it is described according to the waters region and described two initial points respectively in the reality of the natural water area
Position and determine that the water level elevation of the current water surface of the natural water area specifically includes in the image coordinate of the waters image:
The current water surface is obtained in the image coordinate of the waters image according to the waters region and described two initial points
Water level position coordinates in the waters image;
According to two initial points the physical location of the natural water area and the waters image image coordinate and
The water level position coordinates of the current water surface obtain the water level elevation.
Preferably, the method further includes forming virtual water gauge image on the waters image.
Preferably, described to form virtual water gauge image on the waters image and specifically include:
The pixel size of virtual water gauge is obtained according to the water level elevation and the waters region;
Initial position and the final position of virtual water gauge are obtained by inverse perspective mapping;
The virtual water gauge is formed according to the initial position, the final position and the pixel size and shows institute
State water level elevation.
The invention also discloses a kind of water level identifying systems based on virtual water gauge, comprising:
Initial parameter module, for choosing two initial points of known physical location in natural water area;
Waters identification module, for being identified in the image of waters corresponding with the natural water area by Watershed segmentation model
Waters region;
Water level identification module is used for according to the waters region and described two initial points respectively in the natural water area
Physical location and determine the water level elevation of the current water surface of the natural water area in the image coordinate of the waters image.
The invention also discloses a kind of computer equipment, including memory, processor and storage are on a memory and can
The computer program run on a processor,
The processor realizes method as described above when executing described program.
The invention also discloses a kind of computer-readable mediums, are stored thereon with computer program,
The program realizes method as described above when being executed by processor.
The present invention is by choosing two initial points and two initial points of known physical location in natural water area in water
Image coordinate in area image identifies the waters region in the image of waters by the Watershed segmentation model based on deep learning, and
The water level elevation of the current water surface is determined by the image coordinate in the waters region and two initial points.The present invention passes through identification waters
Waters region in image is suitable under different water gauge models and complex environment without carrying out image recognition to practical water gauge
Water level identification, when practical water gauge causes the water gauge in the image of waters can not there are stains, spot, damage or scale color multiplicity
When identification, accurate virtual water gauge can be generated, to improve the accuracy of water level identification, judges to read instead of traditional human eye, from
And artificial investment is reduced, improve working efficiency.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
According to an aspect of the present invention, present embodiment discloses a kind of water level recognition methods based on virtual water gauge.Such as
Shown in Fig. 1, in the present embodiment, the water level recognition methods includes:
S100: choose natural water area in known physical location two initial points and two initial points with the nature
Image coordinate in the corresponding waters image in waters.
S200: the waters region in the waters image is identified by Watershed segmentation model.
S300: described certainly according to the determination of the physical location and image coordinate of the waters region and described two initial points
The water level elevation of the current water surface in right waters.
The present invention is by choosing two initial points and two initial points of known physical location in natural water area in water
Image coordinate in area image identifies the waters region in the image of waters by the Watershed segmentation model based on deep learning, and
The water level elevation of the current water surface is determined by the image coordinate in the waters region and two initial points.The present invention passes through identification waters
Waters region in image is suitable under different water gauge models and complex environment without carrying out image recognition to practical water gauge
Water level identification, when practical water gauge causes the water gauge in the image of waters can not there are stains, spot, damage or scale color multiplicity
When identification, accurate virtual water gauge can be generated, to improve the accuracy of water level identification, judges to read instead of traditional human eye, from
And artificial investment is reduced, improve working efficiency.
In a specific example, when being monitored to natural water area, Natural Water can be acquired by image capture device
The monitor video or monitoring image in domain can form waters by extracting image capture device for the video or image data of acquisition
Image analyzes the coordinate position of two initial points that the waters image is chosen on the image of waters.It is understood that
The position of image capture device and angle do not change during monitoring, so that two initial points are in waters in natural water area
Coordinate position on image is corresponding not to change.When the position of image capture device or angle change, need again
Determine coordinate position of the initial point of two pre-selections on the image of waters.
In a preferred embodiment, described two initial points be the natural water area in practical water gauge cope level with
Two points of initial water level elevation.By choosing two points of cope level and initial water level elevation of practical water gauge as initial point,
On the one hand it can determine and be determined according to two initial points in the actual range of natural water area and the image distance on the image of waters
The pixel size of virtual water gauge, so as to generate virtual water gauge on the image of waters.
In a preferred embodiment, the method further includes forming the Watershed segmentation model.Pass through
Depth learning technology, which forms Watershed segmentation model, can accurately identify waters by the continuous iteration of Watershed segmentation model and optimization
Waters region on image, the current level of the water surface can be further determined that according to the range in waters region, to realize to Natural Water
The real time monitoring in domain.
In a preferred embodiment, as shown in Fig. 2, the formation Watershed segmentation model is specific can include:
S210: it forms image water area and divides network model.In a preferred embodiment, spatial pyramid mould can be passed through
Block takes multi-sampling rate expansion convolution, the wild convolution of more receptions or pond on the characteristic spectrum (feature) of input, explores more rulers
Spend contextual information.Spatial information is gradually recovered by encoder decoding (encoder-decoder) to capture clearly waters
Boundary, and by depth revoluble product (xception) algorithm for acquiring powerful and quick network in Watershed segmentation task
Model.In other embodiments, other deep learning algorithms can also be used and form image water area segmentation network model, the present invention
To this and it is not construed as limiting.
S220: multiple waters images are trained to obtain the water by image segmentation algorithm according to the network model
Regional partition model.Specifically, in one preferred embodiment, deeplabv3+ image segmentation algorithm can be used to natural field
The data set that multiple waters images in scape are formed is trained, and it is 1e-7 that initial learning rate lr, which is arranged, and momentum momentum is
0.9, Watershed segmentation model is obtained after 300 epochs of iteration.In other embodiments, other images point can also be passed through
It cuts algorithm multiple waters images are trained to obtain Watershed segmentation model, the present invention is to this and is not construed as limiting.
In a preferred embodiment, as shown in figure 3, the step S300 is specific can include:
S310: it is obtained currently according to the waters region and described two initial points in the image coordinate of the waters image
Water level position coordinates of the water surface in the waters image.
S320: according to two initial points in the physical location of the natural water area and in the image coordinate of the waters image
And the water level position coordinates of the current water surface obtain the water level elevation.
Specifically, in one preferred embodiment, two initial points be respectively practical water gauge cope level Hg with
Initial water level elevation Hc, wherein coordinate of the cope level Hg on the image of waters is (x1,y1), initial water level elevation Hc is in waters
Coordinate on image is (x2,y2)。
The waters region can be the Mask mask code matrix obtained by Watershed segmentation model, according to mask code matrix and two
Water level position coordinates y of the current level on the image of waters is calculated in a initial pointnow, ynowIt can be by Mask mask code matrix
Execute ynow=Mask [:, (x1+x2)/2] .min () algorithm is calculated.Further, initial in Natural Water by two
The physical location in domain obtains the current water surface can be calculated by the following formula to obtain in natural water area in water level elevation Hw, Hw: Hw=
Hg-[(Hg-Hc)/(y2-y1)]*(ynow-y1).The present invention obtains current water by carrying out waters region recognition to waters image
Position, so as to be monitored according to current level situation to natural water area, the waters image recognition condition for promoting monitoring is poor
In the case of recognition accuracy, preferably play SEA LEVEL VARIATION video image identification monitoring capacity, it is accurate much sooner to note abnormalities.
Mitigate artificial monitoring resource input, promotes whole flood control capacity and working efficiency.
In a preferred embodiment, the method further includes virtual water gauge image is formed on the waters image
Step S400, as shown in Figure 4.It can be led in water gauge breakage or insufficient light by forming virtual water gauge image on the image of waters
When causing practical water gauge not see, make user can according to virtual water gauge monitoring current level, can it is more intuitive, easily to waters
Water level is monitored.
In a preferred embodiment, as shown in figure 5, the S400 is specific can include:
S410: the pixel size of virtual water gauge is obtained according to the water level elevation and the waters region.Specifically, can root
According to the Mask mask code matrix in the waters region that Watershed segmentation model obtains, the position range for needing virtual water gauge to be shown is determined,
Such as in one embodiment, virtual water gauge is from being located at least in the cope level for extending to practical water gauge in the regional scope of waters
Hg, in other embodiments, can also according to actual needs flexible choice formed virtual water gauge pixel size, determine formed
Virtual water gauge position.
S420: initial position and the final position of virtual water gauge are obtained by inverse perspective mapping.According to determining virtual water
The pixel size of ruler obtains the initial position (x of virtual water gauge by inverse perspective mapping1’,y1') and final position (x2’,y2'),
For example, initial position can be point of the cope level of practical water gauge beside the corresponding points or corresponding points on the image of waters, eventually
Stop bit sets the point that can be current level beside the corresponding points or corresponding points on the image of waters.
S430: the virtual water gauge is formed simultaneously according to the initial position, the final position and the pixel size
Show the water level elevation.Specifically, the pixel on the image of waters from initial position to final position according to virtual water gauge is big
It is small to form virtual water gauge.Virtual water gauge is formed by inverse perspective mapping, the virtual water gauge to be formed can be made more three-dimensional, being formed has sky
Between display effect virtual water gauge, promote display effect and user experience.
Based on same principle, the present embodiment also discloses a kind of water level identifying system based on virtual water gauge.Such as Fig. 6 institute
Show, in the present embodiment, the system comprises initial parameter module 11, waters identification module 12 and water level identification modules 13.
Wherein, the initial parameter module 11 is used to choose two initial points of known physical location in natural water area.Institute
State waters identification module 12 for by Watershed segmentation model identification waters corresponding with natural water area image in waters
Region.The water level identification module 13 is used for according to the waters region and described two initial points respectively in the Natural Water
The physical location in domain and the water level elevation of the current water surface of the natural water area is determined in the image coordinate of the waters image.
The present invention is by choosing two initial points and two initial points of known physical location in natural water area in water
Image coordinate in area image identifies the waters region in the image of waters by the Watershed segmentation model based on deep learning, and
The water level elevation of the current water surface is determined by the image coordinate in the waters region and two initial points.The present invention passes through identification waters
Waters region in image is suitable under different water gauge models and complex environment without carrying out image recognition to practical water gauge
Water level identification, when practical water gauge causes the water gauge in the image of waters can not there are stains, spot, damage or scale color multiplicity
When identification, accurate virtual water gauge can be generated, to improve the accuracy of water level identification, judges to read instead of traditional human eye, from
And artificial investment is reduced, improve working efficiency.
In a specific example, when being monitored to natural water area, Natural Water can be acquired by image capture device
The monitor video or monitoring image in domain can form waters by extracting image capture device for the video or image data of acquisition
Image analyzes the coordinate position of two initial points that the waters image is chosen on the image of waters.It is understood that
The position of image capture device and angle do not change during monitoring, so that two initial points are in waters in natural water area
Coordinate position on image is corresponding not to change.When the position of image capture device or angle change, need again
Determine coordinate position of the initial point of two pre-selections on the image of waters.
In a preferred embodiment, described two initial points be the natural water area in practical water gauge cope level with
Two points of initial water level elevation.By choosing two points of cope level and initial water level elevation of practical water gauge as initial point,
On the one hand it can determine and be determined according to two initial points in the actual range of natural water area and the image distance on the image of waters
The pixel size of virtual water gauge, so as to generate virtual water gauge on the image of waters.
In a preferred embodiment, as shown in fig. 7, the system further comprises being used to form Watershed segmentation model
Model construction module 14.Watershed segmentation model is formed by depth learning technology, by the continuous iteration of Watershed segmentation model and excellent
Change, the waters region on the image of waters can be accurately identified, the current of the water surface can be further determined that according to the range in waters region
Water level, to realize the real time monitoring to natural water area.
In a preferred embodiment, the model construction module 14 is specifically used for forming image water area segmentation network mould
Type is trained multiple waters images by image segmentation algorithm according to the network model to obtain the Watershed segmentation mould
Type.
It in a preferred embodiment, can be by spatial pyramid module on the characteristic spectrum (feature) of input
Multi-sampling rate expansion convolution, the wild convolution of more receptions or pond are taken, multiple dimensioned contextual information is explored.It is decoded by encoder
(encoder-decoder) spatial information is gradually recovered to capture clearly waters boundary, and by the revoluble product of depth
(xception) algorithm is for acquiring powerful and quick network model in Watershed segmentation task.In other embodiments,
Other deep learning algorithms can also be used and form image water area segmentation network model, the present invention is to this and is not construed as limiting.
In one preferred embodiment, deeplabv3+ image segmentation algorithm can be used to multiple in natural scene
The data set that waters image is formed is trained, and it is 1e-7 that initial learning rate lr, which is arranged, and momentum momentum is 0.9, in iteration
Watershed segmentation model is obtained after 300 epochs.It in other embodiments, can also be by other image segmentation algorithms to more
It opens waters image to be trained to obtain Watershed segmentation model, the present invention is to this and is not construed as limiting.
In a preferred embodiment, the water level identification module 13 is further used for according to the waters region and described
Two initial points obtain water level position coordinates of the current water surface in the waters image in the image coordinate of the waters image,
According to two initial points in the physical location of the natural water area and image coordinate and the current water surface in the waters image
The water level position coordinates obtain the water level elevation.
Specifically, in one preferred embodiment, two initial points be respectively practical water gauge cope level Hg with
Initial water level elevation Hc, wherein coordinate of the cope level Hg on the image of waters is (x1,y1), initial water level elevation Hc is in waters
Coordinate on image is (x2,y2)。
The waters region can be the Mask mask code matrix obtained by Watershed segmentation model, according to mask code matrix and two
Water level position coordinates y of the current level on the image of waters is calculated in a initial pointnow, ynowIt can be by Mask mask code matrix
Execute ynow=Mask [:, (x1+x2)/2] .min () algorithm is calculated.Further, initial in Natural Water by two
The physical location in domain obtains the current water surface can be calculated by the following formula to obtain in natural water area in water level elevation Hw, Hw: Hw=
Hg-[(Hg-Hc)/(y2-y1)]*(ynow-y1).The present invention obtains current water by carrying out waters region recognition to waters image
Position, so as to be monitored according to current level situation to natural water area, the waters image recognition condition for promoting monitoring is poor
In the case of recognition accuracy, preferably play SEA LEVEL VARIATION video image identification monitoring capacity, it is accurate much sooner to note abnormalities.
Mitigate artificial monitoring resource input, promotes whole flood control capacity and working efficiency.
In a preferred embodiment, as shown in figure 8, the system further comprises forming void on the waters image
The virtual water gauge module 15 of quasi- water gauge image.It can be in water gauge breakage or light by forming virtual water gauge image on the image of waters
When deficiency causes practical water gauge not see, make user that can monitor current level according to virtual water gauge, it can be more intuitive, easily
Waters water level is monitored.
In a preferred embodiment, the virtual water gauge module 15 is specifically used for according to the water level elevation and the water
Domain region obtains the pixel size of virtual water gauge, obtains initial position and the final position of virtual water gauge by inverse perspective mapping,
And the virtual water gauge is formed according to the initial position, the final position and the pixel size and shows the water surface
Elevation.
Specifically, can be according to the Mask mask code matrix in the waters region that Watershed segmentation model obtains, determining need to be to be shown
The position range of virtual water gauge, such as in one embodiment, virtual water gauge extend from being located at least in the regional scope of waters
It, in other embodiments, can also flexible choice is formed according to actual needs virtual water to the cope level Hg of practical water gauge
The pixel size of ruler determines the position of the virtual water gauge formed.
Further, the starting of virtual water gauge is obtained by inverse perspective mapping according to the pixel size of determining virtual water gauge
Position (x1’,y1') and final position (x2’,y2'), for example, initial position can be the cope level of practical water gauge in waters figure
As the point beside upper corresponding points or corresponding points, final position can be corresponding points or correspondence of the current level on the image of waters
The point on point side.
Further, void is formed according to the pixel size of virtual water gauge from initial position to final position on the image of waters
Quasi- water gauge.Virtual water gauge is formed by inverse perspective mapping, the virtual water gauge to be formed can be made more three-dimensional, being formed has spatial display effect
The virtual water gauge of fruit promotes display effect and user experience.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.It is a kind of typically to realize that equipment is computer equipment, specifically, computer is set
It is standby for example can for personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant,
Media player, navigation equipment, electronic mail equipment, game console, tablet computer, wearable device or these equipment
In any equipment combination.
Computer equipment specifically includes memory, processor and storage on a memory simultaneously in a typical example
The computer program that can be run on a processor is realized when the processor executes described program and is held as described above by client
Capable method, alternatively, the processor realizes the method executed as described above by server when executing described program.
Below with reference to Fig. 9, it illustrates the structural representations for the computer equipment 600 for being suitable for being used to realize the embodiment of the present application
Figure.
As shown in figure 9, computer equipment 600 includes central processing unit (CPU) 601, it can be read-only according to being stored in
Program in memory (ROM) 602 is loaded into random access storage device (RAM) from storage section 608) program in 603
And execute various work appropriate and processing.In RAM603, also it is stored with system 600 and operates required various program sum numbers
According to.CPU601, ROM602 and RAM603 are connected with each other by bus 604.Input/output (I/O) interface 605 is also connected to
Bus 604.
I/O interface 605 is connected to lower component: the importation 606 including keyboard, mouse etc.;It is penetrated including such as cathode
The output par, c 607 of spool (CRT), liquid crystal ultramagnifier (LCD) etc. and loudspeaker etc.;Storage section 608 including hard disk etc.;
And including such as LAN card, the communications portion 609 of the network interface card of modem etc..Communications portion 609 via such as because
The network of spy's net executes communication process.Driver 610 is also connected to I/O interface 606 as needed.Detachable media 611, such as
Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 610, in order to read from thereon
Computer program be mounted as needed such as storage section 608.
Particularly, according to an embodiment of the invention, may be implemented as computer above with reference to the process of flow chart description
Software program.For example, the embodiment of the present invention includes a kind of computer program product comprising be tangibly embodied in machine readable
Computer program on medium, the computer program include the program code for method shown in execution flow chart.At this
In the embodiment of sample, which can be downloaded and installed from network by communications portion 609, and/or from removable
Medium 611 is unloaded to be mounted.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices
Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
For convenience of description, it is divided into various units when description apparatus above with function to describe respectively.Certainly, implementing this
The function of each unit can be realized in the same or multiple software and or hardware when application.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including described want
There is also other identical elements in the process, method of element, commodity or equipment.
It will be understood by those skilled in the art that embodiments herein can provide as method, system or computer program product.
Therefore, complete hardware embodiment, complete software embodiment or embodiment combining software and hardware aspects can be used in the application
Form.It is deposited moreover, the application can be used to can be used in the computer that one or more wherein includes computer usable program code
The shape for the computer program product implemented on storage media (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
Formula.
The application can describe in the general context of computer-executable instructions executed by a computer, such as program
Module.Generally, program module includes routines performing specific tasks or implementing specific abstract data types, programs, objects, group
Part, data structure etc..The application can also be practiced in a distributed computing environment, in these distributed computing environments, by
Task is executed by the connected remote processing devices of communication network.In a distributed computing environment, program module can be with
In the local and remote computer storage media including storage equipment.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for system reality
For applying example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to embodiment of the method
Part explanation.
The above description is only an example of the present application, is not intended to limit this application.For those skilled in the art
For, various changes and changes are possible in this application.All any modifications made within the spirit and principles of the present application are equal
Replacement, improvement etc., should be included within the scope of the claims of this application.