A snow depth monitoring method based on machine vision

The machine vision-based snow depth monitoring method improves automation and reduces costs by using image processing to measure snow depth efficiently and accurately with a fixed camera and scale, addressing the limitations of current manual and automated methods.

CN111724403BActive Publication Date: 2024-12-24CHENGDU RUNLIAN TECH DEV +1

Patent Information

Application Number
CN202010214715.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-03-24
Publication Date
2024-12-24
Estimated Expiration
2040-03-24

AI Technical Summary

Technical Problem

Current snow depth measurement methods, whether manual or automated, suffer from low automation, high cost, and inconvenient operation, making real-time detection challenging.

Method used

A snow depth monitoring method based on machine vision using image processing techniques, involving image capture, grayscale conversion, binarization, contour extraction, and pixel conversion to measure snow depth with a fixed camera and a snow detection scale.

Benefits of technology

This method enhances automation, reduces labor and hardware costs, and enables easy operation for continuous snow depth measurement, offering a practical and efficient alternative to existing methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111724403B_ABST
    Figure CN111724403B_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of meteorological monitoring, and discloses a snow depth monitoring method based on machine vision, that is, after obtaining a field shot picture collected by a fixed camera whose lens faces a snow detection scale, the real exposed length of a black scale is measured by sequentially starting image processing methods such as image clipping, image graying and binarization, contour extraction and pixel conversion, and finally the real snow depth is obtained based on the real exposed length, thereby achieving the purpose of automatically measuring the snow depth. Therefore, compared with the existing manual measurement method, on the one hand, the measurement efficiency can be greatly improved, and the labor cost can be reduced, and the method has the advantage of a high degree of automation; on the other hand, since only a black scale, a camera and a computer device need to be arranged to realize the invention of the invention, the hardware cost and maintenance cost can be greatly reduced, and after a simple initialization setting, continuous automatic measurement can be performed, and the method also has the advantage of easy operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of meteorological monitoring, and in particular relates to a snow depth monitoring method based on machine vision. Background Art

[0002] Machine vision is a comprehensive technology, including image processing, mechanical engineering technology, control, electric light source lighting, optical imaging, sensors, analog and digital video technology and computer hardware and software technology (image enhancement and analysis algorithms, image cards, I / O cards, etc.), so a typical machine vision application system includes image capture, light source system, image digitization module, digital image processing module, intelligent judgment and decision module and mechanical control execution module. The most basic feature of the machine vision system is to improve the flexibility and automation of production, so that in some dangerous working environments that are not suitable for manual operation or where artificial vision cannot meet the requirements, machine vision can be used to replace artificial vision, and in large-scale repetitive industrial production processes, machine vision detection methods can be used to greatly improve production efficiency and automation.

[0003] Snow is the snow layer covering the surface of land and sea ice. According to the regulations of China's meteorological department, the area covered by the snow layer reaches more than half of the visible area of ​​the place. Snow depth refers to the vertical distance from the snow surface to the ground. It is a value that accumulates and changes as the snow deepens. Snow has a great impact on the environment where humans live, so the depth of snow is an important meteorological observation object. At present, the main method of measuring the depth of snow is to use a snow ruler for manual field measurement. The snow ruler is made of wood, about 100 cm long, 4 cm wide, and 2 cm thick. The surface is painted and there are centimeter divisions on the ruler. The bottom 5 cm of the ruler is cut into a prism shape so that it can be inserted into the snow during observation. This measurement method has a low degree of automation and is not conducive to real-time detection of snow depth.

[0004] In addition to manual measurement methods, snow depth can also be measured using automated instruments based on lasers or ultrasound. Currently, there are many types of automated snow depth meters available on the market, but these automated instruments are expensive to manufacture and maintain, and are inconvenient to operate. Summary of the invention

[0005] In order to solve the problems of low automation of manual measurement and high cost and inconvenient operation of automated instrument measurement in current snow depth measurement technology, the present invention aims to provide a new snow depth monitoring method based on machine vision.

