A weather forecasting method and device, and a storage medium
Patent Information
- Application Number
- CN202210557255.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-20
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2042-05-20
AI Technical Summary
[0002]气象预报系统存在站点少、数据分散的特点,不利于预报的精准度
[0021]在一示例性实施例中,所述方法还包括,当同一监控相机的多个预置采样点位的图像分别确定的多个天气信息中存在一个天气信息与其他天气信息不同,则分析不同的采样点位对应的拍摄方向上最近的一个或多个监控相机采集画面的天气信息,若所述天气信息不同的采样点位与对应的拍摄方向上最近的一个或多个监控相机采集画面的天气信息相同,则将该第一类监控相机作为边界监控相机;若所述天气信息不同的采样点位与对应的拍摄方向上最近的一个或多个监控相机采集画面的天气信息不同且对应的拍摄方向上最近的一个或多个监控相机采集画面的天气信息与其他预置采样点位相同,则将该监控相机作为本区域的另一中心监控相机。本实施例方案所能产生的有益效果是:1)避免简单的少数服从多数原则导致特殊天气信息的遗漏;2)相较于通过一个中心监控相机利用圆形扫描监控点位寻找边界监控相机的方案,本方案能够使同一天气的摄像机查找更全面,省去后续合并相近天气区域的步骤。
Smart Images

