WO2021042490A1 - Offshore current detection method based on binocular camera - Google Patents

Offshore current detection method based on binocular camera Download PDF

Info

Publication number
WO2021042490A1
WO2021042490A1 PCT/CN2019/115513 CN2019115513W WO2021042490A1 WO 2021042490 A1 WO2021042490 A1 WO 2021042490A1 CN 2019115513 W CN2019115513 W CN 2019115513W WO 2021042490 A1 WO2021042490 A1 WO 2021042490A1
Authority
WO
WIPO (PCT)
Prior art keywords
offshore
image
current
offshore current
neural network
Prior art date
Application number
PCT/CN2019/115513
Other languages
French (fr)
Chinese (zh)
Inventor
王胜利
李晓婉
付庆军
王思又
Original Assignee
山东科技大学
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 山东科技大学 filed Critical 山东科技大学
Publication of WO2021042490A1 publication Critical patent/WO2021042490A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • G06T7/85Stereo camera calibration

Definitions

  • the invention belongs to the computer vision field and the technical field of safety assurance, and specifically relates to an offshore flow detection method based on a binocular camera.
  • the flow rate of offshore stream is mostly 0.3-1 meters per second, and the fastest can reach 3 meters per second. Its length can reach 30-100 meters or even longer.
  • the flow direction is almost perpendicular to the shoreline, which can quickly drag strong swimmers in. Deep water, causing drowning.
  • Offshore currents have become another marine disaster that has caused harm to people's coastal tourism after storm surges and waves. About 90% of seaside drowning is caused by offshore currents.
  • Offshore currents have brought a lot of problems to the attractive maintenance of coastal tourism, beach management, and accident dispute resolution, which seriously affects the healthy development of coastal tourism economy.
  • the present invention proposes a binocular camera-based offshore flow detection method, which is reasonable in design, overcomes the shortcomings of the prior art, and has good effects.
  • a method for detecting offshore currents based on binocular cameras including the following steps:
  • Step 1 Collect the image set for training the convolutional neural network, and train the convolutional neural network
  • Step 2 Use the image recognition algorithm of the trained convolutional neural network to recognize the offshore currents in the collected images; judge whether the offshore currents exist;
  • the judgment result is that the offshore current exists, find the characteristic points of the offshore current, and extract the characteristic points of the offshore current; the characteristic points include the midpoint and the left and right edge points of the offshore current;
  • Step 3 Use the binocular positioning algorithm to locate the identified feature points of the offshore current, and use the location of the offshore current feature points to identify the location of the offshore current;
  • Step 4 Based on the unknown location information of the feature points of the offshore stream, divide the dangerous area and feed it back to the relevant staff, who will remind visitors by marking.
  • the binocular camera includes left and right cameras. Since the data collected by the left and right cameras are basically the same, a single-sided camera image is used for offshore flow identification.
  • the specific steps for training the convolutional neural network in step 1 are as follows:
  • Step 1.1 image data preprocessing; specifically including the following steps:
  • Step 1.1.1 Process the training data collected in Step 1; convert the collected training data into a data format that TensorFlow can recognize;
  • Step 1.1.2 Add label according to the image, put the image and label in the array, and convert the array into a format that Tensorflow can recognize;
  • Step 1.1.3 Standardize the image including cropping and supplementation
  • Step 1.2 Build a convolutional neural network model based on the Tensorflow framework
  • the classic convolutional neural network LeNet-5 model is used; the model is divided into 7 layers: convolutional layer-pooling layer-convolutional layer-pooling layer-fully connected layer-fully connected layer-fully connected output layer; among them, The convolution layer extracts the preliminary offshore current characteristics, the pooling layer extracts the main characteristics of the offshore current, and the fully connected layer summarizes the characteristics of each part;
  • Step 1.3 Use the built convolutional neural network model to train the neural network that recognizes offshore flows.
  • step 3 specifically includes the following steps:
  • Step 3.1 Calibrate the left and right cameras
  • Step 3.2 Correct the left and right camera images
  • Step 3.3 Perform stereo matching on the image
  • Step 3.4 Obtain the three-dimensional coordinate information of the offshore current
  • Step 3.5 Regard the position information of the midpoint of the offshore current as the position of the offshore current, and divide the dangerous area at the left and right edge points of the obtained offshore current, that is, in the area of the offshore current according to the nature of the offshore current, according to the actual situation Carry out the expansion and get the dangerous area.
  • SGBM is a semi-global block matching algorithm, and the SGBM algorithm specifically includes the following steps:
  • the cost calculation is divided into two steps: one is the gradient cost calculation of the gradient information of the image obtained after preprocessing through the sampling-based method; the second is the SAD cost calculation of the original image through the sampling-based method;
  • the post-processing part requires uniqueness detection, sub-pixel interpolation and left-right consistency detection.
  • the invention uses binocular cameras to collect images, uses image recognition algorithms based on convolutional neural networks to identify offshore flows, and uses binocular positioning principles to locate offshore flows, providing a new method for offshore flow detection;
  • the method of detecting offshore flows based on binocular cameras can obtain more accurate position information of offshore flows in a timely manner.
  • the method is simple, the labor cost is low, and the operability is strong.
  • the relevant staff can use this method to obtain offshore flows.
  • the location information of the stream marks the location of the beach, reminding tourists to reduce the occurrence of drowning incidents caused by offshore currents, and provides a practical method for coastal tourism management.
  • Figure 1 is a flow chart of an offshore flow detection method based on binocular cameras
  • Figure 2 is a flow chart of the binocular positioning algorithm
  • Figure 3 is a flowchart of an image recognition algorithm
  • Figure 4 is a schematic diagram of the offshore current model.
  • an offshore current detection method based on binocular cameras includes the following steps:
  • Step 1 Collect the image set for training the convolutional neural network, and train the convolutional neural network.
  • the training data is to provide the basis for subsequent image recognition. It can be a nearshore wave collected by a binocular camera.
  • the image can have offshore currents or no offshore currents.
  • the nearshore wave image data that exists on the network, including offshore currents and not including offshore currents, can also be computer-generated nearshore wave image data of an ideal model of offshore currents.
  • step 1 The specific steps for training the convolutional neural network in step 1 are as follows:
  • Step 1.1 image data preprocessing; specifically including the following steps:
  • Step 1.1.1 Process the training data collected in Step 1, and convert the collected training data into a data format that TensorFlow can recognize;
  • Step 1.1.2 Add label according to the image, put the image and label in the array, and convert the array into a format that Tensorflow can recognize;
  • Step 1.1.3 Standardize the image including cropping and supplementation
  • Step 1.2 Build a convolutional neural network model based on the Tensorflow framework
  • the classic convolutional neural network LeNet-5 model is used; the model is divided into 7 layers: convolutional layer-pooling layer-convolutional layer-pooling layer-fully connected layer-fully connected layer-fully connected output layer; among them, The convolution layer extracts the preliminary offshore current characteristics, the pooling layer extracts the main characteristics of the offshore current, and the fully connected layer summarizes the characteristics of each part;
  • Step 1.3 Use the built convolutional neural network model to train the neural network that recognizes offshore flows.
  • Step 2 After the training is completed, perform experimental operations.
  • the collection of actual ocean waves is called actual data.
  • the actual data is the image collected during the actual offshore current observation.
  • Use the image recognition algorithm of the trained CNN convolutional neural network (the process is shown in Figure 2) to identify the offshore currents in the collected images; and determine whether the offshore currents exist;
  • the judgment result is that offshore currents exist, find the characteristic points of offshore currents; the characteristic points include the midpoint and left and right edge points of offshore currents;
  • Binocular cameras include left and right cameras. Since the data collected by the left and right cameras are basically the same, a single-sided camera image is used for offshore flow identification.
  • Step 3 Use the binocular positioning algorithm (the process is shown in Figure 3) to locate the identified feature points of the offshore current, and use the location of the offshore current feature points to identify the location of the offshore current;
  • Step 3.1 Calibrate the left and right cameras
  • the camera is calibrated by Zhang Zhengyou calibration method to obtain the internal and external parameters of the left and right cameras;
  • Zhang Zhengyou calibration method is a camera calibration method based on a moving plane template. This method is based on a method between the traditional camera calibration method and the camera self-calibration method .
  • the specific steps include calculating the homography matrix, calculating the internal parameter matrix, calculating the external parameter matrix, and calculating the distortion parameter.
  • Step 3.2 Correct the left and right camera images
  • Step 3.3 Perform stereo matching on the image
  • SGBM is a semi-global block matching algorithm, which has the characteristics of good parallax effect and fast speed; the steps of the SGBM algorithm are as follows:
  • the cost calculation is divided into two steps: one is the gradient cost calculation of the gradient information of the image obtained after preprocessing through the sampling-based method; the second is the SAD cost calculation of the original image through the sampling-based method;
  • the post-processing part requires uniqueness detection, sub-pixel interpolation and left-right consistency detection.
  • Step 3.4 Obtain the three-dimensional coordinates of the offshore current
  • Step 3.5 Regard the position information of the midpoint of the offshore current as the position of the offshore current, and divide the dangerous area at the left and right edge points of the obtained offshore current, that is, appropriately expand the area of the offshore current according to the nature of the offshore current, and get Dangerous area, for example: add 5m to the left from the left edge point, and 5m to the right from the right edge point.
  • Step 4 Based on the unknown location information of the feature points of the offshore stream, divide the dangerous area and feed it back to the relevant staff, who will remind visitors by marking.

