A method and system for visual color correction of agricultural drones under natural light environment
Through frame-by-frame and grayscale processing, the overexposure area in agricultural drone videos is identified, and the anti-overexposure color correction processing of RGB three-color channel is performed, which solves the problem of overexposure during drone video shooting in natural light environments. Ensure the authenticity and accuracy of agricultural videos.
Patent Information
- Application Number
- CN202411147942.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2024-11-05
- Estimated Expiration
- 2044-08-21
AI Technical Summary
The phenomenon of overexposure often occurs in agricultural drone video shooting in natural light environments. It is difficult for the existing technology to effectively identify the overexposure area, resulting in overall exposure adjustments that lead to distortion of the picture in other areas, affecting the real observation of agricultural conditions.
By acquiring agricultural drone videos for frame-by-frame processing and grayscale processing, we can determine whether it is in a completely overexposure state. If it is not in a completely overexposure state, we can compare pixel grayscale values and analyze the area shape, identify and mark suspicious For overexposure areas, anti-overexposure color correction is performed according to the RGB three-color channel.
Effectively identify and process overexposure areas separately to avoid picture distortion in other areas and ensure true observation of agricultural conditions.
Smart Images

Figure CN118660234B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of color correction, and in particular relates to a method and system for visual color correction of an agricultural unmanned aerial vehicle under a natural light environment. Background Art
[0002] Color correction is the process of adjusting the colors of images and video materials to make them more visually accurate, natural, and beautiful. It mainly involves fine-tuning the image's brightness, contrast, color temperature, hue, saturation, etc. to ensure the consistency and authenticity of the picture's colors.
[0003] Agricultural drone video shooting under natural light conditions sometimes has the phenomenon of overexposure. However, the existing technology cannot effectively identify the overexposed area of the image, and the correction processing for the overexposure of the image usually involves an overall exposure adjustment of the image, which can easily cause distortion of the image in other areas and affect the true observation of the agricultural situation. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a method and system for visual color correction of an agricultural UAV under natural light environment, aiming to solve the technical problems existing in the prior art mentioned in the background technology.
[0005] The embodiment of the present invention is implemented as follows:
[0006] A method for visual color correction of an agricultural UAV under a natural light environment, the method specifically comprising the following steps:
[0007] Acquire agricultural video taken by an agricultural drone under natural light, process the agricultural video frame by frame, and acquire agricultural images frame by frame in real time;
[0008] Performing image grayscale processing on the agricultural images frame by frame to obtain grayscale images frame by frame, and calculating the average grayscale value of the grayscale images frame by frame to determine whether they are in a completely overexposed state;
[0009] When the image is completely overexposed, make overall exposure adjustments;
[0010] When the image is not in a completely overexposed state, the grayscale values of the pixels are compared to identify multiple suspected overexposed areas, and the rules of the area shapes are analyzed to determine whether the area has an abnormal shape.
[0011] When there is an abnormal shape of the area, the corresponding suspected overexposed area is marked as the actual overexposed area, and color correction processing to prevent overexposure is performed according to the RGB three-color channels.
[0012] As a further limitation of the technical solution of the embodiment of the present invention, the method of obtaining the agricultural video shot by the agricultural drone under natural light environment, processing the agricultural video frame by frame, and obtaining the agricultural image frame by frame in real time specifically includes the following steps:
[0013] Generate a shooting and transmission instruction, and send the shooting and transmission instruction to the agricultural drone;
[0014] Receiving agricultural video shot by the agricultural drone under natural light environment;
[0015] The agricultural video is processed frame by frame to obtain frame by frame agricultural images in real time.
[0016] As a further limitation of the technical solution of the embodiment of the present invention, the grayscale processing of the agricultural images frame by frame, obtaining grayscale images frame by frame, and calculating the average grayscale value of the grayscale images frame by frame, and judging whether they are in a completely overexposed state specifically includes the following steps:
[0017] Calculating grayscale values of multiple pixels of the agricultural image frame by frame;
[0018] According to the grayscale values of the plurality of pixel points, the frame-by-frame agricultural images are subjected to image grayscale processing to generate frame-by-frame grayscale images;
[0019] Calculating an average grayscale value of the frame-by-frame grayscale image according to the grayscale values of the plurality of pixels;
[0020] The average grayscale value is compared with a preset average grayscale threshold to determine whether it is in a completely overexposed state.
[0021] As a further limitation of the technical solution of the embodiment of the present invention, the calculation formula for calculating the grayscale values of multiple pixels of the agricultural image frame by frame is:
[0022] ;
[0023] ;
[0024] in, Represents the pixel coordinates, for The gray value of the pixel at for The pixel R value at is the preset R value coefficient, for The pixel G value at is the preset G value coefficient, for The pixel B value at is the preset B value coefficient;
[0025] The calculation formula for calculating the average grayscale value of the frame-by-frame grayscale image is:
[0026] ;
[0027] in, is the average gray value, for total, for total.
[0028] As a further limitation of the technical solution of the embodiment of the present invention, when the image is in a completely overexposed state, the overall exposure adjustment specifically includes the following steps:
[0029] When in a completely overexposed state, determining an overall adjustment range according to the average grayscale value;
[0030] generating an overall adjustment signal according to the overall adjustment amplitude;
[0031] According to the overall adjustment signal, overall exposure adjustment is performed on the frame-by-frame agricultural images.
[0032] As a further limitation of the technical solution of the embodiment of the present invention, when the image is not in a completely overexposed state, comparing the grayscale values of the pixels, identifying multiple suspected overexposed areas, and performing regular analysis of the area shapes to determine whether the area has an abnormal shape specifically includes the following steps:
[0033] When the image is not in a completely overexposed state, the grayscale values of the plurality of pixels are compared with a preset grayscale threshold of the pixel, and the grayscale comparison result of the pixel is recorded;
[0034] Screening a plurality of suspected overexposed pixels according to the pixel grayscale comparison result;
[0035] Performing cluster analysis on the multiple suspected overexposed pixels to determine the ranges of the multiple suspected pixels;
[0036] According to the multiple suspicious pixel ranges, matching multiple suspicious over-exposure areas in the frame-by-frame agricultural image;
[0037] According to a plurality of preset regular shapes and combinations, shape regularity analysis is performed on a plurality of the suspected overexposed areas to determine whether the areas have abnormal shapes.
[0038] As a further limitation of the technical solution of the embodiment of the present invention, when the region has an abnormal shape, marking the corresponding suspected overexposed region as an actual overexposed region, and performing color correction processing to prevent overexposure according to the RGB three-color channels specifically includes the following steps:
[0039] When the region has an abnormal shape, the corresponding suspected overexposed region is marked as an actual overexposed region;
[0040] According to the RGB three-color channels, color correction calculation for preventing overexposure is performed on the actual overexposed area to obtain multiple color channel optimization values;
[0041] According to the plurality of color channel optimization values, color correction and reconstruction are performed on the actual overexposed area to obtain a reconstructed area image;
[0042] In the frame-by-frame agricultural image, the actual overexposed area is replaced by the reconstructed area image to generate a frame-by-frame corrected image.
[0043] As a further limitation of the technical solution of the embodiment of the present invention, the color correction calculation for preventing overexposure is performed on the actual overexposed area according to the RGB three-color channels, and the calculation formula for obtaining the optimization values of multiple color channels is:
[0044] , ;
[0045] in, Represents the pixel coordinates, Representative color channels, for The Color channel optimization value for each color channel, for The The original color channel values of the color channels, is the preset first optimization coefficient, is the preset second optimization coefficient, is the preset Gaussian standard deviation.
[0046] A visual color correction system for agricultural UAVs in a natural light environment, the system comprises a video acquisition processing module, a grayscale processing analysis module, an overall exposure adjustment module, a regional shape analysis module and a color correction processing module, wherein:
[0047] The video acquisition processing module is used to acquire agricultural video shot by an agricultural drone under natural light conditions, process the agricultural video frame by frame, and acquire agricultural images frame by frame in real time;
[0048] A grayscale processing and analysis module is used to perform grayscale processing on the agricultural images frame by frame, obtain grayscale images frame by frame, and calculate the average grayscale value of the grayscale images frame by frame to determine whether they are in a completely overexposed state;
[0049] The overall exposure adjustment module is used to adjust the overall exposure when the image is in a completely overexposed state;
[0050] The regional shape analysis module is used to compare the grayscale values of pixels when the image is not completely overexposed, identify multiple suspected overexposed areas, and perform regular analysis of the regional shapes to determine whether the area has an abnormal shape;
[0051] The color correction processing module is used to mark the corresponding suspected overexposed area as the actual overexposed area when the area has an abnormal shape, and perform color correction processing to prevent overexposure according to the RGB three-color channels.
[0052] As a further limitation of the technical solution of the embodiment of the present invention, the color correction processing module specifically includes:
[0053] A region marking unit, used for marking a corresponding suspected overexposed region as an actual overexposed region when the region has an abnormal shape;
[0054] A correction calculation unit, configured to perform color correction calculation to prevent overexposure on the actual overexposed area according to the RGB three-color channels, and obtain multiple color channel optimization values;
[0055] A correction and reconstruction unit, configured to perform color correction and reconstruction on the actual overexposed area according to the plurality of color channel optimization values to obtain a reconstructed area image;
[0056] The correction and replacement unit is used to replace the actual overexposed area in the frame-by-frame agricultural image by the reconstructed area image to generate a frame-by-frame corrected image.
[0057] Compared with the prior art, the present invention has the following beneficial effects:
[0058] The embodiment of the present invention obtains agricultural video, performs frame-by-frame processing and grayscale processing, and determines whether it is in a completely overexposed state; when it is in a completely overexposed state, it adjusts the overall exposure; when it is not in a completely overexposed state, it performs regular analysis of regional shapes; when the region has an abnormal shape, it marks the actual overexposed region and performs color correction processing to prevent overexposure. It is able to perform frame-by-frame processing and grayscale processing on agricultural video, identify multiple suspected overexposed regions when it is not in a completely overexposed state, perform regular analysis of regional shapes, determine the actual overexposed region, and perform color correction processing to prevent overexposure, thereby effectively identifying the overexposed region of the picture, realizing separate correction processing of the overexposed region, avoiding distortion of the picture in other areas, and ensuring true observation of agricultural conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 A flowchart of a method for visual color correction of an agricultural UAV in a natural light environment provided by an embodiment of the present invention is shown;
[0060] Figure 2 A flowchart of agricultural video processing in the method provided by an embodiment of the present invention is shown;
[0061] Figure 3 A flowchart of image grayscale processing judgment in the method provided by an embodiment of the present invention is shown;
[0062] Figure 4 A flow chart of overall exposure adjustment in a method provided by an embodiment of the present invention is shown;
[0063] Figure 5 A flow chart showing the shape analysis of a suspected overexposed area in the method provided by an embodiment of the present invention is shown;
[0064] Figure 6 A flow chart of color correction processing for preventing overexposure in a method provided by an embodiment of the present invention is shown;
[0065] Figure 7 An application architecture diagram of a visual color correction system for agricultural drones in a natural light environment provided by an embodiment of the present invention is shown;
[0066] Figure 8 The structure block diagram of the color correction processing module in the system provided by the embodiment of the present invention is shown. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention 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 invention and are not intended to limit the present invention.
[0068] It is understandable that video shooting by agricultural drones under natural light conditions sometimes has the phenomenon of overexposure. However, the existing technology is unable to effectively identify the overexposed areas of the image, and the correction processing for the overexposure of the image usually involves an overall exposure adjustment of the image, which can easily cause distortion of the image in other areas and affect the true observation of the agricultural situation.
[0069] To solve the above problems, an embodiment of the present invention discloses a method and system for visual color correction of an agricultural UAV under a natural light environment. The method obtains agricultural video footage shot by an agricultural UAV under a natural light environment, processes the agricultural video footage frame by frame, and obtains agricultural images frame by frame in real time. The agricultural images are grayed to obtain gray images frame by frame, and the average gray values of the gray images frame by frame are calculated to determine whether they are in a completely overexposed state. When they are in a completely overexposed state, the overall exposure is adjusted. When they are not in a completely overexposed state, the gray values of the pixels are compared to identify multiple suspected overexposed areas, and the rules of the area shapes are analyzed to determine whether the area has an abnormal shape. When the area has an abnormal shape, the corresponding suspected overexposed area is marked as an actual overexposed area, and color correction processing to prevent overexposure is performed according to the RGB three-color channels. It can process agricultural videos frame by frame and grayscale, identify multiple suspected overexposed areas when they are not completely overexposed, and conduct regular analysis of the area shapes to determine the actual overexposed areas. It can then perform color correction to prevent overexposure, thereby effectively identifying the overexposed areas of the picture, achieving separate correction for the overexposed areas, avoiding distortion of the pictures in other areas, and ensuring true observation of agricultural conditions.
[0070] Specifically, Figure 1 A flow chart of a method for visual color correction of an agricultural UAV in a natural light environment provided by an embodiment of the present invention is shown.
[0071] In a preferred embodiment of the present invention, a method for visual color correction of an agricultural UAV under a natural light environment is provided, and the method specifically comprises the following steps:
[0072] Step S101: obtaining an agricultural video shot by an agricultural drone under natural light conditions, performing frame-by-frame processing on the agricultural video, and obtaining frame-by-frame agricultural images in real time.
[0073] In an embodiment of the present invention, an agricultural drone performing agricultural photography under a natural light environment is determined, a shooting transmission instruction is generated, and the shooting transmission instruction is sent to the agricultural drone, thereby receiving the agricultural shooting video shot by the agricultural drone under a natural light environment, and then processing the agricultural shooting video frame by frame according to the video frame rate, so as to obtain frame-by-frame agricultural images in real time.
[0074] Specifically, Figure 2 A flowchart of agricultural video processing in the method provided by an embodiment of the present invention is shown.
[0075] Among them, in the preferred embodiment provided by the present invention, the agricultural video shot by the agricultural drone under the natural light environment is obtained, the agricultural video is processed frame by frame, and the real-time acquisition of agricultural images frame by frame specifically includes the following steps:
[0076] Step S1011: Generate a shooting and transmission instruction, and send the shooting and transmission instruction to the agricultural drone.
[0077] Step S1012: receiving the agricultural video shot by the agricultural drone under natural light conditions.
[0078] Step S1013: Process the agricultural video frame by frame to obtain agricultural images frame by frame in real time.
[0079] Furthermore, the agricultural UAV visual color correction method under natural light environment also includes the following steps:
[0080] Step S102: grayscale the agricultural images frame by frame to obtain grayscale images frame by frame, and calculate the average grayscale value of the grayscale images frame by frame to determine whether they are in a completely overexposed state.
[0081] In an embodiment of the present invention, according to the three-color values of different pixels in the agricultural image frame by frame, the pixel grayscale values of different pixels in the agricultural image frame by frame are calculated, and then according to the multiple pixel grayscale values, the agricultural image frame by frame is subjected to image grayscale processing to generate a grayscale image frame by frame, and according to the multiple pixel grayscale values, the average grayscale value of the grayscale image frame by frame is calculated, and by comparing the average grayscale value with a preset average grayscale threshold, it is determined whether it is in a completely overexposed state. When the average grayscale value is greater than the average grayscale threshold, it is determined that the agricultural image frame by frame is in a completely overexposed state; when the average grayscale value is not greater than the average grayscale threshold, it is determined that the agricultural image frame by frame is not in a completely overexposed state. Specifically, the calculation formula for the multiple pixel grayscale values is:
[0082] ;
[0083] ;
[0084] in, Represents the pixel coordinates, for The gray value of the pixel at for The pixel R value at is the preset R value coefficient, for The pixel G value at is the preset G value coefficient, for The pixel B value at is the preset B value coefficient;
[0085] The calculation formula for the average gray value is:
[0086] ;
[0087] in, is the average gray value, for total, for total.
[0088] Specifically, Figure 3 A flow chart of image grayscale processing judgment in the method provided by an embodiment of the present invention is shown.
[0089] Among them, in the preferred embodiment provided by the present invention, the grayscale processing of the agricultural images frame by frame is performed to obtain grayscale images frame by frame, and the average grayscale value of the grayscale images frame by frame is calculated to determine whether it is in a completely overexposed state, which specifically includes the following steps:
[0090] Step S1021, calculating the grayscale values of multiple pixels of the agricultural image frame by frame.
[0091] Step S1022: grayscale the agricultural images frame by frame according to the grayscale values of the multiple pixels to generate grayscale images frame by frame.
[0092] Step S1023: Calculate the average grayscale value of the frame-by-frame grayscale image according to the grayscale values of the multiple pixels.
[0093] Step S1024: compare the average grayscale value with a preset average grayscale threshold to determine whether it is in a completely overexposed state.
[0094] Furthermore, the agricultural UAV visual color correction method under natural light environment also includes the following steps:
[0095] Step S103: When the image is in a completely overexposed state, adjust the overall exposure.
[0096] In an embodiment of the present invention, when each frame of agricultural images is in a completely overexposed state, exposure adjustment planning is performed based on the average grayscale value, the overall adjustment range of brightness, contrast, etc. is determined, and an overall adjustment signal is generated according to the overall adjustment range. Then, based on the overall adjustment signal, the overall brightness, contrast, etc. of each frame of the agricultural images are adjusted to achieve overall exposure adjustment.
[0097] Specifically, Figure 4 A flow chart of overall exposure adjustment in the method provided by an embodiment of the present invention is shown.
[0098] Among them, in the preferred embodiment provided by the present invention, when in a completely overexposed state, performing overall exposure adjustment specifically includes the following steps:
[0099] Step S1031: When in a completely overexposed state, determine the overall adjustment range according to the average grayscale value.
[0100] Step S1032: Generate an overall adjustment signal according to the overall adjustment amplitude.
[0101] Step S1033: performing overall exposure adjustment on the frame-by-frame agricultural images according to the overall adjustment signal.
[0102] Furthermore, the agricultural UAV visual color correction method under natural light environment also includes the following steps:
[0103] Step S104: When the image is not in a completely overexposed state, grayscale values of pixels are compared to identify multiple suspected overexposed areas, and regular analysis of the area shapes is performed to determine whether the area has an abnormal shape.
[0104] In an embodiment of the present invention, when the frame-by-frame agricultural image is not in a completely overexposed state, the grayscale values of multiple pixels are compared with a preset pixel grayscale threshold, and the pixel grayscale comparison results are recorded. Then, based on the pixel grayscale comparison results, multiple suspected overexposed pixels whose pixel grayscale values are greater than the pixel grayscale threshold are screened, and then a clustering analysis is performed on the multiple suspected overexposed pixels, and the number of multiple pixel clusters is calculated. By comparing the number of multiple pixel clusters with a preset standard cluster number, the range of suspicious pixels whose number of multiple pixel clusters is greater than the standard cluster number is determined, and then based on the multiple suspicious pixel ranges, a plurality of corresponding suspected overexposed areas are divided in the frame-by-frame agricultural image, and shape rule analysis is performed on the multiple suspected overexposed areas according to a plurality of preset regular shapes and combinations to determine whether they have a regional abnormal shape. When at least one suspected overexposed area does not satisfy a single regular shape or a combination of multiple regular shapes, it is determined that the corresponding suspected overexposed area has a regional abnormal shape.
[0105] It can be understood that the number of pixel clusters is the maximum number of adjacent distances between suspected overexposed pixels; by comparing the number of pixel clusters with a preset standard cluster number and determining the range of suspicious pixels in which the number of pixel clusters is greater than the standard cluster number, the range of suspicious pixels can be screened so that the suspected overexposed areas corresponding to the screened suspicious pixel range can meet the minimum image area size for direct observation.
[0106] It is understandable that in the process of video shooting by agricultural drones, white objects may be filmed, such as white lamp poles, white walls, white roads, etc. By identifying regional overexposure through grayscale values, the areas corresponding to these objects may be identified as overexposed areas. The areas of these objects in video shooting are usually some regular shapes (including circles, squares, rectangles, triangles, diamonds, trapezoids, ellipses, semicircles, parallelograms, sectors, etc.) and their combinations. Therefore, by performing shape rule analysis, suspicious overexposed areas with regular shapes and their combinations can be confirmed as areas corresponding to these objects and eliminated.
[0107] Specifically, Figure 5 A flow chart of the shape analysis of the suspected overexposed area in the method provided by the embodiment of the present invention is shown.
[0108] Among them, in the preferred embodiment provided by the present invention, when the image is not in a completely overexposed state, the grayscale value comparison of the pixel points is performed, a plurality of suspected overexposed areas are identified, and a rule analysis of the area shape is performed to determine whether the area has an abnormal shape, specifically including the following steps:
[0109] Step S1041: When the image is not in a completely overexposed state, compare the grayscale values of the plurality of pixels with a preset grayscale threshold of the pixel, and record the grayscale comparison result of the pixel.
[0110] Step S1042: screening a plurality of suspicious overexposed pixels according to the pixel grayscale comparison result.
[0111] Step S1043: performing cluster analysis on the multiple suspicious overexposed pixel points to determine the ranges of the multiple suspicious pixel points.
[0112] Step S1044: Match multiple suspicious overexposure areas in the frame-by-frame agricultural image according to the multiple suspicious pixel ranges.
[0113] Step S1045 : performing shape rule analysis on the plurality of suspected overexposed areas according to a plurality of preset regular shapes and combinations to determine whether the areas have abnormal shapes.
[0114] Furthermore, the agricultural UAV visual color correction method under natural light environment also includes the following steps:
[0115] Step S105: When the region has an abnormal shape, the corresponding suspected overexposed region is marked as an actual overexposed region, and color correction processing for preventing overexposure is performed according to the RGB three-color channels.
[0116] In an embodiment of the present invention, when there is an abnormal regional shape, the corresponding suspected overexposed region is marked as an actual overexposed region, and color correction calculation for preventing overexposure is performed on each pixel in the actual overexposed region according to the RGB three-color channels to obtain multiple color channel optimization values, and then color correction and reconstruction are performed on each pixel in the actual overexposed region according to the multiple color channel optimization values to obtain a reconstructed regional image, and then in the frame-by-frame agricultural image, the actual overexposed region is partially replaced by the reconstructed regional image to generate a frame-by-frame corrected image. Specifically, the calculation formula for the multiple color channel optimization values is:
[0117] , ;
[0118] in, Represents the pixel coordinates, Representative color channels, for The Color channel optimization value for each color channel, for The The original color channel values of the color channels, is the preset first optimization coefficient, is the preset second optimization coefficient, is the preset Gaussian standard deviation.
[0119] Specifically, Figure 6 A flow chart of color correction processing for preventing overexposure in the method provided by an embodiment of the present invention is shown.
[0120] Among them, in the preferred embodiment provided by the present invention, when the region has an abnormal shape, marking the corresponding suspected overexposed region as an actual overexposed region, and performing color correction processing to prevent overexposure according to the RGB three-color channels specifically includes the following steps:
[0121] Step S1051: When the region has an abnormal shape, mark the corresponding suspected overexposed region as an actual overexposed region.
[0122] Step S1052: performing color correction calculation to prevent overexposure on the actual overexposed area according to the RGB three-color channels to obtain multiple color channel optimization values.
[0123] Step S1053: performing color correction and reconstruction on the actual overexposed area according to the plurality of color channel optimization values to obtain a reconstructed area image.
[0124] Step S1054: In the frame-by-frame agricultural image, the actual overexposed area is replaced by the reconstructed area image to generate a frame-by-frame corrected image.
[0125] Furthermore, Figure 7 The application architecture diagram of the agricultural UAV visual color correction system under natural light environment provided by an embodiment of the present invention is shown.
[0126] Among them, in another preferred embodiment provided by the present invention, a visual color correction system for agricultural drones in a natural light environment comprises:
[0127] The video acquisition processing module 101 is used to acquire agricultural video shot by an agricultural drone under natural light conditions, perform frame-by-frame processing on the agricultural video, and acquire frame-by-frame agricultural images in real time.
[0128] In an embodiment of the present invention, the video acquisition processing module 101 generates a shooting transmission instruction by determining an agricultural drone that performs agricultural photography under a natural light environment, and sends the shooting transmission instruction to the agricultural drone, thereby receiving the agricultural video shot by the agricultural drone under a natural light environment, and then processes the agricultural video frame by frame according to the video frame rate to obtain frame-by-frame agricultural images in real time.
[0129] The grayscale processing and analysis module 102 is used to perform grayscale processing on the agricultural images frame by frame, obtain grayscale images frame by frame, and calculate the average grayscale value of the grayscale images frame by frame to determine whether they are in a completely overexposed state.
[0130] In the embodiment of the present invention, the grayscale processing and analysis module 102 calculates the pixel grayscale values of different pixels in the agricultural image frame by frame according to the three-color values of different pixels in the agricultural image frame by frame, and then performs image grayscale processing on the agricultural image frame by frame according to the multiple pixel grayscale values to generate a frame by frame grayscale image, and calculates the average grayscale value of the grayscale image frame by frame according to the multiple pixel grayscale values, and judges whether it is in a completely overexposed state by comparing the average grayscale value with a preset average grayscale threshold. When the average grayscale value is greater than the average grayscale threshold, it is determined that the agricultural image frame by frame is in a completely overexposed state; when the average grayscale value is not greater than the average grayscale threshold, it is determined that the agricultural image frame by frame is not in a completely overexposed state. Specifically, the calculation formula for the multiple pixel grayscale values is:
[0131] ;
[0132] ;
[0133] in, Represents the pixel coordinates, for The gray value of the pixel at for The pixel R value at is the preset R value coefficient, for The pixel G value at is the preset G value coefficient, for The pixel B value at is the preset B value coefficient;
[0134] The calculation formula for the average gray value is:
[0135] ;
[0136] in, is the average gray value, for total, for total.
[0137] The overall exposure adjustment module 103 is used to adjust the overall exposure when the image is in a completely overexposed state.
[0138] In an embodiment of the present invention, when each frame of agricultural images is in a completely overexposed state, the overall exposure adjustment module 103 performs exposure adjustment planning according to the average grayscale value, determines the overall adjustment range of brightness, contrast, etc., generates an overall adjustment signal according to the overall adjustment range, and then adjusts the overall brightness, contrast, etc. of each frame of agricultural images according to the overall adjustment signal to achieve overall exposure adjustment.
[0139] The region shape analysis module 104 is used to compare the gray values of pixels when the image is not in a completely overexposed state, identify multiple suspected overexposed regions, and perform regular analysis of the region shape to determine whether the region has an abnormal shape.
[0140] In an embodiment of the present invention, when the frame-by-frame agricultural image is not in a completely overexposed state, the regional shape analysis module 104 compares the grayscale values of multiple pixels with a preset pixel grayscale threshold, records the pixel grayscale comparison result, and then screens multiple suspected overexposed pixels whose pixel grayscale values are greater than the pixel grayscale threshold according to the pixel grayscale comparison result, and then performs clustering analysis on the multiple suspected overexposed pixels, calculates the number of multiple pixel clusters, and determines the range of suspicious pixels whose number of multiple pixel clusters is greater than the standard cluster number by comparing the number of multiple pixel clusters with a preset standard cluster number, and then divides the frame-by-frame agricultural image into multiple corresponding suspected overexposed areas according to the multiple suspicious pixel ranges, performs shape rule analysis on the multiple suspected overexposed areas according to multiple preset regular shapes and combinations, and determines whether they have regional abnormal shapes. When at least one suspected overexposed area does not satisfy a single regular shape or a combination of multiple regular shapes, it is determined that the corresponding suspected overexposed area has a regional abnormal shape.
[0141] The color correction processing module 105 is used to mark the corresponding suspected over-exposed area as an actual over-exposed area when the area has an abnormal shape, and perform color correction processing to prevent over-exposure according to the RGB three-color channels.
[0142] In the embodiment of the present invention, when there is an abnormal regional shape, the color correction processing module 105 marks the corresponding suspected overexposed region as an actual overexposed region, and performs anti-overexposed color correction calculation on each pixel in the actual overexposed region according to the RGB three-color channels, obtains multiple color channel optimization values, and then performs color correction reconstruction on each pixel in the actual overexposed region according to the multiple color channel optimization values to obtain a reconstructed regional image, and then in the frame-by-frame agricultural image, the actual overexposed region is partially replaced by the reconstructed regional image to generate a frame-by-frame corrected image. Specifically, the calculation formula of the multiple color channel optimization values is:
[0143] , ;
[0144] in, Represents the pixel coordinates, Representative color channels, for The Color channel optimization value for each color channel, for The The original color channel values of the color channels, is the preset first optimization coefficient, is the preset second optimization coefficient, is the preset Gaussian standard deviation.
[0145] Specifically, Figure 8 It shows a structural block diagram of the color correction processing module 105 in the system provided by the embodiment of the present invention.
[0146] Among them, in the preferred embodiment provided by the present invention, the color correction processing module 105 specifically includes:
[0147] The region marking unit 1051 is used to mark the corresponding suspected over-exposed region as an actual over-exposed region when the region has an abnormal shape.
[0148] The correction calculation unit 1052 is used to perform color correction calculation to prevent overexposure on the actual overexposed area according to the RGB three-color channels to obtain multiple color channel optimization values.
[0149] The correction and reconstruction unit 1053 is used to perform color correction and reconstruction on the actual overexposed area according to the multiple color channel optimization values to obtain a reconstructed area image.
[0150] The correction replacement unit 1054 is used to replace the actual overexposed area in the frame-by-frame agricultural image by using the reconstructed area image to generate a frame-by-frame corrected image.
[0151] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0152] Those skilled 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 program can be stored in a non-volatile computer-readable storage medium. When the 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 may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0153] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A method for visual color correction of agricultural UAV under natural light environment, characterized in that: The method specifically comprises the following steps: Acquire agricultural video taken by an agricultural drone under natural light, process the agricultural video frame by frame, and acquire agricultural images frame by frame in real time; Performing image grayscale processing on the agricultural images frame by frame to obtain grayscale images frame by frame, and calculating the average grayscale value of the grayscale images frame by frame to determine whether they are in a completely overexposed state; When the image is completely overexposed, make overall exposure adjustments; When the image is not in a completely overexposed state, the grayscale values of the pixels are compared to identify multiple suspected overexposed areas, and the rules of the regional shapes are analyzed to determine whether the areas have abnormal shapes. Specifically, according to multiple preset regular shapes and combinations, the shapes of the multiple suspected overexposed areas are analyzed according to the rules to determine whether the areas have abnormal shapes. When at least one suspected overexposed area does not satisfy a single regular shape or a combination of multiple regular shapes, it is determined that the corresponding suspected overexposed area has an abnormal shape. When there is an abnormal shape of the area, the corresponding suspected overexposed area is marked as the actual overexposed area, and the color correction processing to prevent overexposure is performed according to the RGB three-color channels; When the region has an abnormal shape, marking the corresponding suspected overexposed region as an actual overexposed region, and performing color correction processing to prevent overexposure according to the RGB three-color channels specifically includes the following steps: When the region has an abnormal shape, the corresponding suspected overexposed region is marked as an actual overexposed region; According to the RGB three-color channels, color correction calculation for preventing overexposure is performed on the actual overexposed area to obtain multiple color channel optimization values; According to the plurality of color channel optimization values, color correction and reconstruction are performed on the actual overexposed area to obtain a reconstructed area image; In the frame-by-frame agricultural image, the actual overexposed area is replaced by the reconstructed area image to generate a frame-by-frame corrected image; According to the RGB three-color channels, the color correction calculation for preventing overexposure is performed on the actual overexposed area, and the calculation formula for obtaining the optimization values of multiple color channels is: , ; in, Represents the pixel coordinates, Representative color channels, for The Color channel optimization value for each color channel, for The The original color channel values of the color channels, is the preset first optimization coefficient, is the preset second optimization coefficient, is the preset Gaussian standard deviation.
2. The method for visual color correction of agricultural UAV under natural light environment according to claim 1 is characterized in that: The step of obtaining the agricultural video shot by the agricultural drone under natural light, processing the agricultural video frame by frame, and obtaining the agricultural image frame by frame in real time specifically comprises the following steps: Generate a shooting and transmission instruction, and send the shooting and transmission instruction to the agricultural drone; Receiving agricultural video shot by the agricultural drone under natural light environment; The agricultural video is processed frame by frame to obtain frame by frame agricultural images in real time.
3. The method for visual color correction of agricultural UAV under natural light environment according to claim 1, characterized in that: The grayscale processing of the agricultural images frame by frame, obtaining grayscale images frame by frame, and calculating the average grayscale value of the grayscale images frame by frame to determine whether they are in a completely overexposed state specifically includes the following steps: Calculating grayscale values of multiple pixels of the agricultural image frame by frame; According to the grayscale values of the plurality of pixel points, the frame-by-frame agricultural images are subjected to image grayscale processing to generate frame-by-frame grayscale images; Calculating an average grayscale value of the frame-by-frame grayscale image according to the grayscale values of the plurality of pixels; The average grayscale value is compared with a preset average grayscale threshold to determine whether it is in a completely overexposed state.
4. The method for visual color correction of agricultural UAV under natural light environment according to claim 3 is characterized in that: The calculation formula for calculating the grayscale values of multiple pixels of the agricultural image frame by frame is: ; ; in, Represents the pixel coordinates, for The gray value of the pixel at for The pixel R value at is the preset R value coefficient, for The pixel G value at is the preset G value coefficient, for The pixel B value at is the preset B value coefficient; The calculation formula for calculating the average grayscale value of the frame-by-frame grayscale image is: ; in, is the average gray value, for total, for total.
5. The method for visual color correction of agricultural UAV under natural light environment according to claim 1, characterized in that: When the image is in a completely overexposed state, the overall exposure adjustment specifically includes the following steps: When in a completely overexposed state, determining an overall adjustment range according to the average grayscale value; generating an overall adjustment signal according to the overall adjustment amplitude; According to the overall adjustment signal, overall exposure adjustment is performed on the frame-by-frame agricultural images.
6. The method for visual color correction of agricultural UAV under natural light environment according to claim 3 is characterized in that: When the image is not in a completely overexposed state, the grayscale value comparison of the pixel points is performed to identify multiple suspected overexposed areas, and the rule analysis of the area shape is performed to determine whether the area has an abnormal shape. Specifically, the following steps are included: When the image is not in a completely overexposed state, the grayscale values of the plurality of pixels are compared with a preset grayscale threshold of the pixel, and the grayscale comparison result of the pixel is recorded; Screening a plurality of suspected overexposed pixels according to the pixel grayscale comparison result; Performing cluster analysis on the multiple suspected overexposed pixels to determine the ranges of the multiple suspected pixels; According to the multiple suspicious pixel ranges, matching multiple suspicious over-exposure areas in the frame-by-frame agricultural image; According to a plurality of preset regular shapes and combinations, shape regularity analysis is performed on a plurality of the suspected overexposed areas to determine whether the areas have abnormal shapes.
7. A visual color correction system for agricultural drones under natural light environment, characterized in that: The system includes a video acquisition processing module, a grayscale processing analysis module, an overall exposure adjustment module, a regional shape analysis module and a color correction processing module, wherein: The video acquisition processing module is used to acquire agricultural video shot by an agricultural drone under natural light conditions, process the agricultural video frame by frame, and acquire agricultural images frame by frame in real time; A grayscale processing and analysis module is used to perform grayscale processing on the agricultural images frame by frame, obtain grayscale images frame by frame, and calculate the average grayscale value of the grayscale images frame by frame to determine whether they are in a completely overexposed state; The overall exposure adjustment module is used to adjust the overall exposure when the image is in a completely overexposed state; The regional shape analysis module is used to compare the gray values of pixels when the image is not in a completely overexposed state, identify multiple suspected overexposed areas, and perform regular analysis of the regional shapes to determine whether the image has an abnormal regional shape. Specifically, according to multiple preset regular shapes and combinations, the multiple suspected overexposed areas are subjected to regular shape analysis to determine whether the image has an abnormal regional shape. When at least one suspected overexposed area does not satisfy a single regular shape or a combination of multiple regular shapes, the corresponding suspected overexposed area is determined to have an abnormal regional shape. A color correction processing module is used to mark the corresponding suspected overexposed area as the actual overexposed area when the area has an abnormal shape, and perform color correction processing to prevent overexposure according to the RGB three-color channels; The color correction processing module specifically includes: A region marking unit, used for marking a corresponding suspected overexposed region as an actual overexposed region when the region has an abnormal shape; A correction calculation unit, configured to perform color correction calculation to prevent overexposure on the actual overexposed area according to the RGB three-color channels, and obtain multiple color channel optimization values; A correction and reconstruction unit, configured to perform color correction and reconstruction on the actual overexposed area according to the plurality of color channel optimization values to obtain a reconstructed area image; A correction replacement unit, used to replace the actual overexposed area in the frame-by-frame agricultural image by the reconstructed area image to generate a frame-by-frame correction image; According to the RGB three-color channels, the color correction calculation for preventing overexposure is performed on the actual overexposed area, and the calculation formula for obtaining the optimization values of multiple color channels is: , ; in, Represents the pixel coordinates, Representative color channels, for The Color channel optimization value for each color channel, for The The original color channel values of the color channels, is the preset first optimization coefficient, is the preset second optimization coefficient, is the preset Gaussian standard deviation.
Citation Information
Patent Citations
Method for converting data, display device, computing device and program incorporating same, and method for optimising coefficients and device and program incorporating same
CN104380370A
Methods, Systems And Apparatus For Over-Exposure Correction
CN106485668A
Image enhancement method, display device and computer readable storage medium
CN107644409A
Imaging apparatus, image processor, image processing method and image processing program
JP2007221678A
Image processing program, image processor and electronic camera
JP2008206132A