[0006] The technical solution adopted by the present invention is:

[0007] A snow depth monitoring method based on machine vision comprises the following steps:

[0008] S100. Reading a picture taken on site, wherein the picture taken on site is collected by a fixed camera whose lens is facing the snow detection scale, and the snow detection scale includes a black scale;

[0009] S101. According to the pre-configured first RIO area, a first ruler image corresponding to the whole body range of the black ruler is cut out from the live picture;

[0010] S102. Converting the first scale image into a grayscale image, and then performing binarization processing to obtain a binary image;

[0011] S103. Extract the outline of the binary image, take the outline of the largest black part as the exposed outline of the black ruler, and then obtain the corresponding minimum circumscribed rectangle according to the exposed outline of the black ruler;

[0012] S104. Obtain the length and width data of the minimum circumscribed rectangle, and then obtain the actual exposed length of the black ruler according to the longitudinal length of the minimum circumscribed rectangle;

[0013] S105. Calculate the actual snow depth L according to the following formula snow :L snow =L total -L nake , where L total is the total length of the black ruler, L nake The actual exposed length of the black ruler.

[0014] Optimally, after step S102 and before step S103, the following step is also included: performing morphological operation on the black part in the binary image, wherein the morphological operation includes any one of dilation operation, erosion operation, opening operation and closing operation or any combination of them in any order.

[0015] Optimized, in the step of obtaining the real exposed length of the black ruler according to the longitudinal length of the minimum circumscribed rectangle, the following steps are included: firstly obtaining the total number of pixel points reflecting the longitudinal length, and then calculating the real exposed length L of the black ruler according to the following formula: nake :L nake =N / l, wherein N is the total number of pixels reflecting the longitudinal length, and l is the actual size determined during initialization and corresponding to a single pixel.

[0016] Specifically, during initialization, the real size of a single pixel is determined in the following manner: for an artificially selected on-site photo in which no snow covers the black ruler, the minimum circumscribed rectangle corresponding to the full body contour of the black ruler is obtained in a manner consistent with steps S100 to S103, and then the total length of the black ruler is divided by the total number of longitudinal pixels of the minimum circumscribed rectangle to obtain the real size of a single pixel.

[0017] Specifically, after step S104 and before step S105, the following step is further included: using the correction formula set during initialization to correct the actual exposed length of the black ruler.

[0018] Optimally, after step S105, the following steps are also included: saving the obtained actual snow depth into a database / and outputting it to a human-computer interaction interface.

[0019] Optimally, if the snow detection scale also includes a red scale, the following steps are included after step S100:

[0020] S201. According to the pre-configured second RIO area, a second ruler image corresponding to the whole body range of the red scale ruler is cut out from the live picture;

[0021] S202. converting the second scale image into an HSV channel image, and then retaining only the red part of the HSV channel image based on the value range of red;

[0022] S203. Extract the contour of the HSV channel image, and use the obtained red part contour as the exposed scale line of the red scale ruler;

[0023] S204. Count the total number of exposed tick marks;

[0024] S205. Calculate the snow verification depth L′ according to the following formula snow :L′ snow =L′ total -M*c, where L′ total is the total length of the red scale ruler, M is the total number of exposed scale lines, and c is the minimum scale value of the red scale ruler.

[0025] Further optimization is performed after step S202 and before step S203, and the following step is also included: performing a morphological operation on the red part of the HSV channel image, wherein the morphological operation includes any one of a dilation operation, an erosion operation, an opening operation and a closing operation, or any combination of these operations in any order.

[0026] Further optimized, step S203 includes the following steps:

[0027] S2031. Obtain the corresponding minimum bounding rectangle for each red portion contour obtained, and then perform elimination processing in the following manner (A) and / or (B):

[0028] (A) If the area of ​​the minimum circumscribed rectangle is smaller than the first threshold, the corresponding red part is removed;

[0029] (B) if the aspect ratio of the minimum circumscribed rectangle is less than the second threshold, the corresponding red part is removed;