Abstract

An offshore current detection method based on a binocular camera, wherein same belongs to the field of computer vision and the technical field of safety assurance. The method comprises the following steps: firstly, training a convolutional neural network for recognizing an offshore current; secondly, during an actual detection process, recognizing, by means of the trained convolutional neural network, whether an offshore current is present in a sea wave image collected by a binocular camera; and finally, locating the recognized offshore current. According to the method, three-dimensional information of an offshore current can be acquired on the basis of binocular stereoscopic vision, and relatively accurate offshore current location information can be acquired in a timely manner; and the method is simple and highly operable, and relevant staff can mark the location of a sand beach on the basis of the three-dimensional information of the offshore current to warn tourists, thereby reducing the occurrence of drowning accidents caused by an offshore current.

Description

一种基于双目相机的离岸流检测方法An Offshore Current Detection Method Based on Binocular Camera 技术领域Technical field
本发明属于计算机视觉领域和安全保障技术领域,具体涉及一种基于双目相机的离岸流检测方法。The invention belongs to the computer vision field and the technical field of safety assurance, and specifically relates to an offshore flow detection method based on a binocular camera.
背景技术Background technique
离岸流流速大多在每秒0.3-1米,最快可达到每秒3米,其长度可达30-100米甚至更长,流向几乎和岸线垂直,可将强壮的游泳者迅速拽入深水,引起溺水。离岸流已成为继风暴潮,海浪之后,给人们滨海旅游造成危害的另一海洋灾害。约90%的海边溺亡是因为离岸流引起的。离岸流给滨海旅游的吸引力维护,海滩管理,事故纠纷处理带来了大量的问题,严重影响了沿海旅游经济的健康发展。目前我国对离岸流灾害的技术评估和安全管理等才刚刚起步,相关调查评估,危险性评价,精细化预报,安全管理和公众科普警示等极为缺乏;公众对离岸流的认识也存在盲区和误区,认知错误和警惕性的缺乏造成了很多热点旅游区出现大量溺水事件,增加了救援工作量,滨海旅游安全管理难度。因此十分需要一种高效简单的离岸流检测方法。目前,对于离岸流的传统检测方法,是在近岸放置浮标或海流计。The flow rate of offshore stream is mostly 0.3-1 meters per second, and the fastest can reach 3 meters per second. Its length can reach 30-100 meters or even longer. The flow direction is almost perpendicular to the shoreline, which can quickly drag strong swimmers in. Deep water, causing drowning. Offshore currents have become another marine disaster that has caused harm to people's coastal tourism after storm surges and waves. About 90% of seaside drowning is caused by offshore currents. Offshore currents have brought a lot of problems to the attractive maintenance of coastal tourism, beach management, and accident dispute resolution, which seriously affects the healthy development of coastal tourism economy. At present, my country’s technical assessment and safety management of offshore stream disasters have just started, and relevant investigations and assessments, risk assessments, refined forecasts, safety management and public science warnings are extremely lacking; there are also blind spots in the public’s understanding of offshore streams. Misunderstandings, cognitive errors and lack of vigilance have caused a large number of drowning incidents in many hot tourist areas, increased rescue work, and difficulty in managing coastal tourism safety. Therefore, there is a great need for an efficient and simple offshore flow detection method. At present, the traditional detection method for offshore currents is to place buoys or current meters near the shore.
发明概述Summary of the invention
技术问题technical problem
问题的解决方案The solution to the problem
技术解决方案Technical solutions
针对现有技术中存在的上述技术问题,本发明提出了一种基于双目相机的离岸流检测方法,设计合理,克服了现有技术的不足,具有良好的效果。In view of the above-mentioned technical problems in the prior art, the present invention proposes a binocular camera-based offshore flow detection method, which is reasonable in design, overcomes the shortcomings of the prior art, and has good effects.
为了实现上述目的,本发明采用如下技术方案:In order to achieve the above objectives, the present invention adopts the following technical solutions:
一种基于双目相机的离岸流检测方法,包括如下步骤:A method for detecting offshore currents based on binocular cameras, including the following steps:
步骤1:收集训练卷积神经网络的图像集,训练卷积神经网络;Step 1: Collect the image set for training the convolutional neural network, and train the convolutional neural network;
步骤2:利用训练好的卷积神经网络的图像识别算法,对采集到的图像进行离 岸流的识别;判断离岸流是否存在;Step 2: Use the image recognition algorithm of the trained convolutional neural network to recognize the offshore currents in the collected images; judge whether the offshore currents exist;
若:判断结果是离岸流存在,则找到离岸流的特征点,对离岸流的特征点进行提取;特征点包括离岸流的中点和左右边缘点;If: the judgment result is that the offshore current exists, find the characteristic points of the offshore current, and extract the characteristic points of the offshore current; the characteristic points include the midpoint and the left and right edge points of the offshore current;
或判断结果是离岸流不存在,则重新采集图像进行处理;Or the judgment result is that there is no offshore current, then re-acquire images for processing;
步骤3:利用双目定位算法,对识别到的离岸流的特征点进行定位,利用离岸流特征点的位置来标识离岸流的位置;Step 3: Use the binocular positioning algorithm to locate the identified feature points of the offshore current, and use the location of the offshore current feature points to identify the location of the offshore current;
基于双目立体视觉技术获取离岸流的三维坐标;Obtain the three-dimensional coordinates of offshore streams based on binocular stereo vision technology;
步骤4:基于离岸流的特征点的未知位置信息,划分危险区域并反馈给相关工作人员,工作人员通过标记方式提醒游客。Step 4: Based on the unknown location information of the feature points of the offshore stream, divide the dangerous area and feed it back to the relevant staff, who will remind visitors by marking.
优选地,在步骤2中,双目相机包括左、右相机,由于左右相机采集的数据基本一致,因此采用单侧相机图像进行离岸流识别。Preferably, in step 2, the binocular camera includes left and right cameras. Since the data collected by the left and right cameras are basically the same, a single-sided camera image is used for offshore flow identification.
优选地,对步骤1中的卷积神经网络进行训练的具体步骤如下:Preferably, the specific steps for training the convolutional neural network in step 1 are as follows:
步骤1.1:图像数据预处理;具体包括如下步骤:Step 1.1: image data preprocessing; specifically including the following steps:
步骤1.1.1:将步骤1所采集的训练数据进行处理;将采集的训练数据转换成TensorFlow能识别的数据格式;Step 1.1.1: Process the training data collected in Step 1; convert the collected training data into a data format that TensorFlow can recognize;
步骤1.1.2:根据图像添加label,将image和label放到数组中,将数组转化为Tensorflow能识别的格式;Step 1.1.2: Add label according to the image, put the image and label in the array, and convert the array into a format that Tensorflow can recognize;
步骤1.1.3:将图像进行包括裁剪和补充在内的标准化处理;Step 1.1.3: Standardize the image including cropping and supplementation;
步骤1.2:基于Tensorflow框架,搭建卷积神经网络模型;Step 1.2: Build a convolutional neural network model based on the Tensorflow framework;
采用经典卷积神经网络LeNet-5模型;该模型分为7层结构:卷积层-池化层-卷积层-池化层-全连接层-全连接层-全连接输出层;其中,卷积层提取初步离岸流特征,池化层提取离岸流的主要特征,全连接层将各个部分特征汇总;The classic convolutional neural network LeNet-5 model is used; the model is divided into 7 layers: convolutional layer-pooling layer-convolutional layer-pooling layer-fully connected layer-fully connected layer-fully connected output layer; among them, The convolution layer extracts the preliminary offshore current characteristics, the pooling layer extracts the main characteristics of the offshore current, and the fully connected layer summarizes the characteristics of each part;
步骤1.3:利用搭建好的卷积神经网络模型,对识别离岸流的神经网络进行训练。Step 1.3: Use the built convolutional neural network model to train the neural network that recognizes offshore flows.
优选地,在步骤3中,具体包括如下步骤:Preferably, step 3 specifically includes the following steps:
步骤3.1:对左右相机进行标定;Step 3.1: Calibrate the left and right cameras;
采用张正友标定法对相机进行标定,获得左右相机的内外参数;Use Zhang Zhengyou calibration method to calibrate the camera to obtain the internal and external parameters of the left and right cameras;
步骤3.2:对左右相机图像进行校正;Step 3.2: Correct the left and right camera images;
利用标定好的左右相机所获得的内外参数,对图像进行畸变校正和立体校正;Use the internal and external parameters obtained by the calibrated left and right cameras to perform distortion correction and stereo correction on the image;
步骤3.3:对图像进行立体匹配;Step 3.3: Perform stereo matching on the image;
利用SGBM算法对图像进行立体匹配,最终获得视差图;Use the SGBM algorithm to perform stereo matching on the image, and finally obtain the disparity map;
步骤3.4:获得离岸流的三维坐标信息;Step 3.4: Obtain the three-dimensional coordinate information of the offshore current;
利用视差图和左右相机的内参数,获得深度图像,根据相机模型和标定相机获得的参数,获得离岸流特征点的三维坐标;Use the disparity map and the internal parameters of the left and right cameras to obtain the depth image, and obtain the three-dimensional coordinates of the feature points of the offshore current according to the camera model and the parameters obtained by the calibration camera;
步骤3.5:将离岸流中点的位置信息当作离岸流的位置,在所获得离岸流左右边缘点划分危险区域,即根据离岸流的性质在离岸流的区域,根据实际情况进行扩大,得到危险区域。Step 3.5: Regard the position information of the midpoint of the offshore current as the position of the offshore current, and divide the dangerous area at the left and right edge points of the obtained offshore current, that is, in the area of the offshore current according to the nature of the offshore current, according to the actual situation Carry out the expansion and get the dangerous area.
优选地,在步骤3.3中,SGBM是一种半全局块匹配算法,SGBM算法具体包括如下步骤:Preferably, in step 3.3, SGBM is a semi-global block matching algorithm, and the SGBM algorithm specifically includes the following steps:
S1:图像预处理;S1: image preprocessing;
利用水平Sobel算子对图像进行处理,将像素点进行映射得到新的图像,预处理得到的原图像的梯度信息;Use the horizontal Sobel operator to process the image, map the pixels to obtain a new image, and preprocess the gradient information of the original image;
S2:代价计算;S2: Cost calculation;
代价计算分为两步:一是经过预处理得到的图像的梯度信息经过基于采样的方法得到的梯度代价计算;二是原图像经过基于采样的方法得到的SAD代价计算;The cost calculation is divided into two steps: one is the gradient cost calculation of the gradient information of the image obtained after preprocessing through the sampling-based method; the second is the SAD cost calculation of the original image through the sampling-based method;
S3:动态规划;S3: Dynamic programming;
在每个方向上按照动态规划的思想进行能量积累,然后将每个方向上的匹配代价相加得到总的匹配代价;Accumulate energy in each direction according to the idea of dynamic programming, and then add the matching cost in each direction to get the total matching cost;
S4:后处理;S4: Post-processing;
后处理部分需要进行唯一性检测、亚像素插值和左右一致性检测。The post-processing part requires uniqueness detection, sub-pixel interpolation and left-right consistency detection.
发明的有益效果The beneficial effects of the invention
有益效果Beneficial effect
本发明所带来的有益技术效果:The beneficial technical effects brought by the present invention:
本发明通过双目相机对图像采集,利用基于卷积神经网络的图像识别算法对离岸流进行识别,利用双目定位原理对离岸流进行定位,对离岸流检测提供了新 的方法;基于双目相机对离岸流进行检测的方法,可以及时的获取较为准确的离岸流位置信息,方法简单,人工代价低,操作性强,相关工作人员便可以利用该方法对获得的离岸流的位置信息对沙滩位置进行标记,提醒游客,减少由于离岸流造成的溺水事件的发生,为沿海旅游管理提供了切实可行的办法。The invention uses binocular cameras to collect images, uses image recognition algorithms based on convolutional neural networks to identify offshore flows, and uses binocular positioning principles to locate offshore flows, providing a new method for offshore flow detection; The method of detecting offshore flows based on binocular cameras can obtain more accurate position information of offshore flows in a timely manner. The method is simple, the labor cost is low, and the operability is strong. The relevant staff can use this method to obtain offshore flows. The location information of the stream marks the location of the beach, reminding tourists to reduce the occurrence of drowning incidents caused by offshore currents, and provides a practical method for coastal tourism management.
对附图的简要说明Brief description of the drawings
附图说明Description of the drawings
图1是一种基于双目相机的离岸流检测方法实现的流程图;Figure 1 is a flow chart of an offshore flow detection method based on binocular cameras;
图2是双目定位算法的流程图;Figure 2 is a flow chart of the binocular positioning algorithm;
图3是识别图像算法的流程图;Figure 3 is a flowchart of an image recognition algorithm;
图4是离岸流模型示意图。Figure 4 is a schematic diagram of the offshore current model.
发明实施例Invention embodiment
本发明的实施方式Embodiments of the present invention
下面结合附图以及具体实施方式对本发明作进一步详细说明:The present invention will be further described in detail below in conjunction with the drawings and specific implementations:
如图1所示,一种基于双目相机的离岸流检测方法,包括如下步骤:As shown in Figure 1, an offshore current detection method based on binocular cameras includes the following steps:
步骤1:收集训练卷积神经网络的图像集,训练卷积神经网络。Step 1: Collect the image set for training the convolutional neural network, and train the convolutional neural network.
其中,训练数据是为了后续进行图像识别提供基础,可以是利用双目相机采集的近岸海浪的,该图像既可以存在离岸流也可以不存在离岸流近岸海浪图像;也可以是在网络上存在的包含离岸流和不包含离岸流的近岸海浪图像数据;也可以是电脑生成的离岸流理想模型近岸海浪图像数据。Among them, the training data is to provide the basis for subsequent image recognition. It can be a nearshore wave collected by a binocular camera. The image can have offshore currents or no offshore currents. The nearshore wave image data that exists on the network, including offshore currents and not including offshore currents, can also be computer-generated nearshore wave image data of an ideal model of offshore currents.
对步骤1中的卷积神经网络进行训练的具体步骤如下:The specific steps for training the convolutional neural network in step 1 are as follows:
步骤1.1:图像数据预处理;具体包括如下步骤:Step 1.1: image data preprocessing; specifically including the following steps:
步骤1.1.1:将步骤1所采集的训练数据进行处理,将采集的训练数据转换成TensorFlow能识别的数据格式;Step 1.1.1: Process the training data collected in Step 1, and convert the collected training data into a data format that TensorFlow can recognize;
步骤1.1.2:根据图像添加label,将image和label放到数组中,将数组转化为Tensorflow能识别的格式;Step 1.1.2: Add label according to the image, put the image and label in the array, and convert the array into a format that Tensorflow can recognize;
步骤1.1.3:将图像进行包括裁剪和补充在内的标准化处理;Step 1.1.3: Standardize the image including cropping and supplementation;
步骤1.2:基于Tensorflow框架,搭建卷积神经网络模型;Step 1.2: Build a convolutional neural network model based on the Tensorflow framework;
采用经典卷积神经网络LeNet-5模型;该模型分为7层结构:卷积层-池化层-卷 积层-池化层-全连接层-全连接层-全连接输出层;其中,卷积层提取初步离岸流特征,池化层提取离岸流的主要特征,全连接层将各个部分特征汇总;The classic convolutional neural network LeNet-5 model is used; the model is divided into 7 layers: convolutional layer-pooling layer-convolutional layer-pooling layer-fully connected layer-fully connected layer-fully connected output layer; among them, The convolution layer extracts the preliminary offshore current characteristics, the pooling layer extracts the main characteristics of the offshore current, and the fully connected layer summarizes the characteristics of each part;
步骤1.3:利用搭建好的卷积神经网络模型,对识别离岸流的神经网络进行训练。Step 1.3: Use the built convolutional neural network model to train the neural network that recognizes offshore flows.
步骤2:训练完成之后,进行实验操作,对实际海浪进行采集称为实际数据,实际数据也就是在实际进行离岸流观测的时候对海浪采集的图像。利用训练好的CNN卷积神经网络的图像识别算法(其流程如图2所示),对采集到的图像进行离岸流的识别;并判断离岸流是否存在;Step 2: After the training is completed, perform experimental operations. The collection of actual ocean waves is called actual data. The actual data is the image collected during the actual offshore current observation. Use the image recognition algorithm of the trained CNN convolutional neural network (the process is shown in Figure 2) to identify the offshore currents in the collected images; and determine whether the offshore currents exist;
若:判断结果是离岸流存在,则找到离岸流的特征点;特征点包括离岸流的中点和左右边缘点;If: the judgment result is that offshore currents exist, find the characteristic points of offshore currents; the characteristic points include the midpoint and left and right edge points of offshore currents;
或判断结果是离岸流不存在,则重新采集图像进行处理;Or the judgment result is that there is no offshore current, then re-acquire images for processing;
双目相机包括左、右相机,由于左右相机采集的数据基本一致,因此采用单侧相机图像进行离岸流识别。Binocular cameras include left and right cameras. Since the data collected by the left and right cameras are basically the same, a single-sided camera image is used for offshore flow identification.
步骤3:利用双目定位算法(其流程如图3所示),对识别到的离岸流的特征点进行定位,利用离岸流特征点的位置来标识离岸流的位置;Step 3: Use the binocular positioning algorithm (the process is shown in Figure 3) to locate the identified feature points of the offshore current, and use the location of the offshore current feature points to identify the location of the offshore current;
基于双目立体视觉技术获取离岸流的三维坐标;Obtain the three-dimensional coordinates of offshore streams based on binocular stereo vision technology;
具体包括如下步骤:Specifically, it includes the following steps:
步骤3.1:对左右相机进行标定;Step 3.1: Calibrate the left and right cameras;
采用张正友标定法对相机进行标定,获得左右相机的内外参数;张正友标定法是一种基于移动平面模板的相机标定方法,此方法是基于传统相机标定法和相机自标定法之间的一种方法。克服了两者的缺点又结合了两者的优点。具体步骤包括计算单应性矩阵,计算内参矩阵,计算外参矩阵,计算畸变参数。The camera is calibrated by Zhang Zhengyou calibration method to obtain the internal and external parameters of the left and right cameras; Zhang Zhengyou calibration method is a camera calibration method based on a moving plane template. This method is based on a method between the traditional camera calibration method and the camera self-calibration method . Overcoming the shortcomings of the two and combining the advantages of the two. The specific steps include calculating the homography matrix, calculating the internal parameter matrix, calculating the external parameter matrix, and calculating the distortion parameter.
步骤3.2:对左右相机图像进行校正;Step 3.2: Correct the left and right camera images;
利用标定好的左右相机所获得的内外参数,对图像进行畸变校正和立体校正;Use the internal and external parameters obtained by the calibrated left and right cameras to perform distortion correction and stereo correction on the image;
步骤3.3:对图像进行立体匹配;Step 3.3: Perform stereo matching on the image;
利用SGBM算法对图像进行立体匹配获得视差图,最终获得图片中点实际的三维坐标信息。SGBM是一种半全局块匹配算法,具有视差效果好速度快的特点;SGBM算法的步骤如下:Use the SGBM algorithm to perform stereo matching on the image to obtain the disparity map, and finally obtain the actual three-dimensional coordinate information of the point in the picture. SGBM is a semi-global block matching algorithm, which has the characteristics of good parallax effect and fast speed; the steps of the SGBM algorithm are as follows:
S1:图像预处理;S1: image preprocessing;
利用水平Sobel算子对图像进行处理,将像素点进行映射得到新的图像,预处理得到的原图像的梯度信息;Use the horizontal Sobel operator to process the image, map the pixels to obtain a new image, and preprocess the gradient information of the original image;
S2:代价计算;S2: Cost calculation;
代价计算分为两步:一是经过预处理得到的图像的梯度信息经过基于采样的方法得到的梯度代价计算;二是原图像经过基于采样的方法得到的SAD代价计算;The cost calculation is divided into two steps: one is the gradient cost calculation of the gradient information of the image obtained after preprocessing through the sampling-based method; the second is the SAD cost calculation of the original image through the sampling-based method;
S3:动态规划;S3: Dynamic programming;
在每个方向上按照动态规划的思想进行能量积累,然后将每个方向上的匹配代价相加得到总的匹配代价;Accumulate energy in each direction according to the idea of dynamic programming, and then add the matching cost in each direction to get the total matching cost;
S4:后处理;S4: Post-processing;
后处理部分需要进行唯一性检测、亚像素插值和左右一致性检测。The post-processing part requires uniqueness detection, sub-pixel interpolation and left-right consistency detection.
步骤3.4:获得离岸流的三维坐标;Step 3.4: Obtain the three-dimensional coordinates of the offshore current;
利用视差图和左右相机的内参数,获得深度图像,根据相机模型和标定相机获得的参数,获得离岸流特征点的三维坐标;Use the disparity map and the internal parameters of the left and right cameras to obtain the depth image, and obtain the three-dimensional coordinates of the feature points of the offshore current according to the camera model and the parameters obtained by the calibration camera;
步骤3.5:将离岸流中点的位置信息当作离岸流的位置,在所获得离岸流左右边缘点划分危险区域,即根据离岸流的性质在离岸流的区域适当扩大,得到危险区域,比如:在左边缘点的左方向上增加5m,在右边缘点往右增加5m。Step 3.5: Regard the position information of the midpoint of the offshore current as the position of the offshore current, and divide the dangerous area at the left and right edge points of the obtained offshore current, that is, appropriately expand the area of the offshore current according to the nature of the offshore current, and get Dangerous area, for example: add 5m to the left from the left edge point, and 5m to the right from the right edge point.
步骤4:基于离岸流的特征点的未知位置信息,划分危险区域并反馈给相关工作人员,工作人员通过标记方式提醒游客。Step 4: Based on the unknown location information of the feature points of the offshore stream, divide the dangerous area and feed it back to the relevant staff, who will remind visitors by marking.
当然,上述说明并非是对本发明的限制,本发明也并不仅限于上述举例,本技术领域的技术人员在本发明的实质范围内所做出的变化、改型、添加或替换,也应属于本发明的保护范围。Of course, the above description is not a limitation of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by those skilled in the art within the essential scope of the present invention shall also belong to the present invention. The scope of protection of the invention.

