Garden image monitoring method based on computer vision
Through computer vision technology, the multi-scale and directional characteristics of garden images are analyzed, and saliency maps are generated for adaptive enhancement, which solves the problem of inaccurate information in shadow parts in the existing technology and improves the accuracy of garden image monitoring.
Patent Information
- Application Number
- CN202410751364.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-12
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-06-12
AI Technical Summary
When the existing technology enhances garden images, the shadow parts caused by branches and leaves cannot accurately reflect the image information, affecting the accuracy of the monitoring results.
Using a method based on computer vision, the HSV space image of the garden image is obtained, multi-scale processing and directional feature extraction are performed, the brightness and saturation distribution of the shadow part is analyzed, the shadow retention value is calculated, and fine and coarse-scale feature maps are fused to generate The final saliency map is adaptively enhanced based on this.
It improves the expression of plant characteristics in the shaded part, enhances the accuracy and efficiency of image monitoring, and ensures the accuracy of monitoring results.
Smart Images

Figure CN118334589B
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of image enhancement, and in particular to a garden image monitoring method based on computer vision. Background Art
[0002] As people pay more and more attention to environmental protection and ecological sustainable development, the garden protection industry has also received extensive attention. In the garden protection operation, whether the health status of the plants in the garden can be obtained in time is an important prerequisite for achieving garden protection.
[0003] Visually observing the appearance of plants in a garden is an effective way to quickly determine the health status of plants. Because there is often noise in the collected images, the images need to be enhanced. The existing technology usually uses an overall enhancement method when enhancing images. However, since there are usually shadows caused by occlusion of some branches and leaves in the image, the overall enhancement method will cause the obtained enhanced image to not accurately reflect all the information in the image, affecting the accuracy of the subsequent monitoring results using the enhanced image. Summary of the invention
[0004] In order to solve the technical problem that the shadow part caused by the occlusion of some branches and leaves usually exists in the image, the overall enhancement method will cause the obtained enhanced image to fail to accurately reflect all the information in the image, affecting the accuracy of the monitoring results of the subsequent monitoring using the enhanced image, the purpose of the present invention is to provide a garden image monitoring method based on computer vision, and the technical scheme adopted is as follows:
[0005] Acquire a garden image, wherein the garden image is an HSV space image; perform multi-scale processing on the garden image to obtain reference images of different scales and directional feature maps of different scales;
[0006] According to the brightness distribution disorder of the pixels in each reference image and the positional relationship between the pixels, a first retention degree value of the shadow part in each reference image is obtained; according to the distribution characteristics of the saturation between the pixels in each reference image and the first retention degree value of the shadow part in the reference image, a second retention degree value of the shadow part in each reference image is obtained;
[0007] The first retention degree value and the second retention degree value of the shadow part in all reference images are fused and analyzed to distinguish fine scales and coarse scales; all brightness significant feature maps and saturation significant feature maps are obtained according to all the reference images at the fine scales and coarse scales, and all directional significant feature maps are obtained according to all the directional feature maps at the fine scales and coarse scales;
[0008] A final salient map of the garden image is obtained according to all the brightness salient feature maps, saturation salient feature maps and direction salient feature maps; the garden image is adaptively enhanced based on the grayscale value of each pixel point in the final salient map to obtain an enhanced image for garden image monitoring.
[0009] Furthermore, the multi-scale processing of the garden image to obtain reference images of different scales and directional feature maps at different scales includes:
[0010] Performing multi-scale processing on the garden image based on the image pyramid technology to obtain a preset number of reference images at different scales;
[0011] The reference images at all scales are processed based on Gabor filters, and the directional feature maps of the reference images at each scale in different preset directions are extracted.
[0012] Furthermore, the method for obtaining the first retention degree value of the shadow part in each reference image includes:
[0013] In any reference image, the mean of the brightness values of all pixels is used as the mean eigenvalue, and the pixels whose brightness values are less than the mean eigenvalue are arranged in ascending order according to the brightness values to obtain an arrangement sequence; according to the difference between the brightness values of the pixels in the arrangement sequence, the target pixels are screened, and according to the positional relationship between all the target pixels, the shadow retention factor of each reference image is obtained;
[0014] Pixels with the same brightness value are regarded as one type of pixels, and the brightness chaos value of the reference image is obtained by using the information entropy calculation formula according to the types of brightness values of all pixels;
[0015] The normalized value of the brightness confusion value of each reference image is multiplied by the shadow retention factor of the reference image, and the multiplied value is normalized to obtain a first retention degree value of the shadow part in each reference image.
[0016] Furthermore, the method of screening target pixels according to the difference between the brightness values of the pixels in the arrangement sequence, and obtaining the shadow retention factor of each reference image according to the positional relationship between all the target pixels, includes:
[0017] In the arrangement sequence corresponding to each reference image, the brightness value difference between all two adjacent pixels is calculated as the brightness difference, and all the pixels before the pixel with the smallest brightness value among the two pixels corresponding to the maximum brightness difference are taken as the target pixels;
[0018] A two-dimensional coordinate system is established with the lower left corner of each reference image as the origin, the horizontal right direction as the horizontal axis, and the vertical upward direction as the vertical axis; the formula model of the shadow retention factor of each reference image is:
[0019]
[0020] in, Indicates The shadow preservation factor of the reference image; Indicates The total number of target pixels in the reference image; Indicates The reference image The horizontal coordinate of the target pixel; Indicates The mean of the horizontal coordinates of all target pixels in the reference image; Indicates The reference image The vertical coordinate of the target pixel; Indicates The mean of the ordinates of all target pixels in the reference image.
[0021] Furthermore, the method for obtaining the second retention degree value of the shadow part in each reference image includes:
[0022] In each reference image, the brightness value of each target pixel is negatively correlated and normalized, and the normalized value is multiplied by the saturation value to obtain the adjusted saturation of each target pixel, and the average value of the adjusted saturation of all target pixels is normalized as the first retention factor of each reference image;
[0023] The variance of the saturation values of all target pixels is normalized and used as the second retention factor of each reference image;
[0024] The first retention factor and the second retention factor are weightedly adjusted according to the first retention degree value of the shadow part in each reference image to obtain the second retention degree value of the shadow part in each reference image.
[0025] Furthermore, the formula model of the second retention degree value of the shadow part in each reference image is:
[0026] ;in, Indicates a second retention degree value of the shadow part in the reference image; Indicates A first retention degree value of the shadow part in a reference image; Indicates A first retention factor of a reference image; Indicates The second retention factor of the reference image.
[0027] Furthermore, the method for obtaining the fine scale and the coarse scale includes:
[0028] Obtaining an adjustment factor according to the variance of the first retention degree value and the variance of the second retention degree value of all reference images, wherein the adjustment factor is positively correlated with the variance of the first retention degree value, and negatively correlated with the variance of the first retention degree value, and the value of the adjustment factor is a normalized value;
[0029] The first retention degree value and the second retention degree value of each reference image are weightedly adjusted according to the adjustment factor to obtain a final retention degree value of the shadow part in each reference image. The formula model of the final retention degree value of the shadow part in each reference image is:
[0030]
[0031] in, Indicates The final retention value of the shadow part in the reference image; Indicates a second retention degree value of the shadow part in the reference image; Indicates A first retention degree value of the shadow part in a reference image; represents the adjustment factor; represents the normalization function;
[0032] The average of the final retention degree values of all reference images is calculated as a reference value; the scale of the reference image corresponding to the final retention degree value less than or equal to the reference value is used as a coarse scale, and the scale of the reference image corresponding to the final retention degree value greater than the reference value is used as a fine scale.
[0033] Further, the obtaining of all brightness significant feature maps and saturation significant feature maps according to all the reference images at the fine scale and the coarse scale, and the obtaining of all directional significant feature maps according to all the directional feature maps at the fine scale and the coarse scale include:
[0034] Obtain the target image corresponding to the reference image of each scale under the S channel and V channel respectively;
[0035] Combine each coarse scale with each fine scale in pairs to obtain all scale combinations;
[0036] In each scale combination, under the S channel, the target image corresponding to the coarse scale is interpolated into the target image corresponding to the fine scale, and then a matrix subtraction operation is performed with the target image corresponding to the fine scale to obtain a saturation significant feature map;
[0037] In each scale combination, under the V channel, the target image corresponding to the coarse scale is interpolated into the target image corresponding to the fine scale, and then a matrix subtraction operation is performed with the target image corresponding to the fine scale to obtain a brightness salient feature map;
[0038] In each scale combination, under each preset direction, the directional feature map corresponding to the coarse scale is interpolated into the directional feature map corresponding to the fine scale, and then a matrix subtraction operation is performed with the directional feature map corresponding to the fine scale to obtain a directional significant feature map.
[0039] Furthermore, the method for obtaining the final saliency map includes:
[0040] Based on the Itti saliency detection algorithm, all brightness salient feature maps, saturation salient feature maps and direction salient feature maps are fused and analyzed to obtain the final saliency map of the garden image.
[0041] Furthermore, the garden image is adaptively enhanced based on the grayscale value of each pixel in the final saliency map to obtain an enhanced image for garden image monitoring, including:
[0042] The normalized value of the grayscale value of each pixel is used as the gamma value in the gamma transform;
[0043] Adaptively enhance the value of each pixel in the garden image under the S channel and the V channel by using gamma change according to the gamma value corresponding to each pixel, so as to obtain the enhanced value of each pixel under the S channel and the V channel;
[0044] The enhanced values of each pixel in the S channel and the V channel are combined with the value of each pixel in the H channel to obtain an enhanced image for garden image monitoring.
[0045] The present invention has the following beneficial effects:
[0046] Since the shadow part in the garden image is caused by the small amount of natural light entering the area, its brightness value and saturation value will be greatly different from the non-shadow part, so the garden image obtained by the present invention is an HSV space image, which is convenient for analyzing the shadow part. The result obtained by analyzing the image at a single scale is one-sided, so the garden image is processed at multiple scales to obtain reference images and directional feature maps of different scales. Further, because the area of the shadow part is usually small, the shadow part will disappear at certain scales, so it is necessary to distinguish the scale according to the degree of retention of the shadow part in the reference image at different scales. In view of the fact that the brightness value information can best express the image characteristics of the shadow part, the brightness distribution characteristics of the pixels in each reference image and the positional relationship between the pixels are analyzed to evaluate the first retention degree value of the shadow part in each reference image; then the distribution characteristics of the saturation between the pixels in each reference image are analyzed, and combined with the first retention degree value, the second retention degree value of the shadow part in each reference image is evaluated; finally, the first retention degree value and the second retention degree value are combined to distinguish all scales to obtain fine scales and coarse scales. Furthermore, the fine-scale and coarse-scale reference images are combined to obtain all brightness significant feature maps, saturation significant feature maps, and direction significant feature maps, which can improve the comprehensiveness of significant feature extraction. Finally, based on all the aforementioned significant feature maps, the final significant map of the garden image is obtained. At this time, the final significant map focuses on analyzing the shadow part. Therefore, when the garden image is adaptively enhanced based on the grayscale value of each pixel in the final significant map, the expression of plant features in the shadow part can be significantly improved, so that more accurate monitoring results can be obtained when monitoring the garden image based on the enhanced image. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 A flow chart of a garden image monitoring method based on computer vision provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of a garden image monitoring method based on computer vision proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0050] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0051] The following is a detailed description of a specific scheme of a garden image monitoring method based on computer vision provided by the present invention in conjunction with the accompanying drawings.
[0052] See also Figure 1 , which shows a method flow chart of a garden image monitoring method based on computer vision provided by an embodiment of the present invention, the method comprising the following steps:
[0053] Step S1: Acquire a garden image, which is an HSV space image; perform multi-scale processing on the garden image to obtain reference images of different scales and directional feature maps of different scales.
[0054] In the garden protection operation, whether the health status of the plants in the garden can be obtained in time is an important prerequisite for achieving garden protection. Visually observing the appearance of plants in the garden is an effective way to quickly judge the health status of plants. For the inspection of the health status of top plants, drones are usually used to take images of the top of the plants. However, because there is often noise in the collected images, the images need to be enhanced. First, it is necessary to obtain garden images. The specific acquisition method can be: You can use drones to take overhead images of the garden.
[0055] Since the overhead image of the garden taken by the drone is usually an RGB image, and there are usually shadow parts in the image caused by partial occlusion of branches and leaves, in order to obtain a better image enhancement effect and thus improve the accuracy of the final image monitoring, the shadow part should be enhanced to make the feature information contained in the corresponding area clearer. The shadow part is caused by the fact that the amount of natural light entering this area is less than that in other surrounding areas. Therefore, its brightness value and saturation are different from those of the pixels in the non-shadow part. Directly using color as the feature design of the highlight area will result in unsatisfactory results. The HSV space focuses on the changes in color and brightness. Therefore, in this embodiment of the present invention, the overhead image is converted into a color space to obtain a garden image in the HSV space.
[0056] Because the shadow parts in the garden image are of different sizes and unevenly distributed, and the sizes of trees, lawns, and flower beds are also different, the garden image contains features of multiple scales. Therefore, in this embodiment of the present invention, the garden image is processed at multiple scales to obtain reference images of different scales, which is convenient for capturing features of different scales. In addition, because the directional feature map can reflect the texture and edge information of objects in the image, which is very important for analyzing the details in the garden image, directional feature maps of different scales are obtained at the same time.
[0057] Preferably, in one embodiment of the present invention, multi-scale processing is performed on the garden image to obtain reference images of different scales and directional feature maps at different scales, including:
[0058] Image pyramid generates a series of images of different resolutions by gradually downsampling the original image. For garden images, this means that multiple scale features from the entire garden layout to the details can be captured. Therefore, the garden image is processed at multiple scales based on the image pyramid technology to obtain a preset number of reference images at different scales.
[0059] Gabor filter is a linear filter that can detect edge and texture information in different directions and can be used to analyze complex textures and structures. Therefore, the reference images at all scales are processed based on Gabor filter to extract the directional feature maps of the reference images of each scale in different preset directions.
[0060] It should be noted that the preset number is set to 9, that is, reference images at 9 scales are obtained, among which the 0th layer is the input original garden image, and the 1st to 8th layers are images obtained by downsampling after Gaussian filtering, and the sizes are 1 / 2, 1 / 4...1 / 256 of the original image respectively; the preset directions are set to 0°, 45°, 90° and 135°, at this time, the directional feature maps of each reference image at four angles can be obtained; the image pyramid technology and the Gabor filtering process are technical means well known to those skilled in the art and will not be elaborated here.
[0061] At this point, the garden image can be acquired and subjected to multi-scale analysis to obtain multiple reference images and multiple directional feature maps at different scales, which can be used in subsequent analysis processes.
[0062] Step S2: According to the brightness distribution disorder of the pixels in each reference image and the positional relationship between the pixels, a first retention degree value of the shadow part in each reference image is obtained; according to the distribution characteristics of the saturation between the pixels in each reference image and the first retention degree value of the shadow part in the reference image, a second retention degree value of the shadow part in each reference image is obtained.
[0063] Because the shadow part is usually composed of the gaps between branches and leaves, the area of each independent shadow part is usually relatively small. In the process of continuously downsampling the image, the shadow part with a smaller area will gradually disappear as the number of sampling times increases. At this time, comparing the images at subsequent scales will lose the meaning of analyzing the shadow part of the gap between branches and leaves; therefore, it is necessary to distinguish the scales according to the degree of retention of the shadow part in the reference image at different scales.
[0064] Since the brightness information can best express the image characteristics of the shadow part, and because the shadow parts are of different sizes and are more dispersed than the area with uniform illumination, in an embodiment of the present invention, the brightness distribution disorder of the pixels in the reference image and the position characteristics between the pixels are analyzed to evaluate the first retention degree value of the shadow part in each reference image.
[0065] Preferably, in one embodiment of the present invention, a method for obtaining a first preservation degree value of a shadow portion in each reference image comprises:
[0066] First, in each reference image, it is necessary to determine the pixels that may be shadows. Because the shadows are usually caused by the fact that the amount of natural light entering this area is less than that in other surrounding areas, the brightness of the pixels in the shadows is usually lower. Therefore, the mean of the brightness values of all pixels is used as the mean eigenvalue to reflect the overall brightness level of the reference image. The pixels with brightness values less than the mean eigenvalue are arranged in ascending order according to the brightness values to obtain an arrangement sequence. At this time, the pixels in the arrangement sequence are the pixels with lower brightness values obtained after preliminary screening. Then, the target pixels are screened according to the difference between the brightness values of the pixels in the arrangement sequence. The specific process is as follows: in each reference image corresponding to In the arrangement sequence, the brightness difference between all two adjacent pixels is calculated as the brightness difference, and all the pixels before the pixel with the smallest brightness value among the two pixels corresponding to the maximum brightness difference are taken as the target pixels. The reason is that in the shadow part, the brightness value usually has a gradual change process, and in this gradual change process, the position with the largest brightness difference is likely to be the edge of the shadow part. The pixel with a smaller brightness value is selected as the target pixel because it is more likely to be the core area of the shadow part. Because the shadow part is more dispersed, the shadow retention factor of each reference image is obtained according to the positional relationship between all the target pixels. The method for obtaining the shadow retention factor specifically includes:
[0067] A two-dimensional coordinate system is established with the lower left corner of each reference image as the origin, the horizontal right direction as the horizontal axis, and the vertical upward direction as the vertical axis; the formula model of the shadow retention factor of each reference image is:
[0068]
[0069] in, Indicates The shadow preservation factor of the reference image; Indicates The total number of target pixels in the reference image; Indicates The reference image The horizontal coordinate of the target pixel; Indicates The mean of the horizontal coordinates of all target pixels in the reference image; Indicates The reference image The vertical coordinate of the target pixel; Indicates The mean of the ordinates of all target pixels in the reference image.
[0070] In the formula model of the shadow retention factor, the mean of the horizontal and vertical coordinates of all target pixels is calculated. , the mean can characterize the distribution characteristics of all target pixels at the overall level, and then calculate each target pixel and The product of the differences between the horizontal and vertical coordinates , which reflects the difference between the distribution characteristics of each target pixel and the overall target pixel. The larger the value, the more it deviates from the overall distribution characteristics, which can also indicate that the distribution of the shadow part is more discrete. Therefore, all target pixels are set to The shadow retention factor of each reference image is accumulated to obtain the shadow retention factor of each reference image. At this time, if the number of target pixels in the reference image is greater and the distribution deviates from the overall distribution characteristics, the greater the shadow retention factor is, then it can be regarded that the shadow part is retained to a greater extent under the reference image.
[0071] In addition, as the number of scale layers increases, the image resolution gradually decreases, the detail information gradually decreases, and the shadow part gradually disappears, so the accuracy of the target pixel point in accurately representing the shadow part gradually decreases, so it is not accurate enough to calculate the degree of shadow retention based only on the discrete degree of the target pixel point. Therefore, the brightness information is further analyzed. The brightness of the area normally illuminated by light should be relatively close, while the brightness of the shadow part is limited by the size of the current gap between branches and leaves. The larger the gap, the more light enters the shadow part and the higher the brightness. Therefore, in the entire image, the more shadow parts are retained, and the more complex the brightness distribution in the image should be. Therefore, pixels with the same brightness value are regarded as a type of pixel points, and the number of brightness value types of all pixel points is counted; according to the probability of occurrence of pixels of all brightness value types, the brightness chaos value of the reference image is obtained using the information entropy calculation formula.
[0072] Finally, the brightness chaos value is combined with the shadow retention factor, that is, the normalized value of the brightness chaos value of each reference image is multiplied by the shadow retention factor of the reference image, and the multiplied value is normalized to obtain the first retention degree value of the shadow part in each reference image. The formula model of the first retention degree value can be, for example, as follows:
[0073]
[0074] in, Indicates A first retention degree value of the shadow part in a reference image; Indicates The number of types of brightness values of pixels in the reference image; Indicates The number of pixels with the same brightness value; Indicates The probability of occurrence of a pixel with a certain brightness value; Indicates The shadow preservation factor of the reference image; represents the logarithmic function with base 2; Represents the normalization function.
[0075] In the formula model of the first retention degree value, because the value of information entropy can reflect the uncertainty of the brightness distribution of pixels in the reference image, that is, the degree of chaos, the probability of occurrence of pixels with different brightness values is counted, and the brightness chaos value of the reference image is obtained based on the information entropy calculation formula. , the larger the value, the more chaotic the brightness distribution is, that is, more shadows are preserved; based on the above analysis, the larger the shadow preservation factor is, the greater the degree to which the shadows are preserved is, so the two can be combined, specifically in the following way: normalize the brightness chaos value, and the normalization method in this embodiment of the present invention is to use the entropy limit Normalize it and use the normalized value of the brightness chaos value as the adjustment factor , multiplied by the shadow retention factor, and the obtained product is normalized to obtain the first retention degree value of the shadow part in the reference image.
[0076] So far, by analyzing the brightness information in each reference image, a first retention degree value of the shadow part in each reference image is obtained, which can be used in subsequent analysis processes.
[0077] Because saturation is one of the color attributes, it is usually related to the color intensity or purity of the pixel, and the saturation between the shadow part and the uniformly illuminated area will also be different. Therefore, the saturation information between the pixels in each reference image can be further analyzed, and combined with the first retention degree value of the shadow part in the reference image, the second retention degree value of the shadow part in the reference image can be obtained.
[0078] Preferably, in one embodiment of the present invention, the method for obtaining the second preservation degree value of the shadow part in each reference image includes:
[0079] In the aforementioned process, the pixels that can represent the shadow part in the reference image, namely the target pixels, have been screened out, so here, the analysis is still performed on the target pixels.
[0080] First, for the target shadow part, the smaller the gap between branches and leaves, the smaller the shadow area, and the less light entering, the darker the shadow of the area. The higher the saturation, the darker the color and the closer it is to the spectral color. The lower the saturation, the lighter the color and the closer it is to white. Therefore, the characteristics of the shadow part are reflected in the image as high pixel saturation and low brightness. Therefore, in each reference image, the normalized value of the brightness value of each target pixel is multiplied by the saturation value to obtain the adjusted saturation of each target pixel. The normalized value of the average adjusted saturation of all target pixels is used as the first retention factor of each reference image. The formula model of the first retention factor can be, for example, as follows:
[0081]
[0082] in, Indicates A first retention factor of a reference image; Indicates The total number of target pixels in the reference image; Indicates The brightness value of the target pixel; Indicates The saturation value of each target pixel; represents a natural constant; Represents the normalization function.
[0083] In the formula model of the first retention factor, since the higher the saturation of the pixel in the shadow part, the lower the brightness, for the target pixel, the weight of the pixel that may belong to the non-shadow part should be reduced, so the brightness value is negatively correlated and normalized, and the logical relationship is corrected and used as the weight of its own saturation value to obtain the adjusted saturation. , and finally the mean of the adjusted saturation of all target pixels is normalized to obtain the first retention factor of the reference image. Among them, the negative correlation relationship means that the dependent variable will decrease as the independent variable increases, and the dependent variable will increase as the independent variable decreases. It can be a subtraction relationship, a division relationship, etc., which is determined by the actual application.
[0084] Then, as the number of scale layers increases, the image resolution gradually decreases, the detail information gradually decreases, and the shadow part gradually disappears. Therefore, the accuracy of the target pixel in accurately representing the shadow part is smaller, that is, there may be non-shadow pixels in the target pixel. Therefore, the difference between the saturation values of the target pixels is analyzed, and the variance of the saturation values of all target pixels is normalized as the second retention factor of each reference image, which is recorded as .
[0085] Finally, the first retention factor and the second retention factor are weightedly adjusted according to the first retention degree value of the shadow part in each reference image to obtain the second retention degree value of the shadow part in each reference image. The formula model of the second retention degree value of the shadow part in each reference image is:
[0086]
[0087] in, Indicates a second retention degree value of the shadow part in the reference image; Indicates A first retention degree value of the shadow part in a reference image; Indicates A first retention factor of a reference image; Indicates The second retention factor of the reference image.
[0088] In the formula model of the second retention degree value, since the first retention degree value of the shadow part in the reference image analyzes the target pixel point and the overall brightness distribution characteristics, the larger the first retention degree value is, the more likely it is that the target pixel point in the reference image accurately represents the shadow part. At this time, adjusting the saturation can better retain the color characteristics of the shadow part. Therefore, when the first retention degree value is larger, the saturation is adjusted, that is, the first retention factor dominates the second retention degree representing the shadow part; conversely, when the first retention degree value is smaller, it becomes more important to consider the variance of the saturation value of the target pixel point as a whole, that is, the degree of discreteness of the color distribution, then the variance of the saturation value of the target pixel point as a whole, that is, the second retention factor should dominate. Therefore, the formula model of the second retention degree value is constructed based on the above logic.
[0089] So far, by analyzing the brightness information and the saturation information, the first retention degree value and the second retention degree value of the shadow part in each reference image are obtained respectively, which can be used in the subsequent analysis process.
[0090] Step S3: fusing and analyzing the first retention degree values and the second retention degree values of the shadow parts in all reference images to distinguish fine scales from coarse scales; obtaining all brightness significant feature maps and saturation significant feature maps based on all reference images at fine scales and coarse scales, and obtaining all directional significant feature maps based on all directional feature maps at fine scales and coarse scales.
[0091] In the above process, based on the brightness characteristics and saturation characteristics of the shadow part, the first retention degree value and the second retention degree value of the shadow part in each reference image can be obtained. Therefore, the two can be fused and analyzed to determine the coarse scale and the fine scale.
[0092] Preferably, in one embodiment of the present invention, the method for obtaining the fine scale and the coarse scale includes:
[0093] First, the adjustment factor is obtained according to the variance of the first retention level value and the variance of the second retention level value of all reference images, and the adjustment factor is positively correlated with the variance of the first retention level value, and negatively correlated with the variance of the first retention level value. The value range of the adjustment factor is the normalized value. The formula model of the adjustment factor can be, for example, as follows:
[0094]
[0095] in, represents the adjustment factor; Indicates a second retention degree value of the shadow part in the reference image; represents the mean of the second retention degree values of all reference images; Indicates A first retention degree value of the shadow part in a reference image; represents the mean of the first retention degree values of all reference images; represents the total number of reference images; Indicates preset parameters; Represents the normalization function.
[0096] In the formula model of the adjustment factor, since the variance can quantify the discreteness of the data and measure the difference between each data and the overall average, the variance of the first retention degree value and the variance of the second retention degree value of all reference images are calculated and placed in the numerator and denominator respectively. At this time, if the variance of the first retention degree value The larger the variance of the second retention value The smaller it is, the larger the value of the adjustment factor will be; conversely, if the variance of the first retention degree value is The smaller the variance of the second retention value The larger it is, the smaller the adjustment factor value is.
[0097] Then, the first retention degree value and the second retention degree value of each reference image are weightedly adjusted according to the adjustment factor to obtain the final retention degree value of the shadow part in each reference image. The formula model of the final retention degree value of the shadow part in each reference image is:
[0098]
[0099] in, Indicates The final retention value of the shadow part in the reference image; Indicates a second retention degree value of the shadow part in the reference image; Indicates A first retention degree value of the shadow part in a reference image; represents the adjustment factor; Represents the normalization function.
[0100] In the formula model of the final retention degree value, based on the analysis of the formula model of the adjustment factor part, it can be seen that when the value of the adjustment factor is larger, the variance of the first retention degree value should be larger, so in all reference images, the proportion of the first retention degree value will be larger; conversely, if the value of the adjustment factor is smaller, the variance of the second retention degree value should be larger, so in all reference images, the proportion of the second retention degree value will be larger. Based on the above logical analysis, the formula model of the final retention degree value is constructed to balance the influence of the first retention degree value and the second retention degree value, so that the final retention degree value is more comprehensive.
[0101] Finally, all scales can be distinguished according to the final retention degree value of the shadow part: the average of the final retention degree values corresponding to all reference images is calculated as the reference value; since the fine scale usually refers to the scale that retains more details and features, and the coarse scale pays more attention to the overall or more macro information, the scale of the reference image corresponding to the final retention degree value less than or equal to the reference value is taken as the coarse scale, and the scale of the reference image corresponding to the final retention degree value greater than the reference value is taken as the fine scale.
[0102] It should be noted that the preset parameters The role of is to prevent the denominator from being 0. The specific value can be 0.001. The specific value can be adjusted according to the implementation scenario and is not limited here. A positive correlation relationship indicates that the dependent variable will increase as the independent variable increases, and the dependent variable will decrease as the independent variable decreases. The specific relationship can be a multiplication relationship, an addition relationship, or the power of an exponential function, which is determined by actual application. A negative correlation relationship indicates that the dependent variable will decrease as the independent variable increases, and the dependent variable will increase as the independent variable decreases. It can be a subtraction relationship, a division relationship, etc., which is determined by actual application.
[0103] So far, by analyzing the degree of preservation of the shadow part in the reference image corresponding to different scales, the scales are distinguished and the fine scale and the coarse scale are obtained.
[0104] After obtaining the fine scale and the coarse scale, the reference images at different scales and the directional feature maps can be combined to obtain a salient feature map.
[0105] Preferably, in one embodiment of the present invention, all brightness significant feature maps and saturation significant feature maps are obtained according to the reference images at all fine scales and coarse scales, and all directional significant feature maps are obtained according to the directional feature maps at all fine scales and coarse scales, including:
[0106] In this embodiment of the present invention, the brightness and saturation are analyzed separately, that is, the target images corresponding to the reference images at each scale in the S channel and the V channel are obtained respectively. All coarse scales are combined with all fine scales in pairs to obtain all scale combinations, which is convenient for comparing image features at different scales and can better capture key information in the image.
[0107] Since the coarse-scale image is converted to a fine-scale resolution through interpolation, it is easy to make a pixel-by-pixel comparison. The matrix subtraction operation with the fine-scale image can facilitate the comparison of the differences between the two images, thereby obtaining a significant feature map to help identify important areas in the image.
[0108] Therefore, in each scale combination, under the S channel, after the target image corresponding to the coarse scale is interpolated into the target image corresponding to the fine scale, a matrix subtraction operation is performed with the target image corresponding to the fine scale to obtain a saturation significant feature map; in each scale combination, under the V channel, after the target image corresponding to the coarse scale is interpolated into the target image corresponding to the fine scale, a matrix subtraction operation is performed with the target image corresponding to the fine scale to obtain a brightness significant feature map; in each scale combination, under each preset direction, after the directional feature map corresponding to the coarse scale is interpolated into the directional feature map corresponding to the fine scale, a matrix subtraction operation is performed with the directional feature map corresponding to the fine scale to obtain a directional significant feature map.
[0109] It should be noted that image interpolation and matrix subtraction operations between images are well known to those skilled in the art and will not be described in detail herein.
[0110] At this point, based on the above process, multiple brightness significant feature maps, saturation significant feature maps and direction significant feature maps can be obtained, which can be used in subsequent analysis processes.
[0111] Step S4: obtaining a final salient map of the garden image according to all brightness salient feature maps, saturation salient feature maps and direction salient feature maps; adaptively enhancing the garden image based on the grayscale value of each pixel in the final salient map to obtain an enhanced image for garden image monitoring.
[0112] After obtaining all brightness salient feature maps, saturation salient feature maps and direction salient feature maps, the final salient map of the garden image can be obtained, which can be comprehensively analyzed to obtain the final salient map containing brightness salient features, saturation salient features and texture salient features.
[0113] Preferably, in one embodiment of the present invention, the method for obtaining the final saliency map includes:
[0114] The Itti saliency detection algorithm can comprehensively consider multiple features such as brightness, saturation and direction, thereby obtaining a comprehensive saliency map. Such a saliency map can more comprehensively reflect the important areas in the image and improve the accuracy of saliency detection. Therefore, in this embodiment of the present invention, all brightness saliency feature maps, saturation saliency feature maps and direction saliency feature maps are fused and analyzed based on the Itti saliency detection algorithm to obtain the final saliency map of the garden image.
[0115] It should be noted that the Itti saliency detection algorithm is a technical means well known to those skilled in the art and will not be described in detail here.
[0116] Based on the above process, a final saliency map with more prominent shadow parts can be obtained. Therefore, the garden image can be adaptively enhanced according to the grayscale value of each pixel in the final saliency map, so that the contrast of the shadow part is enhanced, which is convenient for subsequent image monitoring.
[0117] Preferably, in one embodiment of the present invention, the garden image is adaptively enhanced based on the grayscale value of each pixel in the final saliency map to obtain an enhanced image for garden image monitoring, including:
[0118] The saliency map is essentially a grayscale map, in which the grayscale value of each pixel can represent its saliency. Gamma transform is a commonly used image enhancement technology, especially suitable for adjusting the contrast of an image. Therefore, the normalized value of the grayscale value of each pixel is used as the gamma value in the gamma transform.
[0119] In the HSV color space, the S channel (saturation) and the V channel (brightness) control the vividness and brightness of the color respectively. According to the gamma value corresponding to each pixel, the value of each pixel in the garden image under the S channel and the V channel is adaptively enhanced by using gamma change to obtain the enhanced value of each pixel under the S channel and the V channel. At this time, the pixels in the shadow part will have higher brightness and saturation in the enhanced image, making it easier to identify.
[0120] Finally, the enhanced values of each pixel in the S channel and V channel are combined with the value of each pixel in the H channel to obtain a complete enhanced image. At this time, when monitoring garden images based on the enhanced image, the object features in the shadow part can be more clearly identified and tracked, effectively improving the monitoring accuracy and efficiency.
[0121] In summary, the garden image obtained by the embodiment of the present invention is an HSV space image, which is convenient for analyzing the shadow part. Because the result obtained by analyzing the image at a single scale is one-sided, the garden image is processed at multiple scales to obtain reference images and directional feature maps of different scales. Furthermore, because the area of the shadow part is usually small, the shadow part will disappear at certain scales, so it is necessary to distinguish the scales according to the degree of retention of the shadow part in the reference image at different scales. In view of the fact that the brightness value information can best express the image characteristics of the shadow part, the brightness distribution characteristics of the pixels in each reference image and the positional relationship between the pixels are analyzed to evaluate the first retention degree value of the shadow part in each reference image; then the distribution characteristics of the saturation between the pixels in each reference image are analyzed, and combined with the first retention degree value, the second retention degree value of the shadow part in each reference image is evaluated; finally, the retention degree values of the shadow part under the S channel and the V channel are combined to distinguish all scales to obtain fine scales and coarse scales. Furthermore, the fine-scale and coarse-scale reference images are combined to obtain all brightness significant feature maps, saturation significant feature maps, and direction significant feature maps, which can improve the comprehensiveness of significant feature extraction. Finally, based on all the aforementioned significant feature maps, the final significant map of the garden image is obtained. At this time, the final significant map focuses on analyzing the shadow part. Therefore, when the garden image is adaptively enhanced based on the grayscale value of each pixel in the final significant map, the expression of plant features in the shadow part can be significantly improved, so that more accurate monitoring results can be obtained when monitoring the garden image based on the enhanced image.
[0122] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0123] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. A garden image monitoring method based on computer vision, characterized in that: The method comprises: Acquire a garden image, wherein the garden image is an HSV space image; perform multi-scale processing on the garden image to obtain reference images of different scales and directional feature maps of different scales; According to the brightness distribution disorder of the pixels in each reference image and the positional relationship between the pixels, a first retention degree value of the shadow part in each reference image is obtained; according to the distribution characteristics of the saturation between the pixels in each reference image and the first retention degree value of the shadow part in the reference image, a second retention degree value of the shadow part in each reference image is obtained; The first retention degree value and the second retention degree value of the shadow part in all reference images are fused and analyzed to distinguish fine scales and coarse scales; all brightness significant feature maps and saturation significant feature maps are obtained according to all the reference images at the fine scales and coarse scales, and all directional significant feature maps are obtained according to all the directional feature maps at the fine scales and coarse scales; Obtaining a final salient map of the garden image according to all of the brightness salient feature maps, the saturation salient feature maps, and the direction salient feature maps; adaptively enhancing the garden image based on the grayscale value of each pixel point in the final salient map to obtain an enhanced image for garden image monitoring; The method for obtaining the first retention degree value of the shadow part in each reference image comprises: In any reference image, the mean of the brightness values of all pixels is used as the mean eigenvalue, and the pixels whose brightness values are less than the mean eigenvalue are arranged in ascending order according to the brightness values to obtain an arrangement sequence; according to the difference between the brightness values of the pixels in the arrangement sequence, the target pixels are screened, and according to the positional relationship between all the target pixels, the shadow retention factor of each reference image is obtained; Pixels with the same brightness value are regarded as one type of pixels, and the brightness chaos value of the reference image is obtained by using the information entropy calculation formula according to the types of brightness values of all pixels; The normalized value of the brightness confusion value of each reference image is multiplied by the shadow retention factor of the reference image, and the multiplied value is normalized to obtain a first retention degree value of the shadow part in each reference image; The method of screening target pixels according to the difference between the brightness values of the pixels in the arrangement sequence, and obtaining the shadow retention factor of each reference image according to the positional relationship between all the target pixels, includes: In the arrangement sequence corresponding to each reference image, the brightness value difference between all two adjacent pixels is calculated as the brightness difference, and all the pixels before the pixel with the smallest brightness value among the two pixels corresponding to the maximum brightness difference are taken as the target pixels; A two-dimensional coordinate system is established with the lower left corner of each reference image as the origin, the horizontal right direction as the horizontal axis, and the vertical upward direction as the vertical axis; the formula model of the shadow retention factor of each reference image is: in, Indicates The shadow preservation factor of the reference image; Indicates The total number of target pixels in the reference image; Indicates The reference image The horizontal coordinate of the target pixel; Indicates The mean of the horizontal coordinates of all target pixels in the reference image; Indicates The reference image The vertical coordinate of the target pixel; Indicates The mean of the ordinates of all target pixels in the reference image; The method for obtaining the second retention degree value of the shadow part in each reference image comprises: In each reference image, the brightness value of each target pixel is negatively correlated and normalized, and the normalized value is multiplied by the saturation value to obtain the adjusted saturation of each target pixel, and the average value of the adjusted saturation of all target pixels is normalized as the first retention factor of each reference image; The variance of the saturation values of all target pixels is normalized and used as the second retention factor of each reference image; According to the first retention degree value of the shadow part in each reference image, a first retention factor and a second retention factor are weightedly adjusted to obtain a second retention degree value of the shadow part in each reference image; The formula model of the second retention degree value of the shadow part in each reference image is: ;in, Indicates a second retention degree value of the shadow part in the reference image; Indicates A first retention degree value of the shadow part in a reference image; Indicates A first retention factor of a reference image; Indicates The second retention factor of the reference image.
2. A garden image monitoring method based on computer vision according to claim 1, characterized in that: The multi-scale processing of the garden image to obtain reference images at different scales and directional feature maps at different scales includes: Performing multi-scale processing on the garden image based on the image pyramid technology to obtain a preset number of reference images at different scales; The reference images at all scales are processed based on Gabor filters, and the directional feature maps of the reference images at each scale in different preset directions are extracted.
3. The garden image monitoring method based on computer vision according to claim 1, characterized in that: The method for obtaining the fine scale and the coarse scale includes: Obtaining an adjustment factor according to the variance of the first retention degree value and the variance of the second retention degree value of all reference images, wherein the adjustment factor is positively correlated with the variance of the first retention degree value, and negatively correlated with the variance of the first retention degree value, and the value of the adjustment factor is a normalized value; The first retention degree value and the second retention degree value of each reference image are weightedly adjusted according to the adjustment factor to obtain a final retention degree value of the shadow part in each reference image. The formula model of the final retention degree value of the shadow part in each reference image is: in, Indicates The final retention value of the shadow part in the reference image; Indicates a second retention degree value of the shadow part in the reference image; Indicates A first retention degree value of the shadow part in a reference image; represents the adjustment factor; represents the normalization function; The average of the final retention degree values of all reference images is calculated as a reference value; the scale of the reference image corresponding to the final retention degree value less than or equal to the reference value is used as a coarse scale, and the scale of the reference image corresponding to the final retention degree value greater than the reference value is used as a fine scale.
4. The garden image monitoring method based on computer vision according to claim 2 is characterized in that: The step of obtaining all brightness significant feature maps and saturation significant feature maps according to all the reference images at the fine scale and the coarse scale, and obtaining all directional significant feature maps according to all the directional feature maps at the fine scale and the coarse scale, comprises: Obtain the target image corresponding to the reference image of each scale under the S channel and V channel respectively; Combine each coarse scale with each fine scale in pairs to obtain all scale combinations; In each scale combination, under the S channel, the target image corresponding to the coarse scale is interpolated into the target image corresponding to the fine scale, and then a matrix subtraction operation is performed with the target image corresponding to the fine scale to obtain a saturation significant feature map; In each scale combination, under the V channel, the target image corresponding to the coarse scale is interpolated into the target image corresponding to the fine scale, and then a matrix subtraction operation is performed with the target image corresponding to the fine scale to obtain a brightness salient feature map; In each scale combination, under each preset direction, the directional feature map corresponding to the coarse scale is interpolated into the directional feature map corresponding to the fine scale, and then a matrix subtraction operation is performed with the directional feature map corresponding to the fine scale to obtain a directional significant feature map.
5. The garden image monitoring method based on computer vision according to claim 1, characterized in that: The method for obtaining the final saliency map includes: Based on the Itti saliency detection algorithm, all brightness salient feature maps, saturation salient feature maps and direction salient feature maps are fused and analyzed to obtain the final saliency map of the garden image.
6. The garden image monitoring method based on computer vision according to claim 1, characterized in that: The adaptively enhancing the garden image based on the grayscale value of each pixel in the final saliency map to obtain an enhanced image for garden image monitoring includes: The normalized value of the grayscale value of each pixel is used as the gamma value in the gamma transform; Adaptively enhance the value of each pixel in the garden image under the S channel and the V channel by using gamma change according to the gamma value corresponding to each pixel, so as to obtain the enhanced value of each pixel under the S channel and the V channel; The enhanced values of each pixel in the S channel and the V channel are combined with the value of each pixel in the H channel to obtain an enhanced image for garden image monitoring.
Citation Information
Patent Citations
Significant region extraction method for intelligent monitoring
CN101944178A
Method for detecting image salient region
CN103679173A