[0030] S2032. Use the remaining red outline as the exposed scale lines of the red scale ruler.

[0031] Specifically, after step S2032, the following steps are also included: drawing the corresponding circumscribed rectangles of each red part in the HSV channel image, and then saving the HSV channel image, the total number of exposed scale lines and / or the snow verification depth into a database and / or outputting it to a human-computer interaction interface.

[0032] The beneficial effects of the present invention are:

[0033] (1) The present invention provides a snow depth monitoring method based on existing image processing technology to achieve image measurement, that is, after obtaining a live shot picture collected by a fixed camera with a lens facing the snow detection scale, the real exposed length of the black scale is measured by sequentially starting image processing methods such as image clipping, image graying and binarization, contour extraction and pixel conversion, and finally the real snow depth is obtained based on the real exposed length, thereby achieving the purpose of automatically measuring the snow depth. On the one hand, compared with the existing manual measurement method, the measurement efficiency can be greatly improved and the labor cost can be reduced, and it has the advantage of a high degree of automation; on the other hand, compared with the automated instrument using laser or ultrasonic wave, only one black scale, one camera and one computer device are required to realize the present invention, which can greatly reduce the hardware cost and maintenance cost, and after a simple initialization setting, continuous automatic measurement can be performed, and it also has the advantage of easy operation;

[0034] (2) After obtaining the on-site pictures captured by a fixed camera with its lens facing the snow detection scale, image processing methods such as image cropping, image HSV channelization, contour extraction and contour statistics can be started in sequence to obtain the snow depth marked with a red scale, thereby achieving the purpose of automatically measuring the snow depth. The snow depth independently measured by the above method can be used as a verification parameter for the actual snow depth, so that users can make choices, which is further convenient and practical. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] 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 or the description of the prior art 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 work.

[0036] Figure 1 It is a flow chart of the first snow depth monitoring method based on machine vision provided by the present invention.

[0037] Figure 2 This is an example diagram of the processing process of the first scale image provided by the present invention.

[0038] Figure 3 It is a flow chart of a second snow depth monitoring method based on machine vision provided by the present invention.

[0039] Figure 4 This is an example diagram of the processing process of the second scale image provided by the present invention. DETAILED DESCRIPTION

[0040] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments. It should be noted that although the description of these embodiments is used to help understand the present invention, it does not constitute a limitation of the present invention. The specific structures and functional details disclosed herein are only used to describe the exemplary embodiments of the present invention. However, the present invention can be embodied in many alternative forms, and it should not be understood that the present invention is limited to the embodiments set forth herein.

[0041] It should be understood that although the terms first, second, etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are only used to distinguish one unit from another unit. For example, a first unit can be referred to as a second unit, and similarly, a second unit can be referred to as a first unit without departing from the scope of the exemplary embodiments of the present invention.

[0042] It should be understood that the term "and / or" that may appear in this article is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, B exists alone, and A and B exist at the same time. The term " / and" that may appear in this article describes another type of association object relationship, indicating that two relationships may exist. For example, A / and B can represent two situations: A exists alone, and A and B exist alone. In addition, the character " / " that may appear in this article generally indicates that the previous and next associated objects are in an "or" relationship.

[0043] It should be understood that when an element is referred to herein as being "connected," "connected," or "coupled" to another element, it can be directly connected or coupled to the other element, or intermediate elements can exist. Conversely, when an element is referred to herein as being "directly connected" or "directly coupled" to another element, no intermediate elements are present. Additionally, other words used to describe the relationship between elements (e.g., "between" versus "directly between," "adjacent" versus "directly adjacent," etc.) should be interpreted in a similar manner.

[0044] It should be understood that the terms used herein are only used to describe specific embodiments and are not intended to limit the exemplary embodiments of the present invention. As used herein, the singular forms "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that when the terms "include", "comprises", "includes", and / or "comprising" are used herein, they specify the existence of the claimed features, integers, steps, operations, units, and / or components, and do not exclude the existence or addition of one or more other features, quantities, steps, operations, units, components, and / or their combinations.