Claims (5)

  1. 一种基于双目相机的离岸流检测方法,其特征在于:包括如下步骤:A method for detecting offshore currents based on binocular cameras, which is characterized in that it comprises the following steps:
    步骤1:收集训练卷积神经网络的图像集,训练卷积神经网络;Step 1: Collect the image set for training the convolutional neural network, and train the convolutional neural network;
    步骤2:利用卷积神经网络的图像识别算法,对采集到的图像进行离岸流的识别;判断离岸流是否存在;Step 2: Use the image recognition algorithm of the convolutional neural network to identify the offshore currents in the collected images; judge whether the offshore currents exist;
    若:判断结果是离岸流存在,则找到离岸流的特征点,对离岸流的特征点进行提取;特征点包括离岸流的中点和左右边缘点;If: the judgment result is that offshore currents exist, find the characteristic points of offshore currents, and extract the characteristic points of offshore currents; the characteristic points include the midpoint and left and right edge points of the offshore current;
    或判断结果是离岸流不存在,则重新采集图像进行处理;Or the judgment result is that there is no offshore current, then re-acquire images for processing;
    步骤3:利用双目定位算法,对识别到的离岸流的特征点进行定位,利用离岸流特征点的位置来标识离岸流的位置;Step 3: Use the binocular positioning algorithm to locate the identified feature points of the offshore current, and use the location of the offshore current feature points to identify the location of the offshore current;
    基于双目立体视觉技术获取离岸流的三维坐标;Obtain the three-dimensional coordinates of offshore streams based on binocular stereo vision technology;
    步骤4:基于离岸流的特征点的未知位置信息,划分危险区域并反馈给相关工作人员,工作人员通过标记方式提醒游客。Step 4: Based on the unknown location information of the feature points of the offshore stream, divide the dangerous area and feed it back to the relevant staff, who will remind visitors by marking.
  2. 根据权利要求1所述的基于双目相机的离岸流检测方法,其特征在于:在步骤2中,双目相机包括左、右相机,由于左右相机采集的数据基本一致,因此采用单侧相机图像进行离岸流识别。The method for detecting offshore flows based on binocular cameras according to claim 1, characterized in that: in step 2, the binocular cameras include left and right cameras. Since the data collected by the left and right cameras are basically the same, a single-sided camera is used. Image for offshore flow identification.
  3. 根据权利要求1所述的基于双目相机的离岸流检测方法,其特征在于:对步骤1中的卷积神经网络进行训练的具体步骤如下:The method for detecting offshore flows based on binocular cameras according to claim 1, wherein the specific steps of training the convolutional neural network in step 1 are as follows:
    步骤1.1:图像数据预处理;具体包括如下步骤:Step 1.1: image data preprocessing; specifically including the following steps:
    步骤1.1.1:将步骤1所采集的训练数据进行处理,利用一组单侧相机采集的图像进行处理;将采集的训练数据转换成TensorFlow能识别的数据格式;Step 1.1.1: Process the training data collected in Step 1, and use a set of images collected by a single-side camera for processing; convert the collected training data into a data format that TensorFlow can recognize;
    步骤1.1.2:根据图像添加label,将image和label放到数组中,将数组转化为Tensorflow能识别的格式;Step 1.1.2: Add label according to the image, put the image and label in the array, and convert the array into a format that Tensorflow can recognize;
    步骤1.1.3:将图像进行包括裁剪和补充在内的标准化处理;Step 1.1.3: Standardize the image including cropping and supplementation;
    步骤1.2:基于Tensorflow框架,搭建卷积神经网络模型;Step 1.2: Build a convolutional neural network model based on the Tensorflow framework;
    采用经典卷积神经网络LeNet-5模型;该模型分为7层结构:卷积 层-池化层-卷积层-池化层-全连接层-全连接层-全连接输出层;其中,卷积层提取初步离岸流特征,池化层提取离岸流的主要特征,全连接层将各个部分特征汇总;The classic convolutional neural network LeNet-5 model is used; the model is divided into 7 layers: convolutional layer-pooling layer-convolutional layer-pooling layer-fully connected layer-fully connected layer-fully connected output layer; among them, The convolution layer extracts the preliminary offshore current characteristics, the pooling layer extracts the main characteristics of the offshore current, and the fully connected layer summarizes the characteristics of each part;
    步骤1.3:利用搭建好的卷积神经网络模型,对识别离岸流的神经网络进行训练。Step 1.3: Use the built convolutional neural network model to train the neural network that recognizes offshore flows.
  4. 根据权利要求1所述的基于双目相机的离岸流检测方法,其特征在于:在步骤3中,具体包括如下步骤:The method for detecting offshore currents based on binocular cameras according to claim 1, characterized in that: in step 3, it specifically includes the following steps:
    步骤3.1:对左右相机进行标定;Step 3.1: Calibrate the left and right cameras;
    采用张正友标定法对相机进行标定,获得左右相机的内外参数;Use Zhang Zhengyou calibration method to calibrate the camera to obtain the internal and external parameters of the left and right cameras;
    步骤3.2:对左右相机图像进行校正;Step 3.2: Correct the left and right camera images;
    利用标定好的左右相机所获得的内外参数,对图像进行畸变校正和立体校正;Use the internal and external parameters obtained by the calibrated left and right cameras to perform distortion correction and stereo correction on the image;
    步骤3.3:对图像进行立体匹配;Step 3.3: Perform stereo matching on the image;
    利用SGBM算法对图像进行立体匹配,最终获得视差图;Use the SGBM algorithm to perform stereo matching on the image, and finally obtain the disparity map;
    步骤3.4:获得离岸流的三维坐标信息;Step 3.4: Obtain the three-dimensional coordinate information of the offshore current;
    利用视差图和左右相机的内参数,获得深度图像,根据相机模型和标定相机获得的参数,获得离岸流特征点的三维坐标;Use the disparity map and the internal parameters of the left and right cameras to obtain the depth image, and obtain the three-dimensional coordinates of the feature points of the offshore current according to the camera model and the parameters obtained by the calibration camera;
    步骤3.5:将离岸流中点的位置信息当作离岸流的位置,在所获得离岸流左右边缘点划分危险区域,即根据离岸流的性质在离岸流的区域,根据实际情况进行扩大,得到危险区域。Step 3.5: Regard the position information of the midpoint of the offshore current as the position of the offshore current, and divide the dangerous area at the left and right edge points of the obtained offshore current, that is, in the area of the offshore current according to the nature of the offshore current, according to the actual situation Carry out the expansion and get the dangerous area.
  5. 根据权利要求4所述的基于双目相机的离岸流检测方法,其特征在于:在步骤3.3中,SGBM是一种半全局块匹配算法,SGBM算法具体包括如下步骤:The offshore flow detection method based on binocular cameras according to claim 4, characterized in that: in step 3.3, SGBM is a semi-global block matching algorithm, and the SGBM algorithm specifically includes the following steps:
    S1:图像预处理;S1: image preprocessing;
    利用水平Sobel算子对图像进行处理,将像素点进行映射得到新的图像,预处理得到的原图像的梯度信息;Use the horizontal Sobel operator to process the image, map the pixels to obtain a new image, and preprocess the gradient information of the original image;
    S2:代价计算;S2: Cost calculation;
    代价计算分为两步:一是经过预处理得到的图像的梯度信息经过 基于采样的方法得到的梯度代价计算;二是原图像经过基于采样的方法得到的SAD代价计算;The cost calculation is divided into two steps: one is the gradient cost calculation of the gradient information of the image obtained after preprocessing through the sampling-based method; the second is the SAD cost calculation of the original image through the sampling-based method;
    S3:动态规划;S3: Dynamic programming;
    在每个方向上按照动态规划的思想进行能量积累,然后将每个方向上的匹配代价相加得到总的匹配代价;Accumulate energy in each direction according to the idea of dynamic programming, and then add the matching cost in each direction to get the total matching cost;
    S4:后处理;S4: Post-processing;
    后处理部分需要进行唯一性检测、亚像素插值和左右一致性检测。The post-processing part requires uniqueness detection, sub-pixel interpolation and left-right consistency detection.
