Image acquisition method, device and computer equipment for outdoor operation robot
By obtaining and adjusting the light intensity in the outdoor working robot, combined with image denoising and contrast enhancement processing, the problem of low image clarity in outdoor working is solved, and the quality and analysis efficiency of the target object image are improved.
Patent Information
- Application Number
- CN202310737663.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-20
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2043-06-20
AI Technical Summary
The target object images obtained during outdoor operations have low definition and are greatly affected by unstable lighting, resulting in reduced analysis efficiency.
By obtaining the illumination intensity at the location of the target object, starting the corresponding illumination adjustment equipment, adjusting the illumination intensity and then capturing the image, denoising the illumination image, synthesizing high-frequency and low-frequency images for contrast enhancement, and generating a clear target image.
It improves the clarity of the target object image acquired by the outdoor working robot, enhances the detailed information and dynamic range of the image, and improves the analysis efficiency.
Smart Images

Figure CN116684739B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image acquisition method, device, computer equipment, storage medium and computer program product for an outdoor working robot. Background Art
[0002] In outdoor operations, it is necessary to obtain images of target objects in order to analyze the state of the target objects. Therefore, the clarity of the obtained images affects the efficiency of analyzing the target objects. At present, the method of collecting images of objects outdoors is usually to directly shoot the target objects. However, due to the unstable outdoor lighting, the target objects in the images obtained by direct shooting are not clear.
[0003] Therefore, the current method for acquiring target objects in outdoor operations has the defect of low clarity. Summary of the invention
[0004] Based on this, it is necessary to provide an image acquisition method, device, computer equipment, computer-readable storage medium and computer program product for an outdoor working robot that can improve clarity in response to the above technical problems.
[0005] In a first aspect, the present application provides an image acquisition method for an outdoor working robot, which is applied to the outdoor working robot, and the method comprises:
[0006] Obtaining the light intensity at the location of the target object, and activating a corresponding light adjustment device according to the light intensity;
[0007] photographing the target object under the illumination intensity obtained after adjustment by the illumination adjustment device, and acquiring an image to be processed corresponding to the target object;
[0008] Acquire an illumination image and a reflection image corresponding to the image to be processed, denoise the illumination image, and obtain a denoised composite image according to the denoised illumination image and the reflection image;
[0009] A high-frequency image and a low-frequency image in the denoised composite image are obtained, and after contrast enhancement processing is performed on the high-frequency image, a target image of the target object is obtained according to the enhanced high-frequency image and the low-frequency image.
[0010] In one embodiment, obtaining the light intensity at the location of the target object includes:
[0011] Obtaining a standard pure color image of a preset pure color plate under a preset light intensity, and obtaining a first pixel mean value of the standard pure color image; the preset light intensity represents the light intensity that makes the standard pure color image have the highest clarity;
[0012] At the location of the target object, obtaining a test pure color image corresponding to the preset pure color plate, and obtaining a second pixel mean value of the test pure color image;
[0013] A difference between the first pixel mean and the second pixel mean is obtained, and the light intensity at the location of the target object is determined according to the difference and a preset difference threshold.
[0014] In one embodiment, the starting of a corresponding illumination adjustment device according to the illumination intensity includes:
[0015] If the first pixel mean is greater than the second pixel mean, and the difference is greater than the preset difference threshold, determining to activate the shading plate to reduce the light intensity at the location of the target object;
[0016] If the second pixel mean is greater than the first pixel mean, and the difference is greater than the preset difference threshold, it is determined to start the lighting to increase the light intensity at the location of the target object.
[0017] In one of the embodiments, photographing the target object under the illumination intensity obtained after adjustment by the illumination adjustment device to obtain the to-be-processed image corresponding to the target object includes:
[0018] photographing the target object under the illumination intensity obtained after adjustment by the illumination adjustment device, to obtain an original image of the target object in an RGB color space;
[0019] The original image in the RGB color space is converted into an image in the HSI color space, and an image of the I color channel in the image in the HSI color space is obtained as an image to be processed.
[0020] In one embodiment, the step of acquiring the illumination image and the reflection image corresponding to the image to be processed includes:
[0021] Determine a filter function corresponding to the illumination image according to a preset guide image, a filter window of a preset size, and a coefficient corresponding to the filter window;
[0022] Determining a preset cost function according to a preset guide image, a filter window of a preset size, coefficients corresponding to the filter window, an image to be processed within each filter window, and a preset regularization parameter;
[0023] Fitting the filter function according to the least squares method and the cost function, and acquiring an illumination image output by the filter function;
[0024] A reflection image is obtained according to a ratio of a pixel value of the image to be processed to a pixel value of the illumination image.
[0025] In one embodiment, denoising the illumination image includes:
[0026] Generate a low-rank matrix decomposition function according to the low-rank matrix corresponding to the illumination image and a preset sparse error matrix;
[0027] Obtaining a low-rank component corresponding to the low-rank matrix when the function value of the low-rank matrix decomposition function is minimum, and obtaining a denoised illumination image according to the low-rank component;
[0028] The step of obtaining a denoised composite image based on the denoised illumination image and the reflection image comprises:
[0029] A denoised composite image is obtained according to the product of the pixel value of the denoised illumination image and the pixel value of the reflection image.
[0030] In one embodiment, the step of obtaining the high-frequency image and the low-frequency image in the denoised composite image includes:
[0031] According to a local window of a preset size, traverse the denoised synthetic image to obtain a plurality of local images;
[0032] For each local image, an average pixel value corresponding to the local image is obtained. If the average pixel value is less than a preset pixel value threshold, the local image is determined to be a low-frequency image. If the average pixel value is greater than or equal to the preset pixel value threshold, the local image is determined to be a high-frequency image.
[0033] The step of performing contrast enhancement processing on the high-frequency image comprises:
[0034] An enhanced high-frequency image is obtained according to the product of the high-frequency image and a preset gain value.
[0035] In one embodiment, the enhanced high-frequency image and the low-frequency image are both images of the I color channel in the HSI color space;
[0036] The step of obtaining a target image of the target object according to the enhanced high-frequency image and the low-frequency image includes:
[0037] Fusing the enhanced high-frequency image and the low-frequency image to obtain a first fused image of color channel I;
[0038] Obtaining a first component image in the H color channel and a second component image in the S color channel corresponding to the image to be processed;
[0039] fusing the first component image, the second component image and the first fused image to obtain a second fused image;
[0040] The second fused image is converted into an image in RGB color space to obtain a target image of the target object.
[0041] In a second aspect, the present application provides an image acquisition device for an outdoor working robot, which is applied to the outdoor working robot, and the device comprises:
[0042] A start module, used to obtain the light intensity at the location of the target object, and start the corresponding light adjustment device according to the light intensity;
[0043] An acquisition module, used to photograph the target object under the illumination intensity obtained after adjustment by the illumination adjustment device, and acquire an image to be processed corresponding to the target object;
[0044] A denoising module, used for acquiring an illumination image and a reflection image corresponding to the image to be processed, denoising the illumination image, and obtaining a denoised composite image according to the denoised illumination image and the reflection image;
[0045] The processing module is used to obtain the high-frequency image and the low-frequency image in the denoised composite image, perform contrast enhancement processing on the high-frequency image, and obtain the target image of the target object according to the enhanced high-frequency image and the low-frequency image.
[0046] In a third aspect, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0047] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the steps of the above method when executed by a processor.
[0048] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.
[0049] The image acquisition method, device, computer equipment, storage medium and computer program product of the outdoor working robot are as follows: the outdoor working robot starts the corresponding light adjustment device based on the light intensity at the location of the target object, shoots the target object under the light intensity adjusted by the device, obtains the illumination image and reflection image of the image to be processed, denoises the illumination image, obtains the denoised composite image based on the denoised illumination image and reflection image, performs contrast enhancement processing on the high-frequency image in the denoised composite image, and obtains the target image of the target object based on the enhanced high-frequency image and the low-frequency image in the composite image. Compared with the traditional method of directly shooting the target object to obtain an image, this solution determines and adjusts the appropriate light intensity during shooting by the outdoor working robot, and performs denoising and image enhancement processing on the shot image, thereby improving the clarity of the image of the target object obtained by the outdoor working robot. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A schematic diagram of a flow chart of an image acquisition method for an outdoor working robot in one embodiment;
[0051] Figure 2 is a schematic flow chart of an image capturing step in one embodiment;
[0052] Figure 3 is a schematic flow chart of an image enhancement step in one embodiment;
[0053] Figure 4 is a structural block diagram of an image acquisition device for an outdoor working robot in one embodiment;
[0054] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] In one embodiment, Figure 1 As shown, a method for acquiring an image of an outdoor working robot is provided. This embodiment takes the method applied to an outdoor working robot as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including an outdoor working robot and a server, and is implemented through the interaction between the outdoor working robot and the server, and includes the following steps:
[0057] Step S202, obtaining the light intensity at the location of the target object, and starting the corresponding light adjustment device according to the light intensity.
[0058] Among them, the target object can be a device in the transmission line, such as a transmission wire in the transmission line. Affected by natural light, the light intensity at the location of the target object will change, so there may be strong light or too low light. When maintaining and analyzing the target object, it is necessary to obtain an image of the target object. The light intensity will affect the clarity of the target object in the image. For example, when the sun is shining strongly, such as at noon, the acquired picture will tend to be grayish white; when there is no sun, such as at night, the acquired picture will tend to be dark. These will affect the quality of the picture, thereby having a negative impact on the accuracy of subsequent image-based analysis. Therefore, when the outdoor operation robot obtains the image of the target object, it can first adjust the light intensity at the location of the target object.
[0059] For example, an outdoor working robot can obtain the light intensity at the location of the target object and start the corresponding light adjustment device according to the light intensity. Among them, a plurality of light adjustment devices, such as lighting lamps and sunshades, can be installed in the outdoor working robot to adjust the light intensity when shooting the target object. For example, when the light intensity is low, the brightness can be increased by turning on the lighting lamp, and when the light intensity is strong, the brightness can be reduced by opening the sunshade, so that the light intensity at the location of the target object meets the requirements for the image quality of the target object.
[0060] Step S204, photographing the target object under the illumination intensity obtained after adjustment by the illumination adjustment device, to obtain an image to be processed corresponding to the target object.
[0061] Among them, the outdoor working robot can adjust the light intensity at the location of the target object by turning on the corresponding light adjustment device, so that the light intensity meets the image quality requirements of the target object. After the outdoor working robot adjusts the light intensity through the light adjustment device, it can shoot the target object under the light intensity obtained after the light adjustment device adjusts it, and obtain the image to be processed corresponding to the target object based on the shooting. Among them, an image acquisition device, such as a camera, is provided on the outdoor working robot. The outdoor working robot can shoot the target object under the light intensity obtained after the above adjustment through the image acquisition device, and obtain the above image to be processed.
[0062] Step S206, obtaining an illumination image and a reflection image corresponding to the image to be processed, denoising the illumination image, and obtaining a denoised composite image according to the denoised illumination image and reflection image.
[0063] The image to be processed can be decomposed into an illumination image and a reflection image. The reflection image is the real appearance of the object when there is no light source, that is, the ideal enhanced image, and the illumination image can be regarded as noise. The reflection image stores the detailed information of the image, which is the high-frequency part, and the illumination image is the low-frequency part, such as the contour, which determines the dynamic range of the image pixels. The outdoor operation robot can divide the image in the imaging device into two sub-images, namely the illumination image and the reflection image, according to the Retinex method. The outdoor operation robot can denoise the illumination image and obtain a denoised composite image based on the denoised illumination image and the reflection image. The composite image can be an image obtained by synthesizing the denoised illumination image and the reflection image. For example, the outdoor operation robot can perform a product operation on the corresponding pixel values of the two images to obtain the original image, such as the above-mentioned composite image. The Retinex method is an important method in the field of color image enhancement. Its core is to estimate the illumination L, estimate the illumination component from the image, and remove the illumination component to obtain the original reflection component.
[0064] Step S208, obtaining a high-frequency image and a low-frequency image in the denoised composite image, performing contrast enhancement processing on the high-frequency image, and obtaining a target image of the target object according to the enhanced high-frequency image and low-frequency image.
[0065] Among them, the outdoor working robot can also determine the high-frequency image and the low-frequency image from the denoised synthetic image. The high-frequency part represents the detail information in the image. The outdoor working robot can perform image enhancement on the high-frequency image. For example, the outdoor working robot performs contrast enhancement on the high-frequency image to obtain an enhanced high-frequency image, so that the outdoor working robot can obtain the target image of the target object based on the enhanced high-frequency image and the low-frequency image. For example, the outdoor working robot merges the enhanced high-frequency image and the low-frequency image to obtain the target image of the above-mentioned target object.
[0066] In one embodiment, the image to be processed may be an image of the I color channel in the HSI (Hue-Saturation-Intensity) color space, that is, the outdoor working robot may convert the image in the RGB (Red-Green-Blue) color space obtained by shooting into the image in the HSI color space, and then extract the component of the I color channel as the image to be processed. Thus, the enhanced high-frequency image and low-frequency image are both images of the I color channel in the HSI color space.
[0067] Therefore, in one embodiment, the outdoor working robot can perform color space conversion when merging the high-frequency image and the low-frequency image to obtain the target image. For example, the outdoor working robot can fuse the enhanced high-frequency image and the low-frequency image to obtain the first fused image of the I color channel; and obtain the first component image in the H color channel and the second component image in the S color channel corresponding to the image to be processed. Among them, the outdoor working robot can separate the image into the above-mentioned first component image, the second component image and the image to be processed after capturing the image of the target object and converting it into the HSI color space. The outdoor working robot can fuse the first component image, the second component image and the first fused image to obtain the second fused image; and the outdoor working robot can also convert the second fused image into an image under the RGB color space to obtain the target image of the target object.
[0068] Specifically, the outdoor working robot combines the H component, S component and I component and converts them into an image in the RGB color space. Different functions can be used for conversion according to the value of the H hue. For example, when H∈[0 0 ,120 0 ], we can get: {R=I*[1+ScosH / (cos(60 0 -H))]; G=3*I-(R+B); B=I*(1-S)}. When H∈[120 0 ,240 0 ], we can get: {R = I*(1-S); G = I*[1+ScosH / (cos(60 0 -H))];B=3*I-(R+G)}. When H∈[240 0 ,360 0 ], the conversion formula can be as follows: {R = 3*I-(R+G); G = I*(1-S); B = I*[1+ScosH / (cos(60 0 -H))]}. Wherein, when H belongs to different degrees, it represents different hue ranges. After the outdoor working robot determines the values of each component in the RGB color space from the image in the HSI color space based on the above formula, the target image in the RGB color space can be obtained.
[0069] In the above-mentioned image acquisition method of the outdoor working robot, the outdoor working robot starts the corresponding illumination adjustment device based on the illumination intensity at the location of the target object, shoots the target object under the illumination intensity adjusted by the device, obtains the illumination image and reflection image of the image to be processed, denoises the illumination image, obtains the denoised composite image based on the denoised illumination image and reflection image, performs contrast enhancement processing on the high-frequency image in the denoised composite image, and obtains the target image of the target object based on the enhanced high-frequency image and the low-frequency image in the composite image. Compared with the traditional method of directly shooting the target object to obtain an image, this solution determines and adjusts the appropriate illumination intensity during shooting by the outdoor working robot, and performs denoising and image enhancement processing on the shot image, thereby improving the clarity of the image of the target object obtained by the outdoor working robot.
[0070] In one embodiment, obtaining the light intensity at the location of the target object includes: obtaining a standard pure color image of a preset pure color plate under a preset light intensity, and obtaining a first pixel mean of the standard pure color image; the preset light intensity represents the light intensity that makes the standard pure color image have the highest clarity; at the location of the target object, obtaining a test pure color image corresponding to the preset pure color plate, and obtaining a second pixel mean of the test pure color image; obtaining a difference between the first pixel mean and the second pixel mean, and determining the light intensity at the location of the target object according to the difference and a preset difference threshold.
[0071] In this embodiment, the outdoor operation robot can determine the light intensity at the location of the target object based on the preset pure color plate. Among them, the preset pure color plate can be set near the location of the target object, or it can be set on the outdoor operation robot, and in some embodiments, there can be multiple preset pure color plates, and the specifications and colors of each pure color plate are the same. The outdoor operation robot can pre-shoot the image of the preset pure color plate under the preset light intensity as the standard pure color image, wherein the preset light intensity represents the light intensity that makes the standard pure color image have the highest clarity. The outdoor operation robot can also obtain a test pure color image corresponding to the preset pure color plate at the location of the target object, and the test pure color image can be a pure color plate image taken under the current light intensity at the location of the target object. The outdoor operation robot can obtain the first pixel mean of the standard pure color image, and can also obtain the second pixel mean of the test pure color image. The outdoor operation robot can also obtain the difference between the first pixel mean and the second pixel mean, and determine the light intensity at the location of the target object according to the difference and the preset difference threshold. Thereby, the outdoor operation robot can determine to start different light adjustment devices according to different light intensities.
[0072] Among them, the outdoor working robot can determine the lighting adjustment device that needs to be activated by comparing the size of the first pixel mean and the second pixel mean, and comparing the above mean with the preset difference threshold. For example, in one embodiment, if the outdoor working robot detects that the first pixel mean is greater than the second pixel mean, and the difference is greater than the preset difference threshold, it means that the light intensity is too large, and the outdoor working robot determines to activate the sunshade to reduce the light intensity at the location of the target object. If the outdoor working robot detects that the second pixel mean is greater than the first pixel mean, and the difference is greater than the preset difference threshold, it means that the light intensity is too low, and the outdoor working robot determines to activate the lighting to increase the light intensity at the location of the target object.
[0073] Specifically, the outdoor operation robot uses an adaptive judgment method to determine whether the sunlight is strong or insufficient, and then uses physical fill light or physical light reduction, as well as algorithm processing to enhance the image, improve the quality of the image, and facilitate subsequent image analysis and robot operation. Figure 2 As shown, Figure 2 : is a flowchart of an image capture step in an embodiment. The outdoor working robot can capture a picture of a pure color plate under normal light, that is, the above-mentioned preset light intensity. Assuming that the picture size is M*N, the pixel mean of the M*N picture f(i,j) is M1, where i,j represents the pixel point in the i-th row and j-th column of the pixel point in the picture f; then the specific determination function of the above-mentioned pixel mean M1 can be as follows: That is, M1 may be the first pixel mean value mentioned above.
[0074] Among them, a camera can be installed in the outdoor working robot. When it is necessary to judge the light exposure condition, the outdoor working robot can take a picture of a known pure color plate under the current light condition at the location of the target object to obtain the above-mentioned test pure color image, and calculate the pixel mean of the test pure color image, which is assumed to be M2, that is, the above-mentioned second pixel mean. Among them, the size of the test pure color image can be known to the size of the standard pure color image, and the calculation function of M2 can refer to the calculation function of M1. The outdoor working robot can preset a difference threshold T1, which is positive. If the outdoor working robot detects that M1-M2>T1, it means that the current light intensity is insufficient, and when M2-M1>T1, it means that the current light intensity is too strong. When the sunlight is insufficient, the outdoor working robot turns on the lighting to supplement the light, thereby ensuring the quality of the acquired picture, and uses the image enhancement algorithm to process the acquired picture; when the sunlight is strongly irradiated, the working robot opens the sunshade to reduce the impact of light, and uses the image enhancement method to process the acquired picture. In addition, in some embodiments, when the difference between M1 and M2 is less than or equal to T1, it means that the current light intensity can meet the image clarity requirement, and the outdoor working robot does not need to turn on the lighting or sunshade, nor does it need to perform image enhancement processing. At this time, the outdoor working robot can directly output the target image obtained by photographing the target object.
[0075] Through the above embodiments, the outdoor working robot can determine the strength of the light intensity by comparing the image of the solid color plate obtained based on the light intensity at the target object's location with the pixel mean of the image of the solid color plate obtained with the preset light intensity, and start the corresponding light adjustment device to adjust the light intensity at the target object's location, thereby improving the clarity of the image of the target object.
[0076] In one embodiment, a target object is photographed under the light intensity obtained after adjustment by a light adjustment device, and an image to be processed corresponding to the target object is obtained, including: photographing the target object under the light intensity obtained after adjustment by the light adjustment device, and obtaining an original image of the target object in an RGB color space; converting the original image in the RGB color space into an image in an HSI color space, and obtaining an image of the I color channel in the image in the HSI color space as the image to be processed.
[0077] In this embodiment, after the outdoor working robot uses the lighting adjustment device to adjust the lighting intensity at the location of the target object, the original image obtained by photographing the target object under the adjusted lighting intensity can be obtained. The original image can be an image in the RGB color space. The outdoor working robot can convert the original image in the RGB color space into an image in the HSI color space, and the outdoor working robot can also obtain an image of the I color channel in the image in the HSI color space as an image to be processed.
[0078] Specifically, the HSI color space uses hue, saturation, and intensity to represent an image, which is more in line with the characteristics of human observation of the world and is suitable for human visual characteristics. In actual operation, they are usually processed separately, so the amount of computation required to process the image can be reduced. The HSI color space is represented by a complex cone. In actual operation, usually only the I component is processed, which does not affect the final color of the image. The conversion function of the outdoor working robot from the image in the RGB color space to the image in the HSI color space can be as follows: H = {θ, if B ≤ G; 360 0 , if B>G}. Where B represents the value of the B color channel in the RGB image, and G represents the value of the G color channel in the image of the RGB color space. The above θ can be specifically expressed as: θ=cos -1 {[|(RG)+(RB)|] / [2*|(RG) 2 +(RB)(Gb)| 1 / 2 ]}; The conversion function of the S color channel is as follows: S = 1-[3 / (R+G+B)]|min(R,G,B)|. The conversion function of the I color channel is as follows: I = 1 / 3(R+B+G). Where R represents the value of the R color channel in the image of the RGB color space. That is, the outdoor working robot can use the above I color channel image as the image to be processed.
[0079] Through this embodiment, the outdoor working robot can convert the image in the RGB color space into the image in the HSI color space, and extract the component image of the I channel as the image to be processed, thereby improving the clarity of the image of the target object.
[0080] In one embodiment, an illumination image and a reflection image corresponding to an image to be processed are obtained, including: determining a filter function corresponding to the illumination image according to a preset guide image, a filter window of a preset size, and a coefficient corresponding to the filter window; determining a preset cost function according to a preset guide image, a filter window of a preset size, a coefficient corresponding to the filter window, an image to be processed in each filter window, and a preset regularization parameter; fitting the filter function according to a least squares method and the cost function, and obtaining an illumination image output by the filter function; and obtaining a reflection image according to a ratio of a pixel value of the image to be processed to a pixel value of the illumination image.
[0081] In this embodiment, the outdoor operation robot can extract the illumination image and the reflection image from the image to be processed. The outdoor operation robot can determine the illumination image by the guided filtering method. The guided filtering has the characteristics of strong edge information and low complexity. This method can effectively use the local linear relationship in the window to obtain the information of the image edge. The output value of each pixel is usually obtained by averaging in multiple windows, which can reduce the time complexity. The outdoor operation robot can determine the filter function corresponding to the illumination image according to the preset guided image, the filter window of the preset size, and the coefficient corresponding to the filter window. And according to the preset guided image, the filter window of the preset size, the coefficient corresponding to the filter window, the image to be processed in each filter window, and the preset regularization parameter, determine the preset cost function. Thereby, the outdoor operation robot can fit the above-mentioned filter function according to the least squares method and the cost function, and obtain the illumination image output by the filter function. The outdoor operation robot can also obtain the reflection image according to the ratio of the pixel value of the image to be processed to the pixel value of the illumination image.
[0082] Specifically, the guided filtering assumes that the result of edge-preserving filtering and the guided image have a linear relationship within the filtering window, that is, the above-mentioned filtering function. The filtering function can be specifically shown as follows: i =a k I i +b k , Among them, I i is the guide image, q i is the output image, i.e., the sub-illuminance image in the i-th filtering window, ω k is a window with k as the center pixel, that is, the filter window of the above preset size, a k and b k is the coefficient corresponding to the window. The outdoor working robot can traverse the above-mentioned image to be processed based on the filter window of the preset size. In order to obtain the output image q closest to the input image p, that is, the illumination image closest to the image to be processed, the outdoor working robot can use the least squares method to fit the linear relationship in the formula, and its cost function can be expressed as:
[0083] Among them, ε is the preset regularization parameter, p i is an input image, for example, a sub-image to be processed in the i-th window when the filter window of the preset size traverses the image to be processed.
[0084] Thanks to the Retinex method, the outdoor working robot can divide the image to be processed in the imaging device into two sub-images, namely the illumination image and the reflection image, and multiply the corresponding pixel values of the two images to obtain the original image. After the outdoor working robot determines the illumination image, it can obtain the reflection image based on the ratio of the pixel value of the image to be processed to the pixel value of the illumination image.
[0085] Through this embodiment, the outdoor working robot can extract the illumination image and the reflection image by guided filtering, so that the outdoor working robot can enhance the image of the target object based on the illumination image and the reflection image, thereby improving the clarity of the image of the target object.
[0086] In one embodiment, denoising is performed on an illuminance image, including: generating a low-rank matrix decomposition function based on a low-rank matrix corresponding to the illuminance image and a preset sparse error matrix; obtaining a low-rank component corresponding to the low-rank matrix when the function value of the low-rank matrix decomposition function is minimum, and obtaining a denoised illuminance image based on the low-rank component.
[0087] In this embodiment, the illumination image can be regarded as noise. The outdoor working robot can remove noise based on the low-rank matrix decomposition method. For example, the outdoor working robot can obtain the low-rank matrix corresponding to the illumination image and the preset coefficient error matrix. And generate a low-rank matrix decomposition function according to the low-rank matrix corresponding to the illumination image and the preset coefficient error matrix. The outdoor working robot can obtain the component corresponding to the low-rank matrix at this time when the function value of the low-rank matrix decomposition function is minimum, and obtain the denoised illumination image according to the low-rank matrix component. Thereby, the outdoor working robot can obtain the denoised composite image according to the denoised illumination image and the reflection image. For example, in one embodiment, the outdoor working robot can obtain the product of the pixel value of the denoised illumination image and the pixel value of the reflection image, and obtain the denoised composite image according to the product.
[0088] Specifically, if the image not contaminated by noise is regarded as a matrix, then this matrix has low rank, because there are many correlations in the image not contaminated by noise, which is manifested as correlations between the rows of the matrix. Therefore, the outdoor working robot can remove noise through low rank decomposition. The outdoor working robot can use robust principal component analysis for calculation. This method can use a noise matrix of any size and sufficiently sparse to restore the low rank matrix. The calculation of the low rank matrix can be expressed as a minimization problem, which can obtain the low rank matrix decomposition function as shown below: min rank(A)+λ||E||0, and satisfies R=A+E. Among them, A and E are the low rank components and sparse error matrix of the illumination image, that is, the above low rank matrix and the preset coefficient error matrix. Rank(.) is the rank of the matrix, λ is the regularization parameter, ||.||0 represents the l0 norm, and min represents the minimum value of the function.
[0089] The outdoor operation robot can express the above function as a convex optimization problem, which can be shown as follows: min||E|| + +λ||E||1, and satisfies R=A+E. Among them, ||*|| + represents the nuclear norm of the matrix, and ||*||1 is the norm of 1. The outdoor working robot can use the Lagrange multiplier method to solve the above low-rank matrix decomposition function to obtain the low-rank component A, which is a clear image. The clear image can be a composite image obtained by removing the noise of the illumination image and combining the denoised illumination image and the reflection image.
[0090] Through this embodiment, the outdoor working robot can perform denoising on the image through low-rank matrix decomposition, thereby achieving the effect of improving the image clarity of the target object.
[0091] In one embodiment, obtaining a high-frequency image and a low-frequency image in a denoised composite image includes: traversing the denoised composite image according to a local window of a preset size to obtain a plurality of local images; for each local image, obtaining an average pixel value corresponding to the local image, if the pixel average value is less than a preset pixel value threshold, determining that the local image is a low-frequency image, and if the pixel average value is greater than or equal to the preset pixel value threshold, determining that the local image is a high-frequency image.
[0092] In this embodiment, the outdoor working robot can extract the high-frequency image and the low-frequency image in the above-mentioned composite image, and then enhance the high-frequency image. The outdoor working robot can first identify the high-frequency image and the low-frequency image. For example, the outdoor working robot can set a local window of a preset size, and traverse the denoised composite image according to the local window of the preset size to obtain multiple local images. For each local image, the outdoor working robot can obtain the average pixel value corresponding to the local image, and compare the pixel average with the preset pixel value threshold. If the outdoor working robot detects that the pixel average is less than the preset pixel value threshold, the outdoor working robot determines that the local image is a low-frequency image. If the pixel average is greater than or equal to the preset pixel value threshold, the outdoor working robot determines that the local image is a high-frequency image.
[0093] After the outdoor working robot extracts each local high-frequency image and each local low-frequency image in the composite image, it can combine each local high-frequency image and each local low-frequency image to obtain an overall high-frequency image and a low-frequency image. Thus, the outdoor working robot can perform contrast enhancement processing on the high-frequency image. For example, in one embodiment, the outdoor working robot can obtain the product of the high-frequency image and the preset gain value, and obtain the enhanced high-frequency image according to the product.
[0094] Specifically, Figure 3 As shown, Figure 3 : is a flow diagram of an image enhancement step in an embodiment. The above-mentioned composite image can be an image of the I color channel in the HSI color space. After the outdoor working robot converts the original image of the RGB color space of the target object into the HSI color space, it can guide the filtering of the components of the I color space, determine the illumination image, and perform low-rank decomposition, and perform local contrast enhancement on the composite image obtained by the low-rank decomposition. And combine the images of the above-mentioned H component, S component and I component to form a processed image of the HSI color channel, and convert it to the RGB color space to obtain the above-mentioned target image.
[0095] Among them, the dynamic range of the above-mentioned synthetic image is compressed, the contrast of the image is low, and the image appears grayish white, so the outdoor working robot needs to increase the contrast of the image. And local contrast enhancement of the image can effectively expand the dynamic range. The outdoor working robot can use an adaptive contrast enhancement method to perform local contrast processing on the image. For example, the outdoor working robot can use an unsharp mask to divide the image into a high-frequency part and a low-frequency part, and enhance the high-frequency part representing the detail information. During enhancement, the outdoor working robot can multiply the high-frequency part with a specific gain value, amplify the high-frequency information, and finally obtain an enhanced image, that is, the above-mentioned enhanced high-frequency image. The high-frequency information of the image can be obtained by subtracting the low-frequency part from the original image, and the low-frequency information can be obtained by calculating the local mean of the pixel center.
[0096] Specifically, when calculating local contrast enhancement, the outdoor working robot can set the pixel value of the image to f(i,j), and the local area is centered at (i,j) and the window size is (2n+1)*(2n+1), that is, the local window mentioned above. The local average value, that is, the pixel average value of each local image mentioned above, can be expressed as The outdoor robot can also determine the variance in each local window
[0097] The function for enhancing the high-frequency image in each local window by the outdoor operation robot can be shown as follows: h(i,j)=M ij +[θ / (σ x (i,j))]|f(i,j)-M ij |. Among them, h(i,j) represents the pixel value in the enhanced high-frequency image. Based on multiple h(i,j), the outdoor working robot can obtain the above enhanced high-frequency image; θ is a constant, and the enhancement of the high-frequency part is adaptive and inversely proportional to the local standard deviation. In order to prevent pixel saturation, the outdoor working robot can let θ take the average value of the global pixel value and satisfy θ / (σ x (i,j))≤3.
[0098] Through this embodiment, the outdoor working robot can separate high-frequency image information and low-frequency image information based on the pixel mean, and enhance the high-frequency image, thereby improving the clarity of the image of the target object.
[0099] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0100] Based on the same inventive concept, the embodiment of the present application also provides an image acquisition device for an outdoor working robot for implementing the image acquisition method for an outdoor working robot involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiments of the image acquisition device for one or more outdoor working robots provided below can refer to the limitations of the image acquisition method for an outdoor working robot above, and will not be repeated here.
[0101] In one embodiment, Figure 4 As shown, an image acquisition device for an outdoor working robot is provided, comprising: a starting module 500, an acquisition module 502, a denoising module 504 and a processing module 506, wherein:
[0102] The start module 500 is used to obtain the light intensity at the location of the target object and start the corresponding light adjustment device according to the light intensity.
[0103] The acquisition module 502 is used to shoot the target object under the illumination intensity obtained after adjustment by the illumination adjustment device, and acquire the to-be-processed image corresponding to the target object.
[0104] The denoising module 504 is used to obtain an illumination image and a reflection image corresponding to the image to be processed, denoise the illumination image, and obtain a denoised composite image according to the denoised illumination image and reflection image.
[0105] The processing module 506 is used to obtain the high-frequency image and the low-frequency image in the denoised composite image, perform contrast enhancement processing on the high-frequency image, and obtain the target image of the target object according to the enhanced high-frequency image and the low-frequency image.
[0106] In one embodiment, the above-mentioned startup module 500 is specifically used to obtain a standard pure color image of a preset pure color plate under a preset light intensity, and obtain a first pixel mean of the standard pure color image; the preset light intensity represents the light intensity that makes the standard pure color image have the highest clarity; at the location of the target object, obtain a test pure color image corresponding to the preset pure color plate, and obtain a second pixel mean of the test pure color image; obtain the difference between the first pixel mean and the second pixel mean, and determine the light intensity at the location of the target object based on the difference and a preset difference threshold.
[0107] In one embodiment, the above-mentioned start module 500 is specifically used to determine to start the shading plate to reduce the light intensity at the target object's location if the first pixel mean is greater than the second pixel mean and the difference is greater than the preset difference threshold; if the second pixel mean is greater than the first pixel mean and the difference is greater than the preset difference threshold, determine to start the lighting to increase the light intensity at the target object's location.
[0108] In one embodiment, the acquisition module 502 is specifically used to shoot the target object under the light intensity obtained after adjustment by the light adjustment device, and obtain the original image of the target object in the RGB color space; convert the original image in the RGB color space into an image in the HSI color space, and obtain the image of the I color channel in the image in the HSI color space as the image to be processed.
[0109] In one embodiment, the denoising module 504 is specifically used to determine the filter function corresponding to the illumination image according to the preset guiding image, the filter window of the preset size, and the coefficient corresponding to the filter window; determine the preset cost function according to the preset guiding image, the filter window of the preset size, the coefficient corresponding to the filter window, the image to be processed in each filter window, and the preset regularization parameter; fit the filter function according to the least squares method and the cost function, and obtain the illumination image output by the filter function; obtain the reflection image according to the ratio of the pixel value of the image to be processed to the pixel value of the illumination image.
[0110] In one embodiment, the above-mentioned denoising module 504 is specifically used to generate a low-rank matrix decomposition function based on the low-rank matrix corresponding to the illumination image and a preset sparse error matrix; obtain the low-rank component corresponding to the low-rank matrix when the function value of the low-rank matrix decomposition function is minimum, and obtain the denoised illumination image based on the low-rank component.
[0111] In one embodiment, the denoising module 504 is specifically configured to obtain a denoised composite image according to the product of the pixel value of the denoised illumination image and the pixel value of the reflection image.
[0112] In one embodiment, the processing module 506 is specifically used to traverse the denoised composite image according to a local window of a preset size to obtain multiple local images; for each local image, obtain the average pixel value corresponding to the local image, if the pixel average value is less than a preset pixel value threshold, determine that the local image is a low-frequency image, if the pixel average value is greater than or equal to the preset pixel value threshold, determine that the local image is a high-frequency image.
[0113] In one embodiment, the processing module 506 is specifically configured to obtain an enhanced high-frequency image according to the product of the high-frequency image and a preset gain value.
[0114] In one embodiment, the processing module 506 is specifically used to fuse the enhanced high-frequency image and the low-frequency image to obtain a first fused image of the I color channel; obtain a first component image in the H color channel and a second component image in the S color channel corresponding to the image to be processed; fuse the first component image, the second component image and the first fused image to obtain a second fused image; convert the second fused image into an image in the RGB color space to obtain a target image of the target object.
[0115] Each module in the image acquisition device of the outdoor working robot can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0116] In one embodiment, a computer device is provided. The computer device may be an outdoor operation robot, and its internal structure diagram may be as follows: Figure 5As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external outdoor working robot in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, an image acquisition method for an outdoor working robot is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0117] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0118] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the above-mentioned image acquisition method for the outdoor working robot when executing the computer program.
[0119] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the image acquisition method of the outdoor working robot is implemented.
[0120] In one embodiment, a computer program product is provided, including a computer program, which implements the above-mentioned image acquisition method for the outdoor working robot when executed by a processor.
[0121] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0122] 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 computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0123] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0124] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. An image acquisition method for an outdoor working robot, characterized in that: Applied to an outdoor operation robot, the method comprises: Obtaining the light intensity at the location of the target object, and activating a corresponding light adjustment device according to the light intensity; The target object is photographed under the illumination intensity obtained after adjustment by the illumination adjustment device, and an image to be processed corresponding to the target object is obtained; the image to be processed is an image of the I color channel in the image of the HSI color space; Acquire an illumination image and a reflection image corresponding to the image to be processed, denoise the illumination image, and obtain a denoised composite image based on the denoised illumination image and the reflection image; denoising the illumination image, comprising: generating a low-rank matrix decomposition function based on a low-rank matrix corresponding to the illumination image and a preset sparse error matrix; obtain a low-rank component corresponding to the low-rank matrix when the function value of the low-rank matrix decomposition function is minimum, and obtain a denoised illumination image based on the low-rank component; A high-frequency image and a low-frequency image in the denoised composite image are obtained, and after contrast enhancement processing is performed on the high-frequency image, a target image of the target object is obtained according to the enhanced high-frequency image and the low-frequency image; the enhanced high-frequency image and the low-frequency image are both images of the I color channel in the HSI color space; the obtaining of the target image of the target object according to the enhanced high-frequency image and the low-frequency image includes: fusing the enhanced high-frequency image and the low-frequency image to obtain a first fused image of the I color channel; obtaining a first component image in the H color channel and a second component image in the S color channel corresponding to the image to be processed; fusing the first component image, the second component image and the first fused image to obtain a second fused image; converting the second fused image into an image in the RGB color space to obtain the target image of the target object.
2. The method according to claim 1, characterized in that The step of obtaining the light intensity at the location of the target object includes: Obtaining a standard pure color image of a preset pure color plate under a preset light intensity, and obtaining a first pixel mean value of the standard pure color image; the preset light intensity represents the light intensity that makes the standard pure color image have the highest clarity; At the location of the target object, obtaining a test pure color image corresponding to the preset pure color plate, and obtaining a second pixel mean value of the test pure color image; A difference between the first pixel mean and the second pixel mean is obtained, and the light intensity at the location of the target object is determined according to the difference and a preset difference threshold.
3. The method according to claim 2, characterized in that The starting of a corresponding illumination adjustment device according to the illumination intensity includes: If the first pixel mean is greater than the second pixel mean, and the difference is greater than the preset difference threshold, determining to activate the shading plate to reduce the light intensity at the location of the target object; If the second pixel mean is greater than the first pixel mean, and the difference is greater than the preset difference threshold, it is determined to start the lighting to increase the light intensity at the location of the target object.
4. The method according to claim 1, characterized in that: The step of photographing the target object under the illumination intensity obtained after adjustment by the illumination adjustment device to obtain an image to be processed corresponding to the target object includes: photographing the target object under the illumination intensity obtained after adjustment by the illumination adjustment device, to obtain an original image of the target object in an RGB color space; The original image in the RGB color space is converted into an image in the HSI color space, and an image of the I color channel in the image in the HSI color space is obtained as an image to be processed.
5. The method according to claim 1, characterized in that The step of acquiring the illumination image and the reflection image corresponding to the image to be processed includes: Determine a filter function corresponding to the illumination image according to a preset guide image, a filter window of a preset size, and a coefficient corresponding to the filter window; Determining a preset cost function according to a preset guide image, a filter window of a preset size, coefficients corresponding to the filter window, an image to be processed within each filter window, and a preset regularization parameter; Fitting the filter function according to the least squares method and the cost function, and acquiring an illumination image output by the filter function; A reflection image is obtained according to a ratio of a pixel value of the image to be processed to a pixel value of the illumination image.
6. The method according to claim 1, characterized in that The step of obtaining a denoised composite image based on the denoised illumination image and the reflection image comprises: A denoised composite image is obtained according to the product of the pixel value of the denoised illumination image and the pixel value of the reflection image.
7. The method according to claim 1, characterized in that The obtaining of the high-frequency image and the low-frequency image in the denoised composite image comprises: According to a local window of a preset size, traverse the denoised synthetic image to obtain a plurality of local images; For each local image, obtain a pixel average value corresponding to the local image, if the pixel average value is less than a preset pixel value threshold, determine that the local image is a low-frequency image, if the pixel average value is greater than or equal to the preset pixel value threshold, determine that the local image is a high-frequency image; The step of performing contrast enhancement processing on the high-frequency image comprises: An enhanced high-frequency image is obtained according to the product of the high-frequency image and a preset gain value.
8. An image acquisition device for an outdoor working robot, characterized in that: Applied to outdoor working robots, the device comprises: A start module, used to obtain the light intensity at the location of the target object, and start the corresponding light adjustment device according to the light intensity; an acquisition module, configured to photograph the target object under the illumination intensity obtained after adjustment by the illumination adjustment device, and acquire an image to be processed corresponding to the target object; the image to be processed is an image of the I color channel in the image of the HSI color space; A denoising module is used to obtain an illumination image and a reflection image corresponding to the image to be processed, and after denoising the illumination image, obtain a denoised composite image based on the denoised illumination image and the reflection image; specifically, it is used to generate a low-rank matrix decomposition function based on a low-rank matrix corresponding to the illumination image and a preset sparse error matrix; obtain a low-rank component corresponding to the low-rank matrix when the function value of the low-rank matrix decomposition function is minimum, and obtain a denoised illumination image based on the low-rank component; a processing module, for acquiring a high-frequency image and a low-frequency image in the denoised composite image, performing contrast enhancement processing on the high-frequency image, and obtaining a target image of the target object according to the enhanced high-frequency image and the low-frequency image; the enhanced high-frequency image and the low-frequency image are both images of the I color channel in the HSI color space; and specifically for: fusing the enhanced high-frequency image and the low-frequency image to obtain a first fused image of the I color channel; acquiring a first component image in the H color channel and a second component image in the S color channel corresponding to the image to be processed; fusing the first component image, the second component image and the first fused image to obtain a second fused image; and converting the second fused image into an image in the RGB color space to obtain the target image of the target object.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Image processing method, image processing device, computer readable storage medium and computer equipment
CN107454317A
Extremely dark image visual quality improving method, system and device and medium
CN110706180A