[0045] It should be understood and also noted that in some alternative embodiments, the functions / actions that appear may be different from the order in which the figures appear. For example, depending on the functions / actions involved, two figures shown in succession may actually be performed substantially concurrently, or may sometimes be performed in the reverse order.

[0046] It should be understood that in the following description, specific details are provided to facilitate a complete understanding of the example embodiments. However, it should be understood by those of ordinary skill in the art that the example embodiments can be implemented without these specific details. For example, the system can be shown in a block diagram to avoid obscuring the example with unnecessary details. In other examples, well-known processes, structures, and techniques may not be shown in unnecessary detail to avoid obscuring the example embodiments.

[0047] Embodiment 1

[0048] like Figures 1-2 As shown, the machine vision-based snow depth monitoring method provided in this embodiment may include but is not limited to the following steps S100 to S105.

[0049] S100. Reading pictures taken on site, wherein the pictures taken on site are collected by a fixed camera whose lens faces a snow detection scale, and the snow detection scale includes a black scale.

[0050] In step S100, the reading location of the on-site pictures can be the folder selected by the user during initialization, preferably the folder corresponding to the fixed camera and used for automatically saving the pictures. Therefore, before step S100, a subthread can be started to monitor the folder to determine whether a new file is created, a file is modified, or a file is deleted. If a new file is found to be generated in the folder and the new file is a picture file, step S100 can be started to perform the subsequent image processing process. Since the lens of the fixed camera is facing the snow detection scale (i.e., neither looking up, nor looking down, nor looking sideways, otherwise there may be local deformation of the scale image, which will affect the measurement result even if the correction algorithm is used), it is possible to batch collect on-site pictures with the same viewing angle for subsequent precise cutting and measurement calculation. The fixed camera can be implemented with a conventional camera to reduce costs. The snow detection scale needs to stand vertically on the ground so as to serve as a reference for measuring the snow depth. The black scale is used to provide a black reference surface. It may not have scale lines and corresponding scale values, but it needs to have a total length of the whole body, which needs to be manually input during initialization. In addition, the distance between the lens and the snow detection scale needs to be moderate, which can ensure that the whole body of the snow detection scale can be captured, and the total number of pixels occupied by the scale is as large as possible to reduce subsequent error losses.

[0051] S101. According to a pre-configured first RIO area, a first ruler image corresponding to the full body range of the black ruler is cut out from the on-site photograph.

[0052] In the step S101, the first RIO region (Region of Interest, in machine vision or image processing, the region to be processed is outlined in the form of a box, circle, ellipse or irregular polygon from the processed image, which is called the region of interest) is manually set by the user during initialization and is used to include the entire body of the black ruler. The specific setting method can be as follows: first manually select a live photo of the black ruler without snow covering it, then check the entire body range where the black ruler is located (when checking, it is necessary to ensure that there is no other black part except the black ruler in the range, otherwise it will interfere with subsequent measurement and calculation), and enter the total length of the entire body of the black ruler. Through the shearing process of the aforementioned step S101, it can be ensured that the black part in the first ruler image will not be interfered by other external factors. In addition, the shearing method adopted is an existing conventional image processing method. At the same time, in the first ruler image, if there is no snow covering it, it means that there is no snow.

[0053] S102. Convert the first scale image into a grayscale image, and then perform binarization processing to obtain a binarized image.

[0054] In step S102, the specific grayscale conversion and binarization processing methods are conventional image processing methods, and are as follows Figure 2 As shown, through the above processing, the black part in the ruler image can be presented. Optimally, in order to reduce noise, after the step S102, a morphological operation can be performed on the black part in the binary image, wherein the morphological operation includes any one of a dilation operation, an erosion operation, an opening operation and a closing operation or any combination of them in any order. The above-mentioned dilation operation, erosion operation, opening operation and closing operation are all basic concepts in morphology, so as to achieve the separation or merging of black parts. For example, Figure 2 As shown, an opening operation is specifically adopted, so that when the black ruler part is covered by snow, the exposed ruler part can still be turned into a whole, which is conducive to the subsequent measurement of the actual exposed length.

