CN114862726A - Tidal bore tide head line connection method based on gradient amplitude growth - Google Patents
Tidal bore tide head line connection method based on gradient amplitude growth Download PDFInfo
- Publication number
- CN114862726A CN114862726A CN202210472516.0A CN202210472516A CN114862726A CN 114862726 A CN114862726 A CN 114862726A CN 202210472516 A CN202210472516 A CN 202210472516A CN 114862726 A CN114862726 A CN 114862726A
- Authority
- CN
- China
- Prior art keywords
- image
- tide
- tidal
- pixels
- head line
- 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
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/194—Segmentation; Edge detection involving foreground-background segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/60—Analysis of geometric attributes
- G06T7/62—Analysis of geometric attributes of area, perimeter, diameter or volume
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20024—Filtering details
- G06T2207/20032—Median filtering
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02A—TECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
- Y02A90/00—Technologies having an indirect contribution to adaptation to climate change
- Y02A90/30—Assessment of water resources
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Geometry (AREA)
- Image Processing (AREA)
Abstract
本发明公开了一种基于梯度幅值生长的涌潮潮头线连接方法。本发明针对涌潮到来时潮头线在图像水流方向上梯度幅值较大的特征,采用Sobel算子进行梯度幅值计算,该算子可以计算出每个像素点在水流方向上梯度幅值的大小,通过使用OTSU图像分割方法将图像分为前景和背景部分,最后根据断裂的涌潮潮头线的端点邻域梯度幅值的大小进行像素点生长,从而完成涌潮潮头线连接,最后筛选出面积最大的轮廓即为涌潮的潮头线,该方法能够更加精确地分割得到涌潮的潮头线区域,并且能够准确有效地连接涌潮断裂部分,提高涌潮潮头线识别准确度,为涌潮研究提供数据支持。
The invention discloses a tidal head line connection method based on gradient amplitude growth. Aiming at the feature of the large gradient amplitude of the tide line in the direction of the water flow when the tide arrives, the invention adopts the Sobel operator to calculate the gradient amplitude, and the operator can calculate the gradient amplitude of each pixel point in the direction of the water flow. By using the OTSU image segmentation method, the image is divided into foreground and background parts, and finally the pixel points are grown according to the magnitude of the gradient amplitude of the endpoint neighborhood of the fractured tide head line, so as to complete the tide head line connection. Finally, the contour with the largest area is the tidal head line of the tidal wave. This method can more accurately segment the tidal head line area of the tidal wave, and can accurately and effectively connect the tidal fracture parts, so as to improve the identification of the tidal head line. Accuracy to provide data support for tidal studies.
Description
技术领域technical field
本发明属于海洋信息技术领域,涉及一种涌潮观测方法,具体涉及一种基于梯度幅值生长的涌潮潮头线连接方法。The invention belongs to the technical field of marine information, relates to a tidal surge observation method, and in particular relates to a tidal head line connection method based on gradient amplitude growth.
背景技术Background technique
钱塘江涌潮气势磅礴,来势汹涌,是一种独特且壮观的自然景观,由于不同河段的地理环境的不同,会形成不同类型的涌潮形态,比如海宁的交叉潮、盐官的一线潮、老盐仓和美女坝的回头潮,每年都会吸引成千上万的游客前来观潮,涌潮在前进过程中所引起的强大的动力有时也会直接影响沿江建筑物和航运的安全以及造成一些不必要的人员伤亡,因此,探索涌潮的规律,研究涌潮的水力特性和产生机理,对于涌潮保护和防护具有重要的学术价值和现实意义。Qiantang River tide is majestic and turbulent. It is a unique and spectacular natural landscape. Due to the different geographical environments of different river sections, different types of tide forms will be formed, such as the cross tide in Haining, the first-line tide in Yanguan, The returning tide of the Old Yancang and Meimei Dam attracts thousands of tourists every year to watch the tide. Some unnecessary casualties are caused. Therefore, exploring the law of tidal surge and studying its hydraulic characteristics and generation mechanism have important academic value and practical significance for tidal surge protection and protection.
涌潮传播速度是涌潮的一个重要特性,系指涌潮潮头的前进速度,涌潮传播速度的主要影响因素为下游潮差、上游水深和径流量,水深越大,涌潮传播越快;下游潮差越大,涌潮传播速度也越快;径流与涌潮传播方向相反,径流量越大,涌潮传播速度越慢,涌潮传播速度与涌潮预报、航运安全密切相关,亦是分析涌潮水力学特性的一个重要参数,涌潮潮头高度、涌潮流速、涌潮的局部形态等特性均与涌潮传播速度有关。Tide propagation speed is an important characteristic of tidal surge, which refers to the advancing speed of tidal head. The main influencing factors of tidal propagation speed are downstream tidal range, upstream water depth and runoff. The greater the water depth, the faster the tidal propagation. ; The larger the downstream tidal range, the faster the tidal propagation speed; the direction of runoff and tidal propagation is opposite, the larger the runoff, the slower the tidal propagation speed. The tidal propagation speed is closely related to tidal forecasting and shipping safety, and It is an important parameter for analyzing the hydraulic characteristics of tidal surge. The characteristics of tidal head height, tidal current velocity, and local tidal shape are all related to the tidal propagation velocity.
专利号为CN202110430752.1公开了一种基于无人机的机器视觉涌潮流速测量方法,该方法的实现依次包括视频图像采集、灰度化及滤波处理、边缘检测、膨胀操作、潮头线提取和涌潮速度计算共六个环节,该专利提供的涌潮传播速度计算方法利用无人机的机动性和检测范围广等优势,有利于获取更加全面的涌潮流速信息,具备测量空间尺度大、潮头线识别精确、非接触式安全性高等优势,但是,该专利中的检测涌潮潮头线时所使用的边缘检测方法与边缘连接时所采用的膨胀操作都存在不足,该方法中边缘检测采取的是Canny检测算法,会将图像中不属于潮头线的江面波纹或者干扰点都检测为边缘,影响检测的结果;膨胀操作虽然一定程度地解决了边缘不连续的问题,但存在明显的缺点:一方面,边缘断裂处过大导致无法成功连接边缘,另一方面,像素点膨化操作只是将潮头线断裂的部位进行像素点扩张,也就是将原本像素值为255的像素点邻近的像素点也置为255,因此扩张后的像素点不一定属于潮头线的一部分,仅仅是将潮头线断裂的部分通过像素点扩张的方式从而达到断裂处被填补的效果,对像素点进行扩张必定会使得涌潮潮头线区域扩张,得到的并不是原本形态的潮头线,而是扩张后的潮头线。Patent No. CN202110430752.1 discloses a UAV-based machine vision surge velocity measurement method. The implementation of the method sequentially includes video image acquisition, grayscale and filtering processing, edge detection, expansion operation, and tide line extraction. There are six links in total and tidal velocity calculation. The tidal propagation velocity calculation method provided by this patent takes advantage of the UAV's mobility and wide detection range, which is conducive to obtaining more comprehensive tidal velocity information, and has the ability to measure a large spatial scale. , Tideline identification is accurate, non-contact security and high advantages, however, the edge detection method used in the detection of the tide line in the patent and the expansion operation used in the edge connection are both insufficient. The edge detection adopts the Canny detection algorithm, which detects the ripples or interference points on the river surface that do not belong to the tide line in the image as edges, which affects the detection results; although the expansion operation solves the problem of discontinuous edges to a certain extent, there are Obvious shortcomings: on the one hand, the edge break is too large to successfully connect the edges; on the other hand, the pixel point puffing operation only expands the pixel points of the broken part of the tide line, that is, the original pixel value of 255 pixels. The adjacent pixels are also set to 255, so the expanded pixels do not necessarily belong to part of the tide line, but only the broken part of the tide line is expanded by the pixel points to achieve the effect of filling the break. The expansion of the point will definitely make the area of the surging tide line expand, and what you get is not the original shape of the tide line, but the expanded tide line.
针对上述问题,本专利提出一种基于梯度幅值生长的涌潮潮头线连接方法,针对涌潮到来时潮头线在图像Y轴方向即水流流向方向上梯度幅值较大的特征,该潮头线连接方法采用Sobel算子进行梯度幅值计算,该算子可以计算出每个像素点在图像Y轴上的梯度幅值的大小,梯度幅值较大,则可能属于涌潮潮头线,通过使用OTSU图像分割方法将图像分为前景和背景部分,最后根据断裂的涌潮潮头线的端点邻域的梯度幅值的大小进行像素点生长,对图像中涌潮潮头线断裂处进行潮头线的连接,由于图像中存在其他梯度幅值同样较高的像素点被检测为前景部分,因此最后还要通过比较轮廓面积的大小筛选出轮廓面积最大的部分即为涌潮的潮头线。In view of the above problems, this patent proposes a tidal head line connection method based on gradient amplitude growth. In view of the large gradient amplitude of the tide head line in the Y-axis direction of the image when the tide arrives, that is, the direction of the water flow, the method The tide head line connection method uses the Sobel operator to calculate the gradient amplitude. This operator can calculate the magnitude of the gradient amplitude of each pixel on the Y-axis of the image. If the gradient amplitude is larger, it may belong to the tide head. By using the OTSU image segmentation method, the image is divided into foreground and background parts, and finally the pixel points are grown according to the magnitude of the gradient amplitude of the endpoint neighborhood of the fractured tide head line. Connect the tide head line at the tidal head line. Since there are other pixels in the image with the same high gradient amplitude, which are detected as the foreground part, finally the part with the largest contour area is screened out by comparing the size of the contour area. Tide line.
发明内容SUMMARY OF THE INVENTION
本发明的目的是为了弥补现有无人机对涌潮潮头线识别并计算涌潮传播速度方法的不足,针对涌潮到来时潮头线在Y轴方向上梯度幅值较大的特征,采用Sobel算子进行梯度幅值计算,该算子可以计算出每个像素点在Y轴上的梯度幅值的大小,梯度幅值越大,越可能属于潮头线的一部分,通过迭代使用OTSU图像分割方法将图像分为前景和背景部分,最后根据断裂的涌潮潮头线的端点邻域的梯度幅值的大小进行生长,从而完成涌潮潮头线连接,最后通过筛选面积最大的连通域即为涌潮的潮头线,该方法能够更加精确地分割得到涌潮的潮头线区域,并且能够准确有效地连接涌潮断裂部分,提高涌潮潮头线识别准确度,为涌潮研究提供数据支持。The purpose of the present invention is to make up for the deficiencies of the existing unmanned aerial vehicle (UAV) method for identifying the tide head line and calculating the tide propagation speed. The Sobel operator is used to calculate the gradient magnitude. This operator can calculate the magnitude of the gradient magnitude of each pixel on the Y-axis. The larger the gradient magnitude, the more likely it is part of the tide line. Iteratively uses OTSU The image segmentation method divides the image into foreground and background parts, and finally grows according to the magnitude of the gradient amplitude of the endpoint neighborhood of the fractured tidal head line, so as to complete the connection of the tidal head line, and finally filters the connection with the largest area. The domain is the tidal head line of the tidal wave. This method can more accurately segment the tidal head line area of the tidal wave, and can accurately and effectively connect the tidal fault parts, so as to improve the identification accuracy of the tidal head line, which is the best way to identify the tidal head line of the tidal wave. Research provides data support.
一种基于梯度幅值生长的涌潮边缘连接方法,流程如图1所示,包括以下步骤:A tidal edge connection method based on gradient amplitude growth, as shown in Figure 1, includes the following steps:
步骤1:对所采集的涌潮图像进行灰度化及中值滤波处理。Step 1: Grayscale and median filter processing are performed on the collected tide surge images.
步骤2:利用Sobel算子计算图像幅值梯度并将图像格式转回原来的uint8格式。Step 2: Use the Sobel operator to calculate the image amplitude gradient and convert the image format back to the original uint8 format.
步骤3:利用OTSU图像分割法计算图像分割阈值并使用该阈值将涌潮图像分割为前景和背景部分。Step 3: Calculate the image segmentation threshold using the OTSU image segmentation method and use the threshold to segment the tide surge image into foreground and background parts.
步骤4:寻找图像中所有符合条件的右端点即为涌潮潮头线断裂处的像素点。Step 4: Find all the right endpoints that meet the conditions in the image, which are the pixels where the tide head line breaks.
步骤5:遍历每一个右端点,选择右端点的相邻的8个方向上的像素点中的右侧三个像素点幅值梯度最大的像素点作为潮头线生长的目标点。Step 5: Traverse each right endpoint, and select the pixels with the largest amplitude gradient of the three pixels on the right among the pixels in the adjacent 8 directions of the right endpoint as the target point for the growth of the tide head line.
步骤6:继续筛选得到的目标点的右邻域中像素点,若其右邻域不存在前景像素点,则选择幅值梯度最大的像素点作为下一个潮头线生长的目标点,重复该生长步骤,生长步骤次数可根据图像效果手动设定。Step 6: Continue to filter the pixels in the right neighborhood of the obtained target point. If there are no foreground pixels in its right neighborhood, select the pixel with the largest amplitude gradient as the target point for the next tide line growth, and repeat the process. Growth steps, the number of growth steps can be manually set according to the image effect.
步骤7:根据图像中各个独立的前景部分轮廓面积大小筛选出面积最大的轮廓即为涌潮潮头线。Step 7: According to the contour area size of each independent foreground part in the image, the contour with the largest area is selected as the tide head line.
所述步骤1具体步骤为:根据人类视觉对色彩的敏感度不同,将每个像素点的B、G、R通道分别赋予不同的权重系数进行加权求解灰度值,依次作为整个图像的灰度值,中值滤波是根据邻域模板将图像中某一点邻域内的像素的灰度值按从小到大的顺序进行排列,并将这些从小到大排列的灰度值计算中值,用它作为这个像素点的灰度值。The specific steps of the
所述步骤2具体步骤为:Sobel算子主要用于获得数字图像的一阶梯度,常见的应用和物理意义是边缘检测,图像边缘的相素值会发生显著的变化,梯度幅值的大小代表图像中内容的变化程度,首先需要定义一个3*3的卷积核,根据涌潮到来时,涌潮潮头线前后的像素点差距明显的特点,选择卷积核为Sobel算子在Gy方向上的卷积模板,通过该卷积核与原始图片做卷积,得到各像素点纵向的梯度值,该卷积核的作用就是当该像素点上下部分的像素点差距越大,所得结果绝对值就越大,也就是梯度幅值越大,越有可能是涌潮的潮头线,由于得到的结果可能为负数或者大于255,因此还需要将数据类型转化为uint8类型,从而得到一幅像素值在0~255的灰度图像。The specific steps of the
所述步骤3图像分割的具体步骤为:The specific steps of the step 3 image segmentation are:
3-1:先计算图像的直方图,即将图像所有的像素点按照0~255共256个区域,统计落在每个区域的像素点数量,并归一化直方图3-1: First calculate the histogram of the image, that is, all the pixels of the image are divided into 256 areas from 0 to 255, count the number of pixels falling in each area, and normalize the histogram
3-2:定义一个i表示分类的阈值,从0开始迭代,统计0~i灰度级的像素所占整幅图像的比例w0,并计算其平均灰度u0;统计i~255灰度级的像素所占整幅图像的比例w1,并统计背景像素的平均灰度u1;3-2: Define a threshold where i represents the classification, iterate from 0, count the proportion w0 of the pixels with gray levels of 0 to i in the entire image, and calculate the average gray level u0; count the gray levels of i to 255 The proportion w1 of the pixels of the whole image, and the average gray level u1 of the background pixels is counted;
3-3:计算前景像素和背景像素的方差g=w0*w1*(u0-u1);3-3: Calculate the variance g=w0*w1*(u0-u1) of foreground pixels and background pixels;
3-4:i++;转到3-2,直到i为256时结束迭代,得到最大g相应的i值;3-4: i++; go to 3-2, end the iteration until i is 256, and get the i value corresponding to the maximum g;
3-5:将3-4得到的i值作为3-2中的迭代开始的阈值,重复步骤3-2、3-3、3-4得到新的图像分割阈值j;3-5: Use the i value obtained in 3-4 as the threshold for the start of the iteration in 3-2, and repeat steps 3-2, 3-3, and 3-4 to obtain a new image segmentation threshold j;
3-6:将图像中灰度级大于j的像素点置为255,低于该阈值的像素点置为0,得到一幅前景与背景分离的图。3-6: Set the pixels whose gray level is greater than j to 255 in the image, and set the pixels below the threshold to 0, to obtain a picture with the foreground and background separated.
所述步骤4的具体步骤为:遍历图像中所有的像素点,判断该像素点八邻域中的右侧三个点是否都为空,如果为空,说明该点为右端点,并将其保存,其中八邻域表示一个像素点相连的邻近的八个方位上的像素点。The specific steps of the step 4 are: traverse all the pixel points in the image, determine whether the three points on the right in the eight neighborhoods of the pixel point are all empty, if it is empty, it means that the point is the right endpoint, and use it as the right endpoint. Save, where the eight neighborhoods represent the adjacent pixels in eight directions connected by a pixel.
所述步骤5的具体步骤为:遍历每一个右端点,选择右端点的八邻域中右侧三个像素点幅值梯度最大的像素点作为潮头线生长的目标点。The specific steps of the step 5 are: traverse each right endpoint, and select the pixel point with the largest amplitude gradient of the three pixel points on the right in the eight neighborhoods of the right endpoint as the target point for the growth of the tide head line.
所述步骤6的具体步骤为:继续筛选得到的目标点的右侧三个像素点,若这三个像素点不存在前景像素点,即像素点像素值不为255,则选择幅值梯度最大的像素点作为下一个潮头线生长的目标点,重复该生长步骤,重复次数可人为设定,涌潮潮头线断裂处间隔越大,可将次数设置地越多。The specific steps of the step 6 are: continue to screen the three pixels on the right side of the target point obtained, if there are no foreground pixels in these three pixels, that is, the pixel value of the pixel is not 255, then select the maximum amplitude gradient. The pixel point of 1 is used as the target point of the next tide line growth, and the growth step is repeated, and the number of repetitions can be set manually.
所述步骤7的具体步骤为:经过图像分割,图像中的前景部分包括涌潮的潮头线以及其他灰度阈值较高的部分,找到图像中的所有轮廓,轮廓就是图像边缘连接起来的一个整体,轮廓面积最大的区域就是涌潮潮头线区域。The specific steps of the step 7 are: after image segmentation, the foreground part in the image includes the tide head line of the tide and other parts with high grayscale thresholds, and all contours in the image are found, and the contour is the one connected by the edges of the image. Overall, the area with the largest contour area is the tidal head line area.
本发明的有益效果在于:The beneficial effects of the present invention are:
本发明针对涌潮纵向像素点变化剧烈的特点选择Sobel算子Gy方向上的卷积模板,此方法更容易识别涌潮潮头线,更大程度避免检测出其他干扰像素点。The present invention selects the convolution template in the Gy direction of the Sobel operator according to the characteristic that the vertical pixel points of the tidal surge change drastically. This method makes it easier to identify the tidal head line and avoids detecting other interfering pixel points to a greater extent.
本发明通过迭代使用OTSU图像分割法,更加精确地分割得到涌潮的潮头线区域,提高涌潮潮头线检测精度。By using the OTSU image segmentation method iteratively, the present invention obtains the tidal head line area of the tidal surge more accurately and improves the detection accuracy of the tidal head line.
本发明根据在涌潮潮头线断裂处筛选右侧邻域中幅值梯度最大的像素点作为生长的目标,更加贴合涌潮潮头线,而并非简单膨胀操作,扩大涌潮潮头线区域,并能够完成断裂间隔较大时涌潮潮头线的连接。The invention selects the pixel points with the largest amplitude gradient in the right neighborhood at the break of the tide head line as the growth target, which is more suitable for the tide head line, rather than a simple expansion operation, and expands the tide head line. area, and can complete the connection of the tidal head line when the fracture interval is large.
附图说明Description of drawings
图1是基于梯度幅值生长的涌潮潮头线连接方法流程图;Fig. 1 is the flow chart of the connection method of tidal head line based on gradient amplitude growth;
图2是Sobel算子模板图;Fig. 2 is Sobel operator template diagram;
图3是潮头线连接并识别效果图;Figure 3 is the effect diagram of the connection and identification of the tide line;
具体实施方式Detailed ways
下面结合附图和具体实施例,进一步阐明本发明。The present invention will be further illustrated below in conjunction with the accompanying drawings and specific embodiments.
步骤1:根据人类视觉对色彩的敏感度不同,将每个像素点的B、G、R通道分别赋予不同的权重系数进行加权求解灰度值,依次作为整个图像的灰度值,计算公式如下式(1)所示:Step 1: According to the different sensitivity of human vision to color, assign different weight coefficients to the B, G, and R channels of each pixel to calculate the gray value by weighting, and then use it as the gray value of the entire image. The calculation formula is as follows Formula (1) shows:
f(u,v)=0.1140*B(u,v)+0.5870*G(u,v)+0.2989*R(u,v) (1)f(u,v)=0.1140*B(u,v)+0.5870*G(u,v)+0.2989*R(u,v) (1)
中值滤波是根据邻域模板将图像中某一点邻域内的像素的灰度值按从小到大的顺序进行排列,并将这些从小到大排列的灰度值计算中值,用它作为这个像素点的灰度值,其处理公式见式(2)所示:The median filter is to arrange the gray values of the pixels in the neighborhood of a certain point in the image in ascending order according to the neighborhood template, and calculate the median value of these gray values arranged from small to large, and use it as the pixel. The gray value of the point, its processing formula is shown in formula (2):
上式中,A为邻域模板窗口,median表示求解中值,f(u,v)为二维数据序列,最终显示效果如图3(a)所示。In the above formula, A is the neighborhood template window, median is the solution median, f(u, v) is the two-dimensional data sequence, and the final display effect is shown in Figure 3(a).
步骤2:Sobel算子主要用于获得数字图像的一阶梯度,常见的应用和物理意义是边缘检测,图像边缘的像素值会发生显著的变化,梯度幅值的大小代表图像中内容的变化程度,首先需要定义一个3*3的卷积核,根据涌潮到来时,涌潮潮头线前后的像素点差距明显的特点,选择卷积核为Sobel算子在Y轴方向上的卷积模板,如图2(a)所示,图2(b)所示Sobel算子适用于在X轴下图像灰度发生剧烈变化的场合,通过该卷积核与原始图片做卷积,得到各像素点纵向的梯度值,该卷积核的作用就是当该像素点上下部分的像素点差距越大,所得结果就越大,也就是梯度幅值越大,越有可能是涌潮的潮头线,由于得到的结果可能为负数或者大于255,因此还需要将数据类型转化为uint8类型,从而会得到一幅像素值在0~255的灰度图像,结果如图3(b)所示。Step 2: The Sobel operator is mainly used to obtain the first-order gradient of a digital image. The common application and physical meaning is edge detection. The pixel value of the image edge will change significantly, and the magnitude of the gradient magnitude represents the degree of change in the content of the image. , First of all, a 3*3 convolution kernel needs to be defined. According to the obvious difference between the pixels before and after the tide head line when the tide arrives, the convolution kernel is selected as the convolution template of the Sobel operator in the Y-axis direction. , as shown in Figure 2(a), the Sobel operator shown in Figure 2(b) is suitable for situations where the image grayscale changes drastically under the X-axis. By convolving the convolution kernel with the original image, each pixel is obtained. The vertical gradient value of the point. The function of the convolution kernel is that when the difference between the upper and lower parts of the pixel is larger, the result is larger, that is, the larger the gradient amplitude, the more likely it is the tide line of the tide. , since the obtained result may be negative or greater than 255, it is also necessary to convert the data type to uint8 type, so that a grayscale image with a pixel value of 0 to 255 will be obtained, as shown in Figure 3(b).
步骤3:该过程是为了得到图像分割的阈值,具体步骤分为以下几步:Step 3: This process is to obtain the threshold value of image segmentation, and the specific steps are divided into the following steps:
3-1:先计算图像的直方图,即将图像所有的像素点按照0~255共256个区域,统计落在每个区域的像素点数量,并归一化直方图3-1: First calculate the histogram of the image, that is, all the pixels of the image are divided into 256 areas from 0 to 255, count the number of pixels falling in each area, and normalize the histogram
3-2:定义一个i表示分类的阈值,从0开始迭代,统计0~i灰度级的像素所占整幅图像的比例w0,并计算其平均灰度u0;统计i~255灰度级的像素所占整幅图像的比例w1,并统计背景像素的平均灰度u1;3-2: Define a threshold where i represents the classification, iterate from 0, count the proportion w0 of the pixels with gray levels of 0 to i in the entire image, and calculate the average gray level u0; count the gray levels of i to 255 The proportion w1 of the pixels of the whole image, and the average gray level u1 of the background pixels is counted;
3-3:计算前景像素和背景像素的方差g=w0*w1*(u0-u1);3-3: Calculate the variance g=w0*w1*(u0-u1) of foreground pixels and background pixels;
3-4:i++;转到3-2,直到i为256时结束迭代,得到最大g相应的i值;3-4: i++; go to 3-2, end the iteration until i is 256, and get the i value corresponding to the maximum g;
3-5:将3-4得到的i值作为3-2中的迭代开始的阈值,重复步骤3-2、3-3、3-4得到新的图像分割阈值;3-5: Use the i value obtained in 3-4 as the threshold for the start of the iteration in 3-2, and repeat steps 3-2, 3-3, and 3-4 to obtain a new image segmentation threshold;
3-6:将图像中大于该阈值的像素点置为255,低于该阈值的像素点置为0,得到一幅前景与背景分离的图,结果如图3(c)所示。3-6: Set the pixel points greater than the threshold in the image to 255, and set the pixels below the threshold to 0, to obtain a picture with the foreground and background separated. The result is shown in Figure 3(c).
步骤4:遍历图像中所有的像素点,判断该像素点8个方向上的邻近的像素点中八右侧三个像素点是否都为背景,即像素值为0,如果为背景,说明该点为右端点,并将其保存。Step 4: Traverse all the pixels in the image, and determine whether the three pixels on the right side of the eight adjacent pixels in the eight directions of the pixel are all backgrounds, that is, the pixel value is 0. If it is the background, it indicates the point. as the right endpoint and save it.
步骤5:遍历每一个右端点,选择右端点的八邻域中右侧三个像素点幅值梯度最大的像素点作为潮头线生长的目标点。Step 5: Traverse each right endpoint, and select the pixel with the largest amplitude gradient of the three pixels on the right in the eight neighborhoods of the right endpoint as the target point for the growth of the tide head line.
步骤6:继续筛选得到的目标点的右邻域中像素点,若其右邻域不存在前景像素点,则选择幅值梯度最大的像素点作为下一个潮头线生长的目标点,重复该生长步骤,重复次数可人为设定,涌潮潮头线断裂处间隔越大,可将次数设置地越多,此次实现将生长次数设为20,结果如图3(d)所示。Step 6: Continue to filter the pixels in the right neighborhood of the obtained target point. If there are no foreground pixels in its right neighborhood, select the pixel with the largest amplitude gradient as the target point for the next tide line growth, and repeat the process. For the growth step, the number of repetitions can be set manually. The larger the interval at the break of the tide head line, the more times the number of times can be set. This time, the number of times of growth is set to 20, and the result is shown in Figure 3(d).
步骤7:经过图像分割,图像中的前景部分包括涌潮的潮头线以及其他灰度阈值较高的部分,找到图像中的所有轮廓,轮廓就是图像边缘连接起来的一个整体,轮廓面积最大的区域就是涌潮潮头线区域,结果如图3(e)所示。Step 7: After image segmentation, the foreground part of the image includes the tide head line of the tide and other parts with high grayscale thresholds, find all the contours in the image, the contour is a whole connected by the edges of the image, and the contour area is the largest. The area is the tidal head line area, and the result is shown in Figure 3(e).
以上是本发明较佳的实施方式,但本发明的保护范围并不仅仅局限在此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,凡依本发明技术方案做变换或替换的,都应涵盖在本发明的保护范围内。因此,本发明的保护范围都应以权利要求的保护范围为准。The above are the preferred embodiments of the present invention, but the protection scope of the present invention is not limited to this. Any person skilled in the art is within the technical scope disclosed by the present invention, and all changes or replacements are made according to the technical solutions of the present invention. should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210472516.0A CN114862726A (en) | 2022-04-29 | 2022-04-29 | Tidal bore tide head line connection method based on gradient amplitude growth |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210472516.0A CN114862726A (en) | 2022-04-29 | 2022-04-29 | Tidal bore tide head line connection method based on gradient amplitude growth |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114862726A true CN114862726A (en) | 2022-08-05 |
Family
ID=82635831
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210472516.0A Pending CN114862726A (en) | 2022-04-29 | 2022-04-29 | Tidal bore tide head line connection method based on gradient amplitude growth |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114862726A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118196128A (en) * | 2024-03-20 | 2024-06-14 | 南京筑卫医学科技有限公司 | A Limited Region Growing Segmentation Method Based on Adaptive Gradient |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0469986A1 (en) * | 1990-07-31 | 1992-02-05 | Thomson-Trt Defense | Process and apparatus for localising and characterizing in real time the singularities of a digitized picture especially for pattern recognition in a scene analysis processing |
US5233670A (en) * | 1990-07-31 | 1993-08-03 | Thomson Trt Defense | Method and device for the real-time localization of rectilinear contours in a digitized image, notably for shape recognition in scene analysis processing |
CN104680498A (en) * | 2015-03-24 | 2015-06-03 | 江南大学 | Medical image segmentation method based on improved gradient vector flow model |
CN113344953A (en) * | 2021-04-21 | 2021-09-03 | 中国计量大学 | Unmanned aerial vehicle-based machine vision tidal bore flow velocity measurement method |
-
2022
- 2022-04-29 CN CN202210472516.0A patent/CN114862726A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP0469986A1 (en) * | 1990-07-31 | 1992-02-05 | Thomson-Trt Defense | Process and apparatus for localising and characterizing in real time the singularities of a digitized picture especially for pattern recognition in a scene analysis processing |
US5233670A (en) * | 1990-07-31 | 1993-08-03 | Thomson Trt Defense | Method and device for the real-time localization of rectilinear contours in a digitized image, notably for shape recognition in scene analysis processing |
CN104680498A (en) * | 2015-03-24 | 2015-06-03 | 江南大学 | Medical image segmentation method based on improved gradient vector flow model |
CN113344953A (en) * | 2021-04-21 | 2021-09-03 | 中国计量大学 | Unmanned aerial vehicle-based machine vision tidal bore flow velocity measurement method |
Non-Patent Citations (1)
Title |
---|
张舒羽: "基于文献计量法的涌潮研究动态分析", 《海洋学研究》, vol. 40, no. 1, 31 March 2022 (2022-03-31), pages 89 - 100 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118196128A (en) * | 2024-03-20 | 2024-06-14 | 南京筑卫医学科技有限公司 | A Limited Region Growing Segmentation Method Based on Adaptive Gradient |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106548463B (en) | Automatic dehazing method and system for sea fog images based on dark channel and Retinex | |
CN101586956B (en) | River water level monitoring method based on monocular camera | |
CN104008553B (en) | Crack detection method with image gradient information and watershed method conflated | |
CN111047583B (en) | Underwater netting system damage detection method based on machine vision | |
Lohani et al. | Application of airborne scanning laser altimetry to the study of tidal channel geomorphology | |
CN113628227B (en) | A method for analyzing coastline changes based on deep learning | |
CN110084129B (en) | Machine vision-based real-time detection method for river floating objects | |
CN108229425A (en) | A kind of identifying water boy method based on high-resolution remote sensing image | |
CN107038416B (en) | A Pedestrian Detection Method Based on Improved HOG Feature of Binary Image | |
CN106228161A (en) | A kind of pointer-type dial plate automatic reading method | |
CN103198479B (en) | SAR image segmentation method based on semantic information classification | |
Osorio et al. | An algorithm for the measurement of shoreline and intertidal beach profiles using video imagery: PSDM | |
CN111476723B (en) | Remote sensing image lost pixel recovery method for failure of Landsat-7 scanning line corrector | |
CN111583272B (en) | An Improved Niblack Infrared Image Segmentation Method Based on Joint Maximum Entropy | |
CN117557765B (en) | Small-target water-float garbage detection method based on APM-YOLOv7 | |
CN106156758B (en) | A kind of tidal saltmarsh method in SAR seashore image | |
CN116563288A (en) | Detection method for threaded hole of gear of automobile engine | |
CN109886221A (en) | Sand dredger recognition methods based on saliency detection | |
CN114862726A (en) | Tidal bore tide head line connection method based on gradient amplitude growth | |
CN109801306A (en) | Tidal creek extracting method based on high score remote sensing image | |
CN112669304A (en) | Pollen detection method based on digital image processing technology | |
CN108765440B (en) | Line-guided superpixel coastline extraction method of single-polarized SAR image | |
CN113592829B (en) | Deep learning sediment particle identification method and device based on segmentation and recombination | |
CN103914840A (en) | Automatic human body contour extracting method for non-simple background | |
CN103886289B (en) | Direction self-adaptive method and system for identifying on-water bridge targets |
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 |