A method, device, equipment and medium for detecting a landslide
By calculating the grayscale differences and motion state analysis between mountain image frames, and combining them with feature point extraction algorithms, the dynamic detection problem of landslide detection in existing technologies has been solved, achieving low-cost and high-accuracy landslide detection and alarm.
Patent Information
- Application Number
- CN202211696913.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2025-11-21
- Estimated Expiration
- 2042-12-28
AI Technical Summary
Existing radar wave detection methods cannot adjust the detection cycle and accuracy according to the actual situation of landslides, resulting in the inability to achieve dynamic detection of landslides and to accurately detect landslides.
By acquiring the current frame image and the previous frame image of the mountain, the difference in gray values of pixels is calculated to determine image changes and obtain the motion state of feature points. If the speed exceeds a preset threshold, an alarm message is sent. The Shi-Tomasi algorithm and the pyramid optical flow method are combined to extract feature points and analyze motion state.
It enables dynamic detection of landslides, improves detection accuracy, allows for early detection of landslide risks and provides early warnings, and reduces detection costs.
Smart Images

Figure CN116343436B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of image processing technology and intelligent monitoring technology, and particularly relates to a mountain landslide detection method, device, equipment and medium. BACKGROUND
[0002] Mountain landslide refers to the action and phenomenon that a part of rock and soil on a mountain slope moves to the lower part of the slope along a certain weak structural plane under the action of gravity, and is one of common geological disasters. The activity intensity of landslide is mainly related to the size, sliding speed, sliding distance, accumulated potential energy and generated function of the landslide. Generally speaking, the higher the position of the landslide body, the larger the volume, the faster the moving speed, the farther the moving distance, the higher the activity intensity of the landslide, and the greater the degree of harm.
[0003] In related technologies, a radar wave detection method is usually used to detect mountain landslide, but the cost of radar wave detection is high. Therefore, in the existing radar wave detection method, a fixed detection period is usually set to periodically detect mountain landslide, and the detection accuracy of mountain landslide remains unchanged. For example, detection is performed once every 10 hours, which can achieve a certain detection effect on mountain landslide. However, the detection period and detection accuracy cannot be adjusted according to the actual situation of mountain landslide. When there is a risk of mountain landslide or there is no risk of mountain landslide, the amount of data obtained by detection is the same. Therefore, dynamic detection of mountain landslide cannot be achieved, which leads to inaccurate detection of mountain landslide. SUMMARY
[0004] The present application provides a mountain landslide detection method, device, equipment and medium to solve the problem that the prior art cannot accurately detect mountain landslide.
[0005] In a first aspect, the present application provides a mountain landslide detection method, which comprises:
[0006] obtaining a current frame image of a mountain collected by a collection device and a previous frame image of the current frame image;
[0007] determining whether the current frame image changes relative to the previous frame image according to the difference in the gray value of each pixel point in the current frame image and the previous frame image; if it is determined that the current frame image changes relative to the previous frame image, obtaining the motion state corresponding to each feature point in the current frame image; wherein the motion state comprises speed;
[0008] determining whether the speed in the motion state is greater than a preset speed threshold, and if so, sending an alarm information.
[0009] Further, the determining whether the current frame image changes relative to the previous frame image according to the difference of the gray value of each pixel point in the current frame image and the previous frame image comprises:
[0010] For each pixel point of the current frame image, a ratio of the first gray value of the pixel point corresponding to the pixel point in the previous frame image to the second gray value of the pixel point is determined, and a difference value of the pixel point is determined according to the ratio;
[0011] The difference values of each pixel point in the current frame image are clustered into two categories, and the center value of each category is determined, the category with a larger center value is determined as a change corresponding category, if the number of pixel points in the change corresponding category exceeds a preset threshold, it is determined that the current frame image changes relative to the previous frame image, otherwise, it is determined that the current frame image does not change relative to the previous frame image.
[0012] Further, the determining whether the current frame image changes relative to the previous frame image according to the difference of the gray value of each pixel point in the current frame image and the previous frame image comprises:
[0013] The logarithm of the ratio is determined, and the absolute value of the logarithm is determined as the difference value of the pixel point.
[0014] Further, the obtaining the motion state corresponding to each feature point in the current frame image comprises:
[0015] For each pixel point of the current frame image, a ratio of the first gray value of the pixel point corresponding to the pixel point in the previous frame image to the second gray value of the pixel point is determined, and a difference value of the pixel point is determined according to the ratio; a difference image corresponding to the difference value of each pixel point in the current frame image is determined; a Shi-Tomasi algorithm is used to extract each feature point in a motion mountain area of the difference image; according to the position of each feature point extracted in the difference image, each feature point at a corresponding position of the current frame image and the previous frame image is determined;
[0016] A pyramid optical flow method is used to process each feature point in the current frame image and the previous frame image, and a motion state corresponding to each feature point of the current frame image is determined.
[0017] Further, after the obtaining the motion state corresponding to each feature point in the current frame image, before the determining whether the speed in the motion state is greater than a preset speed threshold, the method further comprises:
[0018] An other acquisition device for acquiring images of the mountain is obtained, an image acquired by the other acquisition device when the acquisition device acquires the current frame image is obtained, and a to-be-processed motion state corresponding to each feature point in the image is obtained.
[0019] acquire a speed in the motion state and a to-be-processed speed in the to-be-processed motion state, determine a target speed according to preset weights corresponding to the acquisition device and the other acquisition device, the speed and the to-be-processed speed, and update the speed in the motion state by using the target speed.
[0020] Further, if the speed in the motion state is greater than a preset speed threshold, before the alarm information is sent, the method comprises the following steps of:
[0021] For each pixel point of the current frame image, a ratio of a first gray value of a pixel point corresponding to the pixel point in the previous frame image to a second gray value of the pixel point is determined, and a difference value of the pixel point is determined according to the ratio; and a sum value of the difference values of each pixel point of the current frame image is determined.
[0022] It is judged whether the sum value is greater than a preset difference threshold, and if yes, the subsequent step of sending the alarm information is executed.
[0023] Further, the sending of the alarm information comprises the following steps of:
[0024] The name of the detected mountain is acquired according to the acquisition device, and a collection time at which the acquisition device collects the current frame image is acquired.
[0025] The name of the mountain and the collection time are carried in the alarm information and sent.
[0026] In a second aspect, the embodiments of the present application further provide a mountain landslide detection device, which comprises:
[0027] An acquisition module is configured to acquire a current frame image of a mountain collected by an acquisition device and a previous frame image of the current frame image.
[0028] A processing module is configured to determine whether the current frame image changes relative to the previous frame image according to a difference between gray values of each pixel point in the current frame image and the previous frame image, and if it is determined that the current frame image changes relative to the previous frame image, acquire a motion state corresponding to each feature point in the current frame image, wherein the motion state comprises a speed.
[0029] A judgment and sending module is configured to judge whether the speed in the motion state is greater than a preset speed threshold, and if yes, send an alarm information.
[0030] Further, the processing module is specifically configured to determine, for each pixel point of the current frame image, a ratio of the first gray value of the pixel point corresponding to the pixel point in the previous frame image to the second gray value of the pixel point, and determine a difference value of the pixel point according to the ratio; cluster the difference values of each pixel point of the current frame image into two categories, and determine a center value of each category, determine a category corresponding to a change as a category with a larger center value, and if the number of pixel points in the category corresponding to the change exceeds a preset threshold, determine that the current frame image has changed relative to the previous frame image, otherwise, determine that the current frame image has not changed relative to the previous frame image.
[0031] Further, the processing module is specifically configured to determine a logarithm of the ratio, and determine an absolute value of the logarithm as the difference value of the pixel point.
[0032] Further, the processing module is specifically configured to determine, for each pixel point of the current frame image, a ratio of the first gray value of the pixel point corresponding to the pixel point in the previous frame image to the second gray value of the pixel point, and determine a difference value of the pixel point according to the ratio; cluster the difference values of each pixel point of the current frame image into two categories, and determine a center value of each category, determine a category corresponding to a change as a category with a larger center value, and if the number of pixel points in the category corresponding to the change exceeds a preset threshold, determine that the current frame image has changed relative to the previous frame image, otherwise, determine that the current frame image has not changed relative to the previous frame image.
[0033] Further, the processing module is specifically configured to determine, for each pixel point of the current frame image, a ratio of the first gray value of the pixel point corresponding to the pixel point in the previous frame image to the second gray value of the pixel point, and determine a difference value of the pixel point according to the ratio; cluster the difference values of each pixel point of the current frame image into two categories, and determine a center value of each category, determine a category corresponding to a change as a category with a larger center value, and if the number of pixel points in the category corresponding to the change exceeds a preset threshold, determine that the current frame image has changed relative to the previous frame image, otherwise, determine that the current frame image has not changed relative to the previous frame image.
[0034] Further, the processing module is specifically configured to determine, for each pixel point of the current frame image, a ratio of the first gray value of the pixel point corresponding to the pixel point in the previous frame image to the second gray value of the pixel point, and determine a difference value of the pixel point according to the ratio; cluster the difference values of each pixel point of the current frame image into two categories, and determine a center value of each category, determine a category corresponding to a change as a category with a larger center value, and if the number of pixel points in the category corresponding to the change exceeds a preset threshold, determine that the current frame image has changed relative to the previous frame image, otherwise, determine that the current frame image has not changed relative to the previous frame image.
[0035] Further, the judging and sending module is specifically configured to acquire a detected mountain name corresponding to the acquisition device, and acquire an acquisition time at which the acquisition device acquires the current frame image; and send the mountain name and the acquisition time in the alarm information.
[0036] In a third aspect, the embodiments of the present application further provide an electronic device, which comprises at least a processor and a memory, and the processor is configured to execute a computer program stored in the memory to implement the steps of the mountain landslide detection method according to any one of the above aspects.
[0037] In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the mountain landslide detection method according to any one of the above aspects.
[0038] In the embodiments of the present application, the electronic device acquires a current frame image of a mountain collected by an acquisition device and a previous frame image of the current frame image, determines whether the current frame image changes relative to the previous frame image according to a difference in a gray value of each pixel point in the current frame image and the previous frame image, acquires a motion state of each feature point in the current frame image if it is determined that the current frame image changes relative to the previous frame image, wherein the motion state comprises a speed, judges whether the speed in the motion state is greater than a preset speed threshold, and sends an alarm information if yes. In the embodiments of the present application, if the electronic device determines that the current frame image of the mountain collected changes relative to the previous frame image, it acquires the motion state of each feature point in the current frame image, judges whether the speed in the motion state is greater than the preset speed threshold, and determines that there is a risk of mountain landslide and sends an alarm if the speed is greater than the preset speed threshold, so that the mountain can be dynamically detected, and it can be accurately determined whether there is a risk of mountain landslide, thereby improving the accuracy of mountain landslide detection. BRIEF DESCRIPTION OF DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort.
[0040] Figure 1 A mountain landslide detection process schematic diagram provided by the embodiments of the present application;
[0041] Figure 2 A determination process schematic diagram provided by the embodiments of the present application;
[0042] Figure 3 A process schematic diagram for determining the motion state of a feature point is provided for an embodiment of the present application.
[0043] Figure 4 A process schematic diagram for determining whether to send alarm information is provided for an embodiment of the present application.
[0044] Figure 5 A process schematic diagram for sending alarm information is provided for an embodiment of the present application.
[0045] Figure 6 A detailed schematic diagram of a landslide detection process is provided for an embodiment of the present application.
[0046] Figure 7 A structural schematic diagram of a landslide detection device is provided for an embodiment of the present application.
[0047] Figure 8 A structural schematic diagram of an electronic device is provided for an embodiment of the present application. DETAILED DESCRIPTION
[0048] The present application will be further described in details below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.
[0049] In order to accurately detect landslides, the present application provides a landslide detection method, device, equipment and medium.
[0050] In the embodiments of the present application, the electronic device obtains a current frame image of a mountain collected by a collection device and a previous frame image of the current frame image, determines whether the current frame image changes relative to the previous frame image according to the difference in the gray value of each pixel point in the current frame image and the previous frame image, if it is determined that the current frame image changes relative to the previous frame image, obtains the motion state corresponding to each feature point in the current frame image, wherein the motion state includes speed, judges whether the speed in the motion state is greater than a preset speed threshold, and if so, sends alarm information. Thus, the landslide detection can be accurately performed.
[0051] Embodiment 1
[0052] Figure 1 A landslide detection process schematic diagram is provided for an embodiment of the present application, which includes the following steps:
[0053] S101: Obtain a current frame image of a mountain collected by a collection device and a previous frame image of the current frame image.
[0054] The landslide detection method provided by the embodiments of the present application is applied to an electronic device, which can be a collection device, a PC, a server or other intelligent device with computing function.
[0055] In order to accurately detect the landslide and determine whether the landslide occurs, a collection device is set near the mountain to be detected by a staff in advance, wherein the collection device is set at a position where the image of the mountain can be collected, and the collection device collects the video frame image corresponding to the mountain in real time.
[0056] If the electronic device is the collection device, the collection device can obtain the current frame image collected and the previous frame image of the current frame image. If the electronic device is a non-collection device such as a PC or a server, after the collection device collects each video frame image corresponding to the mountain, the collection device can send each video frame image collected in real time to the electronic device. The electronic device can obtain the latest video frame image sent by the collection device, and determine the video frame image as the current frame image of the mountain. The electronic device determines the previous video frame image sent by the collection device before the current frame image as the previous frame image of the current frame image. In this way, the electronic device can obtain the current frame image of the mountain collected by the collection device and the previous frame image of the current frame image.
[0057] In S102, the difference between the gray values of each pixel point in the current frame image and the previous frame image is determined to determine whether the current frame image changes relative to the previous frame image. If it is determined that the current frame image changes relative to the previous frame image, the motion state of each feature point in the current frame image is obtained. The motion state includes the speed.
[0058] In order to accurately detect the landslide, after the electronic device obtains the current frame image collected by the collection device and the last frame image of the current frame image, the electronic device can determine whether the current frame image changes relative to the last frame image according to the difference between the gray values of each pixel point in the current frame image and the last frame image. Specifically, the electronic device can determine, for each pixel point in the current frame image, whether the difference between the gray value of the pixel point in the last frame image and the gray value of the pixel point is within a preset range. If the difference is not within the preset range, it means that the difference of the pixel point is large. The current frame image and the last frame image are images of the same size, so each pixel point in the current frame image has a corresponding pixel point at a corresponding position in the last frame image. The pixel point at the corresponding position is the corresponding pixel point described above. The electronic device can determine the number of pixel points with large differences in the current frame image. The electronic device can determine the ratio of the number to the number of pixel points in the current frame image. If the ratio is greater than a preset ratio, it means that the current frame image changes relative to the last frame image. If the ratio is less than the preset ratio, it means that the current frame image does not change relative to the last frame image, which means that the probability of landslide at the time when the current frame image is collected is low. In the present application, the process of determining whether the current frame image changes relative to the last frame image can be referred to as image difference change detection by computer vision technology.
[0059] If it is determined that the current frame image changes relative to the last frame image, it means that the mountain corresponding to the image collected by the collection device has a risk of landslide at the time when the current frame image is collected. In order to further detect the landslide, the electronic device can obtain the motion state corresponding to each feature point in the current frame image. Here, the feature point refers to a pixel point with a large difference, which corresponds to a landslide body that may slide in the actual application scenario. Specifically, how to determine the motion state corresponding to a feature point in an image is known in the art and will not be described here. The motion state includes speed. In the present application, the process of determining the motion state corresponding to each feature point in the current frame image can be referred to as motion state detection by computer vision technology.
[0060] S103: Determine whether the speed in the motion state is greater than a preset speed threshold. If yes, send an alarm message.
[0061] In order to accurately detect the landslide, the electronic device pre-stores a preset speed threshold value. After obtaining the motion state corresponding to each feature point, the electronic device can obtain the speed in the motion state, and determine whether the speed in the motion state is greater than the preset speed threshold value pre-stored in the electronic device. If the speed in the motion state is greater than the preset speed threshold value, it indicates that the landslide occurs at the time when the current frame image is collected. The electronic device can send an alarm information. Specifically, the electronic device can send the alarm information to the device corresponding to the preset manager.
[0062] In the embodiment of the present application, the electronic device obtains the real-time image of the monitored mountain by using the acquisition device, and continuously compares the front and back two frames of images by using the image difference change detection described in the above embodiment to determine whether the current frame image changes relative to the previous frame image. Then, the motion state of each feature point in the current frame image is determined by using the motion state detection, so as to determine whether the mountain has a landslide movement according to whether the speed in the motion state is greater than the preset speed threshold value, and finally send an alarm information. Since the landslide can be detected in the embodiment of the present application when the mountain slightly moves, the occurrence of natural disasters can be detected in advance, the casualties can be reduced, and the purpose of detecting and alarming the landslide of the mountain is achieved. The mountain landslide detection method provided in the embodiment of the present application only uses the acquisition device to collect images, and has low cost.
[0063] In the embodiment of the present application, the electronic device obtains the real-time image of the monitored mountain by using the acquisition device, and continuously compares the front and back two frames of images by using the image difference change detection described in the above embodiment to determine whether the current frame image changes relative to the previous frame image. Then, the motion state of each feature point in the current frame image is determined by using the motion state detection, so as to determine whether the mountain has a landslide movement according to whether the speed in the motion state is greater than the preset speed threshold value, and finally send an alarm information. Since the landslide can be detected in the embodiment of the present application when the mountain slightly moves, the occurrence of natural disasters can be detected in advance, the casualties can be reduced, and the purpose of detecting and alarming the landslide of the mountain is achieved. The mountain landslide detection method provided in the embodiment of the present application only uses the acquisition device to collect images, and has low cost.
[0064] In the embodiment of the present application, the electronic device obtains the real-time image of the monitored mountain by using the acquisition device, and continuously compares the front and back two frames of images by using the image difference change detection described in the above embodiment to determine whether the current frame image changes relative to the previous frame image. Then, the motion state of each feature point in the current frame image is determined by using the motion state detection, so as to determine whether the mountain has a landslide movement according to whether the speed in the motion state is greater than the preset speed threshold value, and finally send an alarm information. Since the landslide can be detected in the embodiment of the present application when the mountain slightly moves, the occurrence of natural disasters can be detected in advance, the casualties can be reduced, and the purpose of detecting and alarming the landslide of the mountain is achieved. The mountain landslide detection method provided in the embodiment of the present application only uses the acquisition device to collect images, and has low cost.
[0065] Embodiment 2:
[0066] In order to accurately determine whether the current frame image changes relative to the previous frame image, on the basis of the above embodiment, in the embodiment of the application, the step of determining whether the current frame image changes relative to the previous frame image according to the difference between the gray values of each pixel point in the current frame image and the previous frame image comprises the following steps:
[0067] For each pixel point in the current frame image, a ratio of a first gray value of the pixel point corresponding to the pixel point in the previous frame image to a second gray value of the pixel point is determined, and a difference value of the pixel point is determined according to the ratio;
[0068] The difference values of each pixel point in the current frame image are clustered into two categories, and a center value of each category is determined. The category with a larger center value is determined as a category corresponding to a change. If the number of pixel points in the category corresponding to the change exceeds a preset threshold, it is determined that the current frame image changes relative to the previous frame image, otherwise, it is determined that the current frame image does not change relative to the previous frame image.
[0069] In order to accurately determine whether the current frame image changes relative to the previous frame image, in the embodiment of the application, the electronic device can determine the gray value of the pixel point corresponding to the pixel point in the previous frame image for each pixel point in the current frame image. In order to facilitate distinction, the gray value can be referred to as a first gray value. Specifically, when obtaining the gray value of the pixel point corresponding to the pixel point in the previous frame image, the electronic device can obtain the position of the pixel point in the current frame image, and determine the pixel point at the position in the previous frame image as the pixel point corresponding to the pixel point. The gray value of the pixel point corresponding to the pixel point is obtained. The gray value of the pixel point can be referred to as a second gray value for ease of distinction. After obtaining the first gray value and the second gray value, the electronic device can determine the ratio of the first gray value to the second gray value, and determine the difference value of the pixel point according to the ratio. The electronic device can determine the ratio as the difference value of the pixel point, or can input the ratio into a preset function to determine the output of the preset function as the difference value of the pixel point. The preset function is a function with larger input and larger output. In this way, the electronic device can determine the difference value of each pixel point in the current frame image.
[0070] After determining the difference value of each pixel point in the current frame image, the electronic device can cluster the difference value of each pixel point in the current frame image into two categories. Specifically, when clustering, the electronic device can randomly determine two center values, and for each difference value of a pixel point, determine the distance of the difference value from the two center values, and determine the difference value in the category of the center value with smaller corresponding distance. In this way, each difference value is classified. After classifying each difference value, the electronic device can determine the center value of each category according to the average value of the difference values in each category. After re-determining the center value of each category, the electronic device can re-classify each difference value in the manner described in the above embodiments, and perform the step of re-determining the center value of each category until the re-determined center value after re-classification is consistent with the center value determined before re-classification. Then, it is determined that the clustering is completed. How to cluster multiple numerical values into two categories is a prior art, which will not be described here.
[0071] After clustering the difference value of each pixel point in the current frame image into two categories, the electronic device can determine the center value of each category, where the average value of the difference values in each category is the center value of the corresponding category, and determine the center value with a larger value among the two center values. The category with the corresponding center value with a larger value is determined as the change corresponding category. After determining the change corresponding category, the electronic device can determine the number of difference values of the pixel points in the change corresponding category, and determine whether the number exceeds a preset threshold. If the number exceeds the preset threshold, it is determined that the current frame image has changed relative to the previous frame image. If the number does not exceed the preset threshold, it is determined that the current frame image has not changed relative to the previous frame image.
[0072] In the embodiments of the present application, the electronic device follows the principle that the distance between pixels of the same category is the smallest and the distance between pixels of different categories is the largest, and obtains the center values of the two categories through iteration. Then, the difference values of the pixel points in each category are obtained using the nearest neighbor method, which is equivalent to obtaining the changed pixels and the unchanged pixels. According to the number of changed pixels, it is determined whether the current frame image has changed relative to the previous frame image, so as to determine whether there is a large change in the mountain. In order to further view the change of the current frame image relative to the previous frame image, the electronic device can adjust the changed pixels and the unchanged pixels in the current frame image to different gray values. The adjusted image can be referred to as a change detection image.
[0073] The electronic device determines whether the current frame image has changed relative to the previous frame image according to the clustering method, and does not need to construct a model in the process of determining whether the current frame image has changed relative to the previous frame image, which has high flexibility, good accuracy and consistency. Moreover, the calculation and processing of data are less, and the time consumption is less.
[0074] In order to further detect the landslide, the electronic device can first adopt the image filtering method to process the current frame image and the previous frame image, thereby effectively suppressing noise and non-changing information, enhancing low pixel intensity, and improving the accuracy of landslide detection.
[0075] In order to accurately determine the difference value of the pixel point, on the basis of the above embodiments, in the embodiment of the application, the difference value of the pixel point is determined according to the ratio value, including:
[0076] The logarithm of the ratio value is determined, and the absolute value of the logarithm is determined as the difference value of the pixel point.
[0077] In order to accurately determine the difference value of the pixel point, the electronic device determines the difference value of the pixel point in the current frame image, and after determining the ratio of the first gray value of the pixel point corresponding to the pixel point in the previous frame image to the second gray value of the pixel point, the electronic device can determine the logarithm of the ratio value, and determine the absolute value of the logarithm, and determine the absolute value of the logarithm as the difference value of the pixel point.
[0078] The electronic device can determine the difference value of the pixel point in the current frame image according to the following formula:
[0079]
[0080] Wherein, D(i,j) is the difference value of the pixel point in the i-th row and the j-th column of the current frame image, abs represents the absolute value, lg represents the logarithm, I1(i,j) is the gray value of the pixel point in the i-th row and the j-th column of the previous frame image, and I2(i,j) is the gray value of the pixel point in the i-th row and the j-th column of the current frame image.
[0081] In the embodiment of the application, the method for determining the difference value of each pixel point in the current frame image can be referred to as a logarithmic ratio operator method.
[0082] Figure 2 A determination process provided in the embodiment of the application includes the following steps:
[0083] The determination process is a process of determining whether the current frame image changes relative to the previous frame image.
[0084] S201: Obtain the current frame image collected by the collection device and the previous frame image of the current frame image.
[0085] S202: Process the current frame image and the previous frame image by adopting the image filtering method.
[0086] S203: Determine the difference value of each pixel point in the current frame image.
[0087] S204: cluster the difference value of each pixel point in the current frame image into two classes.
[0088] S205: determine the center value of each class, and determine the class with larger center value as the change corresponding class.
[0089] S206: determine whether the number of difference values of the pixel points in the change corresponding class exceeds a preset threshold, if yes, execute S207, and if no, execute S208.
[0090] S207: determine that the current frame image changes relative to the previous frame image.
[0091] S208: determine that the current frame image does not change relative to the previous frame image.
[0092] Embodiment 3:
[0093] In order to accurately determine the motion state corresponding to each pixel point in the current frame image, on the basis of the above embodiments, in the embodiment of the present application, the method for determining the motion state corresponding to each feature point in the current frame image comprises:
[0094] For each pixel point in the current frame image, determine the ratio of the first gray value of the pixel point corresponding to the pixel point in the previous frame image to the second gray value of the pixel point, and determine the difference value of the pixel point according to the ratio; determine the corresponding difference image according to the difference value of each pixel point in the current frame image; extract each feature point in the motion mountain area of the difference image by using the Shi-Tomasi algorithm; determine each feature point at the corresponding position of the current frame image and the previous frame image according to the position of each extracted feature point in the difference image;
[0095] Process each feature point in the current frame image and the previous frame image by using the pyramid optical flow method, and determine the motion state corresponding to each feature point in the current frame image.
[0096] In order to determine the motion state of each feature point in the current frame image, the electronic device can first determine each feature point in the current frame image. Specifically, the electronic device can determine the difference value of each pixel point in the current frame image. How to determine the difference value of the pixel point in the current frame image has been described in the above embodiment, and will not be described in detail here. The electronic device can determine the corresponding difference image according to the difference value of each pixel point in the current frame image. Specifically, the electronic device can generate an image that is completely consistent with the size of the current frame image, and determine the gray value of the pixel point corresponding to the pixel point in the generated image as the difference value of the pixel point in the current frame image. The pixel point corresponding to the pixel point in the generated image is the pixel point with the same position as the pixel point. The electronic device can determine the gray value of each pixel point in the generated image in this way, so as to obtain the corresponding difference image. After obtaining the corresponding difference image, the electronic device can process the difference image by using the Shi-Tomasi algorithm to extract each feature point in the motion mountain area of the difference image. Each feature point extracted is a landslide in the mountain. Specifically, how to extract the feature point in the image by using Shi-Tomasi is prior art, and will not be described here. After extracting each feature point in the motion mountain area of the difference image, the electronic device can determine each feature point at the corresponding position in the current frame image and the previous frame image according to the position of each feature point in the difference image.
[0097] After determining each feature point in the current frame image and the previous frame image, the electronic device can process each feature point in the current frame image and the previous frame image by using the pyramid optical flow method, so as to determine the motion state corresponding to each feature point in the current frame image. Specifically, when each feature point in the adjacent two frame images is known, how to obtain the motion state corresponding to each feature point in the next frame image is prior art, and will not be described here.
[0098] The method of extracting the feature point in the difference image by the electronic device can be called a motion detection operator, and the feature point can be called a strong corner point. The electronic device is equivalent to a strong corner point of the difference image extracted after preprocessing by the motion detection operator. The electronic device is equivalent to performing motion state analysis by the pyramid optical flow method, and calculating an affine function, which is the motion state. The affine function obtained by the electronic device can be:
[0099]
[0100] Wherein, x(t) is the motion state in the horizontal direction at time t, y(t) is the motion state in the vertical direction at time t, and t is the time when the current frame image is collected. H is a certain coefficient matrix, which can be obtained by analyzing the physical model of the motion state, and how to obtain it is prior art, which will not be repeated here, and w(t), v(t) are noise terms. The electronic device can obtain acceleration, speed and displacement through the radiation function, and how to obtain acceleration, speed and displacement is prior art, which will not be repeated here.
[0101] In order to obtain more accurate motion state, the electronic device can filter out noise through Kalman filter. Since Kalman filter is linear and unbiased, the obtained motion state is the motion state filtered out of the corresponding noise term.
[0102] In the embodiment of the application, since the motion state of the feature point will not change too much in a short time, the electronic device can adjust the motion state of the feature point in the current frame image according to the motion state of the feature point in the previous frame image. Specifically, a predetermined function and the motion state of the feature point in the previous frame image can be used to determine the predicted motion state of the feature point in the current frame image, and the motion state of the feature point in the current frame image can be adjusted according to the predicted motion state and the determined motion state of the feature point in the current frame image. Specifically, the motion state of the feature point in the current frame image can be adjusted to the predicted motion state, or other adjustment methods can be used. The electronic device can determine the predicted motion state of the feature point in the current frame image by the following method:
[0103]
[0104] wherein, is the predicted motion state of the feature point, is the motion state of the feature point in the previous frame image, H, Q is a predetermined matrix. t is the time when the current frame image is collected, and t-1 is the time when the previous frame image is collected.
[0105] If the electronic device determines to send an alarm message, it can predict the position of the object corresponding to the feature point at the time corresponding to the next frame image according to the position of the feature point in the current frame image and the speed and acceleration in the corresponding motion state. Specifically, given the acceleration, speed and position, the position of the object can be predicted by prior art, which will not be repeated here. It is equivalent to extracting the moving target by using a certain information fusion method.
[0106] Figure 3 is a process diagram for determining the motion state of a feature point provided by an embodiment of the application, which includes the following steps:
[0107] S301: Obtain the current frame image collected by the collection device and the previous frame image of the current frame image.
[0108] S302: If it is determined that the current frame image changes relative to the previous frame image, then according to the difference value of each pixel point in the current frame image, the corresponding difference image is determined.
[0109] S303: Each feature point in the motion mountain area of the difference image is extracted by using the Shi-Tomasi algorithm.
[0110] S304: According to the position of each feature point extracted in the difference image, each feature point at the corresponding position of the current frame image and the previous frame image is determined.
[0111] S305: Each feature point in the current frame image and the previous frame image is processed by using the pyramid optical flow method, and the motion state corresponding to each feature point in the current frame image is determined.
[0112] Embodiment 4:
[0113] In order to accurately determine the speed in the motion state of the feature point, on the basis of the above embodiments, in the embodiment of the present application, after acquiring the motion state corresponding to each feature point in the current frame image, before judging whether the speed in the motion state is greater than a preset speed threshold, the method further comprises:
[0114] Acquiring other acquisition devices for collecting images of the mountain, acquiring images collected by other acquisition devices when the acquisition device collects the current frame image, and acquiring the corresponding to-be-processed motion state of each feature point in the image;
[0115] Acquiring the speed in the motion state and the to-be-processed speed in the to-be-processed motion state, determining a target speed according to the preset weights corresponding to the acquisition device and the other acquisition device, the speed and the to-be-processed speed, and updating the speed in the motion state by using the target speed.
[0116] In actual application scenarios, if the motion state of the feature point is determined only according to the image collected by one acquisition device, the accuracy of the determined motion state may not be high. In order to accurately determine the motion state, the business personnel also set other acquisition devices near the mountain in advance, and the electronic device can determine the speed of the feature point according to the speed in the motion state determined according to the images collected by the other acquisition device and the acquisition device.
[0117] In order to accurately determine the speed in the motion state, the electronic device can pre-store, for each collection device, other collection devices corresponding to the collection device collecting images of the same mountain. In this embodiment of the application, the electronic device can obtain, for the collection device described in the above embodiment, the other collection devices corresponding to the collection device collecting images of the same mountain, and obtain images collected by the other collection devices at the time when the collection device collects the current frame image, and obtain the to-be-processed motion state corresponding to each feature point in the image. How to determine the motion state corresponding to the feature point in the image has been described in the above embodiment, and will not be described in detail here.
[0118] After obtaining the to-be-processed motion state described above, the electronic device can obtain the speed in the motion state corresponding to each feature point in the current frame image, and obtain a to-be-processed speed in the to-be-processed motion state, and determine a target speed according to the preset weight corresponding to the collection device and the other collection devices, the speed, and the to-be-processed speed. Specifically, the electronic device can determine a first product of the speed and the preset weight corresponding to the collection device, and determine a second product of the to-be-processed speed and the preset weight corresponding to the other collection devices. The electronic device can determine the sum of the first product and the second product as the target speed. The number of other collection devices can be multiple, and the number of feature points can be two or more. If the number of feature points is two or more, the electronic device can determine, for each feature point, a target position in the image collected by the other collection devices according to the position of the feature point in the current frame image and the pre-stored correspondence between the positions in the images collected by the collection device and the other collection devices, and determine the to-be-processed motion state of the feature point at the target position in the image collected by the other collection devices. According to the speed in the motion state of the feature point and the to-be-processed speed in the to-be-processed motion state, the electronic device can determine the target speed of the feature point in the manner described in the above embodiment. After determining the target speed, the electronic device can update the determined speed in the motion state using the target speed, and perform the subsequent step of judging whether the updated speed is greater than the preset speed threshold.
[0119] In this embodiment of the application, when determining the speed in the motion state, the electronic device determines the target speed of the feature point according to the images collected by multiple collection devices at the same time, thereby improving the accuracy of the speed determination in the motion state.
[0120] Embodiment 5:
[0121] In order to improve the accuracy of the landslide detection, on the basis of the above embodiments, in the embodiment of the present application, if the speed in the motion state is greater than the preset speed threshold, before the sending of the alarm information, the method comprises:
[0122] For each pixel point of the current frame image, a ratio of the first gray value of the pixel point corresponding to the pixel point in the last frame image to the second gray value of the pixel point is determined, and according to the ratio, a difference value of the pixel point is determined; a sum value of the difference values of each pixel point of the current frame image is determined.
[0123] It is judged whether the sum value is greater than a preset difference threshold, if yes, the subsequent step of sending the alarm information is executed.
[0124] In order to improve the accuracy of the landslide detection, the electronic device also locally saves a preset difference threshold, if the speed in the motion state is greater than the preset speed threshold, the electronic device can also determine the difference value of each pixel point in the current frame image, and judge whether the sum value of the difference values of each pixel point is greater than the preset difference threshold, if the sum value of the difference values of each pixel point is greater than the preset difference threshold, it indicates that the risk of landslide at the time of collecting the current frame image is relatively high, and the alarm information is sent. If the sum value of the difference values of each pixel point is not greater than the preset difference threshold, it indicates that the risk of landslide at the time of collecting the current frame image is relatively low, and the alarm information does not need to be sent.
[0125] Specifically, the electronic device can determine, for each pixel point of the current frame image, a ratio of the first gray value of the pixel point corresponding to the pixel point in the last frame image to the second gray value of the pixel point, and according to the ratio, determine the difference value of the pixel point. Specifically, how to determine the difference value of the pixel point in the current frame image has been described in the above embodiments, and will not be described in detail here.
[0126] The electronic device can obtain the sum value of the difference values by the following formula:
[0127] D all =∑D(i,j)
[0128] Wherein, D all is the sum value of the difference values of each pixel point in the current frame image, and D(i, j) is the difference value of the pixel point in the i-th row and the j-th column of the current frame image.
[0129] The electronic device can determine whether to send the alarm information by the following formula:
[0130] K1<D all ,K2<v
[0131] Wherein, K1 is a preset difference threshold, D allis a sum value of difference values of each pixel point in the current frame image, K2 is a preset speed threshold value, and v is a speed in a motion state.
[0132] Figure 4 A process schematic diagram for determining whether to send alarm information is provided in the embodiments of the present application, and the process includes the following steps:
[0133] S401: It is determined whether a motion speed in a motion state of a feature point in a current frame image is greater than a preset speed threshold value. If yes, S402 is executed, and if no, S403 is executed.
[0134] S402: A sum value of difference values of each pixel point in the current frame image is determined, and S404 is executed.
[0135] S403: The process ends.
[0136] S404: It is determined whether the sum value is greater than a preset difference threshold value. If yes, S405 is executed, and if no, S403 is executed.
[0137] S405: Alarm information is sent.
[0138] The manner in which the electronic device determines whether to send alarm information can be referred to as an alarm operator manner.
[0139] Embodiment 6:
[0140] In order to accurately perform a prevention measure for a landslide, on the basis of the above embodiments, in the embodiments of the present application, the sending of alarm information includes:
[0141] A detected mountain name corresponding to the collection device is acquired, and a collection time at which the collection device collects the current frame image is acquired;
[0142] The mountain name and the collection time are carried in the alarm information and sent.
[0143] In order to accurately perform a prevention measure for a landslide, the electronic device locally stores a detected mountain name corresponding to each collection device. The electronic device can acquire a detected mountain name corresponding to a collection device that collects a current frame image, and acquire a collection time at which the collection device collects the current frame image. The electronic device can carry the acquired detected mountain name and the collection time in alarm information and send the alarm information. Specifically, in the embodiments of the present application, the electronic device can also acquire a mountain position corresponding to the detected mountain name, and can carry the mountain position in the alarm information and send the alarm information. This facilitates a management personnel using a device receiving the alarm information to perform an operation such as personnel evacuation according to the mountain name and the collection time carried in the alarm information.
[0144] The electronic device can also capture each feature point of the moving mountainous region, and send the captured image, the current frame image, the difference image, and the change detection image described in the above embodiment in the alarm information.
[0145] Figure 5 A process diagram for sending alarm information is provided for the embodiments of the present application, and the process includes the following steps:
[0146] S501: Obtain the detected mountain name corresponding to the saved acquisition device.
[0147] S502: Obtain the acquisition time of the current frame image collected by the acquisition device.
[0148] S503: Send the mountain name and the acquisition time in the alarm information.
[0149] Figure 6 A detailed process diagram for detecting mountain landslide is provided for the embodiments of the present application, and the process includes the following steps:
[0150] S601: Obtain the current frame image of the mountain collected by the acquisition device and the previous frame image of the current frame image.
[0151] S602: Determine whether the current frame image has changed relative to the previous frame image according to the difference in the gray value of each pixel point in the current frame image and the previous frame image, if yes, execute S603, and if no, execute S604.
[0152] S603: Obtain the motion state of each feature point in the current frame image, and execute S605.
[0153] S604: End.
[0154] S605: Determine whether the motion speed in the motion state of the feature point in the current frame image is greater than the preset speed threshold, if yes, execute S606, and if no, execute S604.
[0155] S606: Determine the sum value of the difference values of each pixel point in the current frame image.
[0156] S607: Determine whether the sum value is greater than the preset difference threshold, if yes, execute S608, and if no, execute S604.
[0157] S608: Send the alarm information.
[0158] Embodiment 7:
[0159] Figure 7 A structure diagram of a mountain landslide detection device is provided for the embodiments of the present application, and the device includes:
[0160] The acquisition module 701 is configured to acquire a current frame image of a mountain collected by a collection device and a previous frame image of the current frame image.
[0161] The processing module 702 is configured to determine whether the current frame image changes relative to the previous frame image according to a difference in a gray value of each pixel point in the current frame image and the previous frame image; if it is determined that the current frame image changes relative to the previous frame image, acquire a motion state corresponding to each feature point in the current frame image; wherein the motion state includes a speed.
[0162] The judgment and sending module 703 is configured to determine whether the speed in the motion state is greater than a preset speed threshold; if yes, send an alarm information.
[0163] In a possible implementation, the processing module 702 is specifically configured to, for each pixel point in the current frame image, determine a ratio of a first gray value of a pixel point corresponding to the pixel point in the previous frame image to a second gray value of the pixel point, and determine a difference value of the pixel point according to the ratio; cluster the difference values of each pixel point in the current frame image into two categories, and determine a center value of each category, determine a category corresponding to a change as a category with a larger center value, if a number of pixel points in the category corresponding to the change exceeds a preset threshold, determine that the current frame image changes relative to the previous frame image, otherwise, determine that the current frame image does not change relative to the previous frame image.
[0164] In a possible implementation, the processing module 702 is specifically configured to determine a logarithm of the ratio, and determine an absolute value of the logarithm as the difference value of the pixel point.
[0165] In a possible implementation, the processing module 702 is specifically configured to, for each pixel point in the current frame image, determine a ratio of a first gray value of a pixel point corresponding to the pixel point in the previous frame image to a second gray value of the pixel point, and determine a difference value of the pixel point according to the ratio; determine a corresponding difference image according to the difference values of each pixel point in the current frame image; extract each feature point in a moving mountain region of the difference image by using a Shi-Tomasi algorithm; determine each feature point at a corresponding position in the current frame image and the previous frame image according to a position of each extracted feature point in the difference image; process each feature point in the current frame image and the previous frame image by using a pyramid optical flow method, and determine a motion state corresponding to each feature point in the current frame image.
[0166] In a possible implementation, the processing module 702 is further configured to acquire other acquisition devices that acquire images of the mountain, acquire images acquired by the other acquisition devices when the acquisition device acquires the current frame image, and acquire a to-be-processed motion state corresponding to each feature point in the images; acquire a speed in the motion state and a to-be-processed speed in the to-be-processed motion state; determine a target speed according to preset weights corresponding to the acquisition device and the other acquisition devices, the speed, and the to-be-processed speed; and update the speed in the motion state by using the target speed.
[0167] In a possible implementation, the determining and sending module 703 is further configured to, if the speed in the motion state is greater than a preset speed threshold, for each pixel point of the current frame image, determine a ratio of a first gray value of a pixel point corresponding to the pixel point in the previous frame image to a second gray value of the pixel point, and determine a difference value of the pixel point according to the ratio; determine a sum value of the difference values of each pixel point of the current frame image; and determine whether the sum value is greater than a preset difference threshold, and if so, perform a subsequent step of sending alarm information.
[0168] In a possible implementation, the determining and sending module 703 is specifically configured to acquire a detected mountain name corresponding to the acquisition device, and acquire an acquisition time at which the acquisition device acquires the current frame image; and send the mountain name and the acquisition time in the alarm information.
[0169] Embodiment 8
[0170] Figure 8 An electronic device structure schematic diagram provided by the embodiment of the application, on the basis of the above embodiments, the embodiment of the application further provides an electronic device, as shown in Figure 8 The processor 801, the communication interface 802, and the memory 803 can communicate with each other through the communication bus 804.
[0171] The memory 803 stores a computer program, and when the program is executed by the processor 801, the processor 801 performs the following steps:
[0172] Acquire a current frame image of a mountain acquired by an acquisition device and a previous frame image of the current frame image.
[0173] determine whether the current frame image changes relative to the previous frame image according to a difference in a gray value of each pixel point in the current frame image and the previous frame image; if it is determined that the current frame image changes relative to the previous frame image, obtain a motion state corresponding to each feature point in the current frame image; wherein the motion state comprises a speed;
[0174] determine whether the speed in the motion state is greater than a preset speed threshold, and if so, send an alarm message.
[0175] Further, the processor 801 is specifically configured to determine, for each pixel point of the current frame image, a ratio of a first gray value of a pixel point corresponding to the pixel point in the previous frame image to a second gray value of the pixel point, and determine a difference value of the pixel point according to the ratio;
[0176] cluster the difference values of each pixel point in the current frame image into two categories, determine a center value of each category, determine a category corresponding to a change as a category with a larger center value, and if a number of pixel points in the category corresponding to the change exceeds a preset threshold, determine that the current frame image changes relative to the previous frame image, otherwise, determine that the current frame image does not change relative to the previous frame image.
[0177] Further, the processor 801 is specifically configured to determine a logarithm of the ratio, and determine an absolute value of the logarithm as the difference value of the pixel point.
[0178] Further, the processor 801 is specifically configured to determine, for each pixel point of the current frame image, a ratio of a first gray value of a pixel point corresponding to the pixel point in the previous frame image to a second gray value of the pixel point, and determine a difference value of the pixel point according to the ratio; determine a corresponding difference image according to the difference value of each pixel point in the current frame image; extract each feature point in a motion mountain area of the difference image using a Shi-Tomasi algorithm; and determine each feature point at a corresponding position of the current frame image and the previous frame image according to a position of each extracted feature point in the difference image.
[0179] process each feature point in the current frame image and the previous frame image using a pyramid optical flow method, and determine a motion state corresponding to each feature point in the current frame image.
[0180] Further, the processor 801 is also configured to obtain other acquisition devices that acquire images of the mountain, obtain an image acquired by the other acquisition devices at a time when the acquisition device acquires the current frame image, and obtain a to-be-processed motion state corresponding to each feature point in the image.
[0181] The speed in the motion state and a to-be-processed speed in the to-be-processed motion state are acquired, a target speed is determined according to preset weights corresponding to the acquisition device and the other acquisition devices, the speed in the motion state is updated by using the target speed.
[0182] Further, if the speed in the motion state is greater than a preset speed threshold, the processor 801 is further configured to determine, for each pixel point of the current frame image, a ratio of a first gray value of a pixel point corresponding to the pixel point in the previous frame image to a second gray value of the pixel point, determine a difference value of the pixel point according to the ratio, and determine a sum value of the difference values of each pixel point of the current frame image.
[0183] It is determined whether the sum value is greater than a preset difference threshold, and if yes, a subsequent step of sending an alarm information is performed.
[0184] Further, the processor 801 is specifically configured to acquire a detected mountain name corresponding to the acquisition device, and acquire a collection time at which the acquisition device collects the current frame image.
[0185] The mountain name and the collection time are carried in the alarm information and sent.
[0186] The communication bus mentioned in the above server can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or only one type of bus.
[0187] The communication interface is used for communication between the above electronic device and other devices.
[0188] The memory can include a random access memory (RAM) and can also include a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the aforementioned processor.
[0189] The processor can be a general processor, including a central processing unit, a network processor (NP), etc.; can also be a digital signal processor (DSP), an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, etc.
[0190] Embodiment 9:
[0191] Based on the above embodiments, the embodiment of the present application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program executable by an electronic device, and when the program runs on the electronic device, the electronic device executes the following steps:
[0192] The memory stores a computer program, and when the program is executed by the processor, the processor executes the following steps:
[0193] Obtain a current frame image of a mountain collected by a collection device and a previous frame image of the current frame image;
[0194] Determine whether the current frame image changes relative to the previous frame image according to the difference of the gray value of each pixel point in the current frame image and the previous frame image; if it is determined that the current frame image changes relative to the previous frame image, obtain the motion state corresponding to each feature point in the current frame image; wherein the motion state includes speed;
[0195] Determine whether the speed in the motion state is greater than a preset speed threshold, and if so, send an alarm information.
[0196] In a possible implementation, the determining whether the current frame image changes relative to the previous frame image according to the difference of the gray value of each pixel point in the current frame image and the previous frame image includes:
[0197] For each pixel point in the current frame image, determine the ratio of the first gray value of the pixel point corresponding to the pixel point in the previous frame image to the second gray value of the pixel point, and determine the difference value of the pixel point according to the ratio;
[0198] Cluster the difference value of each pixel point in the current frame image into two categories, and determine the center value of each category; determine the category corresponding to the change as the category with a larger center value; if the number of pixel points in the category corresponding to the change exceeds a preset threshold, it is determined that the current frame image changes relative to the previous frame image, otherwise, it is determined that the current frame image does not change relative to the previous frame image.
[0199] In a possible implementation, the determining the difference value of the pixel point according to the ratio includes:
[0200] determining a logarithm of the ratio, and determining an absolute value of the logarithm as the difference value of the pixel point.
[0201] In a possible implementation, the obtaining the motion state corresponding to each feature point in the current frame image includes:
[0202] For each pixel point in the current frame image, determining a ratio of a first gray value of a pixel point corresponding to the pixel point in the previous frame image to a second gray value of the pixel point, and determining a difference value of the pixel point according to the ratio; determining a difference image corresponding to each difference value of each pixel point in the current frame image; extracting each feature point in a motion mountain area of the difference image by using a Shi-Tomasi algorithm; and determining each feature point at a corresponding position in the current frame image and the previous frame image according to a position of each extracted feature point in the difference image.
[0203] processing each feature point in the current frame image and the previous frame image by using a pyramid optical flow method, and determining a motion state corresponding to each feature point in the current frame image.
[0204] In a possible implementation, after the obtaining the motion state corresponding to each feature point in the current frame image, and before the determining whether the speed in the motion state is greater than a preset speed threshold, the method further includes:
[0205] obtaining another acquisition device that acquires images of the mountain, obtaining an image acquired by the other acquisition device when the acquisition device acquires the current frame image, and obtaining a to-be-processed motion state corresponding to each feature point in the image;
[0206] obtaining a speed in the motion state and a to-be-processed speed in the to-be-processed motion state, determining a target speed according to preset weights corresponding to the acquisition device and the other acquisition device, the speed, and the to-be-processed speed, and updating the speed in the motion state by using the target speed.
[0207] In a possible implementation, if the speed in the motion state is greater than the preset speed threshold, the method includes, before the sending the alarm information:
[0208] For each pixel point in the current frame image, determining a ratio of a first gray value of a pixel point corresponding to the pixel point in the previous frame image to a second gray value of the pixel point, and determining a difference value of the pixel point according to the ratio; and determining a sum value of the difference values of each pixel point in the current frame image.
[0209] determining whether the sum is greater than a preset difference threshold, and if so, performing a subsequent step of sending alarm information.
[0210] In one possible implementation, the sending alarm information includes:
[0211] obtaining a detected mountain name corresponding to the acquisition device, and obtaining a collection time at which the acquisition device collects the current frame image;
[0212] carrying the mountain name and the collection time in the alarm information.
[0213] Those skilled in the art will understand that embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer usable program code.
[0214] The present application is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems) and computer program products according to this application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, as well as combinations of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce an apparatus that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 means for performing the functions specified in the flowchart
[0215] These computer program instructions can also be stored in a computer-readable memory that can direct the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means, which implement the functions specified in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 means for performing the functions specified in the flowchart
[0216] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are performed on the computer or other programmable data processing apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable data processing apparatus provide a process for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1one or more processes and / or blocks Figure 1 the steps of a function specified in one or more blocks.
[0217] It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application cover the modifications and variations of this application provided they come within the scope of the appended claims and their equivalents.
Claims
1. A method of detecting a landslide, characterized by, The method comprises: acquiring a current frame image of a mountain collected by a collection device and a previous frame image of the current frame image; determining whether the current frame image changes relative to the previous frame image according to a difference in a gray value of each pixel point in the current frame image and the previous frame image; if it is determined that the current frame image changes relative to the previous frame image, acquiring a motion state corresponding to each feature point in the current frame image; wherein the motion state comprises a speed; determining whether the speed in the motion state is greater than a preset speed threshold; if yes, sending an alarm information; the acquiring of the motion state corresponding to each feature point in the current frame image comprises: for each pixel point in the current frame image, determining a ratio of a first gray value of a pixel point corresponding to the pixel point in the previous frame image to a second gray value of the pixel point, and determining a difference value of the pixel point according to the ratio; determining a corresponding difference image according to the difference value of each pixel point in the current frame image; extracting each feature point in a moving mountain region of the difference image by using a corner point detection Shi-Tomasi algorithm; and determining each feature point at a corresponding position of the current frame image and the previous frame image according to a position of each extracted feature point in the difference image; processing each feature point in the current frame image and the previous frame image by using a pyramid optical flow method to determine a motion state corresponding to each feature point in the current frame image.
2. The method of claim 1, wherein, the determining of whether the current frame image changes relative to the previous frame image according to the difference in the gray value of each pixel point in the current frame image and the previous frame image comprises: for each pixel point in the current frame image, determining a ratio of a first gray value of a pixel point corresponding to the pixel point in the previous frame image to a second gray value of the pixel point, and determining a difference value of the pixel point according to the ratio; clustering the difference value of each pixel point in the current frame image into two categories, and determining a center value of each category; determining a category with a larger center value as a change corresponding category; if a number of pixel points in the change corresponding category exceeds a preset threshold, determining that the current frame image changes relative to the previous frame image; otherwise, determining that the current frame image does not change relative to the previous frame image.
3. The method of claim 2, wherein, the determining of the difference value of the pixel point according to the ratio comprises: determining a logarithm of the ratio, and determining an absolute value of the logarithm as the difference value of the pixel point.
4. The method of claim 1, wherein, after the acquiring of the motion state corresponding to each feature point in the current frame image and before the determining of whether the speed in the motion state is greater than the preset speed threshold, the method further comprises: acquiring other collection devices for collecting images of the mountain, acquiring an image collected by the other collection devices when the collection device collects the current frame image, and acquiring a to-be-processed motion state corresponding to each feature point in the image; The speed in the motion state and a to-be-processed speed in the to-be-processed motion state are acquired, a target speed is determined according to preset weights corresponding to the acquisition device and the other acquisition devices, the speed in the motion state, and the to-be-processed speed, and the target speed is used to update the speed in the motion state.
5. The method of claim 1, wherein, If the speed in the motion state is greater than a preset speed threshold, the method comprises the following steps before the alarm information is sent: For each pixel point of the current frame image, a ratio of a first gray value of a pixel point corresponding to the pixel point in the previous frame image to a second gray value of the pixel point is determined, and a difference value of the pixel point is determined according to the ratio; a sum value of the difference values of each pixel point of the current frame image is determined. It is judged whether the sum value is greater than a preset difference threshold, and if yes, the subsequent step of sending the alarm information is executed.
6. The method of claim 1, wherein, The sending of the alarm information comprises: The name of the detected mountain corresponding to the acquisition device is acquired, and a collection time at which the acquisition device collects the current frame image is acquired; The name of the mountain and the collection time are carried in the alarm information and sent.
7. A landslide detection apparatus, characterized by, The device comprises: An acquisition module is configured to acquire a current frame image of a mountain collected by an acquisition device and a previous frame image of the current frame image; A processing module is configured to determine whether the current frame image changes relative to the previous frame image according to a difference between gray values of each pixel point in the current frame image and the previous frame image; if it is determined that the current frame image changes relative to the previous frame image, a motion state of each feature point in the current frame image is acquired; wherein the motion state comprises a speed; A judgment sending module is configured to judge whether the speed in the motion state is greater than a preset speed threshold, and if yes, an alarm information is sent; For each pixel point of the current frame image, a ratio of a first gray value of a pixel point corresponding to the pixel point in the previous frame image to a second gray value of the pixel point is determined, and a difference value of the pixel point is determined according to the ratio; a sum value of the difference values of each pixel point of the current frame image is determined.
8. An electronic device, comprising: The electronic device at least comprises a processor and a memory, and the processor is configured to execute a computer program stored in the memory to realize the steps of the mountain landslide detection method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The electronic device at least comprises a processor and a memory, and the processor is configured to execute a computer program stored in the memory to realize the steps of the mountain landslide detection method according to any one of claims 1-6. The electronic device at least comprises a processor and a memory, and the processor is configured to execute a computer program stored in the memory to realize the steps of the mountain landslide detection method according to any one of claims 1-6.
Citation Information
Patent Citations
Slope monitoring method and device, electronic equipment and storage medium
CN115359396A