PCT/CN2019/115513 2019-09-02 2019-11-05 Offshore current detection method based on binocular camera WO2021042490A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910821151.6A CN110675449B (en) 2019-09-02 2019-09-02 Binocular camera-based offshore flow detection method
CN201910821151.6 2019-09-02

Publications (1)

Publication Number Publication Date
WO2021042490A1 true WO2021042490A1 (en) 2021-03-11

Family

ID=69076671

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/115513 WO2021042490A1 (en) 2019-09-02 2019-11-05 Offshore current detection method based on binocular camera

Country Status (2)

Country Link
CN (1) CN110675449B (en)
WO (1) WO2021042490A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115663665A (en) * 2022-12-08 2023-01-31 国网山西省电力公司超高压变电分公司 Binocular vision-based protection screen cabinet air-open state checking device and method
CN117131799A (en) * 2023-08-17 2023-11-28 浙江大学 Bottom bed shear stress calculation method based on image
CN117395377A (en) * 2023-12-06 2024-01-12 上海海事大学 Multi-view fusion-based coastal bridge sea side safety monitoring method, system and medium

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110763426B (en) * 2019-09-29 2021-09-10 哈尔滨工程大学 Method and device for simulating offshore flow in pool
CN112950610A (en) * 2021-03-18 2021-06-11 河海大学 Method and system for monitoring and early warning of fission flow
CN113936248B (en) * 2021-10-12 2023-10-03 河海大学 Beach personnel risk early warning method based on image recognition

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050271266A1 (en) * 2001-06-01 2005-12-08 Gregory Perrier Automated rip current detection system
US20150046136A1 (en) * 2012-03-27 2015-02-12 Korea Institute Of Construction Technology Method for generating rip current warning
CN104933718A (en) * 2015-06-23 2015-09-23 广东省自动化研究所 Physical coordinate positioning method based on binocular vision
US9165453B2 (en) * 2012-01-12 2015-10-20 Earl Senchuk Rip current sensor and warning system with anchor
CN105389468A (en) * 2015-11-06 2016-03-09 中国海洋大学 Rip current forecasting method
JP2017133901A (en) * 2016-01-27 2017-08-03 ソニー株式会社 Monitoring device and monitoring method, and program

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
ITRM20010045A1 (en) * 2001-01-29 2002-07-29 Consiglio Nazionale Ricerche SYSTEM AND METHOD FOR DETECTING THE RELATIVE POSITION OF AN OBJECT COMPARED TO A REFERENCE POINT.
CN103308000B (en) * 2013-06-19 2015-11-18 武汉理工大学 Based on the curve object measuring method of binocular vision
KR101947782B1 (en) * 2017-02-22 2019-02-13 한국과학기술원 Apparatus and method for depth estimation based on thermal image, and neural network learning method
CN106982359B (en) * 2017-04-26 2019-11-05 深圳先进技术研究院 A kind of binocular video monitoring method, system and computer readable storage medium
CN107092893B (en) * 2017-04-28 2018-06-19 杨荧 A kind of recognition methods based on image procossing
CN108154134B (en) * 2018-01-11 2019-07-23 天格科技(杭州)有限公司 Pornographic image detection method is broadcast live in internet based on depth convolutional neural networks
CN108665484B (en) * 2018-05-22 2021-07-09 国网山东省电力公司电力科学研究院 Danger source identification method and system based on deep learning
CN109048926A (en) * 2018-10-24 2018-12-21 河北工业大学 A kind of intelligent robot obstacle avoidance system and method based on stereoscopic vision
CN109903507A (en) * 2019-03-04 2019-06-18 上海海事大学 A kind of fire disaster intelligent monitor system and method based on deep learning
CN110060299A (en) * 2019-04-18 2019-07-26 中国测绘科学研究院 Danger source identifies and positions method in passway for transmitting electricity based on binocular vision technology

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050271266A1 (en) * 2001-06-01 2005-12-08 Gregory Perrier Automated rip current detection system
US9165453B2 (en) * 2012-01-12 2015-10-20 Earl Senchuk Rip current sensor and warning system with anchor
US20150046136A1 (en) * 2012-03-27 2015-02-12 Korea Institute Of Construction Technology Method for generating rip current warning
CN104933718A (en) * 2015-06-23 2015-09-23 广东省自动化研究所 Physical coordinate positioning method based on binocular vision
CN105389468A (en) * 2015-11-06 2016-03-09 中国海洋大学 Rip current forecasting method
JP2017133901A (en) * 2016-01-27 2017-08-03 ソニー株式会社 Monitoring device and monitoring method, and program

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115663665A (en) * 2022-12-08 2023-01-31 国网山西省电力公司超高压变电分公司 Binocular vision-based protection screen cabinet air-open state checking device and method
CN117131799A (en) * 2023-08-17 2023-11-28 浙江大学 Bottom bed shear stress calculation method based on image
CN117131799B (en) * 2023-08-17 2024-02-23 浙江大学 Bottom bed shear stress calculation method based on image
CN117395377A (en) * 2023-12-06 2024-01-12 上海海事大学 Multi-view fusion-based coastal bridge sea side safety monitoring method, system and medium
CN117395377B (en) * 2023-12-06 2024-03-22 上海海事大学 Multi-view fusion-based coastal bridge sea side safety monitoring method, system and medium