Figure CN117132881B_ABST
Abstract
Description
Technical Field
[0001] This article relates to weather forecasting technology, and more particularly to a weather forecasting method, device, and storage medium. Background Technology
[0002] Meteorological forecasting systems suffer from a lack of stations and fragmented data, which hinders forecast accuracy. Within the same region, significant weather changes can occur within a few kilometers, and weather patterns are not fixed like administrative regions; they exhibit natural irregularities. Consequently, current weather forecasting systems are characterized by untimeliness, inaccuracy, and large regional variations. Summary of the Invention
[0003] This application provides a weather forecasting method, apparatus, and storage medium to improve the accuracy of weather forecasts.
[0004] This application provides a weather forecasting method, applied to a monitoring system including multiple surveillance cameras, comprising:
[0005] The monitoring camera is controlled to acquire images at multiple preset sampling points; the weather information of the location of the monitoring camera during the image acquisition period is determined based on the images acquired at the preset sampling points, and this information is used as the weather information of the monitoring camera during the acquisition period.
[0006] For any given data collection period, the regional weather distribution is determined based on the weather information from the multiple surveillance cameras and their geographical locations on the map.
[0007] In an exemplary embodiment, the plurality of preset sampling points satisfy at least one of the following:
[0008] It must include at least two sampling points that are not in the water or on the ground;
[0009] It must contain at least 3 sampling points, and the span between the sampling points must be greater than or equal to a preset angle threshold;
[0010] When there is water around the monitoring camera, there is at least one water sampling point.
[0011] In an exemplary embodiment, when one of the multiple weather information determined from images at multiple preset sampling points of the same monitoring camera is different from the other weather information, the monitoring camera is controlled to collect images at non-preset sampling points. New weather information is determined based on the images collected at non-preset sampling points. When the new weather information is the same as the majority of the multiple weather information, the new weather information is used to replace the weather information that is different from the other weather information.
[0012] In one exemplary embodiment, the method further includes, when the new weather information is the same as a minority of the weather information among the plurality of weather information, marking the surveillance camera as a first type of surveillance camera;
[0013] Find one or more surveillance cameras adjacent to the first type of surveillance cameras. If the one or more surveillance cameras are not first type of surveillance cameras and the weather information of the one or more surveillance cameras is the same, ignore the weather information of the minority of the first type of surveillance cameras.
[0014] In an exemplary embodiment, determining the location of the surveillance camera based on the image and the weather information during the image acquisition period includes:
[0015] The image is converted into a binary image, and the location of the monitoring camera during the image acquisition period is determined based on the binary image, or the binary image and the binary images of the image frames preceding the current image.
[0016] Alternatively, image samples corresponding to different weather information can be pre-established, the image can be matched with the image samples, and the weather information of the location of the monitoring camera during the image acquisition period can be determined based on the weather information corresponding to the matched image samples.
[0017] In an exemplary embodiment, determining the regional weather distribution based on the weather information from the plurality of surveillance cameras during the data collection period and the geographical locations of the plurality of surveillance cameras on the map includes:
[0018] Surveillance cameras with the same weather information and geographical proximity are grouped together to form a surveillance camera group. For any surveillance camera group, the weather information of the surveillance cameras in the surveillance camera group is used as the weather information of the area formed by the geographical location of the surveillance cameras in the surveillance camera group during the collection period.
[0019] In an exemplary embodiment, combining surveillance cameras with the same weather information and geographical proximity to form a surveillance camera group includes:
[0020] Using any surveillance camera as the center, a camera is designated as the central surveillance camera. Surveillance cameras with the same weather as the central surveillance camera are found radiating outwards with different radii until the camera with the largest distance from the central surveillance camera in each direction and the same weather is found. These cameras are called boundary surveillance cameras. Surveillance cameras located on the line connecting the boundary surveillance cameras and the central surveillance camera are all in the same weather. The central surveillance camera, the boundary surveillance cameras in each direction, and the surveillance cameras located on the line connecting the two are formed into the surveillance camera group. Alternatively, the central surveillance camera and the boundary surveillance cameras in each direction are also formed into the surveillance camera group.
[0021] In an exemplary embodiment, the method further includes: when one piece of weather information differs from the other weather information among multiple weather information determined from images of multiple preset sampling points of the same surveillance camera, analyzing the weather information captured by one or more surveillance cameras in the shooting direction corresponding to the different sampling points; if the sampling point with different weather information is the same as the weather information captured by one or more surveillance cameras in the corresponding shooting direction, then the first type of surveillance camera is designated as a boundary surveillance camera; if the sampling point with different weather information is different from the weather information captured by one or more surveillance cameras in the corresponding shooting direction, and the weather information captured by one or more surveillance cameras in the corresponding shooting direction is the same as other preset sampling points, then the surveillance camera is designated as another central surveillance camera in the area. The beneficial effects of this embodiment are: 1) avoiding the omission of special weather information due to the simple majority rule; 2) compared with the scheme of finding boundary surveillance cameras by using a circular scan of monitoring points through a central surveillance camera, this scheme can make the search for cameras with the same weather more comprehensive, saving the subsequent step of merging similar weather areas.
[0022] In one exemplary embodiment, the weather information includes rainfall information at the location of the monitoring camera;
[0023] The method further includes: drawing a rainfall map based on weather information from the meteorological station and the plurality of monitoring cameras.
[0024] This disclosure provides a weather forecasting device, including a memory and a processor. The memory stores a program, which, when read and executed by the processor, implements the weather forecasting method described in any of the above embodiments.
[0025] This disclosure provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the weather forecasting method described in any of the above embodiments.
[0026] Compared with related technologies, this application embodiment includes a weather forecasting method and apparatus, and a storage medium. The weather forecasting method is applied to a monitoring system including multiple monitoring cameras, and includes: controlling the monitoring cameras to acquire images at multiple preset sampling points; determining the weather information of the monitoring camera's location during the image acquisition period based on the images acquired at the preset sampling points, and using this as the weather information of the monitoring camera during that acquisition period; for any acquisition period, determining the regional weather distribution based on the weather information of the multiple monitoring cameras during that acquisition period and the geographical locations of the multiple monitoring cameras on a map. The solution provided in this embodiment determines the weather through images from monitoring cameras and makes weather forecasts based on the weather from the monitoring cameras. Compared with traditional weather forecasting systems that forecast weather for fixed areas, the solution provided in this embodiment is more accurate, can utilize existing monitoring systems, is low-cost, and easy to implement.
[0027] Other features and advantages of this application will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the application. Other advantages of this application can be realized and obtained by means of the solutions described in the description and the accompanying drawings. Attached Figure Description
[0028] The accompanying drawings are used to provide an understanding of the technical solutions of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain the technical solutions of this application and do not constitute a limitation on the technical solutions of this application.
[0029] Figure 1 A flowchart of a weather forecasting method provided in this embodiment of the disclosure;
[0030] Figure 2 A flowchart of a weather forecasting method provided as an exemplary embodiment;
[0031] Figure 3 A schematic diagram of a surveillance camera provided as an exemplary embodiment;
[0032] Figure 4 A schematic diagram of a binary image provided for an exemplary embodiment;
[0033] Figure 5 A schematic diagram of the distribution of surveillance cameras on a map, provided as an exemplary embodiment;
[0034] Figure 6 A schematic diagram of the distribution of surveillance cameras on a map provided for an exemplary embodiment (the locations of the surveillance cameras have been circled);
[0035] Figure 7 A schematic diagram of a surveillance camera assembly provided as an exemplary embodiment;
[0036] Figure 8 A schematic diagram of an area comprised of surveillance cameras, provided as an exemplary embodiment;
[0037] Figure 9 Weather diagrams of different regions provided as an exemplary embodiment;
[0038] Figure 10 Weather diagrams for different regions provided as another exemplary embodiment;
[0039] Figure 11 A schematic diagram of a weather forecasting device provided for an exemplary embodiment. Detailed Implementation
[0040] This application describes several embodiments, but these descriptions are exemplary and not restrictive, and it will be apparent to those skilled in the art that many more embodiments and implementations are possible within the scope of the embodiments described herein. Although many possible combinations of features are shown in the drawings and discussed in the detailed description, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with, or may replace, any feature or element of any other embodiment.
[0041] This application includes and contemplates combinations of features and elements known to those skilled in the art. The embodiments, features, and elements disclosed in this application may also be combined with any conventional features or elements to form a unique inventive scheme as defined by the claims. Any feature or element of any embodiment may also be combined with features or elements from other inventive schemes to form another unique inventive scheme as defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in this application may be implemented individually or in any suitable combination. Therefore, the embodiments are not limited except by the limitations imposed by the appended claims and their equivalents. Furthermore, various modifications and changes may be made within the scope of the appended claims.
[0042] Furthermore, in describing representative embodiments, the specification may have presented methods and / or processes as a specific sequence of steps. However, the method or process should not be limited to the specific order of steps described herein, to the extent that it does not depend on such a specific order. As will be understood by those skilled in the art, other sequences of steps are also possible. Therefore, the specific order of steps set forth in the specification should not be construed as a limitation of the claims. Moreover, the claims concerning the method and / or process should not be limited to the steps performed in the written order, and those skilled in the art will readily understand that these orders can be varied and still remain within the spirit and scope of the embodiments of this application.
[0043] Video surveillance is widely used in smart city initiatives. With the development of artificial intelligence, the application of intelligent recognition in surveillance is increasing, such as traffic incident and violation identification, facial recognition, and human behavior analysis. Currently, tens of millions of surveillance cameras are distributed across various social locations in towns and villages, and the number of network cameras (IP cameras, IPCs) is growing rapidly. Combining the development of artificial intelligence and the widespread application of Geographic Information Systems (GIS), along with the increasing prevalence of surveillance in society, can effectively improve the real-time performance, regional accuracy, and reliability of current weather forecasts.
[0044] Figure 1 This is a flowchart illustrating a weather forecasting method provided in an embodiment of this disclosure. Figure 1 As shown, the weather forecasting method provided in this embodiment is applied to a monitoring system including multiple surveillance cameras, including:
[0045] Step 101: Control the monitoring camera to acquire images, and determine the weather information of the monitoring camera's location during the image acquisition period based on the images. This information is referred to as the weather information of the monitoring camera during the acquisition period.
[0046] Step 102: For any collection period, based on the weather information of the multiple surveillance cameras and their geographical locations on the map during that collection period, surveillance cameras with the same weather information and geographical proximity are grouped to form a surveillance camera group. For any surveillance camera group, the weather information of the surveillance cameras in the surveillance camera group is used as the weather information of the area formed by the geographical locations of the surveillance cameras in the surveillance camera group during that collection period.
[0047] The solution provided in this embodiment determines the weather by monitoring images from a camera and makes a weather forecast based on the weather formation area of the camera. Compared with the weather forecast for a fixed area in traditional weather forecasting systems, the solution provided in this embodiment is more accurate, can utilize existing monitoring systems, is low-cost, and easy to implement.
[0048] In one exemplary embodiment, the data collection period can be a period of time or a moment.
[0049] In one exemplary embodiment, controlling the surveillance camera to acquire images may involve controlling some of the surveillance cameras in the surveillance system to acquire images. This is because some of the surveillance cameras in the surveillance system may be located indoors, or the monitoring angle may be unusual, making it impossible to obtain weather information from the acquired images. Therefore, some of the surveillance cameras in the surveillance system can be used to acquire images to obtain weather information.
[0050] In an exemplary embodiment, controlling the monitoring camera to acquire images includes: controlling the monitoring camera to acquire images at multiple preset sampling points respectively;
[0051] Determining the weather information of the location of the surveillance camera during the image acquisition period based on the image includes: determining the weather information of the location of the surveillance camera during the image acquisition period based on the image acquired at the preset sampling points. Multiple weather information items are determined based on the images acquired at multiple preset sampling points. For example, if there are three preset sampling points, one weather information item is determined based on each preset sampling point, thus obtaining three weather information items. This embodiment is not limited to this; there may be only one preset sampling point; or, there may be no preset sampling point, and images can be acquired from the regular monitoring screen of the surveillance camera.
[0052] In an exemplary embodiment, the plurality of preset sampling points may satisfy at least one of the following:
[0053] It must include at least two sampling points that are not in the water or on the ground;
[0054] It must contain at least 3 sampling points, and the span between the sampling points must be greater than or equal to a preset angle threshold;
[0055] When there is water around the monitoring camera, there is at least one water sampling point.
[0056] The preset angle threshold is, for example, 30°, but this embodiment is not limited to this and can be other angles. The large span between sampling points can cover the area surrounding the monitoring camera as much as possible, reducing the chance of subsequent weather judgment errors.
[0057] In an exemplary embodiment, when one piece of weather information differs from the others among multiple weather information determined from images at multiple preset sampling points of the same monitoring camera, the monitoring camera is controlled to acquire images at non-preset sampling points. New weather information is determined based on the images acquired at these non-preset sampling points. When this new weather information is the same as the majority of the multiple weather information, it replaces the weather information that differs from the others. For example, if the weather information obtained from the first and second preset sampling points is heavy snow, and the weather information obtained from the third preset sampling point is light snow, then an image can be acquired at another sampling point different from the aforementioned preset sampling points. The new weather information determined from the image at this other sampling point is heavy snow, and heavy snow is used to replace the weather information at the third preset sampling point. The solution provided in this embodiment can correct potentially erroneous weather information, such as errors in weather information at a preset sampling point caused by building obstruction, factory smoke, etc. In an exemplary embodiment, when the weather information of a preset sampling point is different from that of other preset sampling points multiple times, the administrator can be prompted whether to change the preset sampling point.
[0058] In one exemplary embodiment, the method further includes, when the new weather information is the same as a minority of the weather information among the plurality of weather information, marking the surveillance camera as a first type of surveillance camera;
[0059] The system identifies one or more surveillance cameras adjacent to the first type of surveillance camera. If these cameras are not of the first type and their weather information is identical, the minority weather information from the first type of surveillance camera is ignored. Instead, the majority weather information from the first type of surveillance camera is used as the weather information for that camera. This embodiment provides a solution to correct potentially erroneous weather information. For example, among the three preset sampling points of surveillance camera A1, the weather information obtained from the first and second preset sampling points is heavy snow, and the weather information obtained from the third preset sampling point is light snow. At this time, an image can be collected at another sampling point different from the aforementioned preset sampling points. Based on the image of this other sampling point, the new weather information is determined to be light snow. At this time, the weather information of the third preset sampling point of the surveillance camera is marked as questionable. It is determined that the weather information of surveillance camera A1 and the adjacent surveillance cameras A2 and A3 (this is just an example, there could be more or fewer adjacent surveillance cameras) are both heavy snow. At this time, the weather information obtained by surveillance camera A1 from the third preset sampling point can be ignored, that is, heavy snow will be used as the weather information of surveillance camera A1 in the future. In another exemplary embodiment, when the new weather information is the same as a minority of the multiple weather information, images can be re-acquired at the first preset sampling point and the second preset sampling point to determine the weather information. If it is still heavy snow, the weather information of monitoring camera A1 is heavy snow; if it is light snow, the weather information of monitoring camera A1 is light snow, and so on.
[0060] In an exemplary embodiment, determining the location of the surveillance camera based on the image and the weather information during the image acquisition period may include:
[0061] The image is converted into a binary image. Based on the binary image, or the binary image and the binary images of the previous image frames, the weather information of the location of the monitoring camera during the image acquisition period is determined. If the acquired image is a color image, it can be converted into a grayscale image first, and then the grayscale image can be converted into a binary image. If the acquired image is a grayscale image, it can be directly converted into a binary image.
[0062] Alternatively, image samples corresponding to different weather information can be pre-established. The image is then matched with these image samples, and the weather information corresponding to the matched image samples is used to determine the weather information for the location of the monitoring camera during the image acquisition period. A matching model can be established through training. The acquired image is input into the matching model, and the weather information is determined based on the model's output.
[0063] The above method is merely an example; weather information can be determined using other methods. For instance, it can be based on artificial intelligence image recognition or other image comparison and information extraction algorithms.
[0064] In an exemplary embodiment, taking snowy weather as an example, determining the location of the monitoring camera during the image acquisition period based on the binary image, or the binary image and the binary images of previous image frames, may include: obtaining the number of black or white pixels in the binary image of the current image, or the number of pixels that differ between the binary image of the current image and the binary images of previous image frames, and the shape of the region formed by consecutive black or white pixels in the binary image of the current image, to determine the weather information. For example, based on the shape of the region formed by consecutive black or white pixels in the binary image of the current image, it can be determined whether it is currently raining or snowing. If it is currently raining or snowing, the ratio of the number of pixels to the total number of pixels (i.e., the number of pixels in the binary image) is compared with multiple preset thresholds to determine whether it is heavy snow, moderate snow, or light snow, etc. The ratio of the number of differing pixels to the total number of pixels (i.e., the number of pixels in the binary image) is compared with several preset thresholds to determine whether the wind force is level 5 or above, level 3 to 5, level 1 to 2, or no wind, etc.
[0065] In an exemplary embodiment, combining surveillance cameras with the same weather information and geographical proximity to form a surveillance camera group includes:
[0066] Using any surveillance camera as the center, designated as the central surveillance camera, cameras with the same weather as the central surveillance camera are searched outwards with different radii until the cameras with the largest distance from the central surveillance camera in all directions and the same weather are found; these are called boundary surveillance cameras. Surveillance cameras located on the line connecting the boundary surveillance cameras and the central surveillance camera all share the same weather. The central surveillance camera, the boundary surveillance cameras in each direction, and the cameras on the line connecting them form a surveillance camera group. Alternatively, the central surveillance camera and the boundary surveillance cameras in each direction can also form a surveillance camera group. Using this method, surveillance cameras that are identical and geographically adjacent can be grouped together, with each group corresponding to a region, thus forming multiple regions. This allows for weather forecasting by region, where the region is related to the weather rather than a fixed administrative division, resulting in more accurate weather forecasts. The method for forming surveillance camera groups described here is merely an example; other methods can be used to combine surveillance cameras with the same weather, and this disclosure does not limit this approach.
[0067] In one exemplary embodiment, the weather information includes rainfall information at the location of the monitoring camera;
[0068] The method further includes: drawing a rainfall map based on weather information from the meteorological station and the plurality of monitoring cameras.
[0069] In related technologies, rainfall maps are generated by interpolating information collected from weather stations to form color blocks, with different colors representing different amounts of rainfall. However, weather stations are often set up only at relatively large intervals (e.g., one every 5km), resulting in low accuracy. Due to cost constraints, it is not feasible to set up more weather stations. In this embodiment, rainfall can be detected using monitoring cameras. When drawing the rainfall map, combining weather station information and weather information from the monitoring cameras yields a more accurate map. The rainfall information can include heavy rain, moderate rain, light rain, no rain, etc., which are just examples; more rainfall levels can be set as needed.
[0070] In an exemplary embodiment, controlling the monitoring camera to acquire images includes: controlling the monitoring camera to acquire images at a preset period. The preset period is, for example, 10 to 30 minutes, and is merely an example; it can be longer or shorter. After acquiring images at each preset period, the weather is determined based on the images, and areas are divided according to the determined weather to achieve regional weather forecasting, thereby enabling real-time weather forecasting.
[0071] The implementation of the technical solution disclosed herein will be further illustrated by a specific example below.
[0072] Figure 2 This is a flowchart illustrating a weather forecasting method provided as an exemplary embodiment. In this embodiment, a weather forecast is generated for a city. Figure 2 As shown, the weather forecasting method provided in this embodiment may include:
[0073] Step 201: Obtain surveillance camera information from the city's surveillance system;
[0074] Obtain the surveillance camera information in the city's surveillance system, mark all surveillance cameras, and record the camera type, location, etc., as shown in Table 1.
[0075] Table 1 may include information such as identifier (id), camera code, camera name, type, location, longitude, and latitude. Here, id represents the identifier of this information, type indicates the camera type (common types include bullet camera, standard PTZ camera, infrared PTZ camera, etc.), and the camera types included here are only examples; other types may be included. In the following embodiments, different type values indicate the following types: 1 = bullet camera; 2 = PTZ camera; 3 = infrared PTZ camera. This is only an example; other values can be used to indicate different types. Location indicates the camera's installation location, commonly including indoor, low-altitude outdoor, high-altitude outdoor, and outdoor obstruction. Different values can be used to indicate this; for example, location value 1 represents indoor location, location value 2 represents low-altitude outdoor location, location value 3 represents high-altitude indoor location, and location value 4 represents outdoor obstruction. This is only an example; other values can be used. Longitude and latitude information represent the longitude and latitude of the camera's geographical location.
[0076] Table 1 Camera Information Record Table
[0077]
[0078] Step 202: Determine the preset sampling points of the surveillance camera.
[0079] After filtering out outdoor surveillance cameras from the monitoring system, the subsequent video analysis is needed to determine the weather in the current scene. Therefore, there are certain requirements for the analysis footage of each scene. For example, if a camera mounted on a wall is facing a wall, it cannot collect effective data. Therefore, it is necessary to obtain an effective sampling angle and set it as a preset sampling point.
[0080] In an exemplary embodiment, the plurality of preset sampling points may satisfy, but is not limited to, at least one of the following:
[0081] It must include at least two sampling points that are not in the water or on the ground;
[0082] It includes at least 3 sampling points, and the span between the sampling points is greater than or equal to a preset angle threshold; in an exemplary embodiment, the preset angle threshold is, for example, 30°, but the embodiments disclosed herein are not limited thereto.
[0083] If there is water around the surveillance camera, there will be at least one water sampling point.
[0084] By integrating with a GIS system and based on the camera's field of view established during system deployment, as well as surrounding Points of Interest (POI) information, and through frame-taking analysis by rotating the monitoring camera, effective sample collection location information can be obtained. This allows for the determination and storage of the pre-set sampling point information for the monitoring camera. Table 2 shows the pre-set sampling point information for one monitoring camera. As shown in Table 2, this monitoring camera includes multiple pre-set sampling points: P_1, P_2, P_3, D_1, and D_2. Specifically, the horizontal angle of the monitoring camera in P_1 is 330°, the horizontal angle of the monitoring camera in P_2 is 0°, the horizontal angle of the monitoring camera in P_3 is 45°, the horizontal angle of the monitoring camera in D_1 is 340° and the vertical angle is 45°, and the horizontal angle of the monitoring camera in D_2 is 30° and the vertical angle is 45°. Table 2 is only an example; there may be more or fewer sampling points. Figure 3 The image in the center shows the location of a surveillance camera (code c000002). This surveillance camera can rotate 360 degrees horizontally.
[0085] Table 2 Preset Sampling Point Information Table
[0086] id camera_code P_1 P_2 P_3 D_1 D_2 10001 c000002 330° 0° 45° 340°;45° 30°;45°
[0087] Similarly, the preset sampling point information of other surveillance cameras is recorded.
[0088] Step 203: Control the monitoring camera to collect images at preset sampling points, and determine weather information based on the images.
[0089] For qualified surveillance cameras, real-time video analysis is performed. The system intelligently analyzes the video feed to determine the current weather conditions in the area where the camera is located. Common weather conditions include sunny, cloudy, rainy, and snowy. For different weather types, multiple scenarios can be analyzed. For example, snow can be categorized into light snow, moderate snow, heavy snow, and blizzard. Different classifications can be defined for these weather scenarios. For instance, the letter S can represent snow weather scenarios, where S1 represents light snow, S2 moderate snow, S3 heavy snow, S4 blizzard, and so on. This is just an example; other values can be used to indicate different weather conditions as needed.
[0090] Taking snowy weather as an example, other weather types can be analyzed using similar methods. This can be achieved through intelligent scene recognition, employing various techniques. The following explanation uses a snowy scene as an example.
[0091] Method 1: First, convert each frame of the image to grayscale to obtain a grayscale image. Then, binarize the grayscale image to obtain a binary image. For example... Figure 4 As shown.
[0092] Images captured by surveillance cameras are usually color images. In a standard grayscale image, the grayscale value of each pixel is a value between 0 and 255 (0 represents white, and 255 represents black). For example, a 1920*1080 image has 1920*1080 = 2,073,600 pixels. Each pixel is converted to a grayscale value between 0 and 255.
[0093] During binarization, pixels with gray values greater than a preset gray value threshold can be set to black, and pixels with gray values less than or equal to the preset gray value threshold can be set to white. For example, if the preset gray value threshold is set to 80 (this is just an example and can be other values), pixels with gray values less than or equal to 80 can be set to white, and pixels with gray values greater than 80 can be set to black, thus obtaining a binary image with only black and white pixels.
[0094] Determine the percentage of black pixels in a binary image relative to the total number of pixels in the image. Determine the current weather as snowing: when the percentage of black pixels is greater than or equal to a first preset threshold V1, it is heavy snow; when the percentage of black pixels is less than the first preset threshold V1 but greater than or equal to a second preset threshold V2, it is moderate snow; when the percentage of black pixels is less than the second preset threshold V2, it is light snow, and so on. Where V2... <V1。
[0095] Alternatively, determine the percentage difference in the number of white or black pixels between two frames. For example, in a 10x10 pixel image with 100 pixels, the current frame has 50 white pixels and 50 black pixels, while the previous frame has 30 white pixels and 70 black pixels. Comparing the two frames, the percentage of the differing pixels can be obtained (if the difference in white or black pixels between the current and previous frames is 20, the percentage of the differing pixels is 20 / 100 = 20%). This percentage is then compared to a preset threshold to determine weather information. For instance, if the current weather is windy, a strong wind is indicated when the percentage of differing pixels is greater than or equal to the third preset threshold V3; a moderate wind is indicated when the percentage of black pixels is less than the third preset threshold V3 but greater than or equal to the fourth preset threshold V4; a light breeze is indicated when the percentage of black pixels is less than the fourth preset threshold V4, and so on. Here, V4... <V3。
[0096] Method 2 involves training to collect weather conditions under various snow scenarios in advance, such as light snow, moderate snow, heavy snow, and blizzard. Various materials are collected as samples, and the collected images are compared with the samples to obtain the similarity. If the similarity with the sample reaches a preset similarity threshold, it is considered a matching sample, and the weather corresponding to the matching sample is determined.
[0097] Using method 1 or method 2 or other methods, weather information of the monitoring camera at different times can be obtained, as shown in Table 3. The table shows the weather information of the monitoring camera (code c000002) at 17:00 on March 8, 2022. The weather information obtained from the image of the preset sampling point P_1 of the monitoring camera is S2, the weather information obtained from the image of the preset sampling point P_2 of the monitoring camera is S2, the weather information obtained from the image of the preset sampling point P_3 of the monitoring camera is S2, the weather-related status information obtained from the image of the preset sampling point D_1 of the monitoring camera is D&1, and the weather-related status information obtained from the image of the preset sampling point D_2 of the monitoring camera is D&1. When the current weather is snowing, D&1 can indicate that it is currently snowing (i.e., snow can be detected in the air), and D&2 can indicate that it is not currently snowing (i.e., snow cannot be detected in the air). When the current weather is rainy, D&1 can indicate that it is currently raining (i.e., rain can be detected in the air), and D&2 can indicate that it is not currently raining (i.e., rain cannot be detected in the air). This is just an example, and other information can be used to indicate the weather-related status.
[0098] In some cases, changes in the social environment may lead to temporary scene changes that result in inaccurate information collection. For example, the presence of large vehicles or building obstructions in the monitored scene may cause inconsistencies in weather conditions obtained from images at different preset sampling points on the same monitoring unit (e.g., three weather information points are obtained from images at three preset sampling points P_1, P_2, and P_3, where two are consistent and the other is inconsistent; the two consistent points are called the majority weather information, and the other is called the minority weather information). In such cases, an additional information collection is added (images can be collected at new sampling points, and the weather information can be determined based on the new images). If the weather information obtained from a new sampling point is consistent with the majority of weather information, the minority weather information is determined to be abnormal data, and the abnormal data is replaced with the newly collected weather information. If the weather information obtained from a new sampling point is consistent with the minority weather information, it indicates that there is a probabilistic result anomaly in the current scene. The result of the monitoring camera is then marked as inconsistent, and a marker (such as Q, but not limited to this; other letters, numbers, or combinations thereof can be used) is recorded in the weather information of the monitoring camera, indicating that the monitoring camera is a first-type monitoring camera, and the weather information collected at a certain point (the sampling point corresponding to the minority weather information) is questionable. However, this embodiment is not limited to this; the weather information collected by the monitoring camera may not be marked as questionable. When the weather information obtained from images collected from multiple preset sampling points is inconsistent, the majority weather information can be used as the weather information of the monitoring camera. For example, if there are three preset sampling points, and the weather information obtained from images from two preset sampling points is S2, and the weather information obtained from the image from another preset sampling point is S3, then the weather information of the monitoring camera is S2. If the weather information obtained from the images of the three preset sampling points is different, the information collected may be incorrect. In this case, the images of all preset sampling points of the monitoring camera can be re-collected.
[0099] Table 3 Weather Information Table
[0100] id camera_code time P_1 P_2 P_3 D_1 D_2 10001 c000002 2022 / 3 / 8 17:00 S2 S2 S2 D&1 D&1
[0101] By analogy, the current weather conditions at the locations of all surveillance cameras (those selected for weather forecasting) can be obtained. Each surveillance camera can perform dynamic real-time analysis according to a preset cycle to determine the weather information.
[0102] Step 204: Analyze the weather information from the surveillance cameras to eliminate potentially erroneous weather information;
[0103] In step 203 above, the weather conditions obtained at a certain time are based on the images from various surveillance cameras in the city. However, this only provides information about the weather at that specific point in time and does not reveal which related areas share similar weather conditions. Therefore, it is impossible to obtain accurate regional weather information. Based on the weather analysis in step 203 and the GIS system, the weather can be analyzed to eliminate potentially erroneous weather information.
[0104] by Figure 5 For example, we can obtain the weather information shown in Table 4 below.
[0105] Table 4 Weather Information Table
[0106]
[0107] As can be seen, surveillance camera A5 is a Class 1 surveillance camera. There is questionable data in the weather data (marked with Q). The weather information at the preset sampling point P_3 of surveillance camera A5 is inconsistent with the weather information at other sampling points of the same camera. Therefore:
[0108] (1) Obtain the weather information of the monitoring camera A5 points P_1 and P_2, both of which are S2. Based on the GIS system and the latitude and longitude of each monitoring camera in step 201, we can obtain the multiple surrounding monitoring cameras that are closest to the monitoring camera (i.e., closest to other monitoring cameras). The surrounding monitoring cameras are A3, A4 and A7.
[0109] (2) When the weather information corresponding to the three most recent monitoring cameras A3, A4 and A7 is S2, it can be determined that the data of sampling point P_3 of monitoring camera A5 is abnormal. At this time, the data of the abnormal sampling point (P_3) in the data of monitoring camera A5 can be ignored, that is, the weather information of points P_1 and P_2 can be used as the weather information of monitoring camera A5.
[0110] When the weather information from the three most recent surveillance cameras A3, A4, and A7 is all S3, the weather information from points P_1 and P_2 of surveillance camera A5 can be ignored, and the weather information from point P_3 can be used as the weather information for surveillance camera A5.
[0111] In one exemplary embodiment, the weather information from a surveillance camera can be compared with the weather information from surrounding surveillance cameras. When the weather information differs from that of surrounding surveillance cameras, the original data from the surveillance cameras is compared to determine whether it is the same weather scene. For example, if the weather from surveillance cameras A10 and A14 is different from that of the nearest surveillance camera A15, the original data from surveillance cameras A10 and A14 can be compared with the original data from surveillance camera A15 to obtain a ratio. If the ratio is within a preset threshold range, it is determined to be the same weather scene; if the ratio is outside the preset threshold range, it is determined to be different scenes. For example, when determining weather information by the proportion of black pixels, the original data is the proportion of black pixels. The ratio of the proportion of black pixels (x1) in the binary image of surveillance camera A10 to the proportion of black pixels (y) in the binary image of surveillance camera A15 is obtained as x1 / y. x1 / y is compared with a preset threshold range. If x1 / y is within the preset threshold range, it is determined to be the same weather scene, and surveillance cameras A10 and A15 are classified into the same category when classifying the surveillance cameras later. If x1 / y is outside the preset threshold range, it is determined to be different weather scenes, and surveillance cameras A10 and A15 are classified into two categories when classifying the surveillance cameras later. Obtain the ratio x2 of the black pixel percentage of surveillance camera A14 to y of the black pixel percentage of surveillance camera A15, x2 / y. Compare x2 / y with a preset threshold range. If x2 / y falls within the preset threshold range, the cameras are determined to be in the same weather scene, and A14 and A15 are grouped into the same category when classifying the surveillance cameras subsequently. If x2 / y falls within the preset threshold range, the cameras are determined to be in different weather scenes, and A14 and A15 are grouped into two separate categories when classifying the surveillance cameras subsequently. For example, the preset threshold range could be 0.9 to 1.1, but it is not limited to this and can be other values.
[0112] Step 205: Divide the area into regions based on the weather information from the surveillance cameras, and issue weather forecasts for each region.
[0113] Based on weather information, surveillance cameras are combined to form surveillance camera groups. Each surveillance camera group generates an area, resulting in different areas.
[0114] The combination of surveillance cameras is illustrated using the set of surveillance cameras H = {A1, A2, A3, A4, A5, A6, A7, A8, A9, A11, A12, A13, A15, A16} as an example.
[0115] In step 201, the longitude and latitude of each surveillance camera were recorded, which yields a map showing the distribution of camera locations for the corresponding set H. Figure 6 As shown, the map displays the locations of different surveillance cameras, each of which is a real-time weather data collection point.
[0116] like Figure 7 As shown, any central surveillance camera can be used as the central surveillance camera (e.g., surveillance camera A2), but it is not limited to this; it can be an edge surveillance camera. A circular, stacked scan is performed outwards from the central surveillance camera, recording the weather information of each surveillance camera that passes through with the same weather information as the central surveillance camera, until the outermost surveillance camera with the same weather information as the central surveillance camera is scanned. This results in a surveillance camera group H' = {A6, A5, A8, A9, A11, A16, A12, A13, A15}, which is the set of boundary surveillance cameras. Alternatively, a surveillance camera group H' = {A6, A5, A8, A9, A11, A16, A12, A13, A15, A1, A2, A3, A4, A7} is obtained, which is the set of all surveillance cameras whose weather information is the same as the central surveillance camera obtained from the scan. An area is formed based on this surveillance camera group, such as... Figure 8 As shown, the area can be formed by connecting the boundary monitoring cameras, but the embodiments disclosed herein are not limited to this. It can be an area that includes all the monitoring cameras in the monitoring camera group and does not include monitoring cameras that are not in the monitoring camera group; the weather information of the area is the weather information of the central monitoring camera A2.
[0117] Following the steps above, expand outwards to find new central surveillance cameras and then scan around those cameras to obtain another area. Continue this process until the areas are divided, determine the weather for each area, and display the weather for each area. Figure 9 As shown.
[0118] In this embodiment, the weather area display is dynamic. It can be set at a preset period (e.g., 30 minutes or 10 minutes, depending on the actual needs of the city). Through real-time analysis, the above steps are repeated to dynamically display the weather conditions of the area. For example, in another location, the weather area map will change as shown below. Figure 10 The dynamic area display shown.
[0119] In this embodiment of the disclosure, the regional weather can be known more accurately based on the map, and the real-time weather changes can be known more accurately through real-time analysis. It can also support the real-time playback of weather conditions according to the desired location or the location to be reached in daily use.
[0120] In one feasible embodiment, the boundary monitoring camera is preferably a camera for the boundary area of a weather type, such as light rain (<2.5 mm / h), moderate rain (2.6–8.0 mm / h), and heavy rain (8.1–15.9 mm / h). Those skilled in the art will understand that when heavy rain and moderate rain are divided into regions using the monitoring camera as the boundary point, the boundary monitoring camera is preferably a camera whose rainfall is near a rainfall threshold, which in this embodiment is 7.8–8.3 mm / h. When there are multiple consecutive monitoring cameras in the same direction that meet the rainfall threshold, the location of the midpoint on the distance line is selected as the weather boundary point.
[0121] Daily weather forecasts are typically displayed by administrative region, which can introduce errors, especially when there aren't enough weather data collection stations. In such cases, the weather within the same region may differ, yet the displayed weather appears identical – this type of error is quite common. In this exemplary embodiment, based on weather information obtained from surveillance cameras and combined with a GIS map, the weather conditions of different regions can be dynamically displayed. Different cameras are dynamically combined with weather analysis from surrounding cameras to intelligently and dynamically display the weather conditions of different regions, effectively improving the accuracy and timeliness of regional weather forecasts.
[0122] like Figure 11 As shown, this embodiment of the present disclosure provides a weather forecasting device 11, including a memory 110 and a processor 120. The memory 110 stores a program, which, when read and executed by the processor 120, implements the weather forecasting method described in any of the above embodiments.
[0123] This disclosure provides a computer-readable storage medium storing one or more programs that can be executed by one or more processors to implement the weather forecasting method described in any of the above embodiments.
[0124] It will be understood by those skilled in the art that all or some of the steps, systems, or apparatuses disclosed above, and their functional modules / units, can be implemented as software, firmware, hardware, or suitable combinations thereof. In hardware implementations, the division between functional modules / units mentioned above does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed collaboratively by several physical components. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC). Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.
Claims
1. A weather forecasting method, characterized in that, Applied to surveillance systems that include multiple surveillance cameras, including: The monitoring camera is controlled to acquire images at multiple preset sampling points; the weather information of the location of the monitoring camera during the image acquisition period is determined based on the images acquired at the preset sampling points, and this information is used as the weather information of the monitoring camera during the acquisition period. For any given data collection period, based on the weather information from the multiple surveillance cameras and their geographical locations on the map, the regional weather distribution is determined. The multiple preset sampling points satisfy: It must include at least two sampling points that are not in the water or on the ground; It must contain at least 3 sampling points, and the span between the sampling points must be greater than or equal to a preset angle threshold; and When there is water around the surveillance camera, there is at least one water sampling point; Specifically, when one piece of weather information differs from the others among multiple weather information determined from images at multiple preset sampling points of the same monitoring camera, the monitoring camera is controlled to acquire images at non-preset sampling points. New weather information is determined based on the images acquired at non-preset sampling points. When this new weather information is identical to the majority of the multiple weather information, this new weather information replaces the weather information that differs from the others. The determination of regional weather distribution based on weather information from multiple surveillance cameras during the data collection period and the geographical locations of these cameras on the map includes: Surveillance cameras with the same weather information and geographical proximity are grouped together to form a surveillance camera group. For any surveillance camera group, the weather information of the surveillance cameras in the surveillance camera group is used as the weather information of the area formed by the geographical location of the surveillance cameras in the surveillance camera group during the collection period.
2. The weather forecasting method according to claim 1, characterized in that, The method further includes, when the new weather information is the same as a minority of the multiple weather information, marking the surveillance camera as a first type of surveillance camera; Find one or more surveillance cameras adjacent to the first type of surveillance cameras. If the one or more surveillance cameras are not first type of surveillance cameras and the weather information of the one or more surveillance cameras is the same as the majority of weather information, ignore the minority of weather information in the first type of surveillance cameras.
3. The weather forecasting method according to any one of claims 1 to 2, characterized in that, The step of determining the location of the monitoring camera based on the images acquired from the preset sampling points, and the weather information during the image acquisition period, includes: The image is converted into a binary image. Based on the binary image, or based on the binary image and the binary images of the image frames preceding the current image, the weather information of the location of the monitoring camera during the time period of image acquisition is determined. Alternatively, image samples corresponding to different weather information can be pre-established, the image can be matched with the image samples, and the weather information of the location of the monitoring camera during the image acquisition period can be determined based on the weather information corresponding to the matched image samples.
4. The weather forecasting method according to claim 1, characterized in that, The method of combining surveillance cameras with the same weather information and geographical proximity to form a surveillance camera group includes: Using any surveillance camera as the center, a camera is designated as the central surveillance camera. Surveillance cameras with the same weather as the central surveillance camera are found outwards with different radii until the camera with the largest distance from the central surveillance camera in each direction and the same weather is found. These cameras are called boundary surveillance cameras. Surveillance cameras located on the line connecting the boundary surveillance cameras and the central surveillance camera are all in the same weather. The central surveillance camera, the boundary surveillance cameras in each direction, and the surveillance cameras located on the line connecting the two are formed into the surveillance camera group. Alternatively, the central surveillance camera and the boundary surveillance cameras in each direction are also formed into the surveillance camera group.
5. The weather forecasting method according to any one of claims 1 to 2, characterized in that, The weather information includes rainfall information at the location of the monitoring camera; The method further includes: drawing a rainfall map based on weather information from the meteorological station and the plurality of monitoring cameras.
6. The weather forecasting method according to claim 3, characterized in that, The weather information includes rainfall information at the location of the monitoring camera; The method further includes: drawing a rainfall map based on weather information from the meteorological station and the plurality of monitoring cameras.
7. A weather forecasting device, characterized in that, It includes a memory and a processor, the memory storing a program that, when read and executed by the processor, implements the weather forecasting method as described in any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs, which can be executed by one or more processors to implement the weather forecasting method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Weather prediction data processing method and device, and computer readable storage medium
CN110516860A
Weather avoidance region division method based on offline multi-target tracking
CN112562419A
Outlier processing
US20110153270A1
KR20210053513A