[0055] S103. Perform contour extraction on the binary image, take the contour of the largest black part as the exposed contour of the black ruler, and then obtain the corresponding minimum circumscribed rectangle according to the exposed contour of the black ruler.

[0056] In step S103, the specific contour extraction method is an existing conventional image processing method. Since the black part in the first ruler image is ensured not to be interfered by other external factors by cutting, the largest black part contour must be the exposed contour of the black ruler. In addition, the specific method of obtaining the corresponding minimum circumscribed rectangle based on the contour is also an existing conventional image processing method.

[0057] S104. Obtain the length and width data of the minimum circumscribed rectangle, and then obtain the actual exposed length of the black ruler according to the longitudinal length of the minimum circumscribed rectangle.

[0058] In step S104, the length and width data refers to the total number of pixels reflecting the length and width of the minimum circumscribed rectangle. Since the black ruler is set vertically, the longitudinal length of the minimum circumscribed rectangle corresponds to the real exposed length of the black ruler, which can be further converted. Specifically, in the step of obtaining the real exposed length of the black ruler according to the longitudinal length of the minimum circumscribed rectangle, the following steps are included: first obtain the total number of pixels reflecting the longitudinal length, and then calculate the real exposed length L of the black ruler according to the following formula: nake :L nake=N / l, where N is the total number of pixels reflecting the longitudinal length, and l is the real size of a single pixel determined at initialization and corresponding to the real size of the single pixel. Of course, before the aforementioned steps, the real size of a single pixel needs to be determined at initialization in the following manner: for an artificially selected on-site photograph of a black ruler without snow covering it, the minimum circumscribed rectangle corresponding to the full body contour of the black ruler is obtained in a manner consistent with steps S100 to S103, and then the total length of the black ruler is divided by the total number of longitudinal pixels of the minimum circumscribed rectangle to obtain the real size of a single pixel. In addition, in order to reduce the measurement error, it is optimized that after the step S104, the following step is also included: the real exposed length of the black ruler is corrected using the correction formula set at initialization. The correction formula is a conventional formula used for measurement correction, which can be determined by selecting one of the existing multiple measurement correction algorithms at initialization.

[0059] S105. Calculate the actual snow depth L according to the following formula snow :L snow =L total -L nake , where L total is the total length of the black ruler, L nake The actual exposed length of the black ruler.

[0060] Therefore, through the aforementioned steps S100 to S105, after obtaining the on-site photographs captured by a fixed camera whose lens is facing the snow detection scale, image processing methods such as image cutting, image grayscale and binarization, contour extraction and pixel conversion can be started in sequence to measure the actual exposed length of the black scale, and finally the actual depth of snow can be obtained based on the actual exposed length, thereby achieving the purpose of automatically measuring the depth of snow.

[0061] After step S105, the following steps may also be included: saving the obtained real snow depth in a database / and outputting it to a human-computer interaction interface. Specifically, the obtained measurement data (including but not limited to the real snow depth) may be put into a message queue, and then another sub-thread may be started to cyclically retrieve data from the message queue: if there is data in the message queue, the data is sent to the serial port of the communication connection human-computer interaction interface (such as a display, etc.), and the data is written into the database. After obtaining the data, the human-computer interaction interface can update the latest data to the graphical user interface for real-time display. Further, in order to prevent disconnection from terminal devices such as the human-computer interaction interface, another sub-thread may be started to perform heartbeat detection: that is, heartbeat detection data is sent to the serial port every 30 seconds. In addition, another sub-thread may be started to detect all other sub-threads: that is, whether other sub-threads are hung up is detected by a timed loop method, and when a certain other sub-thread is found to be hung up, the sub-thread is restarted.

