Automatic parameter adjusting method and system for inspection robot camera
Through the automatic parameter adjustment method, the parameters of the patrol robot camera are detected and adjusted, and the problem of low image quality in complex environments is solved, achieving clearer and more accurate image capture.
Patent Information
- Application Number
- CN202411167536.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-11-19
AI Technical Summary
Patrol robot cameras are difficult to capture clear images in complex environments, especially in the face of reflection, glare, virtual focus and noise problems, resulting in low image quality, affecting the accuracy and reliability of data.
Using the automatic parameter adjustment method, the image defects, such as dummy focus, glare and noise are detected in real time through detection algorithms, and image processing and machine learning algorithms are used to calculate and adjust camera parameters, including exposure time, gain, focus and white balance, to realize the image optimization.
It improves the quality and clarity of the images captured by the inspection robot, enhances the color reduction and detailed performance of the images, and ensures the accuracy and reliability of image analysis.
Smart Images

Figure CN118984420A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of patrol robot cameras, and more particularly to an automatic parameter adjustment method and system for patrol robot cameras. Background Art
[0002] With the intelligent transformation of enterprise information room operation and maintenance models, inspection robots are increasingly becoming the backbone of routine inspection tasks, significantly reducing the heavy burden of manual inspections. However, in the face of the diversity and complexity of inspection scenes in computer rooms, more stringent requirements are placed on the performance and adaptability of inspection robots. In particular, when dealing with problems such as reflections, glare, and color interference caused by mesh cabinet doors, as well as reflections and occlusions caused by glass doors, traditional cameras often find it difficult to capture clear, high-quality images and video data.
[0003] However, in the field of inspection robot cameras, the positioning accuracy of inspection robots is inevitably affected by subtle environmental factors when performing repetitive tasks. In addition, slight differences in light changes and shooting angles may cause angle deviations between consecutive pictures, further affecting the accuracy and reliability of the data. Therefore, the current automatic parameter adjustment method is difficult to deal with out-of-focus, glare and noise problems in the image.
[0004] Therefore, in order to cope with the surge in inspection and operation and maintenance workload brought about by the rapid development of information technology, as well as the challenges posed by the complex environment of the computer room to the quality of image acquisition, it is particularly urgent and important to develop a control system that can intelligently and automatically adjust camera parameters. Summary of the invention
[0005] In order to help solve the out-of-focus, glare and noise problems of images taken by a patrol robot camera, the present application provides an automatic parameter adjustment method and system for a patrol robot camera.
[0006] In a first aspect, the present application provides an automatic parameter adjustment method for a patrol robot camera, which adopts the following technical solution: An automatic parameter adjustment method for a patrol robot camera, wherein the automatic parameter adjustment method comprises: Step S1: detecting the image captured by the camera through a detection algorithm, and determining whether the captured image has an inspection robot image defect; Step S2: if the captured image has the image defect of the inspection robot, then save the real-time inspection environment parameters and issue an error alarm instruction; if the captured image does not have the image defect of the inspection robot, then return to step S1; Step S3: Calculating optimization parameters of the inspection robot camera according to the detection data and the real-time inspection environment parameters; Step S4: adjusting the inspection robot camera parameters according to the inspection robot camera optimization parameters, and returning to step S1.
[0007] By adopting the above technical solution, this automatic parameter adjustment method detects the images captured by the inspection robot camera in real time, and uses image processing and machine learning algorithms to determine whether there are defects, such as blur, noise, color deviation, etc. According to the detection data and the real-time inspection environment parameters, the advanced optimization algorithm is used to automatically calculate and adjust the camera parameters to achieve the best imaging effect. This method improves the quality of the images captured by the inspection robot, enhances the clarity and color reproduction of the images, and facilitates subsequent image analysis and processing.
[0008] Preferably, in step S1, the inspection robot image defect includes a defocus defect, and the detection algorithm includes a frequency domain analysis detection algorithm, and the frequency domain analysis detection algorithm detects the defocus defect by the following steps: Performing Fourier transform on the captured image to obtain an image spectrum; Calculate the center point of the image spectrum; Calculate the radial average value of the image spectrum through the center point to obtain a spectrum curve; A Gaussian fitting curve of the frequency spectrum curve is calculated to obtain a peak value and a standard deviation of the Gaussian fitting curve. If the peak value is lower than a preset peak value threshold and the standard deviation is greater than a preset standard deviation threshold, it is considered that the captured image has the out-of-focus defect.
[0009] By adopting the above technical solution, the frequency domain analysis detection algorithm converts the image from the spatial domain to the frequency domain through Fourier transform to obtain the spectrum of the image. By calculating the radial mean value and Gaussian fitting curve of the spectrum curve, the frequency distribution and energy concentration of the image can be analyzed. If the peak value of the Gaussian fitting curve is lower than the preset peak threshold and the standard deviation is greater than the preset standard deviation threshold, it is considered that the image has a defocus defect. This method can accurately detect defocused images and provide an accurate basis for subsequent parameter adjustments.
[0010] Preferably, in step S1, the inspection robot image defect includes a defocus defect, and the detection algorithm includes a first edge detection algorithm, and the first edge detection algorithm detects the defocus defect by the following steps: Converting the captured image into a first grayscale image; Performing Gaussian filtering on the first grayscale image; Applying a Sobel operator to the first grayscale image, wherein the Sobel operator is used to detect first edge information of the first grayscale image; An average grayscale value of the first edge information is calculated, and if the average grayscale value is lower than a preset average grayscale threshold, it is considered that the captured image has the out-of-focus defect.
[0011] By adopting the above technical solution, the first edge detection algorithm reduces the complexity of the algorithm and improves the processing speed by converting the image into a grayscale image. Gaussian filtering is used to remove noise in the image and improve the accuracy of edge detection. The Sobel operator is an edge detection operator that can accurately detect edge information in an image. By calculating the average grayscale value and comparing it with its preset threshold, it can be determined whether the image has a defocus defect. This method has high detection accuracy and real-time performance.
[0012] Preferably, in step S1, the inspection robot image defect includes a glare defect, the detection algorithm includes a frequency domain histogram detection algorithm, and the histogram detection algorithm detects the glare defect by the following steps: Converting the captured image into a second grayscale image; Calculating a histogram of the second grayscale image; Determine a separation threshold according to the distribution of the histogram, wherein the separation threshold is used to divide the second grayscale image into a normal area and an overexposed area; The number of pixels in the overexposed area is counted, and if the number of pixels exceeds a preset ratio threshold, it is considered that the captured image has the glare defect.
[0013] By adopting the above technical solution, the frequency domain histogram detection algorithm calculates the histogram of the image to obtain the pixel distribution of the image. The separation threshold is determined according to the distribution of the histogram, and the image is divided into a normal area and an overexposed area. The number of pixels in the overexposed area is counted and compared with its preset ratio threshold to determine whether the image has glare defects. This method can effectively detect glare images and reduce the impact of glare on image quality.
[0014] Preferably, in step S1, the inspection robot image defect includes a glare defect, and the detection algorithm includes a second edge detection algorithm, and the second edge detection algorithm detects the glare defect by the following steps: Converting the captured image into a third grayscale image; Extracting second edge information in the third grayscale image by using the second edge detection algorithm; Performing binarization processing on the second edge information, wherein the binarization processing is used to convert the second edge information into black and white; The number of black pixels in the captured image is counted, and if the number of black pixels is less than a preset black pixel number threshold, it is considered that the captured image has the glare defect.
[0015] By adopting the above technical solution, the second edge detection algorithm extracts edge information from the image and performs binarization processing to convert the edge information into black and white, which is convenient for subsequent processing and analysis. By counting the number of black pixels in the captured image and comparing it with the preset number threshold, it can be determined whether the image has glare defects. This method is simple and efficient and is suitable for real-time image processing scenarios.
[0016] Preferably, step S3 comprises the following steps: Step SE1: using the application programming interface in the software development kit corresponding to the inspection robot camera to obtain the entropy value of the current captured image; Step SE2: when the entropy value is lower than the entropy value threshold, it is considered that the camera parameters do not need to be adjusted, and the process returns to step SE1; when the entropy value is higher than the entropy value threshold, it is considered that the camera parameters need to be adjusted; Step SE3: Call the operation function through the application programming interface to calculate the optimization parameters of the inspection robot camera, and return to the step SE1.
[0017] By adopting the above technical solution, by comparing the entropy value of the image with the preset entropy value threshold, it can be determined whether the current image quality meets the requirements. If the entropy value of the image is higher than the threshold, it means that the image quality is good and parameter adjustment may not be required; if the entropy value is lower than the threshold, it means that the image quality needs to be improved, and parameter optimization is performed at this time. This method avoids unnecessary parameter adjustments when the image quality is already very good, thereby improving the accuracy of parameter optimization.
[0018] Preferably, in step S4, the out-of-focus defect is solved by the following steps: Adjusting the exposure time and gain parameters of the inspection robot camera, wherein the gain parameters include analog gain parameters and digital gain parameters, wherein the analog gain parameters are used to amplify analog signals, and the digital gain parameters are used to amplify digital signals; Adjusting the focus parameters of the inspection robot camera until the focus of the captured image is consistent with the focus of the actual scene; Adjusting the white balance parameters of the inspection robot camera until the color of the captured image is consistent with the color of the actual scene; The image processing algorithm parameters of the inspection robot camera are adjusted, wherein the image processing algorithm parameters are used to improve the details and clarity of the captured image.
[0019] By adopting the above technical solution, when solving the out-of-focus defect, this method finely adjusts the exposure time and gain parameters of the inspection robot camera, so that the image maintains appropriate brightness while reducing noise and overexposure. By adjusting the focus parameters, the focus of the image is consistent with the focus of the actual scene, which improves the clarity of the image. At the same time, the white balance parameters are adjusted so that the color of the captured image is consistent with the color of the actual scene, which enhances the color reproduction of the image. Finally, by adjusting the image processing algorithm parameters, the details and clarity of the image are further improved.
[0020] Preferably, in step S4, the glare defect is solved by the following steps: Call the inspection robot camera parameter setting interface to set the exposure time, gain parameters, and white balance parameters; Calling the inspection robot camera image processing interface to set image enhancement parameters; The special function interface of the inspection robot camera is called to set the glare suppression parameters.
[0021] By adopting the above technical solution, when solving the glare defect, this method realizes the comprehensive adjustment of the camera parameters by calling the parameter setting interface, image processing interface and special function interface of the inspection robot camera. Setting the appropriate exposure time, gain parameter and white balance parameter can reduce the occurrence of glare. By setting the image enhancement parameter, the clarity and contrast of the image can be further improved. At the same time, by setting the glare suppression parameter, the influence of glare on the image can be effectively suppressed, and the imaging quality of the image can be improved.
[0022] Preferably, in step S3, the user inputs shooting requirement information and preference information, and the optimization parameters of the inspection robot camera are calculated according to the detection data, the real-time inspection environment parameters, the shooting requirement information and the preference information.
[0023] By adopting the above technical solution, this method allows users to input shooting demand information and preference information, so that the actual needs of users can be considered when calculating the optimization parameters of the inspection robot camera. By combining the detection data, the real-time inspection environment parameters and the user's shooting demand information and preference information, the camera optimization parameters suitable for the current scene can be calculated more accurately, further improving the image quality and user satisfaction.
[0024] In a second aspect, the present application provides an automatic parameter adjustment system for a patrol robot camera, which adopts the following technical solution: An automatic parameter adjustment system for a patrol robot camera, wherein the system comprises: The robot algorithm feedback module, parameter optimization module, control execution module and robot edge algorithm module are connected in a sequential closed loop. a user interaction module, the user interaction module being connected to the parameter optimization module and being used to input shooting requirement information and preference information into the parameter optimization module, In the robot algorithm feedback module, if the captured image has the inspection robot image defect, the instant inspection environment parameters are saved and an error alarm instruction is issued; if the captured image does not have the inspection robot image defect, the robot edge end algorithm module is returned; In the parameter optimization module, the optimization parameters of the inspection robot camera are calculated according to the detection data and the real-time inspection environment parameters; In the control execution module, the inspection robot camera parameters are adjusted according to the inspection robot camera optimization parameters, and the robot edge end algorithm module is returned; In the robot edge algorithm module, the image captured by the camera is detected by a detection algorithm, and it is determined whether the captured image has inspection robot image defects.
[0025] By adopting the above technical solutions, this automatic parameter adjustment system realizes automatic adjustment of the inspection robot camera parameters through the modules (robot algorithm feedback module, parameter optimization module, control execution module and robot edge algorithm module) connected in a sequential closed loop. At the same time, the introduction of the user interaction module enables users to input shooting requirements and preference information, further improving the flexibility and practicality of the system. The various modules work together through efficient data transmission and communication mechanisms to achieve real-time adjustment and optimization of camera parameters.
[0026] In addition, in this automatic parameter adjustment system, the robot edge algorithm module is responsible for real-time detection of the camera's captured images and determining whether there are defects. The robot algorithm feedback module is responsible for saving the real-time inspection environment parameters and issuing error alarm instructions when defects are detected. The parameter optimization module calculates the camera optimization parameters suitable for the current scene based on the detection data and the real-time inspection environment parameters. The control execution module is responsible for adjusting the actual parameters of the camera according to the optimized parameters to achieve improved image quality. Through the collaborative work and closed-loop connection of each module, the system can automatically optimize the camera parameters, improve image quality, and meet the actual needs of users. At the same time, the real-time performance and stability of the system are also effectively guaranteed.
[0027] To summarize, this application realizes real-time and automatic optimization and adjustment of the shooting parameters of the inspection robot camera by combining image processing, machine learning algorithms and automatic control technology, significantly improves the imaging quality of inspection images, enhances the accuracy and reliability of inspections, and brings positive impacts to the inspection work in related industries. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 A flowchart of an embodiment of an automatic parameter adjustment method for a patrol robot camera of the present application; Figure 2 A flowchart of an embodiment of a frequency domain analysis detection algorithm of the present application; Figure 3 A schematic diagram of a flow chart of an embodiment of a first edge detection algorithm of the present application; Figure 4 A schematic diagram of a flow chart of an embodiment of a frequency domain histogram detection algorithm of the present application; Figure 5 A schematic diagram of a flow chart of an embodiment of a second edge detection algorithm of the present application; Figure 6 A flowchart of an embodiment of a method for automatically adjusting camera parameters based on image entropy of the present application; and Figure 7 A schematic block diagram of an embodiment of an automatic parameter adjustment system for a patrol robot camera according to the present application.
[0029] Figure numerals: 1. User interaction module; 2. Algorithm feedback module; 3. Parameter optimization module; 4. Robot edge algorithm module; 5. Control execution module. DETAILED DESCRIPTION
[0030] With reference to the accompanying drawings and specific embodiments, the composition, characteristics and advantages of an automatic parameter adjustment method and system for a patrol robot camera according to the present application will be described below in an illustrative manner. However, all descriptions should not be used to form any limitations on the present application.
[0031] In addition, for any single technical feature described or implied in the embodiments mentioned in this document, or any single technical feature displayed or implied in the drawings, this application still allows for continued arbitrary combination or deletion between these technical features (or their equivalents) without any technical obstacles, and thus it should be considered that these more embodiments according to this application are also within the scope of the description of this document.
[0032] It should also be noted that the terms "disposed" and the like should be understood in a broad sense, for example, it can be fixedly connected, detachably connected, or integrated; it can be directly connected, or indirectly connected through an intermediate medium. Unless otherwise clearly defined, those skilled in the art can understand the specific meanings of the above terms in this application according to specific circumstances.
[0033] Figure 1 The following is a flow chart of an embodiment of an automatic parameter adjustment method for a patrol robot camera of the present application. Figure 1 It can be seen that the automatic parameter adjustment method can include four steps, and each step is described in detail below.
[0034] Step S1: Detect the image captured by the camera through a detection algorithm, and determine whether there are inspection robot image defects in the captured image.
[0035] Step S2: If the captured image has inspection robot image defects, save the real-time inspection environment parameters and issue an error alarm instruction; if the captured image does not have inspection robot image defects, return to step S1. The real-time inspection environment parameters may include light intensity and color distribution.
[0036] Step S3: Calculate the inspection robot camera optimization parameters based on the detection data and real-time inspection environment parameters. It should be noted that the inspection robot camera optimization parameters are of the same type as the inspection robot camera parameters, which are simply optimized values calculated through a specific algorithm. In addition, in step S3, the user can input shooting requirement information and preference information, and calculate the inspection robot camera optimization parameters based on the detection data, real-time inspection environment parameters, shooting requirement information and preference information, thereby improving the user experience.
[0037] Step S4: Adjust the inspection robot camera parameters according to the inspection robot camera optimization parameters, and return to step S1. It should be noted that the inspection robot camera parameters may include brightness, contrast, chromaticity, exposure time, gain parameters and white balance parameters.
[0038] In step S1, the image defects of the inspection robot may include out-of-focus defects, glare defects and noise defects. Next, how to solve the out-of-focus defects is described in detail.
[0039] In this embodiment, the detection algorithm may include a frequency domain analysis detection algorithm. Figure 2 A flowchart of an embodiment of the frequency domain analysis detection algorithm of the present application is shown in FIG. Figure 2 In the illustrated embodiment, the frequency domain analysis detection algorithm can detect out-of-focus defects by the following steps: Step SA1: Perform Fourier transform on the captured image to obtain the image spectrum. In step SA1, Fourier transform is a mathematical tool that converts a signal from the time domain (or spatial domain) to the frequency domain. In image processing, the two-dimensional Fourier transform converts the image from the spatial domain to the frequency domain to analyze the frequency components of the image. Information such as edges and textures in the image is expressed as high-frequency components in the frequency domain, while smooth areas are expressed as low-frequency components.
[0040] Through Fourier transform, we can decompose the image into components of different frequencies and analyze the frequency characteristics of the image. This is very useful for detecting the blurriness of the image, because the high-frequency components of the blurred image will be weakened.
[0041] Step SA2: Calculate the center point of the image spectrum. In step SA2, the center point of the spectrum is calculated to move the low-frequency components of the spectrum to the center, which is helpful for subsequent analysis. Then, by calculating the radial average value from the center point to the edge of the spectrum, we can get a one-dimensional curve representing the spectrum energy distribution. This curve reflects the intensity of different frequency components in the image. The shape and characteristics of the spectrum curve can reflect the clarity and blur of the image. If the image is blurred, the high-frequency components will be reduced, resulting in a decrease in the value of the spectrum curve in the high-frequency area.
[0042] Step SA3: Calculate the radial average of the image spectrum through the center point to obtain the spectrum curve. In step SA3, Gaussian fitting is a method of approximating data points using a Gaussian function (also known as a normal distribution function). Here, we use the Gaussian function to fit the spectrum curve to obtain the center position (peak) and width (standard deviation) of the curve. The peak of the Gaussian fitting curve reflects the main frequency component of the image, while the standard deviation reflects the degree of dispersion of the spectrum energy. If the image is blurred, the high-frequency component of the spectrum is reduced, resulting in a lower peak value and an increased standard deviation of the fitting curve. These two parameters can be used as a basis for judging whether the image is blurred.
[0043] Step SA4: Calculate the Gaussian fitting curve of the spectrum curve to obtain the peak value and standard deviation of the Gaussian fitting curve. If the peak value is lower than the preset peak value threshold and the standard deviation is greater than the preset standard deviation threshold, it is considered that the captured image has a defocus defect. In step SA4, according to the peak value and standard deviation of the Gaussian fitting curve obtained in the previous step, we can set two thresholds: one for the peak value and the other for the standard deviation. These two thresholds are determined based on the spectral characteristics of the clear image and the blurred image. By comparing the fitting curve parameters of the actual image with the preset threshold, we can quickly determine whether the image has a defocus defect. If the peak value of the fitting curve is lower than the peak value threshold and the standard deviation is greater than the standard deviation threshold, it can be considered that the image is blurred and has a defocus problem. This method is fast and accurate and is suitable for use in real-time image processing systems.
[0044] In another embodiment, the detection algorithm may include a first edge detection algorithm, Figure 3 A schematic diagram of a flow chart of an embodiment of the first edge detection algorithm of the present application is shown in FIG. Figure 3 In the illustrated embodiment, the first edge detection algorithm can detect out-of-focus defects by following the steps below: Step SB1: Convert the captured image into a first grayscale image. In step SB1, in image processing, a color image usually contains information of three color channels: red, green, and blue, while a grayscale image removes the color information and only retains the brightness information of the image. The conversion process usually combines the three color channels of the color image into one grayscale channel through a certain weighted average method. Converting a color image to a grayscale image can simplify the subsequent processing process because the grayscale image only contains brightness information and does not involve color information, which helps to reduce the amount of calculation and increase the processing speed. At the same time, for algorithms such as edge detection, grayscale images are sufficient to extract edge features of the image.
[0045] Step SB2: Gaussian filtering is performed on the first grayscale image. In step SB2, Gaussian filtering is a linear smoothing filter suitable for eliminating image noise, especially noise that obeys a normal distribution. It achieves a smoothing effect by weighted averaging the pixel values of each pixel in the image and its neighborhood, where the distribution of weights conforms to the shape of a Gaussian function (normal distribution function). Gaussian filtering can effectively suppress image noise and make the image smoother. This is a very important preprocessing step for algorithms such as edge detection, because noise may interfere with the accurate detection of edges. Through Gaussian filtering, the impact of noise on edge detection results can be reduced, and the accuracy and stability of edge detection can be improved.
[0046] Step SB3: Apply the Sobel operator to the first grayscale image. The Sobel operator is used to detect the first edge information of the first grayscale image. In step SB3, the Sobel operator is a discrete differential operator for edge detection, which combines Gaussian smoothing and differential derivation. The Sobel operator works by calculating the approximate value of the gradient of the image brightness function. It is actually a first-order derivative operator used to detect the edge of the image. There are two operators, one for detecting horizontal edges and one for detecting vertical edges. Applying the Sobel operator can highlight the edge information in the image, making the edge part more obvious in the image. This is very useful for subsequent image analysis and processing, because edges are one of the most important features in an image, and they contain the shape and contour information of objects in the image.
[0047] Step SB4: Calculate the average grayscale value of the first edge information. If the average grayscale value is lower than the preset average grayscale threshold, it is considered that the captured image has a defocus defect. In step SB4, the defocus defect is usually manifested as blurring of the edge of the image, which will cause the grayscale value of the edge information to decrease. By calculating the average grayscale value of the edge information and comparing it with the preset threshold, it can be determined whether the image has a defocus defect. If the average grayscale value is lower than the preset threshold, it means that the grayscale value of the edge of the image is generally low, which is most likely due to edge blurring caused by defocus. Therefore, this method can quickly and accurately determine whether the image has a defocus defect, thereby providing important feedback information for subsequent image processing.
[0048] Next, how to solve the glare defect is explained in detail.
[0049] In this embodiment, the detection algorithm may include a frequency domain histogram detection algorithm. Figure 4 A flow chart of an embodiment of the frequency domain histogram detection algorithm of the present application is shown in FIG. Figure 4 In the illustrated embodiment, the frequency domain histogram detection algorithm can detect glare defects by the following steps: Step SC1: Convert the captured image into a second grayscale image. In step SC1, the color image is converted into a grayscale image to simplify the image analysis process, because the grayscale image only contains brightness information but not color information. This is usually achieved by weighting the red, green, and blue channels of the color image in a certain proportion, and the weighted proportion is usually based on the sensitivity of the human eye to different colors. The converted grayscale image retains the brightness characteristics of the original image, but removes the interference of color information, so that subsequent processing is more focused on the brightness changes of the image, which is particularly important for brightness-based image analysis (such as histogram analysis).
[0050] Step SC2: Calculate the histogram of the second grayscale image. In step SC2, the histogram of the image is a statistical chart that represents the frequency of occurrence of each pixel value in the image. For grayscale images, the horizontal axis of the histogram represents different grayscale levels (usually 0 to 255), and the vertical axis represents the number of pixels that appear at each grayscale level. The histogram provides an overview of the image brightness distribution, which can intuitively show the brightness range, contrast, and whether there are overexposed or underexposed areas of the image. For glare detection, the overexposed area will appear as a peak on the histogram where the grayscale level is close to or reaches the maximum value.
[0051] Step SC3: Determine a separation threshold based on the distribution of the histogram, and the separation threshold is used to divide the second grayscale image into a normal area and an overexposed area. In step SC3, by analyzing the distribution of the histogram, a suitable threshold can be found to distinguish between the normal exposure area and the overexposed area. This threshold is usually determined based on the shape of the histogram and the brightness characteristics of the image. The separation threshold allows the algorithm to divide the image into two areas: one is a normal exposure area with moderate brightness and rich information, and the other is an overexposed area with too high brightness that may contain glare or loss of details. This is crucial for subsequent glare detection and suppression.
[0052] Step SC4: Count the number of pixels in the overexposed area. If the number of pixels exceeds the preset ratio threshold, it is considered that the captured image has a glare defect. In step SC4, by counting the number of pixels in the overexposed area and comparing it with the preset ratio threshold, it can be determined whether the image is affected by glare. The preset ratio threshold is an empirical value based on the analysis of a large number of image samples, which is used to balance the sensitivity and false alarm rate of glare detection. If the number of pixels in the overexposed area exceeds the preset ratio threshold, it can be considered that there is an obvious glare defect in the image. This detection method based on pixel counting is simple and intuitive, and can effectively identify image areas affected by glare, providing necessary input information for subsequent image processing (such as glare suppression).
[0053] In another embodiment, the detection algorithm may include a second edge detection algorithm. Figure 5 A schematic diagram of a flow chart of an embodiment of the second edge detection algorithm of the present application is shown in FIG. Figure 5 In the illustrated embodiment, the second edge detection algorithm can detect out-of-focus defects by following the steps below: Step SD1: Convert the captured image into a third grayscale image. In step SD1, the purpose of this step is to convert the color image into a grayscale image. This is because edge detection algorithms are usually not sensitive to color information, but rely more on the brightness changes of the image to identify the edge. Therefore, converting the image into a grayscale image can simplify the processing process while retaining enough information for edge detection. The converted grayscale image removes color interference, allowing the edge detection algorithm to more accurately identify the brightness changes in the image, thereby detecting edge information.
[0054] Step SD2: Extract the second edge information in the third grayscale image by a second edge detection algorithm. In step SD2, edge detection algorithms (such as Canny, Sobel, etc.) identify edges by analyzing local changes in pixel values in the image. These algorithms usually involve multiple steps, including filtering (such as Gaussian filtering) to reduce noise, gradient calculation to identify areas with significant brightness changes, non-maximum suppression to refine edge locations, and double threshold processing to connect edge segments. Through the edge detection algorithm, the edges in the image are highlighted, and these edges are important features of the shape and contour of the object in the image. The extraction of edge information provides key data for the subsequent analysis of glare defects.
[0055] Step SD3: Binarization is performed on the second edge information. Binarization is used to convert the second edge information into black and white. In step SD3, binarization is a simple image processing method that sets the grayscale value of each pixel in the image to 0 or 255, that is, black or white, usually based on a threshold. If the grayscale value of the pixel is greater than or equal to the threshold, it is set to white; otherwise, it is set to black. Applying binarization after edge detection can further highlight the edge information and remove interference from non-edge areas. The binarized image contains only black and white colors, and the edge information is more obvious. This processing helps to simplify the subsequent analysis process while improving the accuracy of glare defect detection.
[0056] Step SD4: Count the number of black pixels in the captured image. If the number of black pixels is less than the preset black pixel number threshold, it is considered that the captured image has a glare defect. In step SD4, in the presence of glare, the glare area usually causes the edge detection algorithm to detect less edge information in the area (because the brightness of the glare area is too high and the edge information is masked). Therefore, by counting the number of black pixels in the binary image (representing edge information) and comparing it with the preset threshold, it can be indirectly determined whether the image has a glare defect. If the number of black pixels is lower than the preset threshold, it means that there is less edge information in the image, which may be caused by glare. This statistical-based detection method can quickly and effectively identify images with glare defects and provide guidance for subsequent processing.
[0057] To summarize, the present application can detect out-of-focus defects through the frequency domain analysis detection algorithm and the first edge detection algorithm, and detect glare defects through the frequency domain histogram detection algorithm and the second edge detection algorithm. The above two defects will be processed next.
[0058] Figure 6 FIG. 1 is a flow chart of an embodiment of a method for automatically adjusting camera parameters based on image entropy of the present application, from Figure 6 It can be seen that the method may include the following steps: Step SE1: Use the application programming interface (API) in the software development kit (SDK) corresponding to the inspection robot camera to obtain the entropy value of the current captured image. Step SE1 is used to obtain the entropy value of the captured image. In step SE1, image entropy is a statistic that measures the amount of information in the image, which reflects the complexity of the distribution of pixel grayscale values in the image. By calculating the probability of each grayscale level appearing in the image and calculating the entropy value based on these probabilities, a quantitative indicator can be obtained to evaluate the amount of information or complexity of the image. In the SDK, API functions for obtaining image information or calculating image entropy are usually provided. Obtaining the image entropy value is the basis for automatically adjusting camera parameters. By calculating the entropy value, the system can preliminarily evaluate the quality level of the current image. The level of entropy directly reflects the richness of information in the image, and provides a basis for whether the camera parameters need to be adjusted later.
[0059] Step SE2: When the entropy value is lower than the entropy value threshold, it is considered that the camera parameters do not need to be adjusted, and return to step SE1. When the entropy value is higher than the entropy value threshold, it is considered that the camera parameters need to be adjusted. Step SE2 is used to determine whether the entropy value reaches the entropy value threshold. In step SE2, an entropy value threshold is preset, and the threshold is set according to the actual application scenario and image quality requirements. Compare the image entropy value calculated in step one with the preset threshold to determine whether the current image quality meets the requirements. By determining whether the entropy value reaches the threshold, the system can decide whether it is necessary to adjust the camera parameters. If the entropy value is lower than the threshold, it means that the image quality is good and no adjustment is required; if the entropy value is higher than the threshold, it means that the image quality needs to be improved and it is necessary to enter the next parameter adjustment process.
[0060] Step SE3: Call the operation function through the application programming interface to calculate the optimization parameters of the inspection robot camera, and return to step SE1. Step SE3 is used to adjust the camera parameters. In step SE3, when the image entropy value is higher than the preset threshold, the system will use the algorithm model to calculate the parameter values that need to be adjusted according to the physical characteristics of the camera and the imaging quality requirements. These parameters may include exposure time, gain, white balance, etc. By calling the API function in the SDK, the system can automatically adjust these parameters to improve image quality. Adjusting camera parameters is a key step to improve image quality. By reasonably adjusting the parameter values, the system can enable the camera to capture better quality images under different lighting and environmental conditions. This not only helps the accuracy of subsequent image processing and analysis, but also improves the work efficiency and intelligence level of the inspection robot. At the same time, automatic adjustment of parameters reduces the need for manual intervention and reduces maintenance costs.
[0061] Publish here Figure 6 The API called by the illustrated embodiment is: ① MV_CAMCTRL_API int __stdcall MV_CC_GetExposureTime(IN void*handle, IN OUT MVCC_FLOATVALUE* pstValue); / / Get exposure time ② MV_CAMCTRL_API int __stdcall MV_CC_GetGain(IN void* handle, IN OUTMVCC_FLOATVALUE* pstValue); / / Get gain ③ MV_CAMCTRL_API int __stdcall MV_CC_GetBalanceWhiteAuto(IN void*handle, IN OUT MVCC_ENUMVALUE* pstValue); / / Get automatic white balance ④int MV_CC_GetImageInfoEx( IN void* handle, IN OUT MVCC_INTVALUE* pstValue ); / / Function to get image information At the same time, the API for adaptive parameter adjustment is given as follows: ① MV_CAMCTRL_API int __stdcall MV_CC_OpenDevice(IN void* handle, INunsigned int nAccessMode = MV_ACCESS_Exclusive, IN unsigned shortnSwitchoverKey =0); / / Open the device ②MV_CAMCTRL_API int __stdcall MV_CC_CloseDevice(IN void* handle); / / Close the device ③MV_CAMCTRL_API int __stdcall MV_CC_GetOneFrameTimeout(IN void*handle, IN OUT unsigned char * pData , IN unsigned int nDataSize, IN OUT MV_FRAME_OUT_INFO_EX* pFrameInfo, unsigned int nMsec); / / Use the timeout mechanism to get a frame of image ④MV_CAMCTRL_API int __stdcall MV_CC_DisplayOneFrame(IN void* handle,IN MV_DISPLAY_FRAME_INFO* pDisplayInfo); / / Display one frame of image ⑤MV_CAMCTRL_API int __stdcall MV_CC_GetDeviceInfo(IN void * handle,IN OUT MV_CC_DEVICE_INFO* pstDevInfo); / / Get device information ⑥MV_CAMCTRL_API int __stdcall MV_CC_GetIntValue(IN void* handle, INconst char* strKey, OUT MVCC_INTVALUE *pIntValue); / / Get the Integer attribute value ⑦MV_CAMCTRL_API int __stdcall MV_CC_GetEnumValue(IN void* handle,INconst char* strKey,OUT MVCC_ENUMVALUE *pEnumValue); / / Set the Enum attribute value ⑧MV_CAMCTRL_API int __stdcall MV_CC_GetAOIoffsetX(IN void* handle,IN OUT MVCC_INTVALUE* pstValue); / / Set image X offset ⑨MV_CAMCTRL_API int __stdcall MV_CC_GetAOIoffsetY(IN void* handle,IN OUT MVCC_INTVALUE* pstValue); / / Set image Y offset ⑩MV_CAMCTRL_API int __stdcall MV_CC_GetExposureTime(IN void* handle,IN OUT MVCC_FLOATVALUE* pstValue); / / Get the exposure time ①①MV_CAMCTRL_API int __stdcall MV_CC_GetGain(IN void* handle, IN OUT MVCC_FLOATVALUE* pstValue); / / Get gain ①② MV_CAMCTRL_API int __stdcall MV_CC_GetBalanceWhiteAuto(IN void*handle, IN OUT MVCC_ENUMVALUE* pstValue); / / Get automatic white balance In addition, in step S3, other algorithms may be considered to process the captured image, such as an automatic parameter adjustment algorithm based on the BSCPT algorithm.
[0062] First, the BSCPT algorithm divides the captured image into multiple blocks of uniform size. Each image block is processed independently to reduce computational complexity and increase flexibility in parameter adjustment. Subsequently, the algorithm performs quality assessment on these image blocks, usually based on image quality assessment (IQA) metrics such as structural similarity (SSIM), peak signal-to-noise ratio (PSNR), or their variants. After the assessment is completed, the algorithm sorts the image blocks according to the quality score, giving priority to blocks with poor quality because these blocks have a greater negative impact on the overall image quality.
[0063] Then, using the theory of compressed sensing, the algorithm performs a sparse representation of the sorted image blocks and extracts key features. This step not only helps reduce data redundancy, but also highlights the parameters that have a significant impact on image quality. Based on these features, the algorithm preliminarily selects several camera parameters (such as exposure time, gain, white balance, etc.) with the greatest potential for improving image quality, narrowing the scope for subsequent fine-tuning.
[0064] In order to further accurately adjust the parameters, the BSCPT algorithm uses a binary search strategy to quickly iterate within the initially selected parameter range. In each iteration, the algorithm generates an image based on the current parameter settings and re-evaluates the image quality. By comparing the changes in image quality under different parameter settings, the algorithm gradually narrows the parameter search range until a parameter combination close to the optimal solution is found.
[0065] In order to accelerate the convergence process, the algorithm also integrates cross-parameter threshold technology. This technology allows the algorithm to consider the impact of other related parameters when adjusting a certain parameter, and avoids local optimal solutions and improves global search efficiency by dynamically adjusting the threshold relationship between parameters.
[0066] When the algorithm finds the optimal parameter combination under the current conditions through binary search, BSCPT does not stop immediately. Instead, it enters a feedback loop to continuously monitor image quality and dynamically adjust parameters according to new environmental conditions (such as lighting changes, target movement, etc.). This continuous optimization mechanism ensures that the camera can capture high-quality images in different scenarios.
[0067] In actual applications, the BSCPT algorithm implements parameter adjustment by calling the API interface provided by the camera SDK. For example, the exposure time and gain are set using functions such as MV_CC_SetExposureTime and MV_CC_SetGain. The algorithm also uses functions such as MV_CC_GetImageInfoEx to obtain image information for quality assessment and parameter optimization. By encapsulating these API calls, the BSCPT algorithm can be seamlessly integrated into the existing camera control system to achieve automated and intelligent parameter adjustment.
[0068] In addition, this application can also optimize the captured images through the following algorithms: To improve the adaptability of the camera in different scenarios, we designed an automatic parameter adjustment algorithm based on neural networks. The algorithm consists of three carefully designed neural networks, which focus on controlling focal length, aperture and exposure time respectively, to ensure that the camera can quickly respond to environmental changes and automatically adjust to the best shooting state. Through training with image data from a large amount of diverse scenes, these neural networks have learned how to identify scene features and predict the optimal camera parameter settings based on them. In addition, the system also integrates an efficient scene classifier, which can instantly analyze the current scene and guide the corresponding neural network module to adjust parameters to ensure that the image quality is always maintained at a high level.
[0069] In addition, in order to achieve more accurate exposure control, we have introduced an advanced automatic exposure algorithm. The algorithm is based on the average brightness method, combined with the weighted mean method and brightness histogram technology, to dynamically monitor and adjust exposure parameters to ensure that the image brightness is moderate and the details are rich. By continuously iteratively calculating the brightness statistics of the current image, the algorithm can quickly respond to light changes and automatically adjust the exposure time, aperture and gain to achieve the preset target brightness. This process is not only efficient and stable, but also effectively avoids image quality problems caused by improper exposure, further improving the efficiency and accuracy of inspection work.
[0070] Adaptive parameter tuning target When setting the adaptive parameter adjustment targets, we took into account the actual needs of image quality and inspection tasks. The optimization goal is not only to capture high-quality images with high clarity, rich details, less noise, less glare, and less out-of-focus, but also to ensure that these images can play the greatest role in subsequent image processing and analysis. Therefore, we are committed to improving the robustness and accuracy of the algorithm in different environments by fine-tuning the camera parameters, so that the inspection robot can work stably in complex and changing scenes, and accurately identify and report abnormal situations. At the same time, we also focus on optimizing the generalization ability of the algorithm to ensure that it can still perform well when facing unknown or rare scenes. Through this series of adaptive parameter adjustment measures, we aim to comprehensively improve the intelligence level and overall efficiency of inspection work.
[0071] As can be seen from the above, step S4 will adjust the inspection robot camera parameters according to the inspection robot camera optimization parameters. In step S4, a method for solving the out-of-focus defect is first proposed, including the following steps: Step SF1: Adjust the exposure time and gain parameters of the inspection robot camera. The gain parameters include analog gain parameters and digital gain parameters. The analog gain parameters are used to amplify analog signals, and the digital gain parameters are used to amplify digital signals. In step SF1, the exposure time refers to the length of time the camera shutter is open, which determines the total amount of light captured by the camera. The gain parameter is used to amplify the camera signal to increase the brightness of the image. Gain is usually divided into analog gain and digital gain. Analog gain amplifies the signal before it is converted to a digital signal, while digital gain is processed after the signal is converted to a digital signal. By adjusting the exposure time and gain parameters, the brightness and contrast of the image can be effectively controlled. If the image is too dark, the exposure time can be extended or the gain can be increased; if the image is too bright or there is noise, the exposure time can be shortened or the gain can be reduced. This can make the image reach a suitable level in brightness and reduce the possibility of out-of-focus.
[0072] Step SF2: Adjust the focus parameters of the inspection robot camera until the focus of the captured image is consistent with the focus of the actual scene. In step SF2, the focus parameters determine the focal position of the camera lens, which affects the clarity of the image. By adjusting the focus parameters, the focus of the lens can be accurately placed on the object being photographed, thereby obtaining a clear image. Adjusting the focus parameters is a direct way to solve the out-of-focus problem. When the camera's automatic focus is inaccurate, manually adjusting the focus parameters can ensure that the subject in the image is clearly visible and avoid blurring caused by focus offset.
[0073] Step SF3: Adjust the white balance parameters of the inspection robot camera until the color of the captured image is consistent with the color of the actual scene. In step SF3, white balance is an important parameter of the camera, which is used to adjust the color balance of the image to eliminate the influence of different light sources on the image color. By adjusting the white balance parameters, the image can present natural colors under different light sources. Adjusting the white balance parameters can ensure accurate color reproduction of the image and avoid color deviation caused by changes in light sources. This is very important for ensuring image quality and reducing out-of-focus phenomena (especially visual blur caused by color deviation).
[0074] Step SF4: Adjust the image processing algorithm parameters of the inspection robot camera. The image processing algorithm parameters are used to improve the details and clarity of the captured image. In step SF4, modern cameras usually have a variety of built-in image processing algorithms, such as sharpening, denoising, color correction, etc. These algorithms can optimize image quality by adjusting parameters. By adjusting these algorithm parameters, the image details can be improved, noise can be reduced, and color saturation can be increased. Adjusting the image processing algorithm parameters can further improve the image quality and make the image clearer and more delicate. This is of great significance for solving the out-of-focus problem and improving the overall visual effect of the image. Through reasonable algorithm parameter settings, the image can be optimized in terms of brightness, contrast, clarity, etc.
[0075] Then a method for solving the glare defect is proposed, including the following steps: Step SG1: Call the inspection robot camera parameter setting interface to set the exposure time, gain parameter, and white balance parameter. In step SG1, most modern cameras, especially industrial-grade cameras, provide programmable interfaces (such as SDK) to allow users to control various parameters of the camera through software. These parameters include exposure time, gain, and white balance, which directly affect the way the camera captures and presents images. The exposure time determines the length of time the camera's photosensitive element receives light, the gain is used to enhance the signal strength to increase the brightness of the image, and the white balance is used to adjust the color of the image to match the color temperature of the actual light source. By calling the camera parameter setting interface and adjusting these key parameters, the image quality can be significantly improved. For example, adjusting the exposure time can avoid overexposure or underexposure of the image, adjusting the gain can increase the brightness while maintaining the image details, and adjusting the white balance can ensure the true restoration of the image color. These adjustments help reduce glare and make the image clearer and more natural.
[0076] Step SG2: Call the inspection robot camera image processing interface and set the image enhancement parameters. In step SG2, image processing functions such as sharpening, denoising, contrast enhancement, etc. are also provided. These functions post-process the image through software algorithms to improve the image quality. The image processing interface allows the user to adjust these enhancement parameters as needed to achieve the best visual effect. Setting the image enhancement parameters can further improve the details and clarity of the image. For example, sharpening can enhance the edges of the image and make the outline of the object clearer; denoising can reduce random noise in the image and improve the smoothness of the image; contrast enhancement can make the light and dark contrast of the image more obvious and highlight the important information in the image. These processes are very helpful in reducing glare and improving image readability.
[0077] Step SG3: Call the special function interface of the inspection robot camera and set the glare suppression parameters. In step SG3, special glare suppression functions are also provided, such as automatic exposure lock (AE Lock), backlight compensation (Backlight Compensation) and high dynamic range imaging (HDR). These special functions use complex algorithms and image processing technologies to reduce or eliminate glare caused by strong light or reflection. By calling the special function interface of the camera and setting the corresponding glare suppression parameters, the impact of glare on image quality can be effectively controlled. Setting the glare suppression parameters can significantly reduce the glare phenomenon in the image, making the image clearer and more natural. For example, the backlight compensation function can balance the bright and dark areas in the image to avoid overexposure of the bright area and overdarkness of the dark area; the HDR function can capture a wider brightness range by merging multiple images with different exposures, thereby reducing the glare phenomenon caused by light differences. The application of these special functions can greatly improve the performance of the camera in complex lighting environments.
[0078] It should be noted here that inspection robot image defects can also include noise problems. Noise problems are the phenomenon of random noise appearing in digital images or videos due to environmental factors such as light and temperature when the camera captures the image. These noises will reduce image quality and affect the accuracy of subsequent image processing and analysis.
[0079] Insufficient light in the working area of the inspection robot: In a dim environment, the camera will increase the gain in order to obtain sufficient exposure, thereby introducing more electronic noise. In addition, high temperature will increase the dark current of the camera, thereby generating additional noise.
[0080] In order to solve the noise problem, the method for solving the noise problem proposed in this application may include the following aspects: 1. Adjust exposure time and gain: Properly balancing exposure time and gain can reduce noise caused by over-amplifying the signal. Increasing exposure time can increase image brightness, but too long will cause motion blur; increasing gain can also increase brightness, but it will also increase noise.
[0081] Specific operation: Adjust the exposure time and gain parameters through the camera SDK to find the best balance point.
[0082] 2. Adjust the black level: Black level refers to the signal level output by the camera when there is no light. If the black level is not set correctly, it will cause the image to be dark or bright overall and increase the visibility of noise.
[0083] Specific operation: Adjust the black level setting through the camera SDK to ensure that the image has rich details and less noise in the dark area.
[0084] 3. Apply noise reduction algorithm: The denoising algorithm uses mathematical methods to remove random noise from the image while preserving image details as much as possible. Common denoising algorithms include mean filtering, median filtering, Gaussian filtering, and bilateral filtering.
[0085] Specific operation: Use the noise reduction function in the camera SDK or image processing software to post-process the image and reduce noise.
[0086] Improve the shooting environment.
[0087] Regarding the noise problem, this application also proposes some noise detection algorithms: Mean filtering algorithm: The noise level is evaluated by comparing the original image with the image after mean filtering.
[0088] Median filter algorithm: Similar to mean filter, but median filter has better suppression effect on salt and pepper noise.
[0089] Wavelet transform algorithm: The image signal is decomposed using wavelet transform, and the noise level is evaluated by calculating the variance of the wavelet coefficients.
[0090] Fourier transform algorithm: Converts the image to the frequency domain and analyzes the high-frequency components to assess the noise level.
[0091] Local variance algorithm: Calculate the variance of the pixels around each pixel in the image and evaluate the noise level of the pixel by the size of the variance.
[0092] Figure 7 This is a schematic block diagram of an embodiment of an automatic parameter adjustment system for a patrol robot camera of the present application. Figure 7 It can be seen that the automatic parameter adjustment system can include a robot algorithm feedback module 2, a parameter optimization module 3, a control execution module 5 and a robot edge algorithm module 4 connected in a sequential closed loop. In addition, it can also include a user interaction module 1, and the user interaction module 1 is connected to the parameter optimization module 3 to input shooting requirement information and preference information into the parameter optimization module 3.
[0093] In the robot edge algorithm module 4, the image captured by the camera is detected by a detection algorithm, and it is determined whether the captured image has inspection robot image defects; in the robot algorithm feedback module 2, if the captured image has inspection robot image defects, the real-time inspection environment parameters are saved and an error alarm instruction is issued; if the captured image does not have inspection robot image defects, the robot edge algorithm module 4 is returned; in the parameter optimization module 3, the inspection robot camera optimization parameters are calculated based on the detection data and the real-time inspection environment parameters; in the control execution module 5, the inspection robot camera parameters are adjusted according to the inspection robot camera optimization parameters, and the robot edge algorithm module 4 is returned.
[0094] Specifically, the system includes the following main modules, which are connected in a closed loop in sequence to realize the automatic parameter adjustment function of the camera. The robot edge algorithm module 4 is responsible for real-time acquisition of images of the inspection scene, and analyzes the image quality through the built-in detection algorithm. It uses the image processing library (such as OpenCV) and the customized edge detection and frequency domain analysis algorithm to evaluate the image quality and determine whether there are defects in the inspection robot image such as out-of-focus, blur, overexposure, underexposure, noise, glare, and occlusion.
[0095] The robot algorithm feedback module 2 is used to receive the analysis results of the edge algorithm module. If an image defect is detected, the current inspection environment parameters (such as light intensity, color distribution, etc.) are saved and an error alarm instruction is issued. At the same time, the detection data and the real-time inspection environment parameters are passed to the parameter optimization module 3. In this embodiment, the environmental parameters can be recorded through the system log, and the data can be transmitted to the parameter optimization module 3 through a message queue or a direct function call.
[0096] The parameter optimization module 3 is used to calculate the optimal camera parameter settings based on the received detection data and the real-time inspection environment parameters, combined with the physical characteristics of the camera and the imaging quality requirements, using an algorithm model (such as a neural network, a BSCPT algorithm, etc.). In this embodiment, a machine learning model or an optimization algorithm can be used to calculate the parameters and generate adjustment suggestions.
[0097] The control execution module 5 is used to automatically adjust the parameter settings of the inspection robot camera according to the calculation results of the parameter optimization module 3, including brightness, contrast, chroma, exposure time, etc. In this embodiment, the parameter adjustment can be achieved by calling the API interface (such as MV_CC_SetExposureTime, MV_CC_SetGain, etc.) in the camera SDK.
[0098] The user interaction module 1 allows the user to input specific shooting requirements and preferences, such as desired image brightness, contrast, etc. These inputs will be used as one of the inputs of the parameter optimization module 3 to further optimize the camera parameters. In this embodiment, the user input is received through a graphical user interface (GUI) or a command line interface (CLI) and passed to the parameter optimization module 3.
[0099] The robot edge algorithm module 4 regularly collects images of the inspection scene. It uses edge detection, frequency domain analysis and other algorithms to analyze the image quality and determine whether there are defects. If an image defect is detected, the algorithm feedback module 2 saves the environmental parameters and issues an alarm.
[0100] The parameter optimization module 3 calculates the optimal camera parameters based on the detection data and user input. The control execution module 5 adjusts the camera settings according to the optimized parameters. Repeating the above steps forms a closed-loop control to continuously optimize the image quality.
[0101] The above are all preferred embodiments of the present application, and the protection scope of the present application is not limited thereto. Therefore, any equivalent changes made according to the structure, shape, and principle of the present application should be included in the protection scope of the present application.
Claims
1. An automatic parameter adjustment method for a patrol robot camera, characterized in that: The automatic parameter adjustment method comprises: Step S1: detecting the image captured by the camera through a detection algorithm, and determining whether the captured image has an inspection robot image defect; Step S2: if the captured image has the image defect of the inspection robot, then save the real-time inspection environment parameters and issue an error alarm instruction; if the captured image does not have the image defect of the inspection robot, then return to step S1; Step S3: Calculating optimization parameters of the inspection robot camera according to the detection data and the real-time inspection environment parameters; Step S4: adjusting the inspection robot camera parameters according to the inspection robot camera optimization parameters, and returning to step S1.
2. The automatic parameter adjustment method according to claim 1, characterized in that: In the step S1, the inspection robot image defect includes a defocus defect, and the detection algorithm includes a frequency domain analysis detection algorithm. The frequency domain analysis detection algorithm detects the defocus defect by the following steps: Performing Fourier transform on the captured image to obtain an image spectrum; Calculate the center point of the image spectrum; Calculate the radial average value of the image spectrum through the center point to obtain a spectrum curve; A Gaussian fitting curve of the frequency spectrum curve is calculated to obtain a peak value and a standard deviation of the Gaussian fitting curve. If the peak value is lower than a preset peak value threshold and the standard deviation is greater than a preset standard deviation threshold, it is considered that the captured image has the out-of-focus defect.
3. The automatic parameter adjustment method according to claim 1, characterized in that: In the step S1, the inspection robot image defect includes a defocus defect, and the detection algorithm includes a first edge detection algorithm. The first edge detection algorithm detects the defocus defect by the following steps: Converting the captured image into a first grayscale image; Performing Gaussian filtering on the first grayscale image; Applying a Sobel operator to the first grayscale image, wherein the Sobel operator is used to detect first edge information of the first grayscale image; An average grayscale value of the first edge information is calculated, and if the average grayscale value is lower than a preset average grayscale threshold, it is considered that the captured image has the out-of-focus defect.
4. The automatic parameter adjustment method according to claim 1, characterized in that: In step S1, the inspection robot image defect includes a glare defect, and the detection algorithm includes a frequency domain histogram detection algorithm. The histogram detection algorithm detects the glare defect by the following steps: Converting the captured image into a second grayscale image; Calculating a histogram of the second grayscale image; Determine a separation threshold according to the distribution of the histogram, wherein the separation threshold is used to divide the second grayscale image into a normal area and an overexposed area; The number of pixels in the overexposed area is counted, and if the number of pixels exceeds a preset ratio threshold, it is considered that the captured image has the glare defect.
5. The automatic parameter adjustment method according to claim 1, characterized in that: In the step S1, the inspection robot image defect includes a glare defect, and the detection algorithm includes a second edge detection algorithm. The second edge detection algorithm detects the glare defect by the following steps: Converting the captured image into a third grayscale image; Extracting second edge information in the third grayscale image by using the second edge detection algorithm; Performing binarization processing on the second edge information, wherein the binarization processing is used to convert the second edge information into black and white; The number of black pixels in the captured image is counted, and if the number of black pixels is less than a preset black pixel number threshold, it is considered that the captured image has the glare defect.
6. The automatic parameter adjustment method according to claim 1, characterized in that: The step S3 comprises the following steps: SE1: using the application programming interface in the software development kit corresponding to the inspection robot camera to obtain the entropy value of the current captured image; SE2: When the entropy value is lower than the entropy value threshold, it is considered that the camera parameters do not need to be adjusted, and the process returns to step SE1; when the entropy value is higher than the entropy value threshold, it is considered that the camera parameters need to be adjusted; SE3: Call the operation function through the application programming interface to calculate the optimization parameters of the inspection robot camera, and return to step SE1.
7. The automatic parameter adjustment method according to claim 2 or 3, characterized in that: In step S4, the out-of-focus defect is solved by the following steps: Adjusting the exposure time and gain parameters of the inspection robot camera, wherein the gain parameters include analog gain parameters and digital gain parameters, wherein the analog gain parameters are used to amplify analog signals, and the digital gain parameters are used to amplify digital signals; Adjusting the focus parameters of the inspection robot camera until the focus of the captured image is consistent with the focus of the actual scene; Adjusting the white balance parameters of the inspection robot camera until the color of the captured image is consistent with the color of the actual scene; The image processing algorithm parameters of the inspection robot camera are adjusted, wherein the image processing algorithm parameters are used to improve the details and clarity of the captured image.
8. The automatic parameter adjustment method according to claim 4 or 5, characterized in that: In step S4, the glare defect is solved by the following steps: Call the inspection robot camera parameter setting interface to set the exposure time, gain parameters, and white balance parameters; Calling the inspection robot camera image processing interface to set image enhancement parameters; The special function interface of the inspection robot camera is called to set the glare suppression parameters.
9. The automatic parameter adjustment method according to claim 1, characterized in that: In step S3, the user inputs shooting requirement information and preference information, and the optimization parameters of the inspection robot camera are calculated according to the detection data, the real-time inspection environment parameters, the shooting requirement information and the preference information.
10. An automatic parameter adjustment system for a patrol robot camera, characterized in that: The system comprises: The robot algorithm feedback module, parameter optimization module, control execution module and robot edge algorithm module are connected in a sequential closed loop. a user interaction module, the user interaction module being connected to the parameter optimization module and being used to input shooting requirement information and preference information into the parameter optimization module, In the robot edge algorithm module, the image captured by the camera is detected by a detection algorithm, and it is determined whether the captured image has an inspection robot image defect; In the robot algorithm feedback module, if the captured image has the inspection robot image defect, the instant inspection environment parameters are saved and an error alarm instruction is issued; if the captured image does not have the inspection robot image defect, the robot edge end algorithm module is returned; In the parameter optimization module, the optimization parameters of the inspection robot camera are calculated according to the detection data and the real-time inspection environment parameters; In the control execution module, the inspection robot camera parameters are adjusted according to the inspection robot camera optimization parameters, and the robot edge end algorithm module is returned.
Citation Information
Cited By
Fan smart point inspection method, system and terminal
CN119376404A
AI inspection unmanned aerial vehicle control method and system based on real-time dynamic measurement technology
CN120512606A
