CN107578045A - A kind of Underwater targets recognition based on machine vision - Google Patents
A kind of Underwater targets recognition based on machine vision Download PDFInfo
- Publication number
- CN107578045A CN107578045A CN201710845431.1A CN201710845431A CN107578045A CN 107578045 A CN107578045 A CN 107578045A CN 201710845431 A CN201710845431 A CN 201710845431A CN 107578045 A CN107578045 A CN 107578045A
- Authority
- CN
- China
- Prior art keywords
- image
- background
- pixel
- carried out
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Abstract
The present invention provides a kind of Underwater targets recognition based on machine vision and obtains size and pixel size regulation that image carries out image first, then concludes image and convolution algorithm is carried out into background image, accumulate background;Then gray proces are carried out to background and original image, generates gray-scale map;Calculus of differences is carried out to original graph and background image again, obtains foreground image.Then OTSU adaptive thresholds are calculated to foreground image, carries out binary conversion treatment.Dilation operation is carried out to bianry image again, the coordinate and number of pixel counted afterwards, obtains the coordinate average of a pixel, rectangular shaped rim is drawn and carries out coordinate demarcation.The result most handled at last is delivered, and carries out alarm detection, the carry out Realtime Alerts to meeting alert if.Whole process realizes entirely autonomous context update and alarm decision, and effective guarantee has been carried out safely to swimming pool, saves the manpower and material resources cost of traditional swimming pool underwater lifesaving.
Description
Technical field
The invention belongs to computer image processing technology field, and in particular to a kind of submarine target based on machine vision is known
Other method.
Background technology
With the fast development of China's economy, increasing people is added in the ranks of swimming body-building in daily life
Go.But problem of being drowned caused by swimming is also following, how effectively to reduce drowning incident and increasingly becomes each
The problem of Swimming pool is paid close attention to.In order to reduce the generation of drowning incident, Swimming pool is provided with the lifesaving personnel of specialty.But
Lifesaving personnel produce visual fatigue, or because other reasonses can not be made to drowned personnel in the case of effectively judging, only with
It is difficult to ensure swimmer's safety completely that lifesaving personnel carry out safety guarantee to be to swimming pool, it is therefore desirable to a new image procossing
Algorithm is detected to whole swimming pool and carries out safety alarm to drowned personnel occur, so as to reduce the hair of drowning incident
It is raw.
The content of the invention
It is an object of the invention to solve the drawbacks of detection of existing swimming pool lifesaving, alarm, there is provided one kind is regarded based on machine
The Underwater targets recognition of feel, can quickly obtain drowned warning information, and the rescue to drowned personnel brings very big
Facility.To realize described purpose of design, the technical solution adopted by the present invention is the Underwater Targets Recognition based on image procossing
Detection scheme:There is provided in time for swimming pool security maintenance person, accurate warning message, also providing scene for swimming pool security maintenance person drowns
The video of water, to be checked and historical query.
A kind of Underwater targets recognition based on machine vision, a series of image procossing is carried out to underwater picture, obtained
Foreground target is taken, then target is drawn a circle to approve and alarm decision, is comprised the following steps:
Step a) is obtained to underwater video, and the image obtained first is initialized.Specific method is adjustment figure
The size of picture and the resolution ratio of image.The formula being adjusted to image size is:
Fx=(double) dsize.width/src.cols, wherein, dsize.width is the width of output image,
Src.cols is the width of input picture, and fx is the ratio of output image and input picture width,
Fy=(double) dsize.height/src.rows, wherein, dsize.height is the height of output image,
Src.rows is the height of input picture, and fy is the ratio of output image and input picture height
Dsize=Size (round (fx*src.cols), round (fy*src.rows)), wherein, dsize is output
The size of image
Step b) carries out gray proces to the image for adjusting size and size, obtains gray level image.In coloured image
The color of each pixel has tri- components of R, G, B to determine, and each component has 255 values can use, and such a pixel can be with
There is the excursion of more than 1,600 ten thousand (255*255*255) color.And gray level image is that tri- component identicals of R, G, B are a kind of
Special coloured image, the excursion of one pixel is 255 kinds, so typically first will be various in Digital Image Processing kind
The image of form is transformed into gray level image so that the amount of calculation of follow-up image becomes few.The description of gray level image and colour
The same entirety for still reflecting entire image of image and local colourity and distribution and the feature of brightness degree.Image is carried out
The formula of gray proces is:
Y=0.299R+0.587G+0.114B
Wherein, Y is to calculate the gray value obtained afterwards, and R is red component in original color image, and G is in original color image
Green component, B are blue component in original color image.
Step c) carries out gaussian filtering to the gray level image acquired, and gaussian filtering is by each of input picture
Point with input gaussian filtering template perform convolutional calculation then by these results one piece constitute filtered output image number
Group, popular saying are exactly that gaussian filtering is that average process is weighted to entire image, and the value of each pixel is by it
In itself and other pixel values in neighborhood are weighted obtaining after being averaged.It is if as follows using 3 × 3 templates, calculation formula
G (x, y)=f (x-1, y-1)+f (x-1, y+1)+f (x+1, y-1)+f (x+1, y+1)+[f (x-1, y)+f (x,
y-1)+f(x+1,y)+f(x,y+1)]*2+f(x,y)*4}/16;
Wherein, g (x, y) is pixel value of the output image at (x, y) point, and f (x, y) is input picture at (x, y) point
Pixel value
Image after step d) acquisition gaussian filterings carries out background accumulation to image again.
Dst (x, y) ← (1-alpha) * dst (x, y)+alpha*src (x, y), wherein, src (x, y) is input picture,
Dst (x, y) is output image, and alpha is deconvolution parameter, can suitably be adjusted according to context update speed, general value
Between 0~1.
Step e) is in the background image obtained by acquisition accumulation and then passes through current underwater picture and background image in real time
Inter-frame difference is carried out, obtains dynamic foreground image.The poor absolute value of () two images, support mask)
Sl (x, y)=src (x, y)-dst (x, y), wherein, dst (x, y) is to accumulate the background image obtained, src (x,
Y) it is the foreground image obtained in real time, sl (x, y) is to pass through the target prospect image acquired in interframe shrimp med
Step f) carries out self-adaption binaryzation processing after foreground image is obtained to target image.Generate " a black and white
Figure ".Maximum between-cluster variance is to be proposed by the big Tianjin of Japanese scholars (Nobuyuki Otsu) in 1979, is a kind of adaptive threshold
It is worth determination method.Algorithm assumes that image pixel can be divided into background [background] and target [objects] according to threshold value
Two parts.Then, the optimal threshold is calculated to distinguish this two classes pixel so that two class pixel discriminations are maximum.
The overall average gray scale of image is:U=w0*u0+w1*u1.
The variance of foreground and background image:
G=w0* (u0-u) * (u0-u)+w1* (u1-u) * (u1-u)=w0*w1* (u0-u1) * (u0-u1)
Optimal threshold:Sb=w1*w2* (u1-u0) * (u0-u1)
Wherein, t is the segmentation threshold of prospect and background, and w0 is that prospect points account for image scaled, and u0 is average gray, w1
Image scaled is accounted for for background points, u1 is average gray.
Optimal threshold is obtained image to be carried out judging, it is specified that the picture point pixel more than this threshold value is arranged to point by point afterwards
255, the point pixel less than this pixel value is arranged to 0.
Step g) needs to carry out expansion process to image after image is carried out binary conversion treatment, expands moving target
Pixel region.Expansion is to be merged into object in the object with all background dots contacted, makes the convenient process to outside expansion.
The space that can be filled up between object.
The step of expansion algorithm:
(1) use 3x3 structural element, each pixel of scan image,
(2) bianry image covered with structural element with it does with operation,
(3) if being all 0, the pixel of result images is 0.Otherwise it is 1,
(4) result:Bianry image is set to expand a circle.
The coordinate of target point pixel in image is inputted array by step h), carries out asking for and then by corresponding to for object boundary
Coordinate inputs rectangle frame, and target is drawn a circle to approve.The coordinate of a warning line is inputted in image, then provides that the target of delineation exists
Alarmed in the case of under warning line.
The Underwater targets recognition of the present invention, is integrated with computer technology, image processing techniques.The algorithm energy newly proposed
The deficiency of existing swimming pool lifesaving is enough made up, and can drowned personnel be carried out with timely, accurately alarm.The design employs machine
The Underwater targets recognition of device vision, underwater camera is fixed on swimming pool bottom, and blocked with glass baffle plate, when
Shooting just is tracked to running underwater target after start, the video image of acquisition is back to Control Room by circuit.
Monitoring host computer is handled image video after obtaining video by the image processing system under VS2010, according to triggering
The situation of alarm it is appropriate send alarm, remind the underwater lifesaving personnel on periphery to implement to rescue to drowned swimmer.The algorithm
Based on the identification on monitor terminal and alarm mechanism, reduce the operating pressure of staff, reduce security maintenance cost.
Brief description of the drawings
Fig. 1 is Underwater targets recognition flow chart of the present invention;
Fig. 2 schemes for monitoring in real time with alarm.
Embodiment
As shown in figure 1, the present invention provides a kind of Underwater targets recognition, comprise the following steps:
Step 1, the initialization that image carries out size and pixel is obtained, in the present embodiment, image is defined size and is:
320*288.As shown in Fig. 2 image display box is named as:" video ", here it is shown that inframe is shown by video text
The real-time sub-aqua sport image that part obtains, the swimming personnel that image includes swimming pool and swum in swimming pool.
Step 2, gray proces are carried out to image, image display box is named as:" gray ", here it is shown that what inframe was shown
It is the gray-scale map being calculated by input picture according to Y=0.299R+0.587G+0.114B, wherein, Y is obtained afterwards to calculate
The gray value taken, R are red component in original color image, and G is original color image Green component, and B is blue in original color image
Colouring component
Step 3, gaussian filtering is carried out to image.
Step 4, the real-time background image of background accumulation acquisition is carried out to image.
Step 5, using OTSU algorithms to image carry out binary conversion treatment.
Step 6, the background image progress difference by image and accumulation gained, obtain real-time prospect.
Step 7, image expansion computing is carried out to image, obtain expanding image, the display box of image is named as:
“foreground”。
Step 8, image progress target delineation and alert process, the display box of image are named as:“video”.
The present invention provides a kind of Underwater targets recognition and obtains size and pixel size tune that image carries out image first
Section, then image is concluded convolution algorithm is carried out into background image, accumulate background;Then ash is carried out to background and original image
Degree processing, generates gray-scale map;Calculus of differences is carried out to original graph and background image again, obtains foreground image.Then to foreground picture
As calculating OTSU adaptive thresholds, binary conversion treatment is carried out.Dilation operation is carried out to bianry image again, afterwards to the seat of pixel
Mark and number are counted, and obtain the coordinate average of a pixel, are drawn rectangular shaped rim and are carried out coordinate demarcation.Most handle at last
Result deliver, carry out alarm detection, the carry out Realtime Alerts to meeting alert if.Whole process realizes the entirely autonomous back of the body
Scape updates and alarm decision, has carried out effective guarantee safely to swimming pool, has saved the manpower of traditional swimming pool underwater lifesaving
And material resources cost.
Claims (5)
1. a kind of Underwater targets recognition based on machine vision, it is characterised in that comprise the following steps:
Step 1, underwater video is obtained, the image of acquisition is initialized, its include adjustment image size and
The resolution ratio of image;
Step 2, gray proces are carried out to the image for adjusting size and size, obtain gray level image;
Step 3, gaussian filtering is carried out to the gray level image acquired;
Image after step 4, acquisition gaussian filtering carries out background accumulation to image again;
Step 5, obtaining the background image obtained by accumulating and then carried out by current underwater picture in real time and background image
Inter-frame difference, obtain dynamic foreground image;
Step 6, foreground image is obtained afterwards to target image progress self-adaption binaryzation processing;
Step 7, need to carry out expansion process to image after image is carried out binary conversion treatment;
Step 8, the coordinate input array by target point pixel in image, carry out asking for corresponding coordinate then for object boundary
Rectangle frame is inputted, target is drawn a circle to approve;The coordinate of a warning line is inputted in image, then provides that the target of delineation is being guarded against
Alarmed in the case of under line.
2. the Underwater targets recognition based on machine vision as claimed in claim 1, it is characterised in that the image of step 4
Background is accumulated:
Dst (x, y) ← (1-alpha) * dst (x, y)+alpha*src (x, y), wherein, src (x, y) is input picture, dst
(x, y) is output image, and alpha is deconvolution parameter, is suitably adjusted according to context update speed, value is between 0~1.
3. the Underwater targets recognition based on machine vision as claimed in claim 1, it is characterised in that step 5 is specially:
Sl (x, y)=src (x, y)-dst (x, y), wherein, dst (x, y) is the background image that accumulation obtains, and src (x, y) is real
When the foreground image that obtains, sl (x, y) is passes through the target prospect image acquired in interframe shrimp med.
4. the Underwater targets recognition based on machine vision as claimed in claim 1, it is characterised in that step 6 is specially:
Self-adaption binaryzation processing is carried out to target image using OTSU algorithms, first, it is assumed that image pixel can be divided according to threshold value
Into background [background] and target [objects] two parts;Then, the optimal threshold is calculated to distinguish this two classes pixel,
So that two class pixel discriminations are maximum,
If the overall average gray scale of image is:U=w0*u0+w1*u1,
The variance of foreground and background image:
G=w0* (u0-u) * (u0-u)+w1* (u1-u) * (u1-u)=w0*w1* (u0-u1) * (u0-u1),
Optimal threshold:Sb=w1*w2* (u1-u0) * (u0-u1),
Wherein, t is the segmentation threshold of prospect and background, and w0 is that prospect points account for image scaled, and u0 is average gray, and w1 is background
Points account for image scaled, and u1 is average gray,
Obtain and image is carried out point by point to judge after optimal threshold, it is specified that the picture point pixel more than this threshold value is arranged to 255, it is small
0 is arranged in the point pixel of this pixel value.
5. the Underwater targets recognition based on machine vision as claimed in claim 1, it is characterised in that step 7 is specially:
The expansion is to be merged into object in the object with all background dots contacted, makes the convenient process to outside expansion, its is swollen
The step of swollen algorithm:
(1) 3x3 structural element, each pixel of scan image are used;
(2) bianry image covered with structural element with it does with operation;
(3) if being all 0, the pixel of result images is 0.Otherwise it is 1;
(4) result:Bianry image is set to expand a circle.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710845431.1A CN107578045A (en) | 2017-09-19 | 2017-09-19 | A kind of Underwater targets recognition based on machine vision |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710845431.1A CN107578045A (en) | 2017-09-19 | 2017-09-19 | A kind of Underwater targets recognition based on machine vision |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107578045A true CN107578045A (en) | 2018-01-12 |
Family
ID=61036028
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710845431.1A Pending CN107578045A (en) | 2017-09-19 | 2017-09-19 | A kind of Underwater targets recognition based on machine vision |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107578045A (en) |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109460705A (en) * | 2018-09-26 | 2019-03-12 | 北京工业大学 | Oil pipeline monitoring method based on machine vision |
CN109543598A (en) * | 2018-11-20 | 2019-03-29 | 哈尔滨工程大学 | A kind of highway accident response and warning system and method based on image recognition |
CN109903265A (en) * | 2019-01-19 | 2019-06-18 | 创新奇智(南京)科技有限公司 | A kind of image change area detecting threshold value setting method, system and its electronic device |
CN111028480A (en) * | 2019-12-06 | 2020-04-17 | 江西洪都航空工业集团有限责任公司 | Drowning detection and alarm system |
CN111047595A (en) * | 2019-11-21 | 2020-04-21 | 深圳市若雅方舟科技有限公司 | Real-time sea wave segmentation method and device based on self-adaptive threshold frame difference method |
CN111768390A (en) * | 2020-07-01 | 2020-10-13 | 南京凯盛国际工程有限公司 | Grate cooler red river identification method based on image identification |
CN112149543A (en) * | 2020-09-16 | 2020-12-29 | 北京工业大学 | Building raise dust identification system and method based on computer vision |
CN112380962A (en) * | 2020-11-11 | 2021-02-19 | 成都摘果子科技有限公司 | Animal image identification method and system based on deep learning |
CN113521683A (en) * | 2021-08-27 | 2021-10-22 | 吉林师范大学 | Intelligent physical ability comprehensive training control system |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103413114A (en) * | 2013-05-17 | 2013-11-27 | 浙江大学 | Near-drowning behavior detection method based on support vector machine |
CN104166841A (en) * | 2014-07-24 | 2014-11-26 | 浙江大学 | Rapid detection identification method for specified pedestrian or vehicle in video monitoring network |
CN104298996A (en) * | 2014-08-08 | 2015-01-21 | 中国科学院自动化研究所 | Underwater active vision tracking method applied to bionic robot fish |
-
2017
- 2017-09-19 CN CN201710845431.1A patent/CN107578045A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103413114A (en) * | 2013-05-17 | 2013-11-27 | 浙江大学 | Near-drowning behavior detection method based on support vector machine |
CN104166841A (en) * | 2014-07-24 | 2014-11-26 | 浙江大学 | Rapid detection identification method for specified pedestrian or vehicle in video monitoring network |
CN104298996A (en) * | 2014-08-08 | 2015-01-21 | 中国科学院自动化研究所 | Underwater active vision tracking method applied to bionic robot fish |
Non-Patent Citations (1)
Title |
---|
岳兵: "《基于OpenCV的目标检测与跟踪算法的研究与实现》", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109460705A (en) * | 2018-09-26 | 2019-03-12 | 北京工业大学 | Oil pipeline monitoring method based on machine vision |
CN109543598A (en) * | 2018-11-20 | 2019-03-29 | 哈尔滨工程大学 | A kind of highway accident response and warning system and method based on image recognition |
CN109903265A (en) * | 2019-01-19 | 2019-06-18 | 创新奇智(南京)科技有限公司 | A kind of image change area detecting threshold value setting method, system and its electronic device |
CN111047595A (en) * | 2019-11-21 | 2020-04-21 | 深圳市若雅方舟科技有限公司 | Real-time sea wave segmentation method and device based on self-adaptive threshold frame difference method |
CN111028480A (en) * | 2019-12-06 | 2020-04-17 | 江西洪都航空工业集团有限责任公司 | Drowning detection and alarm system |
CN111768390A (en) * | 2020-07-01 | 2020-10-13 | 南京凯盛国际工程有限公司 | Grate cooler red river identification method based on image identification |
CN111768390B (en) * | 2020-07-01 | 2024-04-05 | 中材智能科技(成都)有限公司 | Image recognition-based grate cooler red river recognition method |
CN112149543A (en) * | 2020-09-16 | 2020-12-29 | 北京工业大学 | Building raise dust identification system and method based on computer vision |
CN112149543B (en) * | 2020-09-16 | 2024-02-27 | 北京工业大学 | Building dust recognition system and method based on computer vision |
CN112380962A (en) * | 2020-11-11 | 2021-02-19 | 成都摘果子科技有限公司 | Animal image identification method and system based on deep learning |
CN113521683A (en) * | 2021-08-27 | 2021-10-22 | 吉林师范大学 | Intelligent physical ability comprehensive training control system |
CN113521683B (en) * | 2021-08-27 | 2022-08-05 | 吉林师范大学 | Intelligent physical ability comprehensive training control system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107578045A (en) | A kind of Underwater targets recognition based on machine vision | |
CN110688987B (en) | Pedestrian position detection and tracking method and system | |
CN111414887B (en) | Secondary detection mask face recognition method based on YOLOV3 algorithm | |
CN101930543B (en) | Method for adjusting eye image in self-photographed video | |
US11238301B2 (en) | Computer-implemented method of detecting foreign object on background object in an image, apparatus for detecting foreign object on background object in an image, and computer-program product | |
CN103971135A (en) | Human body target detection method based on head and shoulder depth information features | |
CN105654091A (en) | Detection method and apparatus for sea-surface target | |
CN109766828A (en) | A kind of vehicle target dividing method, device and communication equipment | |
CN111680574B (en) | Face detection method and device, electronic equipment and storage medium | |
CN104820995A (en) | Large public place-oriented people stream density monitoring and early warning method | |
CN107392095A (en) | A kind of small IR targets detection algorithm based on mask image | |
CN112417955B (en) | Method and device for processing tour inspection video stream | |
CN106650638A (en) | Abandoned object detection method | |
US20210174073A1 (en) | A Method and Apparatus for Swimmer Tracking | |
CN112287823A (en) | Facial mask identification method based on video monitoring | |
CN109902613A (en) | A kind of human body feature extraction method based on transfer learning and image enhancement | |
CN108492263A (en) | A kind of camera lens Lens Distortion Correction method | |
Surkutlawar et al. | Shadow suppression using RGB and HSV color space in moving object detection | |
Zhang et al. | A novel camera-based drowning detection algorithm | |
CN107222726A (en) | Electric power facility external force damage prevention early warning scheme | |
CN112232205B (en) | Mobile terminal CPU real-time multifunctional face detection method | |
CN112101260B (en) | Method, device, equipment and storage medium for identifying safety belt of operator | |
CN109583414A (en) | Indoor road occupying detection method based on video detection | |
CN104408432A (en) | Infrared image target detection method based on histogram modification | |
CN108010050A (en) | A kind of foreground detection method based on adaptive RTS threshold adjustment and selective context update |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20180112 |