Uphill fog detection method, device, computer equipment and readable storage medium
By acquiring and analyzing the image and environmental data of the target area, combined with the HSV color histogram and sharpness classification model, the problem of low accuracy of uphill fog detection caused by manual observation is solved, and high-precision and all-weather uphill fog detection is achieved.
Patent Information
- Application Number
- CN202010762477.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-31
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2040-07-31
AI Technical Summary
The existing method of manually observing uphill fog has many subjective factors, resulting in low detection accuracy and affecting the normal navigation of the aircraft.
By obtaining the target image of the target area, extracting the visibility value and detecting whether it is less than or equal to the threshold, combined with the environmental data to meet the preset conditions, it is determined whether there is uphill fog. This method uses highly sensitive imaging components and computer equipment, uses HSV color histograms and sharpness classification models to calculate visibility values, and adjusts imaging parameters through a photometer luminance meter to achieve all-weather detection.
It improves the accuracy of uphill fog detection, avoids the problem of low accuracy caused by manual observation, and achieves accurate identification and all-weather detection of uphill fog.
Smart Images

Figure CN111899309B
Abstract
Description
Technical Field
[0001] The present application relates to the field of meteorological detection technology, and in particular to an uphill fog detection method, device, computer equipment and readable storage medium. Background Art
[0002] Up-slope fog is a type of fog that usually occurs in mountainous areas. The main reason for its formation is that when the wind blows humid air toward the hillside, the humid air will climb up the hillside. Since the temperature drops with increasing altitude, the water vapor in the humid air will cool and condense into small water droplets during the rising process, thus forming up-slope fog.
[0003] Uphill fog can affect the normal operation of some plateau airports. For example, if there is uphill fog in the flight area of an aircraft, it will seriously affect the normal navigation of the aircraft and even cause an accident. At present, it is generally determined by manual observation of the flight area to determine whether there is uphill fog, and the visibility value in the flight area is manually calculated based on the observation results combined with the ground observation manual.
[0004] However, the above-mentioned method of manually observing uphill fog has many subjective factors, resulting in low accuracy in detecting uphill fog. Summary of the invention
[0005] Based on this, it is necessary to provide an uphill fog detection method, device, computer equipment and readable storage medium that can improve the detection accuracy of uphill fog in response to the above technical problems.
[0006] In a first aspect, an embodiment of the present application provides an uphill fog detection method, the method comprising:
[0007] Acquire a target image corresponding to at least one target area, where the target area is a preset area in the area to be detected;
[0008] For each of the target areas, obtaining a visibility value of the target area according to the target image of the target area, and detecting whether the visibility value is less than or equal to a visibility threshold;
[0009] If the visibility value is less than or equal to the visibility threshold, detecting whether the environmental data of the target area meets a preset condition, wherein the preset condition is related to a meteorological factor causing uphill fog formation;
[0010] If the environmental data of each of the target areas meets the preset conditions, it is determined that there is uphill fog in the area to be detected.
[0011] In one of the embodiments, a high-sensitivity imaging component is deployed in the target area, and a target image corresponding to the target area is acquired by the high-sensitivity imaging component; the preset area is a mountainside area or a valley area.
[0012] In one embodiment, the target area includes at least one target object, and obtaining the visibility value of the target area according to the target image of the target area includes:
[0013] For each of the targets, extracting a target image corresponding to the target from the target image;
[0014] Extracting an HSV color histogram corresponding to the target object according to the target object image;
[0015] The visibility value of the target area is obtained according to the HSV color histogram corresponding to each of the target objects.
[0016] In one embodiment, obtaining the visibility value of the target area according to the HSV color histogram corresponding to each target object includes:
[0017] For each HSV color histogram corresponding to the target object, the HSV color histogram is input into a clarity classification model to obtain a clarity level corresponding to the target object, wherein the clarity level is used to characterize the clarity of the image of the target object in the target object image, and the clarity classification model is trained based on multiple sample HSV color histograms and clarity level labels corresponding to each sample HSV color histogram;
[0018] Obtaining a visibility coefficient corresponding to the clarity level, and obtaining a shooting distance corresponding to the target object and the target image, wherein the clarity level and the visibility coefficient are positively correlated;
[0019] The visibility value is obtained according to the visibility coefficient and shooting distance corresponding to each of the targets.
[0020] In one embodiment, obtaining the visibility value according to the visibility coefficient and the shooting distance corresponding to each of the targets includes:
[0021] Calculating the product of the visibility coefficient and the shooting distance corresponding to each of the targets;
[0022] An average value of the products corresponding to the target objects is calculated, and the average value is determined as the visibility value.
[0023] In one embodiment, the environmental data of the target area includes relative humidity and wind direction, and the detecting whether the environmental data of the target area meets a preset condition includes:
[0024] Detecting whether the relative humidity is greater than a preset humidity threshold, and detecting whether the wind direction is a preset wind direction;
[0025] If the relative humidity is greater than the preset humidity threshold and the wind direction is the preset wind direction, it is determined that the environmental data of the target area meets the preset condition.
[0026] In one embodiment, the method further comprises:
[0027] Measuring the target brightness value corresponding to the target area by using a light meter brightness meter;
[0028] Searching a preset parameter adjustment table according to the target brightness value to obtain a target imaging parameter corresponding to the target brightness value, wherein the parameter adjustment table includes a mapping relationship between each brightness value and each imaging parameter;
[0029] The target imaging parameters are set as working parameters of the high-sensitivity imaging components deployed in the target area.
[0030] In a second aspect, an embodiment of the present application provides an uphill fog detection device, the device comprising:
[0031] An image acquisition module, used to acquire a target image corresponding to at least one target area, wherein the target area is a preset area in the area to be detected;
[0032] A first detection module, configured to obtain, for each target area, a visibility value of the target area according to a target image of the target area, and detect whether the visibility value is less than or equal to a visibility threshold;
[0033] A second detection module is used to detect whether the environmental data of the target area meets a preset condition if the visibility value is less than or equal to the visibility threshold, and the preset condition is related to the meteorological factors of uphill fog formation;
[0034] The determination module is used to determine whether uphill fog exists in the area to be detected if the environmental data of each target area meets the preset conditions.
[0035] In a third aspect, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method of the first aspect when executing the computer program.
[0036] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method of the first aspect described above.
[0037] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0038] By acquiring a target image corresponding to at least one target area, the target area is a preset area in the area to be detected; for each of the target areas, the visibility value of the target area is acquired according to the target image of the target area, and it is detected whether the visibility value is less than or equal to the visibility threshold; if the visibility value is less than or equal to the visibility threshold, it is detected whether the environmental data of the target area meets the preset conditions, and the preset conditions are related to the meteorological factors of uphill fog formation; if the environmental data of each of the target areas meets the preset conditions, it is determined that there is uphill fog in the area to be detected; therefore, in the embodiment of the present application, the visibility value of the target area is acquired according to the target image of the target area, which avoids the traditional technology. The problem of low accuracy of visibility value caused by the visibility value in the artificially estimated area during the operation; in the embodiment of the present application, if the visibility value of the target area is less than or equal to the visibility threshold, it indicates that the visibility of the target area is low and there is heavy fog. In this case, the environmental data of the target area is compared with the preset conditions. Since the preset conditions are related to the meteorological factors for the formation of uphill fog, if the environmental data meets the preset conditions, it indicates that the current environment of the target area has the conditions for the formation of uphill fog, so that it can be determined that the heavy fog in the target area is uphill fog, that is, it is determined that there is uphill fog in the area to be detected, avoiding the problem of low detection accuracy of uphill fog due to many subjective factors in traditional technology. The embodiment of the present application combines the target image corresponding to the target area and the environmental data of the target area to accurately detect whether there is uphill fog in the area to be detected, thereby improving the detection accuracy of uphill fog. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 Schematic diagram of a flow chart of an uphill fog detection method in one embodiment;
[0040] Figure 2 It is a schematic diagram of some detailed steps of step S200 in another embodiment;
[0041] Figure 3 is a schematic diagram of detailed steps of step S230 in another embodiment;
[0042] Figure 4 is a schematic diagram of detailed steps of step S300 in another embodiment;
[0043] Figure 5 A schematic diagram of a flow chart of an uphill fog detection method in another embodiment;
[0044] Figure 6 is a structural block diagram of an uphill fog detection device in one embodiment;
[0045] Figure 7 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0046] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0047] The uphill fog detection method, device, computer equipment and readable storage medium provided in the embodiments of the present application are intended to solve the technical problem that the detection accuracy of uphill fog is low due to many subjective factors in the traditional technology, which relies on manual observation to detect uphill fog. The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems will be described in detail below through embodiments and in conjunction with the accompanying drawings. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments.
[0048] It should be noted that the uphill fog detection method provided in the embodiment of the present application may be executed by an uphill fog detection device, which may be implemented as part or all of a computer device through software, hardware, or a combination of software and hardware, and the computer device may be a server. In the following method embodiments, the execution subject is a computer device as an example for explanation. It can be understood that the uphill fog detection method provided in the following method embodiments may also be applied to a terminal, and may also be applied to a system including a terminal and a server, and may be implemented through the interaction between the terminal and the server.
[0049] In one embodiment, Figure 1 As shown, a method for detecting uphill fog is provided, comprising the following steps:
[0050] Step S100: acquiring a target image corresponding to at least one target area.
[0051] In the embodiment of the present application, the area to be detected may be a hillside area where uphill fog needs to be detected, for example, it may be a hillside area in the flight route of an aircraft or some specific hillside areas, etc. The target area is a preset area in the area to be detected, and the preset area may be a valley area in the area to be detected, that is, an observation area set in the valley of the area to be detected, and the preset area may also be a hillside area in the area to be detected, that is, an observation area set on the hillside of the area to be detected, etc.
[0052] The computer device obtains a target image corresponding to at least one target area. In a possible implementation, a high-sensitivity imaging component is deployed in the target area, and the target image corresponding to the target area is obtained by the computer device through the high-sensitivity imaging component.
[0053] In the embodiment of the present application, each target area is a preset area in the area to be detected, and the preset area is a mountainside area or a valley area, that is, each target area is a mountainside area or a valley area in the area to be detected. As an implementation method, the at least one target area is two target areas, and the two target areas can be a mountainside area and a valley area in the area to be detected, that is, one of the target areas is a mountainside area in the area to be detected, and the other target area is a valley area in the area to be detected. The computer device collects the target image of the valley area through the high-sensitivity imaging component in the valley area, and collects the target image of the mountainside area through the high-sensitivity imaging component in the mountainside area, thereby obtaining the target images corresponding to the two target areas respectively.
[0054] In the embodiments of the present application, at least one target area is two target areas, and the two target areas are the mountainside area and the valley area in the area to be detected, as an example, to illustrate the implementation of the embodiments of the present application. It can be understood that at least one target area can also be a target area with a greater or lesser number than two, for example, at least one target area is one target area, and the one target area is a valley area or a mountainside area, and for example, at least one target area is three target areas, and the three target areas are the mountainside area, the valley area, and the mountaintop area in the area to be detected, etc., and no specific limitation is made here.
[0055] It should be noted that, since uphill fog belongs to the climbing type, if a high-sensitivity imaging component is deployed only in one target area in the detection area, for example, a high-sensitivity imaging component is deployed in the valley area, and the computer device detects heavy fog from the target image of the valley area collected by the high-sensitivity imaging component, but the heavy fog has not developed on the vertical level, that is, it has not climbed, then there may be a situation where the computer device mistakenly determines the heavy fog as uphill fog, causing an uphill fog detection error. The embodiment of the present application deploys high-sensitivity imaging components in the valley area and the hillside area respectively, and the valley area and the hillside area belong to areas of different heights, thereby accurately judging the heavy fog on the vertical level at different heights, which is conducive to more accurate detection of uphill fog, thereby improving the detection accuracy of uphill fog.
[0056] In the embodiment of the present application, the high-sensitivity imaging component can be a high-sensitivity imager. Due to the performance limitations of traditional cameras, computer devices cannot recognize the content in the pictures collected by them at night. Therefore, based on the pictures collected by traditional cameras, the computer device cannot realize the night detection of uphill fog, and night is usually the peak time period for heavy fog. In the embodiment of the present application, the computer device uses a high-sensitivity imaging component to obtain the target image. The computer device adjusts the working parameters of the high-sensitivity imaging component so that the high-sensitivity imaging component can also collect the target image with the imaging effect similar to that during the day at night or in a poor light environment, thereby realizing all-weather detection of uphill fog, expanding the detection range of uphill fog, and further improving the detection accuracy of uphill fog.
[0057] Step S200 , for each target area, obtaining a visibility value of the target area according to the target image of the target area, and detecting whether the visibility value is less than or equal to a visibility threshold.
[0058] For each target area, such as a valley area or a mountainside area, the computer device obtains a visibility value of the corresponding target area according to the target image of each target area.
[0059] Visibility is an indicator of atmospheric transparency. In a possible implementation, the computer device can determine the visibility value of a target area by the clarity of the image of a target object in the target area in the target image of the target area. It can be understood that the clearer the image of the target object in the target area is in the corresponding target image, the higher the visibility value of the target area is, and vice versa.
[0060] After the computer equipment obtains the visibility value of each target area, it detects whether the visibility value of each target area is less than or equal to the visibility threshold. The visibility threshold can be flexibly set during implementation. For example, the visibility threshold can be set to 1km according to the heavy fog standard reported by the civil aviation meteorological report. If the visibility value is less than or equal to 1km, it is considered heavy fog.
[0061] Step S300: If the visibility value is less than or equal to the visibility threshold, then detect whether the environmental data of the target area meets the preset conditions.
[0062] If the computer device detects that the visibility value of the target area is less than or equal to the visibility threshold, it indicates that there is heavy fog in the target area, and the visibility value of the target area affected by the heavy fog is relatively small. In this case, the computer device detects whether the environmental data of the target area meets the preset condition, which is related to the meteorological factors of uphill fog formation, and the preset condition can be determined according to the meteorological factors of uphill fog formation.
[0063] In a possible implementation, the preset conditions may include meteorological factors that are prone to uphill fog. For example, uphill fog usually occurs in mountainous areas. When the wind blows humid air toward the hillside, the humid air will rise up the hillside. Since the temperature decreases with increasing altitude, the water vapor in the humid air will cool and condense into small water droplets during the rising process, thereby forming uphill fog. The computer device can set the preset conditions to be a humidity range or wind direction that is prone to uphill fog, etc.
[0064] The computer device detects whether the environmental data of the target area meets the preset conditions, for example, it can detect whether the relative humidity included in the environmental data is within the humidity range that is prone to form uphill fog, etc.
[0065] In a possible implementation, if the computer device detects that the visibility value of the target area is greater than the visibility threshold, it is determined that there is no heavy fog in the target area, thereby determining that there is no uphill fog in the area to be detected.
[0066] Step S400: If the environmental data of each target area meets the preset conditions, it is determined that there is uphill fog in the area to be detected.
[0067] The computer device can determine whether the current environment of the target area represented by the environmental data can form uphill fog by detecting whether the environmental data meets the preset conditions. If the computer device detects that the environmental data of each target area in the area to be detected meets the preset conditions, the current environment representing each target area can form uphill fog, and it is determined that uphill fog exists in each target area, thereby determining that uphill fog exists in the area to be detected, and outputting the visibility values of each target area, namely the valley area and the mountainside area, for reference.
[0068] This embodiment obtains a target image corresponding to at least one target area, where the target area is a preset area in the area to be detected; for each target area, the visibility value of the target area is obtained according to the target image of the target area, and it is detected whether the visibility value is less than or equal to the visibility threshold; if the visibility value is less than or equal to the visibility threshold, it is detected whether the environmental data of the target area meets the preset conditions, and the preset conditions are related to the meteorological factors of uphill fog formation; if the environmental data of each target area meets the preset conditions, it is determined that there is uphill fog in the area to be detected; therefore, in the embodiment of the present application, the visibility value of the target area is obtained according to the target image of the target area, which avoids the problem of manually calculating the visibility value in the area in the traditional technology. The problem of low accuracy of visibility value caused by visibility value; in the embodiment of the present application, if the visibility value of the target area is less than or equal to the visibility threshold, it indicates that the visibility of the target area is low and there is heavy fog. In this case, the environmental data of the target area is compared with the preset conditions. Since the preset conditions are related to the meteorological factors for the formation of uphill fog, if the environmental data meets the preset conditions, it indicates that the current environment of the target area has the conditions for the formation of uphill fog, so that it can be determined that the heavy fog in the target area is uphill fog, that is, it is determined that there is uphill fog in the area to be detected, avoiding the problem of low detection accuracy of uphill fog due to many subjective factors in traditional technology. The embodiment of the present application combines the target image corresponding to the target area and the environmental data of the target area to accurately detect whether there is uphill fog in the area to be detected, thereby improving the detection accuracy of uphill fog.
[0069] In one embodiment, in the above Figure 1 Based on the embodiment shown, see Figure 2 , this embodiment relates to a process of how a computer device obtains a visibility value of a target area according to a target image of the target area. Figure 2 As shown, the process includes step S210, step S220 and step S230:
[0070] Step S210 : for each target object, extracting a target object image corresponding to the target object from the target image.
[0071] In the embodiment of the present application, the target area includes at least one target object, and the target object may be a building, a lighthouse, a mountain, etc. in the target area. In a possible implementation, the distance between the high-sensitivity imaging component and each target object in the target area when deployed may be within the range of 50m-2km; when the distance between the high-sensitivity imaging component and the target object is too close, the high-sensitivity imaging component can still capture clear images in the case of heavy fog in the target area, and when the distance is too far, even if there is no heavy fog in the target area, the image captured by the high-sensitivity imaging component is not clear due to the long distance. All of the above are not conducive to the computer device detecting uphill fog based on the target image of the target area. Therefore, the embodiment of the present application sets the distance between the high-sensitivity imaging component and each target object in the target area within the range of 50m-2km, which is conducive to improving the detection accuracy of uphill fog.
[0072] For each target object, the computer device extracts a target object image corresponding to the target object from the target image. For example, the target area may include four targets. The computer device then extracts an area corresponding to each position frame coordinate from the target image based on the position frame coordinates of each target object in the target image to obtain a target object image corresponding to each target object.
[0073] In one possible implementation, since the position of the target object is fixed, the position of the target object in the target image is also fixed. Therefore, the position frame coordinates of each target object in the target image can be manually input into a computer device, and the computer device stores the position frame coordinates of each target object in the target image. In another possible implementation, the position frame coordinates of the target object in the target image can also be detected by a computer device using a target detection algorithm, which is not specifically limited here.
[0074] Step S220: extracting the HSV color histogram corresponding to the target object according to the target object image.
[0075] In an embodiment of the present application, the computer device can convert the target object image from the RGB color space to the HSV color space, and then perform histogram statistics on the HSV image corresponding to the target object image in the HSV color space to obtain the HSV color histogram corresponding to each target object image, that is, to obtain the HSV color histogram corresponding to each target object.
[0076] As an implementation method, the computer device can extract the HSV color histogram corresponding to each target object through OpenCV (computer vision library). The HSV color histogram describes the proportion of different colors in the entire image. In the embodiment of the present application, the HSV color histogram corresponding to each target object is used as the feature of the target object in the target image.
[0077] Step S230, obtaining the visibility value of the target area according to the HSV color histogram corresponding to each target object.
[0078] The computer device obtains the visibility value of the target area according to the HSV color histogram corresponding to each target object. In a possible implementation, a mapping relationship between each HSV color histogram and the visibility value may be preset in the computer device. The computer device obtains the visibility value of the target area by searching the mapping relationship according to the HSV color histogram corresponding to each target object.
[0079] In another possible implementation of step S230, see Figure 3 , step S230 may include step S2301, step S2302 and step S2303:
[0080] Step S2301: for each target object corresponding to the HSV color histogram, the HSV color histogram is input into the clarity classification model to obtain the clarity level corresponding to the target object.
[0081] The clarity level is used to characterize the clarity of the target object in the target image, and the clarity classification model is trained based on multiple sample HSV color histograms and the clarity level labels corresponding to each sample HSV color histogram.
[0082] In an embodiment of the present application, a computer device acquires a plurality of sample images collected by a high-sensitivity imaging component in a region to be detected within a preset time period, and each sample image includes a manually annotated clarity level label of the target object imaged in the sample image and the position frame coordinates of the target object in the sample image. For example, a clarity level label of "0" indicates that the target object is not visible in the sample image, a clarity level label of "1" indicates that the target object is vaguely visible in the sample image, a clarity level label of "2" indicates that the edge of the target object is visible in the sample image, and a clarity level label of "3" indicates that the target object is clearly visible in the sample image.
[0083] The computer device intercepts the sample target object images corresponding to each target object from each sample image according to the position frame coordinates of each target object in each sample image, and the computer device extracts the sample HSV color histogram corresponding to each target object from each sample target object image to obtain multiple sample HSV color histograms. In the embodiment of the present application, the sample image may include multiple targets. For example, the sample image includes four targets. Based on the sample image, the computer device can obtain four sample HSV color histograms and four clarity level labels, and one sample HSV color histogram corresponds to one clarity level label.
[0084] The computer device uses the obtained multiple sample HSV color histograms and the clarity level labels corresponding to each sample HSV color histogram as a training sample set, divides the training sample set into a training set and a test set, and then uses the sample HSV color histogram in the training set as the model input, and uses the clarity level labels corresponding to the input in the training set as supervision to train the initial classification model. During the training process, the classification results are verified in combination with the test set until the model converges to obtain a clarity classification model. Among them, the initial classification model can be a random forest, and of course it can also be other classification model frameworks, which are not specifically limited here.
[0085] After the clarity classification model is trained, for each target object's corresponding HSV color histogram, the computer device inputs the HSV color histogram into the trained clarity classification model to obtain the clarity level corresponding to the target object, for example, the clarity level is "0", "1", "2" or "3", and different clarity levels represent different degrees of clarity of the target object in the target object image.
[0086] Step S2302, obtaining the visibility coefficient corresponding to the clarity level, and obtaining the shooting distance corresponding to the target object and the target image.
[0087] The clarity level and the visibility coefficient are positively correlated. As an implementation, the computer device searches the database for a visibility coefficient that matches the clarity level. For example, the visibility coefficient that matches the clarity level "0" is 0, the visibility coefficient that matches the clarity level "1" is 1, the visibility coefficient that matches the clarity level "2" is 1.5, and the visibility coefficient that matches the clarity level "3" is 2.5. The matching relationship between the clarity level and the visibility coefficient can be determined by the ground observation manual.
[0088] The computer device obtains the shooting distance corresponding to the target object and the target image. The shooting distance may be manually measured and input into the computer device, or may be measured by the computer device through a distance measuring sensor, and no specific limitation is made here.
[0089] Step S2303, obtaining the visibility value according to the visibility coefficient and shooting distance corresponding to each target object.
[0090] In a possible implementation, if the target image includes a target object, the computer device calculates the product of the visibility coefficient corresponding to the target object and the shooting distance, and determines the calculated product as the visibility value of the target area.
[0091] In another possible implementation of step S2303, if the target image includes multiple targets, the computer device obtains the visibility value according to the visibility coefficient and shooting distance corresponding to each target, which can be achieved by executing the following steps A1 and A2:
[0092] Step A1, calculating the product of the visibility coefficient corresponding to each target object and the shooting distance.
[0093] Step A2, calculating the average value of the products corresponding to each target object, and determining the average value as the visibility value.
[0094] Therefore, by calculating the average value of the product corresponding to each target object in the target area to obtain the visibility value of the target area, the accuracy of the visibility value of the target area can be improved.
[0095] The computer device obtains the visibility value of the target area and detects whether the visibility value is less than or equal to the visibility threshold. As an implementation mode, if it is detected that the visibility value is less than or equal to the visibility threshold, and it is detected that the environmental data of the target area does not meet the preset conditions, the computer device stores the target image corresponding to the target area into the image sequence to be optimized, and the image sequence to be optimized is used by the computer device to optimize the parameters of the clarity classification model.
[0096] The embodiment of the present application extracts a target object image corresponding to the target object from the target image, extracts an HSV color histogram corresponding to the target object from the target object image, obtains the clarity level corresponding to the target object based on the HSV color histogram, and obtains the visibility coefficient corresponding to the clarity level, thereby avoiding the problem of poor accuracy caused by determining the visibility coefficient through manual observation in traditional technology, thereby improving the accuracy of the visibility value of the target area; the embodiment of the present application calculates the average value of the products corresponding to each target object and determines the average value as the visibility value, which can weaken the influence of the error of a single product on the visibility value, thereby further improving the accuracy of the visibility value of the target area, and then improving the accuracy of uphill fog detection.
[0097] In one embodiment, in the above Figure 1 Based on the embodiment shown, the environmental data of the target area includes relative humidity and wind direction. Figure 4 This embodiment relates to a process of how a computer device detects whether the environmental data of a target area meets a preset condition. Figure 4 As shown, the process includes:
[0098] Step S310, detecting whether the relative humidity is greater than a preset humidity threshold, and detecting whether the wind direction is a preset wind direction.
[0099] In the embodiment of the present application, the environmental data of the target area includes relative humidity and wind direction. As an implementation method, a temperature and humidity sensor and a wind direction and speed sensor can be deployed in the target area, and the computer device obtains the relative humidity of the target area through the temperature and humidity sensor and obtains the wind direction of the target area through the wind direction and speed sensor.
[0100] The computer device determines the preset conditions as relative humidity greater than a preset humidity threshold and wind direction being a preset wind direction based on the meteorological factors for uphill fog formation. The preset humidity threshold can be flexibly set during implementation, for example, it can be set to 90%, and the preset wind direction can be, for example, the direction towards the hillside.
[0101] The computer device detects whether the relative humidity included in the environmental data of the target area is greater than a preset humidity threshold, and detects whether the wind direction included in the environmental data of the target area is a preset wind direction. Thus, the computer device can detect whether the current environment of the target area meets the characteristics of meteorological factors that can form uphill fog through step S310.
[0102] Step S320: If the relative humidity is greater than a preset humidity threshold and the wind direction is a preset wind direction, it is determined that the environmental data of the target area meets the preset conditions.
[0103] If the computer device detects that the relative humidity included in the environmental data of the target area is greater than the preset humidity threshold, and the wind direction included in the environmental data is the preset wind direction, it is determined that the environmental data of the target area meets the preset conditions; when the environmental data of one or more target areas included in the area to be detected all meet the preset conditions, the computer device determines that there is uphill fog in the area to be detected. Therefore, the accuracy of uphill fog detection can be improved by detecting uphill fog in combination with the meteorological factors that form uphill fog.
[0104] In one embodiment, in the above Figure 1 Based on the embodiment shown, see Figure 5 This embodiment relates to a process of how a computer device automatically adjusts the working parameters of a high-sensitivity imaging component. Figure 5 As shown, the uphill fog detection method of this embodiment also includes:
[0105] Step S510: measuring a target brightness value corresponding to the target area by using a light meter.
[0106] In an embodiment of the present application, before the computer device acquires a target image corresponding to at least one target area through a high-sensitivity imaging component deployed in the target area, the computer device adjusts the working parameters of the high-sensitivity imaging component so that the high-sensitivity imaging component can also capture target images with similar imaging effects during the day at night or in an environment with poor lighting, thereby achieving all-weather detection of uphill fog, expanding the detection range of uphill fog, and thereby improving the detection reliability of uphill fog.
[0107] The computer device measures the target brightness value corresponding to the target area through a photometer brightness meter. Different target brightness values represent different light intensities in the target area. The larger the target brightness value, the higher the light intensity of the target area.
[0108] Step S520 , searching a preset parameter adjustment table according to the target brightness value to obtain a target imaging parameter corresponding to the target brightness value.
[0109] The parameter adjustment table includes the mapping relationship between each brightness value and each imaging parameter. In the embodiment of the present application, the mapping relationship between each brightness value and each imaging parameter can be obtained by a computer device fitting the brightness value of the light meter at multiple historical moments and the imaging parameters of the corresponding high-sensitivity imaging component, and the imaging parameters include exposure, gain, noise reduction, etc.
[0110] The computer device searches a preset parameter adjustment table according to the target brightness value to obtain the target imaging parameter corresponding to the target brightness value.
[0111] Step S530, setting the target imaging parameters to the working parameters of the high-sensitivity imaging components deployed in the target area.
[0112] In a possible implementation manner, the parameter adjustment table is shown in Table 1:
[0113] Luminance agc mshutter denoise 0 0x00 0x4f 0x07 (0,750] 0x0c 0x49 0x05 (750,2700] 0x00 0x40 0x00 (2700,∞) 0x00 0x4a 0x05
[0114] Table 1
[0115] Among them, Luminance is the lumen value (brightness value) of the light meter, agc is gain, mshutter is exposure, and denoise is noise reduction.
[0116] As shown in Table 1, when the target brightness value is 0, the computer device adjusts the AGC of the high-sensitivity imaging component to 0x00, mshutter to 0x4f, and denoise to 0x07; when the target brightness value is 0-750, the computer device adjusts the AGC of the high-sensitivity imaging component to 0x0c, mshutter to 0x49, and denoise to 0x05; when the target brightness value is 750-2700, the computer device adjusts the AGC of the high-sensitivity imaging component to 0x00, mshutter to 0x40, and denoise to 0x00; when the target brightness value is greater than 2700, the computer device adjusts the AGC of the high-sensitivity imaging component to 0x00, mshutter to 0x0f, and denoise to 0x07.
[0117] Therefore, the computer equipment can adaptively adjust the working parameters of the high-sensitivity imaging component based on the target brightness value corresponding to the target area measured by the light meter brightness meter, without the need for manual adjustment, thereby improving the timeliness of the adjustment of the working parameters of the high-sensitivity imaging component, thereby ensuring the imaging effect of the target image captured by the high-sensitivity imaging component, and further improving the accuracy of uphill fog detection.
[0118] It should be understood that although Figure 1-5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-5 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.
[0119] In one embodiment, Figure 6 As shown, an uphill fog detection device is provided, comprising:
[0120] An image acquisition module 10 is used to acquire a target image corresponding to at least one target area, where the target area is a preset area in the area to be detected;
[0121] A first detection module 20 is used to obtain, for each target area, a visibility value of the target area according to a target image of the target area, and detect whether the visibility value is less than or equal to a visibility threshold;
[0122] A second detection module 30 is used to detect whether the environmental data of the target area meets a preset condition if the visibility value is less than or equal to the visibility threshold, wherein the preset condition is related to the meteorological factors of uphill fog formation;
[0123] The determination module 40 is used to determine whether uphill fog exists in the area to be detected if the environmental data of each target area meets the preset condition.
[0124] In one embodiment, based on the above Figure 6 In the illustrated embodiment, a high-sensitivity imaging component is deployed in the target area, and a target image corresponding to the target area is acquired by the high-sensitivity imaging component; the preset area is a mountainside area or a valley area.
[0125] In one embodiment, based on the above Figure 6 In the embodiment shown, the target area includes at least one target object, and the first detection module 20 includes:
[0126] A first extraction unit, configured to extract, for each of the target objects, a target object image corresponding to the target object from the target image;
[0127] A second extraction unit, configured to extract an HSV color histogram corresponding to the target object according to the target object image;
[0128] An acquisition unit is used to acquire the visibility value of the target area according to the HSV color histogram corresponding to each of the target objects.
[0129] Optionally, the acquiring unit is specifically used for:
[0130] For each HSV color histogram corresponding to the target object, the HSV color histogram is input into a clarity classification model to obtain a clarity level corresponding to the target object, wherein the clarity level is used to characterize the clarity of the image of the target object in the target object image, and the clarity classification model is trained based on multiple sample HSV color histograms and clarity level labels corresponding to each sample HSV color histogram;
[0131] Obtaining a visibility coefficient corresponding to the clarity level, and obtaining a shooting distance corresponding to the target object and the target image, wherein the clarity level and the visibility coefficient are positively correlated;
[0132] The visibility value is obtained according to the visibility coefficient and shooting distance corresponding to each of the targets.
[0133] Optionally, the acquiring unit is specifically used for:
[0134] Calculating the product of the visibility coefficient and the shooting distance corresponding to each of the targets;
[0135] An average value of the products corresponding to the target objects is calculated, and the average value is determined as the visibility value.
[0136] In one embodiment, based on the above Figure 6 In the embodiment shown, the environmental data of the target area includes relative humidity and wind direction, and the second detection module 30 includes:
[0137] A detection unit, used to detect whether the relative humidity is greater than a preset humidity threshold, and to detect whether the wind direction is a preset wind direction;
[0138] A determination unit is used to determine that the environmental data of the target area meets the preset condition if the relative humidity is greater than the preset humidity threshold and the wind direction is the preset wind direction.
[0139] In one embodiment, based on the above Figure 6 In the embodiment shown, the device further comprises:
[0140] A measuring module, used for measuring a target brightness value corresponding to the target area by using a photometer brightness meter;
[0141] A search module, used to search a preset parameter adjustment table according to the target brightness value to obtain a target imaging parameter corresponding to the target brightness value, wherein the parameter adjustment table includes a mapping relationship between each brightness value and each imaging parameter;
[0142] A parameter setting module is used to set the target imaging parameters as working parameters of the high-sensitivity imaging components deployed in the target area.
[0143] For the specific definition of the uphill fog detection device, please refer to the definition of the uphill fog detection method above, which will not be repeated here. Each module in the above-mentioned uphill fog detection device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0144] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 7 As shown. The computer device includes a processor, a memory and a network interface connected through 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 and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data of the uphill fog detection method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an uphill fog detection method is implemented.
[0145] Those skilled in the art will understand that Figure 7 The structure shown in the figure 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 device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0146] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0147] Acquire a target image corresponding to at least one target area, where the target area is a preset area in the area to be detected;
[0148] For each of the target areas, obtaining a visibility value of the target area according to the target image of the target area, and detecting whether the visibility value is less than or equal to a visibility threshold;
[0149] If the visibility value is less than or equal to the visibility threshold, detecting whether the environmental data of the target area meets a preset condition, wherein the preset condition is related to a meteorological factor causing uphill fog formation;
[0150] If the environmental data of each of the target areas meets the preset conditions, it is determined that there is uphill fog in the area to be detected.
[0151] In one embodiment, a high-sensitivity imaging component is deployed in the target area, and a target image corresponding to the target area is acquired by the high-sensitivity imaging component; the preset area is a mountainside area or a valley area.
[0152] In one embodiment, the target area includes at least one target object, and the processor implements the following steps when executing the computer program:
[0153] For each of the targets, extracting a target image corresponding to the target from the target image;
[0154] Extracting an HSV color histogram corresponding to the target object according to the target object image;
[0155] The visibility value of the target area is obtained according to the HSV color histogram corresponding to each of the target objects.
[0156] In one embodiment, the processor implements the following steps when executing the computer program:
[0157] For each HSV color histogram corresponding to the target object, the HSV color histogram is input into a clarity classification model to obtain a clarity level corresponding to the target object, wherein the clarity level is used to characterize the clarity of the image of the target object in the target object image, and the clarity classification model is trained based on multiple sample HSV color histograms and clarity level labels corresponding to each sample HSV color histogram;
[0158] Obtaining a visibility coefficient corresponding to the clarity level, and obtaining a shooting distance corresponding to the target object and the target image, wherein the clarity level and the visibility coefficient are positively correlated;
[0159] The visibility value is obtained according to the visibility coefficient and shooting distance corresponding to each of the targets.
[0160] In one embodiment, the processor implements the following steps when executing the computer program:
[0161] Calculating the product of the visibility coefficient and the shooting distance corresponding to each of the targets;
[0162] An average value of the products corresponding to the target objects is calculated, and the average value is determined as the visibility value.
[0163] In one embodiment, the environmental data of the target area includes relative humidity and wind direction, and the processor implements the following steps when executing the computer program:
[0164] Detecting whether the relative humidity is greater than a preset humidity threshold, and detecting whether the wind direction is a preset wind direction;
[0165] If the relative humidity is greater than the preset humidity threshold and the wind direction is the preset wind direction, it is determined that the environmental data of the target area meets the preset condition.
[0166] In one embodiment, the processor implements the following steps when executing the computer program:
[0167] Measuring the target brightness value corresponding to the target area by using a light meter brightness meter;
[0168] Searching a preset parameter adjustment table according to the target brightness value to obtain a target imaging parameter corresponding to the target brightness value, wherein the parameter adjustment table includes a mapping relationship between each brightness value and each imaging parameter;
[0169] The target imaging parameters are set as working parameters of the high-sensitivity imaging components deployed in the target area.
[0170] 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:
[0171] Acquire a target image corresponding to at least one target area, where the target area is a preset area in the area to be detected;
[0172] For each of the target areas, obtaining a visibility value of the target area according to the target image of the target area, and detecting whether the visibility value is less than or equal to a visibility threshold;
[0173] If the visibility value is less than or equal to the visibility threshold, detecting whether the environmental data of the target area meets a preset condition, wherein the preset condition is related to a meteorological factor causing uphill fog formation;
[0174] If the environmental data of each of the target areas meets the preset conditions, it is determined that there is uphill fog in the area to be detected.
[0175] In one embodiment, a high-sensitivity imaging component is deployed in the target area, and a target image corresponding to the target area is acquired by the high-sensitivity imaging component; the preset area is a mountainside area or a valley area.
[0176] In one embodiment, the target area includes at least one target object, and when the computer program is executed by a processor, the following steps are implemented:
[0177] For each of the targets, extracting a target image corresponding to the target from the target image;
[0178] Extracting an HSV color histogram corresponding to the target object according to the target object image;
[0179] The visibility value of the target area is obtained according to the HSV color histogram corresponding to each of the target objects.
[0180] In one embodiment, the computer program, when executed by a processor, implements the following steps:
[0181] For each HSV color histogram corresponding to the target object, the HSV color histogram is input into a clarity classification model to obtain a clarity level corresponding to the target object, wherein the clarity level is used to characterize the clarity of the image of the target object in the target object image, and the clarity classification model is trained based on multiple sample HSV color histograms and clarity level labels corresponding to each sample HSV color histogram;
[0182] Obtaining a visibility coefficient corresponding to the clarity level, and obtaining a shooting distance corresponding to the target object and the target image, wherein the clarity level and the visibility coefficient are positively correlated;
[0183] The visibility value is obtained according to the visibility coefficient and shooting distance corresponding to each of the targets.
[0184] In one embodiment, the computer program, when executed by a processor, implements the following steps:
[0185] Calculating the product of the visibility coefficient and the shooting distance corresponding to each of the targets;
[0186] An average value of the products corresponding to the target objects is calculated, and the average value is determined as the visibility value.
[0187] In one embodiment, the environmental data of the target area includes relative humidity and wind direction, and the computer program, when executed by the processor, implements the following steps:
[0188] Detecting whether the relative humidity is greater than a preset humidity threshold, and detecting whether the wind direction is a preset wind direction;
[0189] If the relative humidity is greater than the preset humidity threshold and the wind direction is the preset wind direction, it is determined that the environmental data of the target area meets the preset condition.
[0190] In one embodiment, the computer program, when executed by a processor, implements the following steps:
[0191] Measuring the target brightness value corresponding to the target area by using a light meter brightness meter;
[0192] Searching a preset parameter adjustment table according to the target brightness value to obtain a target imaging parameter corresponding to the target brightness value, wherein the parameter adjustment table includes a mapping relationship between each brightness value and each imaging parameter;
[0193] The target imaging parameters are set as working parameters of the high-sensitivity imaging components deployed in the target area.
[0194] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0195] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0196] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for detecting uphill fog, characterized in that: The method comprises: Acquire a target image corresponding to at least one target area, where the target area is a preset area in the area to be detected; For each of the target areas, the target area includes at least one target object, and for each of the target objects, a target object image corresponding to the target object is extracted from the target image; Extracting an HSV color histogram corresponding to the target object according to the target object image; For each HSV color histogram corresponding to the target object, the HSV color histogram is input into a clarity classification model to obtain a clarity level corresponding to the target object, wherein the clarity level is used to characterize the clarity of the image of the target object in the target object image, and the clarity classification model is trained based on multiple sample HSV color histograms and clarity level labels corresponding to each sample HSV color histogram; Obtaining a visibility coefficient corresponding to the clarity level, and obtaining a shooting distance corresponding to the target object and the target image, wherein the clarity level and the visibility coefficient are positively correlated; Calculating the product of the visibility coefficient and the shooting distance corresponding to each of the targets; Calculating an average value of the products corresponding to each of the target objects, determining the average value as a visibility value, and detecting whether the visibility value is less than or equal to a visibility threshold; If the visibility value is less than or equal to the visibility threshold, detecting whether the environmental data of the target area meets a preset condition, wherein the preset condition is related to a meteorological factor causing uphill fog formation; If the environmental data of each of the target areas meets the preset conditions, it is determined that there is uphill fog in the area to be detected.
2. The method according to claim 1, characterized in that A high-sensitivity imaging component is deployed in the target area, and a target image corresponding to the target area is acquired by the high-sensitivity imaging component; the preset area is a mountainside area or a valley area.
3. The method according to claim 1, characterized in that The environmental data of the target area includes relative humidity and wind direction, and the detecting whether the environmental data of the target area meets a preset condition includes: Detecting whether the relative humidity is greater than a preset humidity threshold, and detecting whether the wind direction is a preset wind direction; If the relative humidity is greater than the preset humidity threshold and the wind direction is the preset wind direction, it is determined that the environmental data of the target area meets the preset condition.
4. The method according to claim 2, characterized in that: The method further comprises: Measuring the target brightness value corresponding to the target area by using a light meter brightness meter; Searching a preset parameter adjustment table according to the target brightness value to obtain a target imaging parameter corresponding to the target brightness value, wherein the parameter adjustment table includes a mapping relationship between each brightness value and each imaging parameter; The target imaging parameters are set as working parameters of the high-sensitivity imaging components deployed in the target area.
5. An uphill fog detection device, characterized in that: The device comprises: An image acquisition module, used to acquire a target image corresponding to at least one target area, wherein the target area is a preset area in the area to be detected; A first detection module is used for extracting a target image corresponding to each target area, the target area including at least one target object, from the target image for each target object; extracting an HSV color histogram corresponding to the target object according to the target object image; inputting the HSV color histogram corresponding to each target object into a clarity classification model to obtain a clarity level corresponding to the target object, wherein the clarity level is used to characterize the clarity of imaging of the target object in the target image, and the clarity classification model is trained based on a plurality of sample HSV color histograms and clarity level labels corresponding to each sample HSV color histogram; obtaining a visibility coefficient corresponding to the clarity level, and obtaining a shooting distance corresponding to the target object and the target image, wherein the clarity level is positively correlated with the visibility coefficient; calculating the product of the visibility coefficient corresponding to each target object and the shooting distance; calculating an average value of the products corresponding to each target object, and determining the average value as a visibility value, and detecting whether the visibility value is less than or equal to a visibility threshold; A second detection module is used to detect whether the environmental data of the target area meets a preset condition if the visibility value is less than or equal to the visibility threshold, and the preset condition is related to the meteorological factors of uphill fog formation; The determination module is used to determine whether uphill fog exists in the area to be detected if the environmental data of each target area meets the preset conditions.
6. The device according to claim 5, characterized in that A high-sensitivity imaging component is deployed in the target area, and a target image corresponding to the target area is acquired by the high-sensitivity imaging component; the preset area is a mountainside area or a valley area.
7. The device according to claim 5, characterized in that The environmental data of the target area includes relative humidity and wind direction, and the second detection module includes: A detection unit, used to detect whether the relative humidity is greater than a preset humidity threshold, and to detect whether the wind direction is a preset wind direction; A determination unit is used to determine that the environmental data of the target area meets the preset condition if the relative humidity is greater than the preset humidity threshold and the wind direction is the preset wind direction.
8. The device according to claim 6, characterized in that The device further comprises: A measuring module, used for measuring a target brightness value corresponding to the target area by using a photometer brightness meter; A search module, used to search a preset parameter adjustment table according to the target brightness value to obtain a target imaging parameter corresponding to the target brightness value, wherein the parameter adjustment table includes a mapping relationship between each brightness value and each imaging parameter; A parameter setting module is used to set the target imaging parameters as working parameters of the high-sensitivity imaging components deployed in the target area.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