[0062] In summary, the snow depth monitoring method based on machine vision provided by this embodiment has the following technical effects:

[0063] (1) This embodiment provides a snow depth monitoring method based on existing image processing technology to achieve image measurement, that is, after obtaining a live shot picture collected by a fixed camera whose lens is facing the snow detection scale, the real exposed length of the black scale is measured by sequentially starting image processing methods such as image clipping, image graying and binarization, contour extraction and pixel conversion. Finally, the real snow depth is obtained based on the real exposed length, thereby achieving the purpose of automatically measuring the snow depth. On the one hand, compared with the existing manual measurement method, the measurement efficiency can be greatly improved and the labor cost can be reduced, and it has the advantage of a high degree of automation. On the other hand, compared with automated instruments using lasers or ultrasonic waves, only a black scale, a camera and a computer device are required to implement the invention, which can greatly reduce hardware costs and maintenance costs. Moreover, after a simple initialization setting, continuous automatic measurement can be performed, and it also has the advantage of easy operation.

[0064] Embodiment 2

[0065] like Figures 3-4 As shown, based on the technical solution of the first embodiment, this embodiment provides another snow depth monitoring method based on machine vision when the snow detection scale includes a red scale, that is, the following steps S201 to S205 are also included after step S100.

[0066] S201. According to the pre-configured second RIO area, a second ruler image corresponding to the whole body range of the red scale ruler is cut out from the on-site photograph.

[0067] In step S201, the red scale ruler is used to provide a reference scale line of red (a commonly used eye-catching color). It not only needs to have scale lines and corresponding scale values, but also needs to have a total length of the whole body and a minimum scale value. The total length of the whole body and the minimum scale value need to be manually input during initialization. The second RIO area is manually set by the user during initialization and is used to include the whole body of the red scale ruler. The specific setting method can be as follows: first manually select a live photo without snow covering the red scale ruler, and then check the whole body range where the red scale ruler is located (when checking, it is necessary to ensure that there is no other red part except the red scale ruler in the range, otherwise it will interfere with subsequent measurement and calculation), and enter the total length of the whole body and the minimum scale value (for example, 2mm) of the red scale ruler. Through the shearing process of the aforementioned step S201, it can be ensured that the red part in the second ruler image will not be interfered by other external factors.

[0068] S202. Convert the second scale image into an HSV channel image, and then retain only the red part of the HSV channel image based on the value range of red.

[0069] In step S202, the specific HSV channel conversion method is an existing conventional image processing method to extract the red part. In addition, the method of retaining only the red part of the HSV channel image based on the value range of red (it may take multiple attempts to select the most suitable range) can be specifically as follows: Figure 4 As shown: first, the HSV channel's upper red range value is used as the threshold for binarization processing, then the HSV channel's lower red range value is used as the threshold for binarization processing, and finally the two binarization processing results are merged to obtain an HSV channel image that only retains the red part.

[0070] After step S202, in order to optimize and reduce noise, a morphological operation is performed on the red part of the HSV channel image, wherein the morphological operation includes any one of a dilation operation, an erosion operation, an opening operation and a closing operation or any combination of these operations in any order. For example, Figure 4 As shown, opening operation 1, dilation operation 1, dilation operation 2 and opening operation 2 are used in sequence, which can not only restore the situation in which the same red scale line is divided into two parts due to snow cover to one part, but also avoid merging two independent red scale lines into one red block, thereby improving the accuracy and avoiding misjudgment.

[0071] S203. Perform contour extraction on the HSV channel image, and use the obtained red part contour as the exposed scale line of the red scale ruler.

[0072] In the step S203, the specific contour extraction method is also the existing conventional image processing method, and in order to further eliminate unqualified red scale lines, it is optimized and includes the following steps S2031-S2032.

[0073] S2031. For each acquired red part contour, obtain the corresponding minimum enclosing rectangle, and then perform elimination processing in the following manner (A) and / or (B): (A) if the area of ​​the minimum enclosing rectangle is smaller than the first threshold, eliminate the corresponding red part; (B) if the aspect ratio of the minimum enclosing rectangle is smaller than the second threshold, eliminate the corresponding red part.

[0074] In step S2031, the specific method of obtaining the corresponding minimum circumscribed rectangle based on the contour is also an existing conventional image processing method. For method (A), if the area of ​​the minimum circumscribed rectangle is less than the first threshold (for example, 40 pixels squared), it means that the corresponding red part is a noise point and needs to be removed; for method (B), if the aspect ratio of the minimum circumscribed rectangle (considering that the minimum circumscribed rectangle may be rotated, the rotation operation is reflected in the second parameter of the circumscribed rectangle being the rotation angle, and the rotated and non-rotated parts can be calculated separately) is less than the second threshold (for example, 1.3, when making a red scale ruler, the length ratio of the red scale line can be 1.5, and the use of 1.3 takes into account the corrosion expansion factor), it means that the corresponding red part is not a standard red scale line, and is also regarded as a noise point that needs to be removed.

[0075] S2032. Use the remaining red outline as the exposed scale lines of the red scale ruler.

[0076] S204. Count the total number of exposed tick marks.

[0077] S205. Calculate the snow verification depth L′ according to the following formula snow :L′ snow =L′ total -M*c, where L′ total is the total length of the red scale ruler, M is the total number of exposed scale lines, and c is the minimum scale value of the red scale ruler.

[0078] Therefore, through the aforementioned steps S201 to S205, after obtaining the on-site photographs captured by the fixed camera whose lens is facing the snow detection scale, the image processing methods such as image cropping, image HSV channelization, contour extraction and contour statistics can be started in sequence to obtain the snow depth marked with the red scale, thereby achieving the purpose of automatically measuring the snow depth. The snow depth independently measured by the aforementioned method can be used as a verification parameter of the actual snow depth in Example 1, so that the user can make a choice (if the difference between the two is large, it means that the measured actual snow depth is suspicious and cannot be used, while conversely it can be used), which is further convenient and practical.

[0079] Similarly, after step S2032, the following steps are also included: drawing the corresponding circumscribed rectangle of each red part in the HSV channel image, and then saving the HSV channel image, the total number of exposed scale lines and / or the snow verification depth into the database / and outputting it to the human-computer interaction interface. The specific method can refer to the actual snow depth in Example 1 to realize data saving / and output, which will not be repeated here.

[0080] The technical effects of the aforementioned snow depth monitoring method provided in this embodiment, on the basis of the first embodiment, also have the following technical effects: (1) after obtaining the on-site shooting pictures collected by a fixed camera whose lens is facing the snow detection scale, the image processing methods such as image cutting, image HSV channelization, contour extraction and contour statistics can be started in sequence to obtain the snow depth marked with a red scale, thereby achieving the purpose of automatically measuring the snow depth. The snow depth independently measured by the aforementioned method can be used as a verification parameter of the actual snow depth in the first embodiment, so that users can make choices, which is further convenient and practical.

[0081] The multiple embodiments described above are merely illustrative. If a unit described as a separate component is involved, it may or may not be physically separated; if a component displayed as a unit is involved, it may or may not be a physical unit, that is, it may be located in one place, or it may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0082] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention is described in detail with reference to the above embodiments, a person skilled in the art should understand that the technical solutions described in the above embodiments can still be modified, or some of the technical features can be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

[0083] Finally, it should be noted that the present invention is not limited to the above optional implementations, and anyone can derive other various forms of products under the enlightenment of the present invention. The above specific implementations should not be understood as limiting the scope of protection of the present invention. The scope of protection of the present invention should be based on the definition in the claims, and the description can be used to interpret the claims.

Claims

