CN111882550A - Hail detection method, hail detection device, computer equipment and readable storage medium - Google Patents
Hail detection method, hail detection device, computer equipment and readable storage medium Download PDFInfo
- Publication number
- CN111882550A CN111882550A CN202010760020.4A CN202010760020A CN111882550A CN 111882550 A CN111882550 A CN 111882550A CN 202010760020 A CN202010760020 A CN 202010760020A CN 111882550 A CN111882550 A CN 111882550A
- Authority
- CN
- China
- Prior art keywords
- hail
- target
- target area
- image
- area
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 184
- 238000000034 method Methods 0.000 claims abstract description 43
- 230000008859 change Effects 0.000 claims abstract description 18
- 230000007613 environmental effect Effects 0.000 claims description 44
- 238000004590 computer program Methods 0.000 claims description 29
- 238000012795 verification Methods 0.000 claims description 17
- 238000005259 measurement Methods 0.000 claims description 5
- 230000008569 process Effects 0.000 description 16
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 8
- 238000005070 sampling Methods 0.000 description 8
- 230000009286 beneficial effect Effects 0.000 description 5
- 238000003384 imaging method Methods 0.000 description 5
- 238000013475 authorization Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000004904 shortening Methods 0.000 description 3
- 238000013507 mapping Methods 0.000 description 2
- 230000004044 response Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000002411 adverse Effects 0.000 description 1
- 230000004075 alteration Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 230000001066 destructive effect Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 244000144972 livestock Species 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000010287 polarization Effects 0.000 description 1
- 238000011897 real-time detection Methods 0.000 description 1
- 230000000630 rising effect Effects 0.000 description 1
- 230000001568 sexual effect Effects 0.000 description 1
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01W—METEOROLOGY
- G01W1/00—Meteorology
- G01W1/14—Rainfall or precipitation gauges
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10016—Video; Image sequence
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30181—Earth observation
- G06T2207/30192—Weather; Meteorology
Landscapes
- Engineering & Computer Science (AREA)
- Environmental & Geological Engineering (AREA)
- Life Sciences & Earth Sciences (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Hydrology & Water Resources (AREA)
- Quality & Reliability (AREA)
- Atmospheric Sciences (AREA)
- Biodiversity & Conservation Biology (AREA)
- Ecology (AREA)
- Environmental Sciences (AREA)
- Image Analysis (AREA)
Abstract
本申请涉及一种冰雹检测方法、装置、计算机设备和可读存储介质。所述方法包括:获取目标区域对应的背景图像,所述背景图像是基于所述目标区域对应的至少一个不包括冰雹的历史实景图像生成的;获取所述目标区域对应的至少一个目标实景图像,并将所述目标实景图像与所述背景图像进行对比,得到对比结果,所述对比结果包括所述目标实景图像相对于所述背景图像的像素值变化信息;根据所述对比结果,获取所述目标区域的冰雹检测结果,所述冰雹检测结果用于表征所述目标区域存在冰雹或所述目标区域不存在冰雹。采用本方法可以降低冰雹检测的成本,且易于实施,提升了冰雹检测的普适性。
The present application relates to a hail detection method, device, computer equipment and readable storage medium. The method includes: acquiring a background image corresponding to a target area, the background image being generated based on at least one historical real image corresponding to the target area that does not include hail; acquiring at least one target real image corresponding to the target area, Comparing the target real scene image with the background image to obtain a comparison result, where the comparison result includes the pixel value change information of the target real scene image relative to the background image; and according to the comparison result, obtain the The hail detection result of the target area, the hail detection result is used to indicate that there is hail in the target area or there is no hail in the target area. The adoption of the method can reduce the cost of hail detection, is easy to implement, and improves the universality of hail detection.
Description
技术领域technical field
本申请涉及气象检测技术领域,特别是涉及一种冰雹检测方法、装置、计算机设备和可读存储介质。The present application relates to the technical field of meteorological detection, and in particular, to a hail detection method, device, computer equipment and readable storage medium.
背景技术Background technique
冰雹是一种天气现象,是上升的水蒸气遇到骤降的气温所结成的冰团,其在夏季或春夏之交最为常见。冰雹具有很强的破坏力,冰雹损坏房屋、车辆、毁坏农田、树木、砸伤人或牲畜的情况常常发生,是严重的自然灾害之一。Hail is a weather phenomenon in which rising water vapour meets plummeting temperatures and is most common in summer or around the turn of spring and summer. Hail has strong destructive power. Hail damage often occurs in houses, vehicles, farmland, trees, and people or livestock. It is one of the serious natural disasters.
目前,检测冰雹的主流方法是部署双偏振多普勒天气雷达,通过雷达的发射机发射水平和垂直极化信号,通过雷达的双通道接收机和数字中频对数据进行并行处理,处理过程中结合特定算法(如美国的NEX-TRAD冰雹探测算法)来检测冰雹。At present, the mainstream method to detect hail is to deploy dual-polarization Doppler weather radar, transmit horizontal and vertical polarization signals through the radar's transmitter, and process the data in parallel through the radar's dual-channel receiver and digital intermediate frequency. A specific algorithm (such as the NEX-TRAD hail detection algorithm in the United States) is used to detect hail.
然而,上述检测冰雹的方法需要部署双偏振多普勒天气雷达,雷达部署成本高,且冰雹检测受特定算法的实施权限限制,导致冰雹检测的普适性较差,例如对于一些个人用户并不适用。因此,提供一种低成本且易于实施的冰雹检测方法,成为目前亟待解决的问题。However, the above method of detecting hail requires the deployment of dual-polarization Doppler weather radar, which is costly to deploy, and hail detection is limited by the implementation authority of a specific algorithm, resulting in poor universality of hail detection. Be applicable. Therefore, it is an urgent problem to provide a low-cost and easy-to-implement hail detection method.
发明内容SUMMARY OF THE INVENTION
基于此,有必要针对上述技术问题,提供一种低成本且易于实施的冰雹检测方法、装置、计算机设备和可读存储介质。Based on this, it is necessary to provide a low-cost and easy-to-implement hail detection method, device, computer device, and readable storage medium for the above technical problems.
第一方面,本申请实施例提供一种冰雹检测方法,所述方法包括:In the first aspect, the embodiments of the present application provide a method for detecting hail, the method comprising:
获取目标区域对应的背景图像,所述背景图像是基于所述目标区域对应的至少一个不包括冰雹的历史实景图像生成的;Obtain a background image corresponding to the target area, the background image is generated based on at least one historical real image corresponding to the target area that does not include hail;
获取所述目标区域对应的至少一个目标实景图像,并将所述目标实景图像与所述背景图像进行对比,得到对比结果,所述对比结果包括所述目标实景图像相对于所述背景图像的像素值变化信息;Acquire at least one target real-life image corresponding to the target area, and compare the target real-life image with the background image to obtain a comparison result, where the comparison result includes the pixels of the target real-life image relative to the background image value change information;
根据所述对比结果,获取所述目标区域的冰雹检测结果,所述冰雹检测结果用于表征所述目标区域存在冰雹或所述目标区域不存在冰雹。According to the comparison result, the hail detection result of the target area is obtained, and the hail detection result is used to indicate that there is hail in the target area or there is no hail in the target area.
在其中一个实施例中,所述至少一个目标实景图像为多个目标实景图像,各所述目标实景图像在时序上连续。In one of the embodiments, the at least one target real-life image is a plurality of target real-life images, and each of the target real-life images is consecutive in time sequence.
在其中一个实施例中,所述背景图像包括参考背景像素区域,所述将所述目标实景图像与所述背景图像进行对比,得到对比结果,包括:In one embodiment, the background image includes a reference background pixel area, and comparing the target real-life image with the background image to obtain a comparison result includes:
针对每个所述目标实景图像,从所述目标实景图像中确定与所述参考背景像素区域对应的目标像素区域;For each of the target real-life images, determining a target pixel area corresponding to the reference background pixel area from the target real-life image;
将所述目标像素区域中各像素点的像素值分别与所述参考背景像素区域中对应像素点的像素值作差,得到作差结果;Differentiate the pixel value of each pixel in the target pixel area with the pixel value of the corresponding pixel in the reference background pixel area to obtain a difference result;
将各所述目标实景图像的作差结果确定为所述对比结果。A difference result of each of the target real-life images is determined as the comparison result.
在其中一个实施例中,所述根据所述对比结果,获取所述目标区域的冰雹检测结果,包括:In one embodiment, obtaining the hail detection result of the target area according to the comparison result, including:
针对每个所述目标实景图像,检测所述目标实景图像中目标像素区域的各像素点的作差结果是否大于预设差值阈值;For each of the target real-life images, detect whether the difference result of each pixel in the target pixel area in the target real-life image is greater than a preset difference threshold;
从所述目标像素区域的各像素点中确定作差结果大于所述预设差值阈值的多个目标像素点,并根据所述多个目标像素点生成所述目标实景图像对应的掩码图,所述掩码图包括所述多个目标像素点形成的多个掩码区域;A plurality of target pixel points whose difference result is greater than the preset difference threshold value are determined from each pixel point of the target pixel area, and a mask map corresponding to the target real scene image is generated according to the plurality of target pixel points , the mask map includes a plurality of mask regions formed by the plurality of target pixels;
检测所述多个掩码区域的属性信息是否满足预设属性条件,所述预设属性条件与各所述掩码区域的面积以及所述多个掩码区域的数量有关;Detecting whether the attribute information of the multiple mask areas satisfies a preset attribute condition, the preset attribute condition is related to the area of each of the mask areas and the number of the multiple mask areas;
若存在至少一个目标实景图像的多个掩码区域的属性信息满足所述预设属性条件,则确定所述冰雹检测结果为所述目标区域存在冰雹。If the attribute information of multiple mask areas of at least one target real-world image satisfies the preset attribute condition, it is determined that the hail detection result is that there is hail in the target area.
在其中一个实施例中,所述根据所述对比结果,获取所述目标区域的冰雹检测结果之后,还包括:In one embodiment, after obtaining the hail detection result of the target area according to the comparison result, the method further includes:
若所述冰雹检测结果为所述目标区域存在冰雹,则获取所述目标区域对应的至少一个更新实景图像,并基于所述至少一个更新实景图像对所述冰雹检测结果进行准确性验证;If the hail detection result is that there is hail in the target area, obtain at least one updated real scene image corresponding to the target area, and perform accuracy verification on the hail detection result based on the at least one updated real scene image;
在所述冰雹检测结果通过准确性验证的情况下,输出所述冰雹检测结果。When the hail detection result passes the accuracy verification, output the hail detection result.
在其中一个实施例中,所述根据所述对比结果,获取所述目标区域的冰雹检测结果之后,还包括:In one embodiment, after obtaining the hail detection result of the target area according to the comparison result, the method further includes:
若所述冰雹检测结果为所述目标区域存在冰雹,则获取所述目标区域对应的环境数据,所述环境数据包括所述目标区域对应的温度和空气湿度中的至少一个;If the hail detection result is that there is hail in the target area, obtain environmental data corresponding to the target area, and the environmental data includes at least one of temperature and air humidity corresponding to the target area;
检测所述环境数据是否满足冰雹产生的环境条件;Detecting whether the environmental data satisfies the environmental conditions produced by the hail;
若所述环境数据满足冰雹产生的所述环境条件,则输出所述冰雹检测结果。If the environmental data satisfies the environmental condition for hail generation, output the hail detection result.
在其中一个实施例中,所述根据所述对比结果,获取所述目标区域的冰雹检测结果之后,还包括:In one embodiment, after obtaining the hail detection result of the target area according to the comparison result, the method further includes:
若所述冰雹检测结果为所述目标区域存在冰雹,则通过测距组件测量所述测距组件与所述目标区域中的预设目标物之间的当前距离信息;If the hail detection result is that there is hail in the target area, measure the current distance information between the ranging component and the preset target in the target area by the ranging component;
检测所述当前距离信息与所述目标区域对应的参考距离信息之间的差值是否大于预设距离阈值,所述参考距离信息是在所述目标区域不存在冰雹的情况下,通过所述测距组件测量的所述测距组件与所述预设目标物之间的距离信息;Detect whether the difference between the current distance information and the reference distance information corresponding to the target area is greater than a preset distance threshold, and the reference distance information is that when there is no hail in the target area, through the measurement distance information between the distance measuring component and the preset target measured by the distance component;
若所述当前距离信息与所述参考距离信息的差值大于所述预设距离阈值,则输出所述冰雹检测结果。If the difference between the current distance information and the reference distance information is greater than the preset distance threshold, output the hail detection result.
在其中一个实施例中,所述根据所述对比结果,获取所述目标区域的冰雹检测结果之后,还包括:In one embodiment, after obtaining the hail detection result of the target area according to the comparison result, the method further includes:
若所述冰雹检测结果为所述目标区域存在冰雹,则发送冰雹提示信息至用户终端,所述冰雹提示信息用于提示所述目标区域存在冰雹;If the hail detection result is that there is hail in the target area, then send hail prompt information to the user terminal, and the hail prompt information is used to prompt that there is hail in the target area;
若接收到所述用户终端发送的视频查看请求,则获取所述目标区域对应的冰雹视频数据,并将所述冰雹视频数据发送至所述用户终端。If a video viewing request sent by the user terminal is received, the hail video data corresponding to the target area is acquired, and the hail video data is sent to the user terminal.
第二方面,本申请实施例提供一种冰雹检测装置,所述装置包括:In a second aspect, an embodiment of the present application provides a hail detection device, the device comprising:
第一获取模块,用于获取目标区域对应的背景图像,所述背景图像是基于所述目标区域对应的至少一个不包括冰雹的历史实景图像生成的;a first acquisition module, configured to acquire a background image corresponding to the target area, the background image is generated based on at least one historical real image corresponding to the target area that does not include hail;
对比模块,用于获取所述目标区域对应的至少一个目标实景图像,并将所述目标实景图像与所述背景图像进行对比,得到对比结果,所述对比结果包括所述目标实景图像相对于所述背景图像的像素值变化信息;A comparison module, configured to acquire at least one target real-life image corresponding to the target area, and compare the target real-life image with the background image to obtain a comparison result, where the comparison result includes the relative relationship between the target real-life image and the background image. Describe the pixel value change information of the background image;
第二获取模块,用于根据所述对比结果,获取所述目标区域的冰雹检测结果,所述冰雹检测结果用于表征所述目标区域存在冰雹或所述目标区域不存在冰雹。The second obtaining module is configured to obtain the hail detection result of the target area according to the comparison result, where the hail detection result is used to indicate that there is hail in the target area or that there is no hail in the target area.
第三方面,本申请实施例提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现如上述第一方面的方法的步骤。In a third aspect, an embodiment of the present application provides a computer device, including a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the method in the first aspect when the processor executes the computer program.
第四方面,本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上述第一方面的方法的步骤。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of the method in the first aspect.
本申请实施例提供的技术方案带来的有益效果至少包括:The beneficial effects brought by the technical solutions provided in the embodiments of the present application include at least:
通过获取目标区域对应的背景图像,该背景图像是基于目标区域对应的至少一个不包括冰雹的历史实景图像生成的,以及获取目标区域对应的至少一个目标实景图像,并将目标实景图像与背景图像进行对比,得到对比结果,该对比结果包括目标实景图像相对于背景图像的像素值变化信息,然后根据对比结果,获取目标区域的冰雹检测结果,冰雹检测结果用于表征目标区域存在冰雹或目标区域不存在冰雹;由此,将目标区域的目标实景图像与背景图像进行对比,得到包括目标实景图像相对于背景图像的像素值变化信息的对比结果后,即可根据该对比结果确定目标区域是否存在冰雹;避免了传统技术中,需要部署双偏振多普勒天气雷达以及结合特定算法(如NEX-TRAD冰雹探测算法)来检测冰雹,由于雷达部署成本高,且冰雹探测算法需要获取相应的授权,导致的冰雹检测的普适性差,尤其对于一些个人用户不适用的缺点。本申请实施例在冰雹检测时只需要获取图像数据而不必部署雷达,从而可以降低冰雹检测的成本,且冰雹检测过程也不必结合NEX-TRAD等特定冰雹探测算法,因此就不需要获取这些特定算法的实施权限,易于实施,提升了冰雹检测的普适性。By acquiring a background image corresponding to the target area, the background image is generated based on at least one historical real image corresponding to the target area that does not include hail, and acquiring at least one target real image corresponding to the target area, and comparing the target real image with the background image Carry out a comparison to obtain a comparison result, the comparison result includes the pixel value change information of the target real image relative to the background image, and then according to the comparison result, the hail detection result of the target area is obtained, and the hail detection result is used to indicate the presence of hail in the target area or the target area. There is no hail; thus, the target real-life image of the target area is compared with the background image, and after obtaining the comparison result including the pixel value change information of the target real-life image relative to the background image, it can be determined whether the target area exists according to the comparison result. Hail; avoids the need to deploy dual-polarization Doppler weather radar and combine specific algorithms (such as NEX-TRAD hail detection algorithm) to detect hail in traditional technology. Due to the high cost of radar deployment, and the hail detection algorithm needs to obtain the corresponding authorization, The resulting hail detection is not universally applicable, especially for some individual users. The embodiment of the present application only needs to acquire image data without deploying radar during hail detection, thereby reducing the cost of hail detection, and the hail detection process does not need to be combined with specific hail detection algorithms such as NEX-TRAD, so it is not necessary to acquire these specific algorithms It is easy to implement and improves the universality of hail detection.
附图说明Description of drawings
图1为一个实施例中冰雹检测方法的流程示意图;Fig. 1 is the schematic flow sheet of hail detection method in one embodiment;
图2为另一个实施例中步骤S200的部分细化步骤示意图;FIG. 2 is a schematic diagram of part of the refinement steps of step S200 in another embodiment;
图3为另一个实施例中步骤S300的细化步骤示意图;FIG. 3 is a schematic diagram of the refinement steps of step S300 in another embodiment;
图4为另一个实施例中冰雹检测方法的流程示意图;Fig. 4 is the schematic flow sheet of the hail detection method in another embodiment;
图5为另一个实施例中冰雹检测方法的流程示意图;5 is a schematic flowchart of a hail detection method in another embodiment;
图6为另一个实施例中冰雹检测方法的流程示意图;Fig. 6 is the schematic flow sheet of the hail detection method in another embodiment;
图7为一个实施例中冰雹检测系统的示意图。Figure 7 is a schematic diagram of a hail detection system in one embodiment.
图8为一个实施例中冰雹检测装置的结构框图;Fig. 8 is the structural block diagram of the hail detection device in one embodiment;
图9为一个实施例中计算机设备的内部结构图。Figure 9 is a diagram of the internal structure of a computer device in one embodiment.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.
本申请实施例提供的冰雹检测方法、装置、计算机设备和可读存储介质,旨在解决传统技术中,由于雷达部署成本高以及特定的冰雹探测算法需要获取相应的授权,导致的冰雹检测方法的普适性差的技术问题。下面将通过实施例并结合附图具体地对本申请的技术方案进行详细说明。下面这几个具体地实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。The hail detection method, device, computer equipment, and readable storage medium provided by the embodiments of the present application are intended to solve the problem of the hail detection method in the traditional technology, due to the high cost of radar deployment and the need to obtain corresponding authorization for a specific hail detection algorithm. Technical problems with poor universality. The technical solutions of the present application will be specifically described in detail below with reference to the accompanying drawings. The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
需要说明的是,本申请实施例提供的冰雹检测方法,其执行主体可以是冰雹检测装置,该冰雹检测装置可以通过软件、硬件或者软硬件结合的方式实现成为计算机设备的部分或者全部,计算机设备可以是服务器。下述方法实施例中,均以执行主体是计算机设备为例来进行说明。可以理解的是,下述方法实施例提供的冰雹检测方法,也可以应用于终端,还可以应用于包括终端和服务器的系统,并通过终端和服务器的交互实现。It should be noted that, in the hail detection method provided by the embodiment of the present application, its execution body can be a hail detection device, and the hail detection device can be realized as part or all of computer equipment through software, hardware or a combination of software and hardware. Can be a server. In the following method embodiments, the execution subject is a computer device as an example for description. It can be understood that the hail detection method provided by the following method embodiments can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through interaction between the terminal and the server.
在一个实施例中,如图1所示,提供了一种冰雹检测方法,包括以下步骤:In one embodiment, as shown in Figure 1, a kind of hail detection method is provided, comprising the following steps:
步骤S100,获取目标区域对应的背景图像。Step S100, acquiring a background image corresponding to the target area.
本申请实施例中,目标区域可以是需要进行冰雹检测的区域,例如,可以是特定道路、用户居住区域、农田,等等。计算机设备获取目标区域对应的背景图像,该背景图像可以是计算机设备基于目标区域对应的至少一个不包括冰雹的历史实景图像生成的。作为一种实施方式,计算机设备生成该背景图像后,可以将该背景图像对应于目标区域存储在计算机设备的数据库中,在需要对目标区域进行冰雹检测时,计算机设备则从数据库中获取该背景图像。背景图像用于在冰雹检测过程中作为目标区域不存在冰雹时的参照背景。In this embodiment of the present application, the target area may be an area where hail detection needs to be performed, for example, may be a specific road, a user living area, farmland, and the like. The computer device acquires a background image corresponding to the target area, and the background image may be generated by the computer device based on at least one historical real image corresponding to the target area that does not include hail. As an embodiment, after the computer device generates the background image, the background image can be stored in the database of the computer device corresponding to the target area. When the target area needs to be detected for hail, the computer device obtains the background image from the database. image. The background image is used as a reference background when there is no hail in the target area during the hail detection process.
作为一种实施方式,计算机设备可以在历史时刻下,通过采集组件采集目标区域对应的至少一个不包括冰雹的历史实景图像。例如,在历史天气晴朗的环境下,计算机设备控制采集组件采集目标区域的多个历史实景图像,该多个历史实景图像对应的采样时刻可以连续。由于冰雹大多呈白色,采集组件在部署时,可以将采集画面固定瞄准目标区域中的固定建筑或者其它非白色背景,固定建筑或者非白色背景可以和冰雹形成明显色差,这样,计算机设备将基于多个历史实景图像生成的背景图像作为参照背景时,有利于计算机设备根据色差对冰雹的视觉分离。As an implementation manner, the computer device may collect at least one historical real image corresponding to the target area that does not include hail by using the collection component at a historical moment. For example, in an environment with clear historical weather, the computer device controls the acquisition component to collect multiple historical real-life images of the target area, and the sampling moments corresponding to the multiple historical real-life images may be continuous. Since hail is mostly white, when the acquisition component is deployed, the acquisition picture can be fixed at a fixed building or other non-white background in the target area. The fixed building or non-white background can form a significant color difference with the hail. In this way, the computer equipment will be based on multiple When a background image generated by a historical real image is used as a reference background, it is beneficial for computer equipment to visually separate hail according to chromatic aberration.
计算机设备基于多个历史实景图像生成背景图像,在一种可能的实施方式中,计算机设备可以调用OpenCV视觉库中的cv2.Canny函数从多个历史实景图像中提取轮廓,然后调用cv2.findContours函数从提取的轮廓中查找连通域(即首尾相连的线段围成的区域)以及调用cv2.contourArea函数获取每个连通域的面积,接着调用cv2.drawContours函数填充小面积的连通域,并调用cv2.getStructuringElement函数和cv2.dilate函数进行区域膨胀,以使较小的连通域连成一个整体形成背景,从而得到背景图像。The computer device generates a background image based on multiple historical reality images. In a possible implementation, the computer device can call the cv2.Canny function in the OpenCV vision library to extract contours from the multiple historical reality images, and then call the cv2.findContours function. Find connected areas (that is, the area enclosed by end-to-end line segments) from the extracted contours, and call the cv2.contourArea function to obtain the area of each connected area, then call the cv2.drawContours function to fill the small area of connected areas, and call cv2. The getStructuringElement function and the cv2.dilate function perform area expansion, so that the smaller connected domains are connected as a whole to form the background, so as to obtain the background image.
由于多个历史实景图像在时序上连续,即光照等环境相近,计算机设备通过上述过程对多个历史实景图像分析不变的像素,从而提取出背景图像,该背景图像与历史实景图像的尺寸相同。作为一种实施方式,以采集组件在部署时将采集画面固定瞄准目标区域中的固定建筑为例,则该背景图像中包括该固定建筑对应的参考背景像素区域,该背景图像中除参考背景像素区域之外的其它区域的像素值均为0(即为黑色)。Since the multiple historical real images are continuous in time sequence, that is, the lighting and other environments are similar, the computer equipment analyzes the unchanged pixels of the multiple historical real images through the above process, thereby extracting a background image, which is the same size as the historical real image. . As an example, when the acquisition component is deployed, the acquisition image is fixed at the fixed building in the target area as an example, the background image includes the reference background pixel area corresponding to the fixed building, and the reference background pixel is excluded from the background image. The pixel values of other regions outside the region are all 0 (ie black).
由于随着时间的推移,采集组件有可能松动或者环境有可能变化,这些均会导致计算机设备存储的背景图像与当前实际环境存在较大差异,为了减小这种差异,本申请实施例计算机设备可以基于预设的时间周期,定期对目标区域执行上述基于多个历史实景图像生成背景图像的过程,更新存储的背景图像,从而可以确保背景图像的准确性,有利于提升冰雹检测方法的准确性。As time goes by, the acquisition component may become loose or the environment may change, which will cause a large difference between the background image stored by the computer device and the current actual environment. In order to reduce this difference, the computer device in the embodiment of the present application Based on a preset time period, the above process of generating a background image based on multiple historical real-life images can be periodically performed on the target area, and the stored background image can be updated, thereby ensuring the accuracy of the background image and improving the accuracy of the hail detection method. .
本申请实施例中,采集组件可以是高感光成像仪,高感光成像仪由于其高感光的特性,即使在夜间或者光线较差的环境下也可以采集到与白天成像效果类似的图像,从而可以实现冰雹的全天候检测,扩大了冰雹检测的时间范围,有利于提升冰雹检测的可靠性。In the embodiment of the present application, the acquisition component may be a high-sensitivity imager. Due to its high-sensitivity characteristics, the high-sensitivity imager can collect images similar to those in daytime imaging even in the night or in an environment with poor light, so that it can The realization of all-weather detection of hail expands the time range of hail detection, which is beneficial to improve the reliability of hail detection.
步骤S200,获取目标区域对应的至少一个目标实景图像,并将目标实景图像与背景图像进行对比,得到对比结果。Step S200: Obtain at least one target real-life image corresponding to the target area, and compare the target real-life image with the background image to obtain a comparison result.
计算机设备通过采集组件采集目标区域对应的至少一个目标实景图像。在一种可能的实施方式中,该至少一个目标实景图像可以是一个目标实景图像;在另一种可能的实施方式中,该至少一个目标实景图像也可以为多个目标实景图像,该多个目标实景图像中的各目标实景图像在时序上连续,例如,计算机设备可以采集当前采样时刻的目标实景图像以及当前采样时刻之前连续的两个采样时刻的目标实景图像,则得到三个连续的目标实景图像。The computer device collects at least one target real-world image corresponding to the target area through the acquisition component. In a possible embodiment, the at least one target reality image may be a target reality image; in another possible embodiment, the at least one target reality image may also be a plurality of target reality images, the plurality of target reality images Each target real image in the target real image is continuous in time sequence. For example, the computer equipment can collect the target real image at the current sampling time and the target real image at two consecutive sampling times before the current sampling time, then three consecutive targets are obtained. Live image.
需要说明的是,相较于单个目标实景图像,时序连续的多个目标实景图像可以更为准确的表征目标区域的实景,即当前的实际环境。计算机设备采用时序连续的多个目标实景图像进行冰雹检测,可以避免仅采用一个目标实景图像,而若该一个目标实景图像中存在干扰导致的降低冰雹检测准确性的问题,从而有利于提升冰雹检测的准确性。本申请实施例中,均以该至少一个目标实景图像为多个目标实景图像为例,对本申请实施例的实施方式进行说明,当然,在其它实施例中,计算机设备也可以获取目标区域对应的一个目标实景图像,并将该一个目标实景图像与背景图像进行对比,得到包括该目标实景图像相对于背景图像的像素值变化信息的对比结果,并根据该对比结果,获取目标区域的冰雹检测结果,在此不做具体限制。It should be noted that, compared with a single target real image, multiple target real images with continuous time series can more accurately represent the real scene of the target area, that is, the current actual environment. The computer equipment adopts multiple target real-world images with continuous time series for hail detection, which can avoid using only one target real-world image, and if there is interference in the one target real-world image, the problem of reducing the accuracy of hail detection is conducive to improving hail detection. accuracy. In the embodiments of the present application, the implementation of the embodiments of the present application is described by taking the at least one target real-life image as a plurality of target real-life images as an example. Of course, in other embodiments, the computer device may also obtain the corresponding images of the target area. A target real scene image, and the target real scene image is compared with the background image to obtain a comparison result including the pixel value change information of the target real scene image relative to the background image, and according to the comparison result, obtain the hail detection result of the target area , there is no specific restriction here.
由于采集组件的采集画面固定,因此,目标实景图像和历史实景图像的画面视野以及尺寸均是相同的。计算机设备将各目标实景图像分别与背景图像进行对比,可以是将目标实景图像的各像素点的像素值与背景图像的各像素点的像素值进行比较。例如,对于一个目标实景图像,计算机设备可以将该目标实景图像的各像素点的像素值与背景图像中对应位置的像素点的像素值作差,从而获取目标实景图像相对于背景图像的像素值变化信息。计算机设备将各目标实景图像分别与背景图像进行对比,得到对比结果,该对比结果包括各目标实景图像相对于背景图像的像素值变化信息。Since the acquisition picture of the acquisition component is fixed, the picture field of view and size of the target real-life image and the historical real-life image are the same. The computer device compares each target real scene image with the background image, which may be to compare the pixel value of each pixel point of the target real scene image with the pixel value of each pixel point of the background image. For example, for a target real-life image, the computer device can make the difference between the pixel value of each pixel of the target real-life image and the pixel value of the pixel at the corresponding position in the background image, so as to obtain the pixel value of the target real-life image relative to the background image. change information. The computer device compares each target real scene image with the background image respectively to obtain a comparison result, where the comparison result includes pixel value change information of each target real scene image relative to the background image.
步骤S300,根据对比结果,获取目标区域的冰雹检测结果。Step S300, obtaining the hail detection result of the target area according to the comparison result.
其中,冰雹检测结果用于表征目标区域存在冰雹或目标区域不存在冰雹。计算机设备根据对比结果,则确定目标区域是否存在冰雹。Among them, the hail detection result is used to represent the presence of hail in the target area or the absence of hail in the target area. The computer equipment determines whether there is hail in the target area according to the comparison result.
在一种可能的实施方式中,计算机设备可以对目标实景图像中与背景图像的像素值差异较大的像素点进行标记,并根据这些标记后的像素点形成的区域的大小以及密集程度来确定目标区域是否存在冰雹;例如,若各目标实景图像中存在较多标记后的像素点形成的区域,且形成的区域的面积与冰雹的尺寸比例匹配,则可以确定目标区域存在冰雹。In a possible implementation manner, the computer device may mark the pixel points in the target real-world image with a large difference in pixel value from the background image, and determine the size and density of the area formed by the marked pixels according to the size and density of the area. Whether there is hail in the target area; for example, if there is an area formed by many marked pixels in each target real-life image, and the area of the formed area matches the size ratio of the hail, it can be determined that there is hail in the target area.
在另一种可能的实施方式中,由于冰雹大多呈白色,若各目标实景图像中存在较多标记后的像素点形成的区域,且形成的区域的面积与冰雹的尺寸比例匹配,计算机设备还可以检测这些标记后的像素点在目标实景图像中的实际像素值所表征的颜色是否为白色或者接近白色,若是,则进一步确定目标区域存在冰雹。In another possible implementation, since hailstones are mostly white, if there are many areas formed by marked pixels in each target real-life image, and the area of the formed areas matches the size ratio of the hailstones, the computer equipment will also It can be detected whether the color represented by the actual pixel value of these marked pixels in the target real image is white or close to white, and if so, it is further determined that there is hail in the target area.
本申请实施例中,作为一种实施方式,计算机设备可以是Raspberry Pi(树莓派)等微型电脑,微型电脑的成本较低,从而可以进一步降低冰雹检测方法的成本。In the embodiment of the present application, as an implementation manner, the computer device may be a microcomputer such as a Raspberry Pi (Raspberry Pi), and the cost of the microcomputer is low, so that the cost of the hail detection method can be further reduced.
本实施例通过获取目标区域对应的背景图像,该背景图像是基于目标区域对应的至少一个不包括冰雹的历史实景图像生成的,以及获取目标区域对应的至少一个目标实景图像,并将目标实景图像与背景图像进行对比,得到对比结果,该对比结果包括目标实景图像相对于背景图像的像素值变化信息,然后根据对比结果,获取目标区域的冰雹检测结果,冰雹检测结果用于表征目标区域存在冰雹或目标区域不存在冰雹;由此,将目标区域的目标实景图像与背景图像进行对比,得到包括目标实景图像相对于背景图像的像素值变化信息的对比结果后,即可根据该对比结果确定目标区域是否存在冰雹;避免了传统技术中,需要部署双偏振多普勒天气雷达以及结合特定算法(如NEX-TRAD冰雹探测算法)来检测冰雹,由于雷达部署成本高,且冰雹探测算法需要获取相应的授权,导致的冰雹检测的普适性差,尤其对于一些个人用户不适用的缺点。本申请实施例在冰雹检测时只需要获取图像数据而不必部署雷达,从而可以降低冰雹检测的成本,且冰雹检测过程也不必结合NEX-TRAD等特定冰雹探测算法,因此就不需要获取这些特定算法的实施权限,易于实施,提升了冰雹检测的普适性。In this embodiment, a background image corresponding to the target area is acquired, the background image is generated based on at least one historical real image corresponding to the target area that does not include hail, at least one target real image corresponding to the target area is acquired, and the target real image is Compare with the background image to obtain the comparison result, the comparison result includes the pixel value change information of the target real scene image relative to the background image, and then according to the comparison result, the hail detection result of the target area is obtained, and the hail detection result is used to characterize the presence of hail in the target area. Or there is no hail in the target area; thus, the target real scene image in the target area is compared with the background image, and after obtaining the comparison result including the pixel value change information of the target real scene image relative to the background image, the target can be determined according to the comparison result. Whether there is hail in the area; avoids the need to deploy dual-polarization Doppler weather radar and combine specific algorithms (such as NEX-TRAD hail detection algorithm) to detect hail in traditional technology. authorization, resulting in poor universality of hail detection, especially for some individual users. The embodiment of the present application only needs to acquire image data without deploying radar during hail detection, thereby reducing the cost of hail detection, and the hail detection process does not need to be combined with specific hail detection algorithms such as NEX-TRAD, so it is not necessary to acquire these specific algorithms It is easy to implement and improves the universality of hail detection.
在一个实施例中,在上述图1所示实施例的基础上,参见图2,本实施例涉及的是在至少一个目标实景图像为多个目标实景图像的情况下,计算机设备如何将各目标实景图像分别与背景图像进行对比,得到对比结果的过程。如图2所示,该过程包括步骤S201、步骤S202和步骤S203:In one embodiment, on the basis of the above-mentioned embodiment shown in FIG. 1 and referring to FIG. 2 , this embodiment relates to how a computer device converts each target to a situation in which at least one target reality image is a plurality of target reality images. The process of comparing the real image with the background image and obtaining the comparison result. As shown in Figure 2, the process includes steps S201, S202 and S203:
步骤S201,针对每个目标实景图像,从目标实景图像中确定与参考背景像素区域对应的目标像素区域。Step S201 , for each target real scene image, determine a target pixel area corresponding to the reference background pixel area from the target real scene image.
本申请实施例中,背景图像包括参考背景像素区域。参考背景像素区域对应目标区域中的背景,以采集组件在部署时采集画面固定瞄准目标区域中的固定建筑为例,则该参考背景像素区域即为该固定建筑在背景图像中对应的区域。背景图像中参考背景像素区域的像素值为真实像素值,而背景图像中除参考背景像素区域之外的其它区域的像素值均为0。In this embodiment of the present application, the background image includes a reference background pixel area. The reference background pixel area corresponds to the background in the target area. Taking the acquisition component as an example of a fixed building in the target area when the acquisition component is deployed, the reference background pixel area is the area corresponding to the fixed building in the background image. The pixel values of the reference background pixel area in the background image are real pixel values, and the pixel values of other areas in the background image except the reference background pixel area are all 0.
由于采集组件的采集画面固定,从而目标实景图像和背景图像的尺寸相同,目标实景图像中与背景图像的参考背景像素区域对应位置的区域即为目标像素区域。针对每个目标实景图像,计算机设备从目标实景图像中确定目标像素区域,则可以是将目标实景图像中与参考背景像素区域位置相同的区域确定为目标像素区域。Since the acquisition screen of the acquisition component is fixed, the size of the target real scene image and the background image is the same, and the area in the target real scene image corresponding to the reference background pixel area of the background image is the target pixel area. For each target real-life image, the computer device determines the target pixel area from the target real-life image, which may be to determine the target pixel area in the target real image with the same location as the reference background pixel area.
在另一种可能的实施方式中,针对每个目标实景图像,计算机设备还可以检测背景图像中各像素点的像素值是否为0,若为0,则确定背景图像中该位置的像素点不是参考背景像素区域中的,因此,则确定目标实景图像中该位置的像素点也不是目标像素区域中的;同理,若不为0,则确定目标实景图像中该位置的像素点为目标像素区域中的像素点,从而通过依次检测目标实景图像中的各像素点,则可以确定目标实景图像中的目标像素区域。In another possible implementation, for each target real image, the computer device can also detect whether the pixel value of each pixel in the background image is 0, and if it is 0, it is determined that the pixel at this position in the background image is not Refer to the background pixel area, therefore, it is determined that the pixel at this position in the target live image is not in the target pixel area; similarly, if it is not 0, it is determined that the pixel at this position in the target live image is the target pixel. Therefore, by sequentially detecting each pixel in the target real-life image, the target pixel area in the target real-life image can be determined.
步骤S202,将目标像素区域中各像素点的像素值分别与参考背景像素区域中对应像素点的像素值作差,得到作差结果。In step S202, the pixel value of each pixel in the target pixel area is respectively different from the pixel value of the corresponding pixel in the reference background pixel area to obtain a difference result.
本申请实施例中,计算机设备将目标实景图像与背景图像进行对比,可以是将目标像素区域中各像素点的像素值与参考背景像素区域中对应位置像素点的像素值作差,得到作差结果。In the embodiment of the present application, the computer device compares the target real scene image with the background image, which may be the difference between the pixel value of each pixel point in the target pixel area and the pixel value of the corresponding position pixel point in the reference background pixel area to obtain the difference result.
可以理解的是,计算机设备只将目标实景图像与背景图像中的部分区域(目标像素区域和参考背景像素区域中)进行作差对比,可以提升对比效率,从而可以缩短冰雹检测时间,有利于实现冰雹的实时检测,并且可以节约计算机设备的计算资源。It can be understood that the computer equipment only compares the target real scene image with the partial area in the background image (the target pixel area and the reference background pixel area), which can improve the comparison efficiency, thereby shortening the hail detection time, which is conducive to the realization of Real-time detection of hail, and can save computing resources of computer equipment.
步骤S203,将各目标实景图像的作差结果确定为对比结果。Step S203, determining the difference result of each target real scene image as the comparison result.
计算机设备将各目标实景图像的作差结果确定为对比结果。The computer equipment determines the difference result of the real-life images of each target as the comparison result.
基于图2所示的实施例,对应地,参见图3,步骤S300可以包括步骤S301、步骤S302、步骤S303和步骤S304:Based on the embodiment shown in FIG. 2, correspondingly, referring to FIG. 3, step S300 may include step S301, step S302, step S303 and step S304:
步骤S301,针对每个目标实景图像,检测目标实景图像中目标像素区域的各像素点的作差结果是否大于预设差值阈值。Step S301 , for each target real scene image, detect whether the difference result of each pixel point in the target pixel area in the target real scene image is greater than a preset difference threshold.
对于每个目标实景图像,计算机设备检测目标实景图像中目标像素区域的各像素点的作差结果是否大于预设差值阈值。可以理解的是,在目标区域不存在冰雹的情况下,由于采集组件的采集画面固定,因此目标实景图像与背景图像中对应位置的像素点的像素值应该相同或者相近。For each target real-life image, the computer device detects whether the difference result of each pixel point in the target pixel area in the target real-life image is greater than a preset difference threshold. It can be understood that, in the case where there is no hail in the target area, since the capture image of the capture component is fixed, the pixel values of the pixels at the corresponding positions in the target real image and the background image should be the same or similar.
步骤S302,从目标像素区域的各像素点中确定作差结果大于预设差值阈值的多个目标像素点,并根据多个目标像素点生成目标实景图像对应的掩码图。Step S302: Determine a plurality of target pixels whose difference result is greater than a preset difference threshold from each pixel in the target pixel area, and generate a mask map corresponding to the target real image according to the plurality of target pixels.
若目标像素区域中存在像素点的作差结果大于预设差值阈值,则表征目标像素区域存在变化因子,如冰雹下落过程的成像,则属于变化因子。计算机设备可以将作差结果大于预设差值阈值的像素点确定为目标像素点,并在目标实景图像中对各目标像素点进行标记,将目标实景图像中除目标像素点之外的其它像素点的像素值置0,则得到目标实景图像对应的掩码图。该掩码图包括多个目标像素点形成的多个掩码区域。If the difference result of pixel points in the target pixel area is greater than the preset difference threshold, it indicates that there is a change factor in the target pixel area, such as the imaging of the hail falling process, which belongs to the change factor. The computer device can determine the pixel points whose difference result is greater than the preset difference threshold value as the target pixel point, and mark each target pixel point in the target real scene image, and classify the other pixels except the target pixel point in the target real scene image. If the pixel value of the point is set to 0, the mask map corresponding to the target real scene image is obtained. The mask map includes multiple mask regions formed by multiple target pixels.
步骤S303,检测多个掩码区域的属性信息是否满足预设属性条件。Step S303: Detect whether the attribute information of the multiple mask regions satisfies a preset attribute condition.
本申请实施例中,预设属性条件与各掩码区域的面积以及多个掩码区域的数量有关。计算机设备可以根据冰雹下落过程的特征设置预设属性条件,例如,可以设置该预设属性条件为掩码区域的面积处于冰雹成像区域的面积范围内、掩码区域的数量不低于冰雹下落的最小数量等。In this embodiment of the present application, the preset attribute condition is related to the area of each mask area and the number of multiple mask areas. The computer equipment can set preset attribute conditions according to the characteristics of the hail falling process. For example, the preset attribute conditions can be set as the area of the mask area is within the area of the hail imaging area, and the number of mask areas is not less than the amount of the hail falling. minimum quantity, etc.
计算机设备检测每个目标实景图像对应的掩码图中的多个掩码区域的属性信息是否满足预设属性条件,例如可以是检测各掩码区域的面积是否处于冰雹成像区域的面积范围内、检测掩码图包括的掩码区域的数量是否大于冰雹下落的最小数量。作为一种实施方式,对于掩码图,计算机设备可以调用OpenCV视觉库中的cv2.findContours函数查找连通域,即掩码区域,再通过调用cv2.contourArea函数获取每个掩码区域的面积。The computer equipment detects whether the attribute information of the multiple mask areas in the mask map corresponding to each target real scene image satisfies the preset attribute conditions, for example, it can be detected whether the area of each mask area is within the area of the hail imaging area, Detects whether the number of mask areas included in the mask map is greater than the minimum number of hail falls. As an implementation manner, for the mask map, the computer device can call the cv2.findContours function in the OpenCV vision library to find the connected area, that is, the mask area, and then obtain the area of each mask area by calling the cv2.contourArea function.
步骤S304,若存在至少一个目标实景图像的多个掩码区域的属性信息满足预设属性条件,则确定冰雹检测结果为目标区域存在冰雹。Step S304, if the attribute information of multiple masked areas of at least one target real-life image satisfies the preset attribute condition, it is determined that the hailstone detection result is that there is hailstone in the target area.
若多个目标实景图像中,存在至少一个目标实景图像的多个掩码区域的属性信息满足预设属性条件,计算机设备则确定目标区域的冰雹检测结果为目标区域存在冰雹。即若至少一个目标实景图像对应的掩码图中存在较多的掩码区域,且掩码区域的面积处于冰雹成像区域的面积范围内,则确定冰雹检测结果为目标区域存在冰雹。若连续的多张目标实景图像的多个掩码区域的属性信息均满足预设属性条件,则同样确定冰雹检测结果为目标区域存在冰雹,且该种情况下,目标区域存在冰雹的可能性更大。If the attribute information of multiple mask areas in at least one target real-life image in the multiple target real-life images satisfies the preset attribute condition, the computer device determines that the hail detection result in the target area is that there is hail in the target area. That is, if there are many mask areas in the mask map corresponding to at least one target real-world image, and the area of the mask area is within the area of the hail imaging area, the hail detection result is determined to be hail in the target area. If the attribute information of the multiple mask areas of the consecutive multiple target real-life images all meet the preset attribute conditions, the hail detection result is also determined to be that there is hail in the target area, and in this case, the possibility of hail in the target area is higher. big.
在一种可能的实施方式中,在确定目标区域存在冰雹后,计算机设备还可以根据各目标实景图像中各掩码区域的面积以及多个掩码区域的数量,确定冰雹强度。作为一种实施方式,计算机设备中可以存储掩码区域的面积区间、掩码区域的数量区间与冰雹强度的映射关系,计算机设备可以获取目标实景图像对应的掩码图中各掩码区域的平均面积以及掩码区域的数量,然后根据该平均面积和掩码区域的数量在映射关系中查找对应的掩码区域的面积区间以及掩码区域的数量区间,从而可以确定对应的冰雹强度。In a possible implementation manner, after determining that there is hail in the target area, the computer device may also determine the hail intensity according to the area of each mask area and the number of multiple mask areas in each target real-life image. As an embodiment, the computer device can store the area interval of the mask area, the mapping relationship between the number interval of the mask area and the hail intensity, and the computer device can obtain the average value of each mask area in the mask map corresponding to the target real scene image. area and the number of masked areas, and then according to the average area and the number of masked areas, the corresponding area of masked area and the number of masked areas are searched in the mapping relationship, so that the corresponding hail intensity can be determined.
本实施例通过将目标像素区域中各像素点的像素值分别与参考背景像素区域中对应像素点的像素值作差,可以提升对比效率,从而可以缩短冰雹检测时间,有利于实现冰雹的实时检测,并且可以节约计算机设备的计算资源。本实施例在确定目标区域存在冰雹后,进一步得到目标区域的冰雹强度,能够提供给用户更为精细化的冰雹检测数据,从而可以更有效地帮助用户及时做出防雹反应,有利于降低用户的损失以及保障用户安全。In this embodiment, the difference between the pixel value of each pixel in the target pixel area and the pixel value of the corresponding pixel in the reference background pixel area can improve the comparison efficiency, thereby shortening the hail detection time, which is conducive to the realization of real-time hail detection , and can save computing resources of computer equipment. In this embodiment, after it is determined that there is hail in the target area, the hail intensity of the target area is further obtained, which can provide the user with more refined hail detection data, thereby more effectively helping the user to make an anti-hail response in a timely manner, which is beneficial to reducing the risk of the user. loss and protect user safety.
在上述图1所示实施例的基础上,参见图4,本实施例为一个实施例中计算机设备对冰雹检测结果进行准确性验证的过程。如图4所示,本实施例冰雹检测方法还包括步骤S401和步骤S402:On the basis of the above embodiment shown in FIG. 1 , referring to FIG. 4 , this embodiment is a process in which a computer device performs accuracy verification on a hail detection result in one embodiment. As shown in Figure 4, the hail detection method of the present embodiment further includes step S401 and step S402:
步骤S401,若冰雹检测结果为目标区域存在冰雹,则获取目标区域对应的至少一个更新实景图像,并基于至少一个更新实景图像对冰雹检测结果进行准确性验证。Step S401, if the hail detection result is that there is hail in the target area, obtain at least one updated real-life image corresponding to the target area, and verify the accuracy of the hail detection result based on the at least one updated real-world image.
本申请实施例中,计算机设备在确定目标区域的冰雹检测结果为目标区域存在冰雹后,计算机设备获取目标区域对应的至少一个更新实景图像,并基于至少一个更新实景图像对冰雹检测结果进行准确性验证。In the embodiment of the present application, after the computer device determines that the hail detection result in the target area is that there is hail in the target area, the computer device acquires at least one updated real-world image corresponding to the target area, and based on the at least one updated real-life image, the hail detection result is accurate. verify.
在一种可能的实施方式中,该至少一个更新实景图像可以为一个更新实景图像;在另一种可能的实施方式中,该至少一个更新实景图像可以为多个更新实景图像,各更新实景图像在时序上连续,且各更新实景图像之间的采样间隔小于各目标实景图像之间的采样间隔。In a possible implementation manner, the at least one updated real-life image may be one updated real-life image; in another possible implementation, the at least one updated real-life image may be a plurality of updated real-life images, each of which is updated It is continuous in time sequence, and the sampling interval between each updated live image is smaller than the sampling interval between each target live image.
作为一种实施方式,以至少一个更新实景图像为多个更新实景图像为例,计算机设备在确定目标区域的冰雹检测结果为目标区域存在冰雹后,可以将采样间隔调小,控制采集组件再次对目标区域进行连续的图像采样,得到多个更新实景图像。计算机设备可以采用如图2和图3所示实施例的方式,将各更新实景图像与目标图像进行对比,并根据对比结果检测目标区域是否存在冰雹。As an embodiment, taking at least one updated real image as a plurality of updated real images as an example, after the computer device determines that the hail detection result in the target area is that there is hail in the target area, the sampling interval can be reduced, and the acquisition component can be controlled to re-evaluate Continuous image sampling is performed on the target area to obtain multiple updated real-world images. The computer device can compare each updated real-life image with the target image in the manner of the embodiments shown in FIG. 2 and FIG. 3 , and detect whether there is hail in the target area according to the comparison result.
需要说明的是,计算机设备根据多个更新实景图像和背景图像检测目标区域是否存在冰雹的实施方式,与计算机设备根据多个目标实景图像和背景图像检测目标区域是否存在冰雹的实施方式相同或类似,具体可以参见上述实施例,在此不再赘述。It should be noted that the implementation of the computer equipment detecting whether there is hail in the target area according to a plurality of updated real-life images and background images is the same as or similar to the implementation of the computer equipment detecting whether there is hail in the target area according to a plurality of target real-life images and background images. , for details, reference may be made to the foregoing embodiments, which will not be repeated here.
步骤S402,在冰雹检测结果通过准确性验证的情况下,输出冰雹检测结果。Step S402, in the case that the hail detection result passes the accuracy verification, output the hail detection result.
计算机设备若根据至少一个更新实景图像确定目标区域存在冰雹,则确定冰雹检测结果通过准确性验证,在冰雹检测结果通过准确性验证的情况下,输出冰雹检测结果,例如可以是向用户终端发送推送信息,提示目标区域发生了冰雹现象,以提醒用户及时做出防雹反应来降低用户损失以及保障用户安全。If the computer device determines that there is hail in the target area according to at least one updated real-world image, it is determined that the hail detection result passes the accuracy verification, and in the case that the hail detection result passes the accuracy verification, the hail detection result is output, for example, it can be sent to the user terminal. information to remind the target area that hail has occurred, to remind users to make anti-hail responses in time to reduce user losses and ensure user safety.
在上述图1所示实施例的基础上,参见图5,本实施例为另一个实施例中计算机设备对冰雹检测结果进行准确性验证的过程。如图5所示,本实施例冰雹检测方法还包括步骤S501、步骤S502和步骤S503:On the basis of the above embodiment shown in FIG. 1 , referring to FIG. 5 , this embodiment is a process in which a computer device performs accuracy verification on a hail detection result in another embodiment. As shown in FIG. 5, the hail detection method of the present embodiment further includes step S501, step S502 and step S503:
步骤S501,若冰雹检测结果为目标区域存在冰雹,则获取目标区域对应的环境数据。Step S501, if the hail detection result is that there is hail in the target area, obtain environmental data corresponding to the target area.
本申请实施例中,计算机设备在确定目标区域的冰雹检测结果为目标区域存在冰雹后,计算机设备可以通过部署在目标区域中的传感器获取目标区域对应的环境数据,该环境数据包括目标区域对应的温度和空气湿度中的至少一个,传感器可以是温湿度传感器。In the embodiment of the present application, after the computer device determines that the hail detection result in the target area is that there is hail in the target area, the computer device can obtain environmental data corresponding to the target area through sensors deployed in the target area, and the environmental data includes the corresponding environmental data in the target area. At least one of temperature and air humidity, the sensor may be a temperature and humidity sensor.
步骤S502,检测环境数据是否满足冰雹产生的环境条件。Step S502, detecting whether the environmental data meets the environmental conditions for hail generation.
计算机设备检测环境数据是否满足冰雹产生的环境条件,该环境条件可以与冰雹产生的气象因素相关联,例如可以将冰雹产生的必要湿度作为湿度阈值以及将冰雹产生的必要温度作为温度阈值。计算机设备则可以检测环境数据包括的温度是否低于温度阈值以及检测环境数据包括的湿度是否高于湿度阈值。The computer device detects whether the environmental data meets the environmental conditions for hail generation, and the environmental conditions can be associated with meteorological factors generated by hail, for example, the necessary humidity for hail generation can be used as a humidity threshold and the necessary temperature for hail generation can be used as a temperature threshold. The computer device can then detect whether the temperature included in the environmental data is lower than the temperature threshold and whether the humidity included in the environmental data is higher than the humidity threshold.
步骤S503,若环境数据满足冰雹产生的环境条件,则输出冰雹检测结果。Step S503, if the environmental data meets the environmental conditions for hail generation, output the hail detection result.
若环境数据满足冰雹产生的环境条件,计算机设备则确定目标区域的当前环境容易形成冰雹,则进一步确定冰雹检测结果准确,再输出冰雹检测结果,能够确保冰雹检测结果的可靠性。If the environmental data meets the environmental conditions for hail generation, the computer equipment determines that the current environment of the target area is likely to form hail, further determines that the hail detection result is accurate, and then outputs the hail detection result, which can ensure the reliability of the hail detection result.
在上述图1所示实施例的基础上,参见图6,本实施例为另一个实施例中计算机设备对冰雹检测结果进行准确性验证的过程。如图6所示,本实施例冰雹检测方法还包括步骤S601、步骤S602和步骤S603:On the basis of the above embodiment shown in FIG. 1 , referring to FIG. 6 , this embodiment is a process in which a computer device performs accuracy verification on a hail detection result in another embodiment. As shown in FIG. 6, the hail detection method of the present embodiment further includes step S601, step S602 and step S603:
步骤S601,若冰雹检测结果为目标区域存在冰雹,则通过测距组件测量测距组件与目标区域中的预设目标物之间的当前距离信息。Step S601, if the hail detection result is that there is hail in the target area, measure the current distance information between the ranging component and a preset target in the target area by using the ranging component.
若计算机设备检测到目标区域的冰雹检测结果为目标区域存在冰雹,为了提升冰雹检测结果的可靠性,计算机设备通过测距组件获取测距组件与目标区域中的预设目标物之间的当前距离信息。If the computer device detects that the hail detection result in the target area is that there is hail in the target area, in order to improve the reliability of the hail detection result, the computer device obtains the current distance between the ranging component and the preset target in the target area through the ranging component. information.
本申请实施例中,测距组件可以是激光测距传感器,将激光测距传感器朝向目标区域中的预设目标物,发射激光束以获取激光探测距离,即当前距离信息。可以理解的是,若目标区域中存在冰雹,激光测距传感器发出的激光束可能未到达预设目标物即会被冰雹阻挡,导致激光的往返传输路径变短,从而距离缩短。预设目标物可以是目标区域中的任一目标物。In this embodiment of the present application, the ranging component may be a laser ranging sensor. The laser ranging sensor is directed toward a preset target in the target area, and a laser beam is emitted to obtain the laser detection distance, that is, current distance information. It is understandable that if there is hail in the target area, the laser beam emitted by the laser ranging sensor may be blocked by the hail before reaching the preset target, which will shorten the round-trip transmission path of the laser, thereby shortening the distance. The preset target can be any target in the target area.
步骤S602,检测当前距离信息与目标区域对应的参考距离信息之间的差值是否大于预设距离阈值。Step S602, detecting whether the difference between the current distance information and the reference distance information corresponding to the target area is greater than a preset distance threshold.
计算机设备检测当前距离信息与目标区域对应的参考距离信息之间的差值是否大于预设距离阈值,其中,参考距离信息是在目标区域不存在冰雹的情况下,通过测距组件测量的测距组件与预设目标物之间的距离信息,即测距组件与预设目标物之间的实际距离。该预设距离阈值在实施时可以自行设置,例如可以基于人工经验设置。The computer equipment detects whether the difference between the current distance information and the reference distance information corresponding to the target area is greater than a preset distance threshold, wherein the reference distance information is the distance measured by the distance measuring component when there is no hail in the target area. The distance information between the component and the preset target, that is, the actual distance between the ranging component and the preset target. The preset distance threshold can be set by itself during implementation, for example, it can be set based on human experience.
步骤S603,若当前距离信息与参考距离信息的差值大于预设距离阈值,则输出冰雹检测结果。Step S603, if the difference between the current distance information and the reference distance information is greater than a preset distance threshold, output a hail detection result.
计算机设备若检测到当前距离信息与目标区域对应的参考距离信息之间的差值大于预设距离阈值,则表征距离变化过大,则进一步确定目标区域存在冰雹,再输出目标区域存在冰雹的冰雹检测结果,从而能够确保冰雹检测结果的可靠性。If the computer device detects that the difference between the current distance information and the reference distance information corresponding to the target area is greater than the preset distance threshold, it indicates that the distance change is too large, then further determines that there is hail in the target area, and then outputs the hail that there is hail in the target area. Therefore, the reliability of the hail detection results can be ensured.
在一个实施例中,在上述实施例的基础上,本实施例冰雹检测方法还可以包括步骤A1和步骤A2:In one embodiment, on the basis of the above-mentioned embodiment, the hail detection method of the present embodiment may also include step A1 and step A2:
步骤A1,若冰雹检测结果为目标区域存在冰雹,则发送冰雹提示信息至用户终端,冰雹提示信息用于提示目标区域存在冰雹。Step A1, if the hail detection result is that there is hail in the target area, send hail prompt information to the user terminal, and the hail prompt information is used to prompt that there is hail in the target area.
步骤A2,若接收到用户终端发送的视频查看请求,则获取目标区域对应的冰雹视频数据,并将冰雹视频数据发送至用户终端。Step A2, if a video viewing request sent by the user terminal is received, obtain hail video data corresponding to the target area, and send the hail video data to the user terminal.
在一种可能的实施方式中,参见图7,图7为一个实施例中冰雹检测系统的示意图。以计算机设备是树莓派(Raspberry Pi)为例,树莓派通过通信模块(GSM/HLS)与用户终端(Phone)通信,树莓派控制高感光成像仪(Camera)采集目标区域的历史实景图像、目标实景图像以及更新实景图像等,通过传感器(Sensors),如温湿度传感器采集目标区域的环境数据、激光测距传感器采集目标区域的激光探测距离等。In a possible implementation, see FIG. 7 , which is a schematic diagram of a hail detection system in an embodiment. Taking the computer device as Raspberry Pi as an example, the Raspberry Pi communicates with the user terminal (Phone) through the communication module (GSM/HLS), and the Raspberry Pi controls the high-sensitivity imager (Camera) to collect the historical real scene of the target area Images, target real images and updated real images, etc., through sensors, such as temperature and humidity sensors to collect environmental data of the target area, laser ranging sensors to collect the laser detection distance of the target area, etc.
树莓派若检测到目标区域存在冰雹,则发送冰雹提示信息至用户终端,该冰雹提示信息中可以携带询问确认选项,询问确认选项例如“是否观看视频?”,若用户点击“是”,用户终端则发送视频查看请求至树莓派,树莓派在接收到用户发送的视频查看请求后,则控制高感光成像仪采集目标区域对应的冰雹视频数据,并将冰雹视频数据发送至用户终端。由此,有利于用户实时且更直观的了解冰雹信息,例如,冰雹大小、强度等,避免或减少冰雹对用户的生命财产安全,以及生活出行造成不利影响。If the Raspberry Pi detects that there is hail in the target area, it will send a hail reminder message to the user terminal. The hail reminder message can carry a confirmation option, such as "Do you want to watch the video?", if the user clicks "Yes", the user The terminal sends a video viewing request to the Raspberry Pi. After receiving the video viewing request sent by the user, the Raspberry Pi controls the high-sensitivity imager to collect hail video data corresponding to the target area, and sends the hail video data to the user terminal. Therefore, it is beneficial for the user to understand the hail information in real time and more intuitively, such as the size and intensity of the hail, so as to avoid or reduce the adverse impact of the hail on the safety of the user's life and property, as well as the life and travel.
应该理解的是,虽然图1-6的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图1-6中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the steps in the flowcharts of FIGS. 1-6 are shown in sequence according to the arrows, these steps are not necessarily executed in the sequence shown by the arrows. Unless explicitly stated herein, the execution of these steps is not strictly limited to the order, and these steps may be performed in other orders. Moreover, at least a part of the steps in FIGS. 1-6 may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but may be executed at different times. The execution of these steps or stages The order is also not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the steps or phases within the other steps.
在一个实施例中,如图8所示,提供了一种冰雹检测装置,包括:In one embodiment, as shown in Figure 8, a hail detection device is provided, comprising:
第一获取模块10,用于获取目标区域对应的背景图像,所述背景图像是基于所述目标区域对应的至少一个不包括冰雹的历史实景图像生成的;The
对比模块20,用于获取所述目标区域对应的至少一个目标实景图像,并将所述目标实景图像与所述背景图像进行对比,得到对比结果,所述对比结果包括所述目标实景图像相对于所述背景图像的像素值变化信息;The
第二获取模块30,用于根据所述对比结果,获取所述目标区域的冰雹检测结果,所述冰雹检测结果用于表征所述目标区域存在冰雹或所述目标区域不存在冰雹。The second obtaining
可选地,所述至少一个目标实景图像为多个目标实景图像,各所述目标实景图像在时序上连续。Optionally, the at least one target real-life image is a plurality of target real-life images, and each of the target real-life images is consecutive in time sequence.
可选地,所述背景图像包括参考背景像素区域,所述对比模块20,包括:Optionally, the background image includes a reference background pixel area, and the
第一确定单元,用于针对每个所述目标实景图像,从所述目标实景图像中确定与所述参考背景像素区域对应的目标像素区域;a first determining unit, configured to, for each of the target real-life images, determine a target pixel area corresponding to the reference background pixel area from the target real-life image;
运算单元,用于将所述目标像素区域中各像素点的像素值分别与所述参考背景像素区域中对应像素点的像素值作差,得到作差结果;an arithmetic unit, used to make a difference between the pixel value of each pixel in the target pixel area and the pixel value of the corresponding pixel in the reference background pixel area, to obtain a difference result;
第二确定单元,用于将各所述目标实景图像的作差结果确定为所述对比结果。The second determination unit is configured to determine the difference result of each of the target real-life images as the comparison result.
可选地,所述第二获取模块30,包括:Optionally, the second obtaining
第一检测单元,用于针对每个所述目标实景图像,检测所述目标实景图像中目标像素区域的各像素点的作差结果是否大于预设差值阈值;a first detection unit, configured to detect, for each of the target real-life images, whether the difference result of each pixel in the target pixel area in the target real-life image is greater than a preset difference threshold;
掩码图生成单元,用于从所述目标像素区域的各像素点中确定作差结果大于所述预设差值阈值的多个目标像素点,并根据所述多个目标像素点生成所述目标实景图像对应的掩码图,所述掩码图包括所述多个目标像素点形成的多个掩码区域;A mask map generating unit is used to determine a plurality of target pixels whose difference result is greater than the preset difference threshold from each pixel of the target pixel area, and generate the said target pixel according to the plurality of target pixels. a mask map corresponding to the target real scene image, the mask map including multiple mask regions formed by the multiple target pixels;
第二检测单元,用于检测所述多个掩码区域的属性信息是否满足预设属性条件,所述预设属性条件与各所述掩码区域的面积以及所述多个掩码区域的数量有关;a second detection unit, configured to detect whether the attribute information of the multiple mask areas satisfies a preset attribute condition, the preset attribute condition is related to the area of each of the mask areas and the number of the multiple mask areas related;
第三确定单元,用于若存在至少一个目标实景图像的多个掩码区域的属性信息满足所述预设属性条件,则确定所述冰雹检测结果为所述目标区域存在冰雹。A third determining unit, configured to determine that the hail detection result is that there is hail in the target area if the attribute information of multiple mask areas in at least one target real-life image meets the preset attribute condition.
可选地,所述装置还包括:Optionally, the device further includes:
验证模块,用于若所述冰雹检测结果为所述目标区域存在冰雹,则获取所述目标区域对应的至少一个更新实景图像,并基于所述至少一个更新实景图像对所述冰雹检测结果进行准确性验证;A verification module, configured to obtain at least one updated real-world image corresponding to the target area if the hail detection result is that there is hail in the target area, and accurately perform the hail detection result based on the at least one updated real-world image sexual verification;
第一输出模块,用于在所述冰雹检测结果通过准确性验证的情况下,输出所述冰雹检测结果。The first output module is configured to output the hail detection result when the hail detection result passes the accuracy verification.
可选地,所述装置还包括:Optionally, the device further includes:
第三获取模块,用于若所述冰雹检测结果为所述目标区域存在冰雹,则获取所述目标区域对应的环境数据,所述环境数据包括所述目标区域对应的温度和空气湿度中的至少一个;A third acquisition module, configured to acquire environmental data corresponding to the target area if the hail detection result is that there is hail in the target area, and the environmental data includes at least one of the temperature and air humidity corresponding to the target area One;
第一检测模块,用于检测所述环境数据是否满足冰雹产生的环境条件;a first detection module for detecting whether the environmental data meets the environmental conditions generated by hail;
第二输出模块,用于若所述环境数据满足冰雹产生的所述环境条件,则输出所述冰雹检测结果。The second output module is configured to output the hail detection result if the environmental data satisfies the environmental conditions generated by hail.
可选地,所述装置还包括:Optionally, the device further includes:
第四获取模块,用于若所述冰雹检测结果为所述目标区域存在冰雹,则通过测距组件测量所述测距组件与所述目标区域中的预设目标物之间的当前距离信息;The fourth acquisition module is used for, if the hail detection result is that there is hail in the target area, then measure the current distance information between the ranging component and the preset target in the target area by the ranging component;
第二检测模块,用于检测所述当前距离信息与所述目标区域对应的参考距离信息之间的差值是否大于预设距离阈值,所述参考距离信息是在所述目标区域不存在冰雹的情况下,通过所述测距组件测量的所述测距组件与所述预设目标物之间的距离信息;The second detection module is configured to detect whether the difference between the current distance information and the reference distance information corresponding to the target area is greater than a preset distance threshold, and the reference distance information is that there is no hail in the target area. In this case, the distance information between the ranging component and the preset target measured by the ranging component;
第三输出模块,用于若所述当前距离信息与所述参考距离信息的差值大于所述预设距离阈值,则输出所述冰雹检测结果。A third output module, configured to output the hail detection result if the difference between the current distance information and the reference distance information is greater than the preset distance threshold.
可选地,所述装置还包括:Optionally, the device further includes:
提示模块,用于若所述冰雹检测结果为所述目标区域存在冰雹,则发送冰雹提示信息至用户终端,所述冰雹提示信息用于提示所述目标区域存在冰雹;A prompting module, configured to send hail prompt information to the user terminal if the hail detection result is that there is hail in the target area, and the hail prompt information is used to prompt that there is hail in the target area;
发送模块,用于若接收到所述用户终端发送的视频查看请求,则获取所述目标区域对应的冰雹视频数据,并将所述冰雹视频数据发送至所述用户终端。A sending module, configured to acquire hail video data corresponding to the target area if a video viewing request sent by the user terminal is received, and send the hail video data to the user terminal.
关于冰雹检测装置的具体限定可以参见上文中对于冰雹检测方法的限定,在此不再赘述。上述冰雹检测装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitation of the hail detection device, please refer to the limitation of the hail detection method above, which will not be repeated here. Each module in the above-mentioned hail detection device can be implemented in whole or in part by software, hardware and combinations thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图9所示。该计算机设备包括通过系统总线连接的处理器、存储器和网络接口。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储冰雹检测方法的数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种冰雹检测方法。In one embodiment, a computer device is provided, and the computer device may be a server, and its internal structure diagram may be as shown in FIG. 9 . The computer device includes a processor, memory, and a network interface connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium, an internal memory. The nonvolatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the execution of the operating system and computer programs in the non-volatile storage medium. The database of the computer device is used to store the data of the hail detection method. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program, when executed by the processor, implements a hail detection method.
本领域技术人员可以理解,图9中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 9 is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:In one embodiment, a computer device is provided, including a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:
获取目标区域对应的背景图像,所述背景图像是基于所述目标区域对应的至少一个不包括冰雹的历史实景图像生成的;Obtain a background image corresponding to the target area, the background image is generated based on at least one historical real image corresponding to the target area that does not include hail;
获取所述目标区域对应的至少一个目标实景图像,并将所述目标实景图像与所述背景图像进行对比,得到对比结果,所述对比结果包括所述目标实景图像相对于所述背景图像的像素值变化信息;Acquire at least one target real-life image corresponding to the target area, and compare the target real-life image with the background image to obtain a comparison result, where the comparison result includes the pixels of the target real-life image relative to the background image value change information;
根据所述对比结果,获取所述目标区域的冰雹检测结果,所述冰雹检测结果用于表征所述目标区域存在冰雹或所述目标区域不存在冰雹。According to the comparison result, the hail detection result of the target area is obtained, and the hail detection result is used to indicate that there is hail in the target area or there is no hail in the target area.
在一个实施例中,所述至少一个目标实景图像为多个目标实景图像,各所述目标实景图像在时序上连续。In one embodiment, the at least one target real-life image is a plurality of target real-life images, and each of the target real-life images is consecutive in time sequence.
在一个实施例中,所述背景图像包括参考背景像素区域,处理器执行计算机程序时还实现以下步骤:In one embodiment, the background image includes a reference background pixel area, and the processor further implements the following steps when executing the computer program:
针对每个所述目标实景图像,从所述目标实景图像中确定与所述参考背景像素区域对应的目标像素区域;For each of the target real-life images, determining a target pixel area corresponding to the reference background pixel area from the target real-life image;
将所述目标像素区域中各像素点的像素值分别与所述参考背景像素区域中对应像素点的像素值作差,得到作差结果;Differentiate the pixel value of each pixel in the target pixel area with the pixel value of the corresponding pixel in the reference background pixel area to obtain a difference result;
将各所述目标实景图像的作差结果确定为所述对比结果。A difference result of each of the target real-life images is determined as the comparison result.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, the processor further implements the following steps when executing the computer program:
针对每个所述目标实景图像,检测所述目标实景图像中目标像素区域的各像素点的作差结果是否大于预设差值阈值;For each of the target real-life images, detect whether the difference result of each pixel in the target pixel area in the target real-life image is greater than a preset difference threshold;
从所述目标像素区域的各像素点中确定作差结果大于所述预设差值阈值的多个目标像素点,并根据所述多个目标像素点生成所述目标实景图像对应的掩码图,所述掩码图包括所述多个目标像素点形成的多个掩码区域;A plurality of target pixel points whose difference result is greater than the preset difference threshold value are determined from each pixel point of the target pixel area, and a mask map corresponding to the target real scene image is generated according to the plurality of target pixel points , the mask map includes a plurality of mask regions formed by the plurality of target pixels;
检测所述多个掩码区域的属性信息是否满足预设属性条件,所述预设属性条件与各所述掩码区域的面积以及所述多个掩码区域的数量有关;Detecting whether the attribute information of the multiple mask areas satisfies a preset attribute condition, the preset attribute condition is related to the area of each of the mask areas and the number of the multiple mask areas;
若存在至少一个目标实景图像的多个掩码区域的属性信息满足所述预设属性条件,则确定所述冰雹检测结果为所述目标区域存在冰雹。If the attribute information of multiple mask areas of at least one target real-world image satisfies the preset attribute condition, it is determined that the hail detection result is that there is hail in the target area.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, the processor further implements the following steps when executing the computer program:
若所述冰雹检测结果为所述目标区域存在冰雹,则获取所述目标区域对应的至少一个更新实景图像,并基于所述至少一个更新实景图像对所述冰雹检测结果进行准确性验证;If the hail detection result is that there is hail in the target area, obtain at least one updated real scene image corresponding to the target area, and perform accuracy verification on the hail detection result based on the at least one updated real scene image;
在所述冰雹检测结果通过准确性验证的情况下,输出所述冰雹检测结果。When the hail detection result passes the accuracy verification, output the hail detection result.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, the processor further implements the following steps when executing the computer program:
若所述冰雹检测结果为所述目标区域存在冰雹,则获取所述目标区域对应的环境数据,所述环境数据包括所述目标区域对应的温度和空气湿度中的至少一个;If the hail detection result is that there is hail in the target area, obtain environmental data corresponding to the target area, and the environmental data includes at least one of temperature and air humidity corresponding to the target area;
检测所述环境数据是否满足冰雹产生的环境条件;Detecting whether the environmental data satisfies the environmental conditions produced by the hail;
若所述环境数据满足冰雹产生的所述环境条件,则输出所述冰雹检测结果。If the environmental data satisfies the environmental condition for hail generation, output the hail detection result.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, the processor further implements the following steps when executing the computer program:
若所述冰雹检测结果为所述目标区域存在冰雹,则通过测距组件测量所述测距组件与所述目标区域中的预设目标物之间的当前距离信息;If the hail detection result is that there is hail in the target area, measure the current distance information between the ranging component and the preset target in the target area by the ranging component;
检测所述当前距离信息与所述目标区域对应的参考距离信息之间的差值是否大于预设距离阈值,所述参考距离信息是在所述目标区域不存在冰雹的情况下,通过所述测距组件测量的所述测距组件与所述预设目标物之间的距离信息;Detect whether the difference between the current distance information and the reference distance information corresponding to the target area is greater than a preset distance threshold, and the reference distance information is that when there is no hail in the target area, through the measurement distance information between the distance measuring component and the preset target measured by the distance component;
若所述当前距离信息与所述参考距离信息的差值大于所述预设距离阈值,则输出所述冰雹检测结果。If the difference between the current distance information and the reference distance information is greater than the preset distance threshold, output the hail detection result.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:In one embodiment, the processor further implements the following steps when executing the computer program:
若所述冰雹检测结果为所述目标区域存在冰雹,则发送冰雹提示信息至用户终端,所述冰雹提示信息用于提示所述目标区域存在冰雹;If the hail detection result is that there is hail in the target area, then send hail prompt information to the user terminal, and the hail prompt information is used to prompt that there is hail in the target area;
若接收到所述用户终端发送的视频查看请求,则获取所述目标区域对应的冰雹视频数据,并将所述冰雹视频数据发送至所述用户终端。If a video viewing request sent by the user terminal is received, the hail video data corresponding to the target area is acquired, and the hail video data is sent to the user terminal.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:In one embodiment, a computer-readable storage medium is provided on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
获取目标区域对应的背景图像,所述背景图像是基于所述目标区域对应的至少一个不包括冰雹的历史实景图像生成的;Obtain a background image corresponding to the target area, the background image is generated based on at least one historical real image corresponding to the target area that does not include hail;
获取所述目标区域对应的至少一个目标实景图像,并将所述目标实景图像与所述背景图像进行对比,得到对比结果,所述对比结果包括所述目标实景图像相对于所述背景图像的像素值变化信息;Acquire at least one target real-life image corresponding to the target area, and compare the target real-life image with the background image to obtain a comparison result, where the comparison result includes the pixels of the target real-life image relative to the background image value change information;
根据所述对比结果,获取所述目标区域的冰雹检测结果,所述冰雹检测结果用于表征所述目标区域存在冰雹或所述目标区域不存在冰雹。According to the comparison result, the hail detection result of the target area is obtained, and the hail detection result is used to indicate that there is hail in the target area or there is no hail in the target area.
在一个实施例中,所述至少一个目标实景图像为多个目标实景图像,各所述目标实景图像在时序上连续。In one embodiment, the at least one target real-life image is a plurality of target real-life images, and each of the target real-life images is consecutive in time sequence.
在一个实施例中,所述背景图像包括参考背景像素区域,计算机程序被执行时还实现以下步骤:In one embodiment, the background image includes a reference background pixel area, and the computer program further implements the following steps when executed:
针对每个所述目标实景图像,从所述目标实景图像中确定与所述参考背景像素区域对应的目标像素区域;For each of the target real-life images, determining a target pixel area corresponding to the reference background pixel area from the target real-life image;
将所述目标像素区域中各像素点的像素值分别与所述参考背景像素区域中对应像素点的像素值作差,得到作差结果;Differentiate the pixel value of each pixel in the target pixel area with the pixel value of the corresponding pixel in the reference background pixel area to obtain a difference result;
将各所述目标实景图像的作差结果确定为所述对比结果。A difference result of each of the target real-life images is determined as the comparison result.
在一个实施例中,计算机程序被执行时还实现以下步骤:In one embodiment, the computer program, when executed, also implements the following steps:
针对每个所述目标实景图像,检测所述目标实景图像中目标像素区域的各像素点的作差结果是否大于预设差值阈值;For each of the target real-life images, detect whether the difference result of each pixel in the target pixel area in the target real-life image is greater than a preset difference threshold;
从所述目标像素区域的各像素点中确定作差结果大于所述预设差值阈值的多个目标像素点,并根据所述多个目标像素点生成所述目标实景图像对应的掩码图,所述掩码图包括所述多个目标像素点形成的多个掩码区域;A plurality of target pixel points whose difference result is greater than the preset difference threshold value are determined from each pixel point of the target pixel area, and a mask map corresponding to the target real scene image is generated according to the plurality of target pixel points , the mask map includes a plurality of mask regions formed by the plurality of target pixels;
检测所述多个掩码区域的属性信息是否满足预设属性条件,所述预设属性条件与各所述掩码区域的面积以及所述多个掩码区域的数量有关;Detecting whether the attribute information of the multiple mask areas satisfies a preset attribute condition, the preset attribute condition is related to the area of each of the mask areas and the number of the multiple mask areas;
若存在至少一个目标实景图像的多个掩码区域的属性信息满足所述预设属性条件,则确定所述冰雹检测结果为所述目标区域存在冰雹。If the attribute information of multiple mask areas of at least one target real-world image satisfies the preset attribute condition, it is determined that the hail detection result is that there is hail in the target area.
在一个实施例中,计算机程序被执行时还实现以下步骤:In one embodiment, the computer program, when executed, also implements the following steps:
若所述冰雹检测结果为所述目标区域存在冰雹,则获取所述目标区域对应的至少一个更新实景图像,并基于所述至少一个更新实景图像对所述冰雹检测结果进行准确性验证;If the hail detection result is that there is hail in the target area, obtain at least one updated real scene image corresponding to the target area, and perform accuracy verification on the hail detection result based on the at least one updated real scene image;
在所述冰雹检测结果通过准确性验证的情况下,输出所述冰雹检测结果。When the hail detection result passes the accuracy verification, output the hail detection result.
在一个实施例中,计算机程序被执行时还实现以下步骤:In one embodiment, the computer program, when executed, also implements the following steps:
若所述冰雹检测结果为所述目标区域存在冰雹,则获取所述目标区域对应的环境数据,所述环境数据包括所述目标区域对应的温度和空气湿度中的至少一个;If the hail detection result is that there is hail in the target area, obtain environmental data corresponding to the target area, and the environmental data includes at least one of temperature and air humidity corresponding to the target area;
检测所述环境数据是否满足冰雹产生的环境条件;Detecting whether the environmental data satisfies the environmental conditions produced by the hail;
若所述环境数据满足冰雹产生的所述环境条件,则输出所述冰雹检测结果。If the environmental data satisfies the environmental condition for hail generation, output the hail detection result.
在一个实施例中,计算机程序被执行时还实现以下步骤:In one embodiment, the computer program, when executed, also implements the following steps:
若所述冰雹检测结果为所述目标区域存在冰雹,则通过测距组件测量所述测距组件与所述目标区域中的预设目标物之间的当前距离信息;If the hail detection result is that there is hail in the target area, measure the current distance information between the ranging component and the preset target in the target area by the ranging component;
检测所述当前距离信息与所述目标区域对应的参考距离信息之间的差值是否大于预设距离阈值,所述参考距离信息是在所述目标区域不存在冰雹的情况下,通过所述测距组件测量的所述测距组件与所述预设目标物之间的距离信息;Detect whether the difference between the current distance information and the reference distance information corresponding to the target area is greater than a preset distance threshold, and the reference distance information is that when there is no hail in the target area, through the measurement distance information between the distance measuring component and the preset target measured by the distance component;
若所述当前距离信息与所述参考距离信息的差值大于所述预设距离阈值,则输出所述冰雹检测结果。If the difference between the current distance information and the reference distance information is greater than the preset distance threshold, output the hail detection result.
在一个实施例中,计算机程序被执行时还实现以下步骤:In one embodiment, the computer program, when executed, also implements the following steps:
若所述冰雹检测结果为所述目标区域存在冰雹,则发送冰雹提示信息至用户终端,所述冰雹提示信息用于提示所述目标区域存在冰雹;If the hail detection result is that there is hail in the target area, then send hail prompt information to the user terminal, and the hail prompt information is used to prompt that there is hail in the target area;
若接收到所述用户终端发送的视频查看请求,则获取所述目标区域对应的冰雹视频数据,并将所述冰雹视频数据发送至所述用户终端。If a video viewing request sent by the user terminal is received, the hail video data corresponding to the target area is acquired, and the hail video data is sent to the user terminal.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存或光存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage In the medium, when the computer program is executed, it may include the processes of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database or other media used in the various embodiments provided in this application may include at least one of non-volatile and volatile memory. The non-volatile memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, and the like. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, the RAM may be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM).
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, all It is considered to be the range described in this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several embodiments of the present application, and the descriptions thereof are specific and detailed, but should not be construed as a limitation on the scope of the invention patent. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the scope of protection of the patent of the present application shall be subject to the appended claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010760020.4A CN111882550B (en) | 2020-07-31 | 2020-07-31 | Hail detection method, device, computer equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010760020.4A CN111882550B (en) | 2020-07-31 | 2020-07-31 | Hail detection method, device, computer equipment and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111882550A true CN111882550A (en) | 2020-11-03 |
CN111882550B CN111882550B (en) | 2024-12-13 |
Family
ID=73206121
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010760020.4A Active CN111882550B (en) | 2020-07-31 | 2020-07-31 | Hail detection method, device, computer equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111882550B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114942654A (en) * | 2022-05-19 | 2022-08-26 | 国网河北省电力有限公司营销服务中心 | Automatic tracking type new energy photovoltaic power generation device |
CN115437025A (en) * | 2022-08-23 | 2022-12-06 | 杭州睿影科技有限公司 | Open source detection method, device, system, electronic equipment and medium of security inspection equipment |
CN118262259A (en) * | 2024-05-31 | 2024-06-28 | 国网浙江省电力有限公司苍南县供电公司 | Unmanned aerial vehicle power task monitoring method and device based on big data |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001325672A (en) * | 2000-05-16 | 2001-11-22 | Mega Chips Corp | Invader monitoring system |
CN106600625A (en) * | 2016-12-13 | 2017-04-26 | 广东沅朋网络科技有限公司 | Image processing method and device for detecting small-sized living thing |
CN108182417A (en) * | 2017-12-29 | 2018-06-19 | 广东安居宝数码科技股份有限公司 | Shipment detection method, device, computer equipment and automatic vending machine |
CN109829930A (en) * | 2019-01-15 | 2019-05-31 | 深圳市云之梦科技有限公司 | Face image processing process, device, computer equipment and readable storage medium storing program for executing |
CN110717878A (en) * | 2019-10-12 | 2020-01-21 | 北京迈格威科技有限公司 | Image fusion method, device, computer equipment and storage medium |
CN110969642A (en) * | 2019-12-19 | 2020-04-07 | 深圳云天励飞技术有限公司 | Video filtering method and device, electronic equipment and storage medium |
CN111242128A (en) * | 2019-12-31 | 2020-06-05 | 深圳奇迹智慧网络有限公司 | Target detection method, target detection device, computer-readable storage medium and computer equipment |
-
2020
- 2020-07-31 CN CN202010760020.4A patent/CN111882550B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001325672A (en) * | 2000-05-16 | 2001-11-22 | Mega Chips Corp | Invader monitoring system |
CN106600625A (en) * | 2016-12-13 | 2017-04-26 | 广东沅朋网络科技有限公司 | Image processing method and device for detecting small-sized living thing |
CN108182417A (en) * | 2017-12-29 | 2018-06-19 | 广东安居宝数码科技股份有限公司 | Shipment detection method, device, computer equipment and automatic vending machine |
CN109829930A (en) * | 2019-01-15 | 2019-05-31 | 深圳市云之梦科技有限公司 | Face image processing process, device, computer equipment and readable storage medium storing program for executing |
CN110717878A (en) * | 2019-10-12 | 2020-01-21 | 北京迈格威科技有限公司 | Image fusion method, device, computer equipment and storage medium |
CN110969642A (en) * | 2019-12-19 | 2020-04-07 | 深圳云天励飞技术有限公司 | Video filtering method and device, electronic equipment and storage medium |
CN111242128A (en) * | 2019-12-31 | 2020-06-05 | 深圳奇迹智慧网络有限公司 | Target detection method, target detection device, computer-readable storage medium and computer equipment |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114942654A (en) * | 2022-05-19 | 2022-08-26 | 国网河北省电力有限公司营销服务中心 | Automatic tracking type new energy photovoltaic power generation device |
CN115437025A (en) * | 2022-08-23 | 2022-12-06 | 杭州睿影科技有限公司 | Open source detection method, device, system, electronic equipment and medium of security inspection equipment |
CN118262259A (en) * | 2024-05-31 | 2024-06-28 | 国网浙江省电力有限公司苍南县供电公司 | Unmanned aerial vehicle power task monitoring method and device based on big data |
Also Published As
Publication number | Publication date |
---|---|
CN111882550B (en) | 2024-12-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
AU2020100323A4 (en) | Solar Power Forecasting | |
CN110321853B (en) | Distributed cable external-damage-prevention system based on video intelligent detection | |
US10354386B1 (en) | Remote sensing of structure damage | |
CN111882550A (en) | Hail detection method, hail detection device, computer equipment and readable storage medium | |
CN105844240A (en) | Method and device for detecting human faces in infrared temperature measurement system | |
CN109979468B (en) | Lightning stroke optical path monitoring system and method | |
CN111932519A (en) | Weather prediction method and device, computer equipment and storage medium | |
CN113340432B (en) | Fire monitoring method and system based on stationary meteorological satellite | |
CN110675448B (en) | Ground lighting remote sensing monitoring method, system and storage medium based on civil aviation airliner | |
CN110517440B (en) | Intelligent monitoring and early warning system and method based on satellite remote sensing system | |
CN114973310B (en) | A passive human body positioning method and system based on infrared thermal imaging | |
KR20070028813A (en) | Forest fire detection method and system | |
CN104573387A (en) | Noise map drawing method and device | |
CN111724440A (en) | Orientation information determining method and device of monitoring equipment and electronic equipment | |
EP3665512B1 (en) | Real-time computation of an atmospheric precipitation rate from a digital image of an environment where an atmospheric precipitation is taking place | |
CN113269175B (en) | Fire monitoring method and device | |
CN110910379A (en) | Incomplete detection method and device | |
TW201430318A (en) | Method of water level surveillance | |
CN113867406A (en) | Unmanned aerial vehicle-based line inspection method and system, intelligent equipment and storage medium | |
CN111399014B (en) | Local stereo vision infrared camera system and method for wildlife monitoring | |
US20230326316A1 (en) | System and method for estimating location of forest fire | |
US20230147316A1 (en) | Forest fire detection systemand method capable of determining whether events are same | |
JP2016134804A (en) | Imaging range abnormality determination device, imaging range abnormality determination method, and computer program for imaging range abnormality determination | |
CN115912183A (en) | Method, system, and readable storage medium for inspecting ecological measures of high-voltage transmission lines | |
CN115588267A (en) | Natural fire early warning and response system based on remote sensing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |