CN118196168A - Method and device for calculating length of dry beach of tailing pond, storage medium and product - Google Patents
Method and device for calculating length of dry beach of tailing pond, storage medium and product Download PDFInfo
- Publication number
- CN118196168A CN118196168A CN202410181042.3A CN202410181042A CN118196168A CN 118196168 A CN118196168 A CN 118196168A CN 202410181042 A CN202410181042 A CN 202410181042A CN 118196168 A CN118196168 A CN 118196168A
- Authority
- CN
- China
- Prior art keywords
- dry beach
- length
- area
- computer program
- dry
- 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
Classifications
-
- 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
-
- 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
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/25—Determination of region of interest [ROI] or a volume of interest [VOI]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/26—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
- G06V10/267—Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion by performing operations on regions, e.g. growing, shrinking or watersheds
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/764—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/70—Arrangements for image or video recognition or understanding using pattern recognition or machine learning
- G06V10/82—Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/10—Terrestrial scenes
- G06V20/13—Satellite images
-
- 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/10—Image acquisition modality
- G06T2207/10024—Color image
-
- 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/20081—Training; Learning
-
- 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/20084—Artificial neural networks [ANN]
-
- 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/20112—Image segmentation details
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Computation (AREA)
- Computing Systems (AREA)
- Artificial Intelligence (AREA)
- Databases & Information Systems (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Astronomy & Astrophysics (AREA)
- Remote Sensing (AREA)
- Geometry (AREA)
- Image Analysis (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及尾矿库运行及安全监测技术领域,特别是涉及一种尾矿库干滩长度计算方法、装置、存储介质及产品。The present invention relates to the technical field of tailings pond operation and safety monitoring, and in particular to a method, device, storage medium and product for calculating the dry beach length of a tailings pond.
背景技术Background technique
尾矿库是矿山生产不可或缺的设施。在矿山生产开采过程中,选矿厂会按照一定的工艺,从原始粗矿中提炼有用的物质,同时会产生大量尾矿废料,尾矿是矿石加工的副产物,而尾矿库是用以堆存矿山生产中尾矿废渣的场所。Tailings ponds are indispensable facilities for mining production. During the mining process, the ore dressing plant will extract useful substances from the original rough ore according to certain processes, and a large amount of tailings waste will be generated at the same time. Tailings are a by-product of ore processing, and the tailings pond is a place to store tailings waste in mining production.
在处理尾矿时,会将尾矿配水后形成尾矿浆,再通过放矿管道运输到尾矿库区进行排放。因为排放的尾矿浆中含有大量水分,再经过沉积后,尾矿库中会形成滩涂区域和水区,滩涂区域又叫干滩区域。干滩线指的是滩涂区域与水区的分界线,干滩长度指的是库区放矿边至滩涂与水域分界线的直线距离。When processing tailings, the tailings will be mixed with water to form tailings slurry, which will then be transported to the tailings pond through the ore discharge pipeline for discharge. Because the discharged tailings slurry contains a large amount of water, after sedimentation, a tidal flat area and a water area will be formed in the tailings pond. The tidal flat area is also called the dry beach area. The dry beach line refers to the boundary between the tidal flat area and the water area, and the dry beach length refers to the straight-line distance from the ore discharge edge of the reservoir area to the boundary between the tidal flat and the water area.
尾矿库干滩长度是衡量尾矿库安全运行的重要指标,若指标超出安全阈值,则可能引发尾矿库库内水位漫顶、尾矿库溃坝等重大安全事故,会对人民的生命财产安全造成威胁,因此准确获取尾矿库干滩长度距离非常重要。The length of the dry beach of the tailings pond is an important indicator for measuring the safe operation of the tailings pond. If the indicator exceeds the safety threshold, it may cause major safety accidents such as water overflowing in the tailings pond and dam collapse, which will pose a threat to the safety of people’s lives and property. Therefore, it is very important to accurately obtain the length of the dry beach of the tailings pond.
现有干滩长度测量技术中,有采用人工安插标杆标尺估算距离的方法;也有利用库区摄像头进行干滩长度估算的方法等等。例如:中国专利(申请号为201710491350.6)公开了一种利用机器视觉进行尾矿库干滩长度测量的方法,在尾矿干滩上设立3个标志杆,3个标志杆在一条直线上,并且该直线与坝体垂直;分别测量3个标志杆之间的距离,及各标志杆到到坝体的距离;利用彩色高清数字摄像头拍摄数字图像,提取出3个标志杆在数字图像中的位置;把数字图像分割成干滩区域和水域区域;根据3个标志杆在数字图像中的位置坐标拟合成一条直线,计算拟合直线上标志杆位置点及边界交点的交比;利用交比不变的性质计算出干滩距离。又例如:中国专利(申请号为201911380099.1)公开了一种基于摄影测量与激光测距的干滩测方法,包括利用远程自动拍照系统,校正工业相机,定期拍摄干滩相片;根据干滩相片,利用水线自动识别算法,精确水线的位置;利用精准控制伺服系统,调整激光测距装置的角度,使得激光测距装置对准所识别到的精确水线位置;激光测距装置自动测量水线到激光镜头的距离,通过几何换算得到干滩长度。又例如:中国专利(申请号为202310264510.9)公开了一种基于深度学习计算尾矿库干滩长度的方法,包括利用训练好的深度学习图像识别模型,识别出图像中的坝和水边线区域,并计算出测量断面处、坝与积水区水边线图像像素距离,得到断面处距离像素比;根据断面处的距离像素比,计算出测量断面处坝体到积水区水边线的距离;计算滩面长度及滩顶水位差的差值;最后根据滩面长度和滩顶水位差计算尾矿库干滩长度。Among the existing dry beach length measurement technologies, there are methods that use manually placed markers to estimate the distance; there are also methods that use cameras in the reservoir area to estimate the dry beach length, etc. For example: A Chinese patent (application number 201710491350.6) discloses a method for measuring the dry beach length of a tailings pond using machine vision, in which three markers are set up on the dry beach of the tailings, and the three markers are in a straight line, and the straight line is perpendicular to the dam body; the distances between the three markers and the distances from each marker to the dam body are measured respectively; a digital image is taken using a color high-definition digital camera, and the positions of the three markers in the digital image are extracted; the digital image is divided into a dry beach area and a water area; a straight line is fitted according to the position coordinates of the three markers in the digital image, and the intersection ratio of the marker position points and the boundary intersection points on the fitted straight line is calculated; the dry beach distance is calculated using the property of the invariant cross ratio. For another example: A Chinese patent (application number 201911380099.1) discloses a dry beach measurement method based on photogrammetry and laser ranging, including using a remote automatic photography system to calibrate an industrial camera and regularly take photos of the dry beach; based on the dry beach photos, using a waterline automatic recognition algorithm to accurately identify the position of the waterline; using a precise control servo system to adjust the angle of the laser ranging device so that the laser ranging device is aligned with the identified precise waterline position; the laser ranging device automatically measures the distance from the waterline to the laser lens, and obtains the dry beach length through geometric conversion. For another example: A Chinese patent (application number 202310264510.9) discloses a method for calculating the dry beach length of a tailings pond based on deep learning, including using a trained deep learning image recognition model to identify the dam and water edge area in the image, and calculate the image pixel distance between the dam and the water edge of the water accumulation area at the measurement section to obtain the distance pixel ratio at the section; according to the distance pixel ratio at the section, calculate the distance from the dam body to the water edge of the water accumulation area at the measurement section; calculate the difference between the beach length and the beach top water level difference; finally, calculate the dry beach length of the tailings pond based on the beach length and the beach top water level difference.
但是以上方法存在计算步骤多,实施过程复杂的缺点,并且仍然需要去现场进行摄像头安装,安插标尺,架设测量仪器等操作,这些步骤易受外部环境影响,需要不少人工操作,受干扰因素较大。However, the above methods have the disadvantages of many calculation steps and complicated implementation process. In addition, it is still necessary to go to the site to install cameras, insert scales, set up measuring instruments, etc. These steps are easily affected by the external environment, require a lot of manual operations, and are greatly affected by interference factors.
因此,为了最大程度上降低外界环境因素影响,同时可以代替人工巡检,提高测量效率和准确度,亟需提供一种新的尾矿库干滩长度计算方法。Therefore, in order to minimize the impact of external environmental factors and replace manual inspections to improve measurement efficiency and accuracy, it is urgent to provide a new method for calculating the dry beach length of tailings ponds.
发明内容Summary of the invention
本发明的目的是提供一种尾矿库干滩长度计算方法、装置、存储介质及产品,最大程度上降低外界环境因素影响,同时可以代替人工巡检,提高测量效率和准确度。The purpose of the present invention is to provide a method, device, storage medium and product for calculating the dry beach length of a tailings pond, which can reduce the influence of external environmental factors to the greatest extent, and at the same time can replace manual inspections and improve measurement efficiency and accuracy.
为实现上述目的,本发明提供了如下方案:To achieve the above object, the present invention provides the following solutions:
一种尾矿库干滩长度计算方法,所述方法包括:A method for calculating the dry beach length of a tailings pond, the method comprising:
利用训练好的深度学习模型Mask R-CNN识别出卫星图像中尾矿库的整个干滩区域;干滩区域是由坝前放矿边、库区边界和干滩水域分割线所围成的多边形区域;The trained deep learning model Mask R-CNN is used to identify the entire dry beach area of the tailings pond in the satellite image; the dry beach area is a polygonal area surrounded by the dam front ore edge, the reservoir boundary and the dry beach water dividing line;
利用图像处理技术对干滩区域进行边缘轮廓检测提取;提取的边缘轮廓包括:坝前放矿边缘轮廓、干滩水域分割线以及库区边界;Image processing technology is used to detect and extract the edge contour of the dry beach area; the extracted edge contours include: the edge contour of the ore discharge in front of the dam, the dry beach water area dividing line and the reservoir area boundary;
利用直线拟合方法将识别出的坝前放矿边缘轮廓拟合成一条直线;The identified edge contour of the dam is fitted into a straight line using the straight line fitting method;
根据干滩水域分割线上的每一像素点到拟合为直线的坝前放矿边的像素距离,得到像素距离的最大值、最小值和平均值;According to the pixel distance from each pixel point on the dry beach water dividing line to the dam front mining edge fitted as a straight line, the maximum, minimum and average values of the pixel distance are obtained;
根据卫星图像分辨率与比例尺将像素距离的最大值、最小值和平均值换算成实际距离,得到尾矿库干滩的最大长度、最小长度和平均长度。According to the resolution and scale of the satellite image, the maximum, minimum and average values of the pixel distance are converted into actual distances to obtain the maximum, minimum and average lengths of the dry beach of the tailings pond.
可选地,所述训练好的深度学习模型Mask R-CNN包括:残差神经网络和特征金字塔网络构成的主干网络、区域建议网络以及感兴趣区域对齐网络。Optionally, the trained deep learning model Mask R-CNN includes: a backbone network consisting of a residual neural network and a feature pyramid network, a region proposal network, and a region of interest alignment network.
可选地,深度学习模型MaskR-CNN的训练过程为:Optionally, the training process of the deep learning model MaskR-CNN is:
利用labelme标识工具对卫星图像中尾矿库干滩区域进行标记;Use labelme to mark the dry beach area of the tailings pond in the satellite image;
标记完成后由labelme生成COCO格式数据集;After labeling is completed, labelme generates a COCO format dataset;
根据COCO格式数据集训练深度学习模型Mask R-CNN。Train the deep learning model Mask R-CNN based on the COCO format dataset.
可选地,边缘轮廓检测提取的方法为canny算法。Optionally, the edge contour detection and extraction method is a Canny algorithm.
可选地,图像处理技术为最小二乘法。Optionally, the image processing technique is a least squares method.
一种计算机装置,包括:存储器、处理器以存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序以实现所述方法的步骤。A computer device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method.
一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现所述方法的步骤。A computer-readable storage medium stores a computer program, which implements the steps of the method when executed by a processor.
一种计算机程序产品,包括计算机程序,该计算机程序/指令被处理器执行时实现所述方法的步骤。A computer program product comprises a computer program, which, when executed by a processor, implements the steps of the method.
根据本发明提供的具体实施例,本发明公开了以下技术效果:According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
本发明所提供的一种尾矿库干滩长度计算方法、装置、存储介质及产品,采用卫星图像和深度学习模型高效识别干滩区域和干滩长度,受外界环境因素干扰较小,有效降低天气、环境等外部因素影响,提高监测效率和准确度;本发明无需现场人工巡检和无人机拍摄,相比于现场视频监控测算干滩长度方法,本发明能够减少摄像头拍摄角度原因所带来的测量误差;本发明采用卫星图像即可,不用现场架设摄像头获取图像,操作方便,后期维护方便,较现有技术简单方便;计算步骤简便、高效;具有较高的工程应用价值。综上,本发明测试效果良好,方案可行。The present invention provides a method, device, storage medium and product for calculating the dry beach length of a tailings pond, which use satellite images and deep learning models to efficiently identify the dry beach area and dry beach length, are less affected by external environmental factors, effectively reduce the impact of external factors such as weather and environment, and improve monitoring efficiency and accuracy; the present invention does not require on-site manual inspections and drone photography, and compared with the on-site video monitoring method for calculating the dry beach length, the present invention can reduce the measurement error caused by the camera shooting angle; the present invention uses satellite images, and does not need to set up cameras on site to obtain images, which is easy to operate and maintain in the later stage, and is simpler and more convenient than the existing technology; the calculation steps are simple and efficient; and it has a high engineering application value. In summary, the test effect of the present invention is good and the solution is feasible.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
图1为本发明所提供的一种尾矿库干滩长度计算方法流程示意图;FIG1 is a schematic flow chart of a method for calculating the dry beach length of a tailings pond provided by the present invention;
图2为本发明所采用的Mask-RCNN网络结构示意图;FIG2 is a schematic diagram of the Mask-RCNN network structure used in the present invention;
图3为本发明识别卫星图像中干滩区域的效果示意图;FIG3 is a schematic diagram showing the effect of the present invention on identifying dry beach areas in satellite images;
图4为本发明对识别后的图像进行灰度处理的效果示意图;FIG4 is a schematic diagram showing the effect of grayscale processing of a recognized image according to the present invention;
图5为本发明对灰度处理的图像进行轮廓提取的效果示意图;FIG5 is a schematic diagram showing the effect of performing contour extraction on a grayscale processed image according to the present invention;
图6为本发明保留放矿边缘与干滩线轮廓的效果示意图;FIG6 is a schematic diagram showing the effect of retaining the contour of the ore drawing edge and the dry beach line of the present invention;
图7为本发明对放矿边缘拟合直线、建立坐标轴、计算干滩线到放矿边直线距离的效果示意图。7 is a schematic diagram showing the effect of the present invention on fitting a straight line to the ore-drawing edge, establishing a coordinate axis, and calculating the straight-line distance from the dry beach line to the ore-drawing edge.
图8为计算机设备的内部结构图。FIG. 8 is a diagram showing the internal structure of a computer device.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
本发明的目的是提供一种尾矿库干滩长度计算方法、装置、存储介质及产品,最大程度上降低外界环境因素影响,同时可以代替人工巡检,提高测量效率和准确度。The purpose of the present invention is to provide a method, device, storage medium and product for calculating the dry beach length of a tailings pond, which can reduce the influence of external environmental factors to the greatest extent, and at the same time can replace manual inspections and improve measurement efficiency and accuracy.
为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图和具体实施方式对本发明作进一步详细的说明。In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
如图1所示,本发明所提供的一种尾矿库干滩长度计算方法,所述方法包括:As shown in FIG1 , the present invention provides a method for calculating the dry beach length of a tailings pond, the method comprising:
S101,利用训练好的深度学习模型MaskR-CNN识别出卫星图像中尾矿库的整个干滩区域;干滩区域是由坝前放矿边、库区边界和干滩水域分割线所围成的多边形区域;S101, using the trained deep learning model MaskR-CNN, identifies the entire dry beach area of the tailings pond in the satellite image; the dry beach area is a polygonal area surrounded by the dam front ore edge, the reservoir boundary and the dry beach water dividing line;
如图2所示,Mask R-CNN是一个实例分割(Instance segmentation)算法,可以用来做“目标检测”、“目标实例分割”、“目标关键点检测”。它是一种在有效检测目标的同时输出高质量的实例分割mask,是对Faster R-CNN的扩展,在Faster R-CNN基础上增加了一个预测分割mask的分支。Mask R-CNN在实例分割、目标检测、人体关键点检测等任务都取得了优异的效果。Mask R-CNN主流框架有PyTorch和Tensorflow,常见的Mask R-CNN数据集格式有COCO、PascalVOC等等。本发明所采用的深度学习框架基于Tensorflow和Keras,数据集格式为COCO。As shown in Figure 2, Mask R-CNN is an instance segmentation algorithm that can be used for "target detection", "target instance segmentation", and "target key point detection". It is an extension of Faster R-CNN that outputs high-quality instance segmentation masks while effectively detecting targets. It adds a branch for predicting segmentation masks based on Faster R-CNN. Mask R-CNN has achieved excellent results in tasks such as instance segmentation, target detection, and human key point detection. The mainstream frameworks of Mask R-CNN are PyTorch and Tensorflow, and common Mask R-CNN dataset formats include COCO, PascalVOC, and so on. The deep learning framework used in the present invention is based on Tensorflow and Keras, and the dataset format is COCO.
训练好的深度学习模型MaskR-CNN包括:残差神经网络和特征金字塔网络构成的主干网络、区域建议网络以及感兴趣区域对齐网络。The trained deep learning model MaskR-CNN includes: a backbone network consisting of a residual neural network and a feature pyramid network, a region proposal network, and a region of interest alignment network.
主干网络中的ResNet(残差神经网络)和FPN(特征金字塔网络),对输入图像进行特征提取,生成特征图(Feature Maps);区域建议网络(RPN),RPN生成锚框提取可能含有目标信息的区域,生成不同大小的建议框;ROIAlign(感兴趣区域对齐网络)将上一步骤中不同大小的建议框调整为统一尺寸,便于后续检测框定位与分类;将统一尺寸的建议框分别输入mask分支与检测框分支,分别生成目标物掩码与检测框及其分类。本发明采用的深度学习框架为Tensorflow,它是由2015年谷歌推出的机器学习开源工具,编程接口支持Python和C++,是当前最流行的深度学习框架之一。本发明采用的数据集训练集格式为COCO;编程语言为Python。The ResNet (residual neural network) and FPN (feature pyramid network) in the backbone network extract features from the input image and generate feature maps; the region proposal network (RPN) generates anchor frames to extract areas that may contain target information and generates proposal frames of different sizes; ROIAlign (region of interest alignment network) adjusts the proposal frames of different sizes in the previous step to a uniform size to facilitate subsequent detection frame positioning and classification; the uniform-sized proposal frames are input into the mask branch and the detection frame branch respectively to generate the target mask and detection frame and their classification. The deep learning framework used in the present invention is Tensorflow, which is an open source machine learning tool launched by Google in 2015. The programming interface supports Python and C++ and is one of the most popular deep learning frameworks. The training set format of the data set used in the present invention is COCO; the programming language is Python.
训练深度学习模型Mask R-CNN所需要的卫星图像,可使用谷歌地球、高德地图、百度地图等地图软件中获取。图像为三通道的RGB图像。The satellite images required for training the deep learning model Mask R-CNN can be obtained using map software such as Google Earth, Amap, and Baidu Map. The images are three-channel RGB images.
深度学习模型Mask R-CNN的训练过程为:The training process of the deep learning model Mask R-CNN is:
S110,利用labelme标识工具对卫星图像中尾矿库干滩区域进行标记;S110, labeling the dry beach area of the tailings pond in the satellite image using the labelme identification tool;
标注具体步骤为:打开labelme软件,选择待标注的图片,点击左侧项目栏中CreatePolygons按钮开始绘制多边形,将图片中干滩区域沿着边界进行绘制;将鼠标放置在第一个点上,点击第二个点时会自动闭合这两点之间的边界,将干滩区域边界绘制一圈成封闭图形后,会自动弹出类别框,自定义类别后,点击保存即可,保存后自动生成对应的json数据;重复以上步骤直到标注完成所有数据集。The specific steps for labeling are as follows: open the labelme software, select the picture to be labeled, click the CreatePolygons button in the project bar on the left to start drawing polygons, and draw the dry beach area in the picture along the boundary; place the mouse on the first point, and click the second point to automatically close the boundary between the two points. After drawing a circle around the dry beach area boundary into a closed figure, the category box will automatically pop up. After customizing the category, click Save. After saving, the corresponding json data will be automatically generated; repeat the above steps until all data sets are labeled.
S111,标记完成后由labelme生成COCO格式数据集;S111, after labeling, labelme generates a COCO format dataset;
最后打开labelme软件所自带的json转换文件,找到并运行json_to_dataset.py,即可生成COCO格式,完成数据集的制作。Finally, open the json conversion file that comes with the labelme software, find and run json_to_dataset.py to generate the COCO format and complete the production of the dataset.
S112,根据COCO格式数据集训练深度学习模型MaskR-CNN。S112, train the deep learning model MaskR-CNN based on the COCO format dataset.
COCO格式数据集由图像标记工具labelme生成,使用labelme软件对采集的卫星图像进行一一标注,标注出图像中的干滩区域,将标注好的图像作为图像训练集;图像数量在300张左右即可,数量越多,模型预测越精准。The COCO format dataset is generated by the image labeling tool labelme. The collected satellite images are labeled one by one using the labelme software, and the dry beach areas in the images are marked. The labeled images are used as the image training set. The number of images can be around 300. The more images there are, the more accurate the model prediction will be.
将标注完成的图像训练集输入到Mask RCNN网络进行训练,每个epoch的训练步数设为1000,每个epoch的验证步数设为100,过滤RPNproposals的阈值设为0.7,设置学习率为0.001,权重衰减设为0.0001,训练100轮。The labeled image training set is input into the Mask RCNN network for training. The number of training steps for each epoch is set to 1000, the number of verification steps for each epoch is set to 100, the threshold for filtering RPN proposals is set to 0.7, the learning rate is set to 0.001, the weight decay is set to 0.0001, and the training is performed for 100 rounds.
如果发现准确率达不到预期或者训练过拟合,可调节训练次数、调整参数设置以及扩充数据集进行改善。If you find that the accuracy is not as expected or the training is overfitting, you can adjust the number of training times, adjust parameter settings, and expand the data set to improve it.
在训练完成后,会生成训练模型权重,在计算机中,训练模型权重表现为一个文件,后续的预测,网络会以该训练权重文件为核心,对待预测图像进行预测。After the training is completed, the training model weights will be generated. In the computer, the training model weights are represented as a file. For subsequent predictions, the network will use the training weight file as the core to predict the image to be predicted.
如附图3所示,将待预测图像输入Mask RCNN网络,网络会自动对图像中尾矿库干滩区域进行识别,并生成识别结果,干滩区域会由红色mask掩码覆盖。As shown in Figure 3, the image to be predicted is input into the Mask RCNN network. The network will automatically identify the dry beach area of the tailings pond in the image and generate a recognition result. The dry beach area will be covered by a red mask.
S102,利用图像处理技术对干滩区域进行边缘轮廓检测提取;提取的边缘轮廓包括:坝前放矿边缘轮廓、干滩水域分割线以及库区边界;S102, using image processing technology to detect and extract edge contours of the dry beach area; the extracted edge contours include: the edge contour of the ore discharge in front of the dam, the dry beach water area dividing line and the reservoir area boundary;
对识别完成后的卫星图像,运用灰度处理和canny算法,对干滩区域进行轮廓提取;具体步骤如下:第一步,进行灰度处理,导入cv2和numpy库;首先加载识别后的图像(本发明采用Mask R-CNN模型所识别出的干滩区域默认为红色区域,因此后续所给出的图像处理方法,是针对于红色区域进行轮廓提取;若图像识别结果显示区域设置为其他颜色,则定义相应HSV颜色空间范围即可),将图像转换为HSV颜色空间;其次定义红色范围上下界,创建掩膜,其余区域设置为黑色;最后通过按位与操作将干滩的红色识别区域提取出来,其余背景变为黑色。第二步,进行边缘轮廓提取处理,采用cv2和numpy库;首先加载图像,将图像转换为HSV颜色空间;其次在HSV空间中定义红色范围;创建遮罩层,将红色部分设置为白色,其余部分为黑色;采用双阈值追踪确定边界,提取出区域边缘轮廓,即为尾矿库干滩区域轮廓。最后显示为白色的干滩区域轮廓线,其余为黑色背景。For the satellite image after identification, grayscale processing and canny algorithm are used to extract the contour of the dry beach area; the specific steps are as follows: the first step is to perform grayscale processing and import cv2 and numpy libraries; first load the identified image (the dry beach area identified by the Mask R-CNN model in this invention is a red area by default, so the image processing method given later is to extract the contour of the red area; if the image recognition result shows that the area is set to other colors, define the corresponding HSV color space range), convert the image to HSV color space; secondly, define the upper and lower limits of the red range, create a mask, and set the remaining areas to black; finally, extract the red identification area of the dry beach through bitwise AND operation, and the rest of the background becomes black. The second step is to perform edge contour extraction processing, using cv2 and numpy libraries; first load the image and convert it to HSV color space; secondly define the red range in HSV space; create a mask layer, set the red part to white, and the rest to black; use double threshold tracking to determine the boundary, and extract the edge contour of the area, which is the contour of the dry beach area of the tailings pond. Finally, the contour line of the dry beach area is displayed as white, and the rest is a black background.
如附图4所示,对上述7中预测完成的图像,进行图像灰度处理,对于识别出的干滩红色掩码区域进行保留,对其余背景部分作灰度处理,不再保留,变为黑色。As shown in FIG. 4 , the image predicted in the above 7 is subjected to image grayscale processing, the identified red mask area of the dry beach is retained, and the remaining background parts are subjected to grayscale processing and are no longer retained but turned into black.
进行灰度处理时,采用cv2和numpy库。首先加载图像,When performing grayscale processing, cv2 and numpy libraries are used. First, load the image.
将图像转换为HSV颜色空间;其次定义红色范围上下界,创建掩膜,其余区域设置为黑色;最后通过按位与操作将红色识别区域提取出来,其余背景变为黑色。Convert the image to HSV color space; define the upper and lower bounds of the red range, create a mask, and set the rest of the area to black; finally, extract the red identification area through a bitwise AND operation, and turn the rest of the background to black.
如附图5所示,对上述9中提取出的干滩区域,作进一步处理,对其进行边缘轮廓的提取处理。As shown in FIG. 5 , the dry beach area extracted in 9 above is further processed to extract its edge contour.
进行边缘轮廓提取处理时,采用cv2和numpy库。首先加载图像,将图像转换为HSV颜色空间;其次在HSV空间中定义红色范围;创建遮罩层,将红色部分设置为白色,其余部分为黑色;最后运用canny边缘检测算法,提取出区域边缘轮廓,即为尾矿库干滩区域轮廓。最后显示为白色的干滩区域轮廓线,其余为黑色背景。When performing edge contour extraction, cv2 and numpy libraries are used. First, load the image and convert it to HSV color space; second, define the red range in HSV space; create a mask layer, set the red part to white and the rest to black; finally, use the canny edge detection algorithm to extract the regional edge contour, which is the dry beach area contour of the tailings pond. Finally, the dry beach area contour line is displayed as white, and the rest is a black background.
如附图6所示,去掉周围多余轮廓线,仅留下放矿边和干滩线,方法较多,采用python编程、matlab编程、图像处理器等皆可。As shown in Figure 6, the surrounding redundant contour lines are removed, leaving only the mining edge and the dry beach line. There are many methods, such as python programming, matlab programming, image processor, etc.
S103,利用直线拟合方法将识别出的坝前放矿边缘轮廓拟合成一条直线;S103, using a straight line fitting method to fit the identified edge contour of the dam front ore drawing into a straight line;
对放矿边的线条采用最小二乘法对直线进行拟合,具体步骤为:首先对放矿边线条轮廓进行像素点坐标提取,因放矿边的最终轮廓显示为白色,所以定义函数np.where(threshold==255),返回一个包含白色点坐标的元组,接着通过索引操作获取行索引数组和列索引数组,即可得到坐标信息;接着采用np.polyfit函数对所获取的数据点进行直线拟合,最后采用np.poly1d函数创建多项式对象,即可拟合出一条直线。The least squares method is used to fit a straight line to the line of the mining edge. The specific steps are as follows: first, the pixel coordinates of the mining edge line contour are extracted. Because the final contour of the mining edge is displayed in white, the function np.where(threshold == 255) is defined to return a tuple containing the coordinates of the white points. Then, the row index array and column index array are obtained through indexing operations to obtain the coordinate information; then, the np.polyfit function is used to fit the obtained data points to a straight line. Finally, the np.poly1d function is used to create a polynomial object to fit a straight line.
如附图7所示,采用最小二乘法对坝前放矿边缘进行直线拟合。As shown in Figure 7, the least square method is used to perform a straight line fitting on the ore edge in front of the dam.
S104,根据干滩水域分割线上的每一像素点到拟合为直线的坝前放矿边的像素距离,得到像素距离的最大值、最小值和平均值;S104, obtaining the maximum value, minimum value and average value of the pixel distances from each pixel point on the dry beach water area dividing line to the dam front ore placement edge fitted as a straight line;
遍历干滩水域分割曲线上的每一像素点,计算每一像素点到拟合完成后的直线的距离。Traverse each pixel point on the dry beach water segmentation curve and calculate the distance from each pixel point to the straight line after fitting.
S105,根据卫星图像分辨率与比例尺将像素距离的最大值、最小值和平均值换算成实际距离,得到尾矿库干滩的最大长度、最小长度和平均长度。S105, converting the maximum value, minimum value and average value of the pixel distance into actual distance according to the resolution and scale of the satellite image, and obtaining the maximum length, minimum length and average length of the dry beach of the tailings pond.
采用的图像为16级卫星图,图像分辨率为72dpi,像素为118,图上距离为4.16cm,实际距离为500m,比例尺为12000:1;根据比例尺信息,将图像中干滩的像素距离换算为实际距离,得到干滩长度实际距离。The image used is a 16-level satellite image with an image resolution of 72dpi, 118 pixels, an on-image distance of 4.16cm, an actual distance of 500m, and a scale of 12000:1. Based on the scale information, the pixel distance of the dry beach in the image is converted into the actual distance to obtain the actual distance of the dry beach length.
综上所述,本发明方法具备以下特点:1.适应性好,受外界环境干扰因素小。2.方便监测和评估数据。3.后期运行及维护方便。4.操作简单,适合企业技术人员进行操作。In summary, the method of the present invention has the following characteristics: 1. Good adaptability and little interference from external environmental factors. 2. Convenient for monitoring and evaluating data. 3. Convenient for later operation and maintenance. 4. Simple operation, suitable for enterprise technicians to operate.
在一个实施例中,提供了一种计算机装置,计算机装置可以是数据库,其内部结构图可以如图8所示。该计算机设备包括处理器、存储器、输入/输出接口(Input/Output,简称I/O)和通信接口。其中,处理器、存储器和输入/输出接口通过系统总线连接,通信接口通过输入/输出接口连接到系统总线。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质和内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储待处理事务。该计算机设备的输入/输出接口用于处理器与外部设备之间交换信息。该计算机设备的通信接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种数据处理方法。In one embodiment, a computer device is provided, which may be a database, and its internal structure diagram may be shown in FIG8. The computer device includes a processor, a memory, an input/output interface (Input/Output, referred to as I/O) and a communication interface. The processor, the memory and the input/output interface are connected via a system bus, and the communication interface is connected to the system bus via the input/output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store pending transactions. The input/output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a data processing method is implemented.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述各方法实施例中的步骤。In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
在一个实施例中,提供了一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现上述各方法实施例中的步骤。In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
需要说明的是,本申请所涉及的对象信息(包括但不限于对象设备信息、对象个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经对象授权或者经过各方充分授权的信息和数据,且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准。It should be noted that the object information (including but not limited to object device information, object personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the object or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-OnlyMemory,ROM)、磁带、软盘、闪存、光存储器、高密度嵌入式非易失性存储器、阻变存储器(ReRAM)、磁变存储器(Magnetoresistive RandomAccess Memory,MRAM)、铁电存储器(Ferroelectric RandomAccess Memory,FRAM)、相变存储器(Phase Change Memory,PCM)、石墨烯存储器等。易失性存储器可包括随机存取存储器(RandomAccess Memory,RAM)或外部高速缓冲存储器等。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static RandomAccessMemory,SRAM)或动态随机存取存储器(Dynamic Random AccessMemory,DRAM)等。本申请所提供的各实施例中所涉及的数据库可包括关系型数据库和非关系型数据库中至少一种。非关系型数据库可包括基于区块链的分布式数据库等,不限于此。本申请所提供的各实施例中所涉及的处理器可为通用处理器、中央处理器、图形处理器、数字信号处理器、可编程逻辑器、基于量子计算的数据处理逻辑器等,不限于此。Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处。综上所述,本说明书内容不应理解为对本发明的限制。This article uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only used to help understand the method and core ideas of the present invention. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410181042.3A CN118196168A (en) | 2024-02-18 | 2024-02-18 | Method and device for calculating length of dry beach of tailing pond, storage medium and product |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410181042.3A CN118196168A (en) | 2024-02-18 | 2024-02-18 | Method and device for calculating length of dry beach of tailing pond, storage medium and product |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118196168A true CN118196168A (en) | 2024-06-14 |
Family
ID=91402554
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410181042.3A Pending CN118196168A (en) | 2024-02-18 | 2024-02-18 | Method and device for calculating length of dry beach of tailing pond, storage medium and product |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118196168A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119478424A (en) * | 2025-01-14 | 2025-02-18 | 中国四维测绘技术有限公司 | Tailings pond dry beach length identification method, device, computer equipment, and storage medium |
-
2024
- 2024-02-18 CN CN202410181042.3A patent/CN118196168A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN119478424A (en) * | 2025-01-14 | 2025-02-18 | 中国四维测绘技术有限公司 | Tailings pond dry beach length identification method, device, computer equipment, and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN116994140B (en) | Cultivated land extraction method, device, equipment and medium based on remote sensing image | |
CN103400151B (en) | The optical remote sensing image of integration and GIS autoregistration and Clean water withdraw method | |
CN105139395B (en) | SAR image segmentation method based on small echo pond convolutional neural networks | |
CN110084817B (en) | Production method of digital elevation model based on deep learning | |
CN111914767B (en) | A method and system for detecting scattered and polluted enterprises based on multi-source remote sensing data | |
CN108932496A (en) | The quantity statistics method and device of object in region | |
CN112990085B (en) | Method and device for detecting change of culture pond and computer readable storage medium | |
CN112801227B (en) | Typhoon identification model generation method, device, equipment and storage medium | |
CN112926694A (en) | Method for automatically identifying pigs in image based on improved neural network | |
CN115829995A (en) | Cloth flaw detection method and system based on pixel-level multi-scale feature fusion | |
CN116052094B (en) | Ship detection method, system and computer storage medium | |
CN116030453A (en) | An identification method, device and equipment for a digital electric meter | |
CN110889840A (en) | Validity Detection Method of Gaofen-6 Remote Sensing Satellite Data Oriented to Ground Objects | |
CN118196168A (en) | Method and device for calculating length of dry beach of tailing pond, storage medium and product | |
CN116630352B (en) | A core measurement method and device based on bidirectional cascade pixel difference network | |
CN117392651A (en) | Intelligent identification method for arc-shaped display instrument of nuclear power plant main control room | |
CN118172553A (en) | Water gauge water level line detection method based on large model image segmentation | |
CN103743750A (en) | Method for generating distribution diagram of surface damage of heavy calibre optical element | |
CN112287895A (en) | Model construction method, recognition method and system for river drain outlet detection | |
CN116433596A (en) | Slope vegetation coverage measuring method and device and related components | |
CN114913424A (en) | Improved U-net model based collapsing extraction method and system | |
CN112053407B (en) | Automatic lane line detection method based on AI technology in traffic law enforcement image | |
CN112818836A (en) | Personnel target detection method and system for transformer substation scene | |
CN112598055A (en) | Helmet wearing detection method, computer-readable storage medium and electronic device | |
CN117746252A (en) | A landslide detection method based on improved lightweight YOLOv7 |
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 |