1. A snow depth monitoring method based on machine vision, characterized in that: The steps include: S100. Reading a picture taken on site, wherein the picture taken on site is collected by a fixed camera whose lens is facing the snow detection scale, and the snow detection scale includes a black scale; S101. According to the pre-configured first RIO area, a first ruler image corresponding to the whole body range of the black ruler is cut out from the live picture; S102. Converting the first scale image into a grayscale image, and then performing binarization processing to obtain a binary image; S103. Extract the outline of the binary image, take the outline of the largest black part as the exposed outline of the black ruler, and then obtain the corresponding minimum circumscribed rectangle according to the exposed outline of the black ruler; S104. Obtain the length and width data of the minimum circumscribed rectangle, and then obtain the real exposed length of the black ruler according to the longitudinal length of the minimum circumscribed rectangle, specifically including: first obtaining the total number of pixel points reflecting the longitudinal length, and then calculating the real exposed length of the black ruler according to the following formula: : ,in, To reflect the total number of pixels of the longitudinal length, is the real size of a single pixel determined during initialization and corresponding to the real size of the single pixel, and the real size of the single pixel is determined during initialization in the following manner: for an artificially selected on-site photo of the black ruler without snow covering it, the minimum circumscribed rectangle corresponding to the full body contour of the black ruler is obtained in a manner consistent with steps S100 to S103, and then the total length of the black ruler is divided by the total number of longitudinal pixels of the minimum circumscribed rectangle to obtain the real size of the single pixel; S105. Calculate the actual snow depth according to the following formula : ,in, is the total length of the black ruler, The actual exposed length of the black ruler; If the snow detection scale also includes a red scale for providing red reference scale lines, then the following steps S201 to S205 are also included after step S100: S201. According to the pre-configured second RIO area, a second ruler image corresponding to the whole body range of the red scale ruler is cut out from the live picture; S202. converting the second scale image into an HSV channel image, and then retaining only the red part of the HSV channel image based on the value range of red, and finally performing a morphological operation on the red part of the HSV channel image, wherein the morphological operation includes any one of a dilation operation, an erosion operation, an opening operation and a closing operation, or any combination of these operations in any order; S203. Extract the contour of the HSV channel image, and use the obtained red part contour as the exposed scale line of the red scale ruler, which specifically includes the following steps: S2031. For each obtained red part contour, obtain the corresponding minimum circumscribed rectangle, and then perform elimination processing in the following manner (A) and / or (B): (A) if the area of ​​the minimum circumscribed rectangle is less than the first threshold, eliminate the corresponding red part; (B) if the aspect ratio of the minimum circumscribed rectangle is less than the second threshold, eliminate the corresponding red part; S2032. Use the remaining red part contour as the exposed scale line of the red scale ruler; S204. Count the total number of exposed tick marks; S205. Calculate the snow verification depth according to the following formula : ,in, is the total length of the body on the red scale, is the total number of exposed tick marks, The minimum scale value of the red scale ruler.

2. The snow depth monitoring method based on machine vision according to claim 1, characterized in that: After step S102 and before step S103, the following step is also included: performing morphological operation on the black part of the binary image, wherein the morphological operation includes any one of dilation operation, erosion operation, opening operation and closing operation or any combination of them in any order.

3. The snow depth monitoring method based on machine vision according to claim 1, characterized in that: After step S104 and before step S105, the following step is also included: using the correction formula set during initialization to correct the actual exposed length of the black ruler.

4. The snow depth monitoring method based on machine vision according to claim 1, characterized in that: The step S105 is followed by the following steps: saving the obtained real snow depth into a database and / or outputting it to a human-computer interaction interface.

5. The snow depth monitoring method based on machine vision according to claim 1, characterized in that: After step S2032, the following steps are also included: drawing the corresponding circumscribed rectangles of each red part in the HSV channel image, and then saving the HSV channel image, the total number of exposed scale lines and / or the snow verification depth into a database and / or outputting it to a human-computer interaction interface.

Citation Information

Patent Citations

  • Image-based snow depth measuring method

    CN102589461A

  • Water gauge image automatic recognition method based on computer vision technology

    CN108764229A

Cited By

  • Snow depth intelligent identification system and method

    CN120317746A