Also Published As

Publication number Publication date
CN110675449B (en) 2020-12-08
CN110675449A (en) 2020-01-10

Similar Documents

Publication Publication Date Title
WO2021042490A1 (en) Offshore current detection method based on binocular camera
CN104091369B (en) Unmanned aerial vehicle remote-sensing image building three-dimensional damage detection method
WO2018153304A1 (en) Map road mark and road quality collection apparatus and method based on adas system
CN102494733B (en) Water level monitoring system based on image processing and method
CN106846340B (en) A kind of striation boundary extraction method based on on-fixed characteristic point
CN105184779B (en) One kind is based on the pyramidal vehicle multiscale tracing method of swift nature
CN111260788B (en) Power distribution cabinet switch state identification method based on binocular vision
CN104517095B (en) A kind of number of people dividing method based on depth image
CN101398886A (en) Rapid three-dimensional face identification method based on bi-eye passiveness stereo vision
CN111160291B (en) Human eye detection method based on depth information and CNN
CN105225229B (en) Fish based on vision signal cross dam movement locus positioner and method
CN106228579A (en) A kind of video image dynamic water table information extracting method based on geographical space-time scene
CN103927758B (en) Saliency detection method based on contrast ratio and minimum convex hull of angular point
CN110009610A (en) A kind of reservoir dam slope protection surface damage visible detection method and bionic device
CN105913013A (en) Binocular vision face recognition algorithm
CN108960076A (en) Ear recognition and tracking based on convolutional neural networks
CN102075785A (en) Method for correcting wide-angle camera lens distortion of automatic teller machine (ATM)
CN109472802A (en) A kind of surface grid model construction method constrained certainly based on edge feature
CN115060343B (en) Point cloud-based river water level detection system and detection method
CN113139437A (en) Helmet wearing inspection method based on YOLOv3 algorithm
CN111292360A (en) Method and system for recommending ship driving route
WO2024032233A1 (en) Stereophotogrammetric method based on binocular vision
CN103308000A (en) Method for measuring curve object on basis of binocular vision
CN106960027B (en) The UAV Video big data multidate association analysis method of spatial information auxiliary
CN114724094A (en) System for measuring number of people in gateway vehicle based on three-dimensional image and radar technology

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19944313

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19944313

Country of ref document: EP

Kind code of ref document: A1