Automatic focusing method and device based on low illumination level and medium

By setting sample data and using data from specified locations for focusing in low-light environments, the problem of inaccurate autofocus under low-light conditions at night is solved, achieving efficient and accurate autofocus, adapting to complex environmental changes, and improving the performance and reliability of power transmission line monitoring equipment.

CN121284401APending Publication Date: 2026-01-06SHANDONG SENTER ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410879228.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2026-01-06

AI Technical Summary

Technical Problem

In low-light environments at night, existing autofocus technologies based on sharpness evaluation values ​​are easily affected by factors such as insufficient light, image noise, and strong point light sources, leading to inaccurate focusing of imaging devices and increasing the probability of defocusing.

Method used

When the monitoring equipment acquires autofocus position data, sample data is set and the specified position data is used directly for focusing in low-light environments. The position range of autofocus is determined by the average value and standard deviation of the sample data, and the focusing process is optimized by combining the light sensor and the back-end processing system.

Benefits of technology

It improves the accuracy and efficiency of autofocus, reduces computational complexity, ensures image quality and the reliability of monitoring equipment, adapts to different lighting conditions, and expands the applicability of monitoring equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121284401A_ABST
    Figure CN121284401A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses an automatic focusing method and device based on low illumination, and a medium, and the method comprises the steps: obtaining the automatic focusing position data of a monitoring device when a power transmission line is monitored through the monitoring device, and if the illumination is greater than a preset illumination value; if the automatic focusing of the monitoring equipment is not out of focus, setting the automatic focusing position data as sample data; determining specified position data of automatic focusing according to the sample data; and when the illumination is not greater than the preset illumination value, focusing based on the specified position data through the monitoring equipment. According to the invention, focusing can be carried out by directly using the specified position data under the condition of relatively low illumination, so that inaccurate focusing caused by interference of the definition evaluation value in a low-illumination environment is avoided. The probability of out-of-focus can be reduced, and the imaging quality and accuracy of the monitoring equipment in a night environment can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer technology, and in particular to an autofocus method, device and medium based on low illumination. Background Technology

[0002] With the continuous advancement of technology, the safety monitoring of power transmission lines is receiving increasing attention. In power transmission line monitoring, the autofocus technology of imaging equipment plays a crucial role. Through autofocus, the imaging equipment can adjust the focal length in real time, ensuring clear imaging of the target object, thereby improving the accuracy and reliability of monitoring.

[0003] Currently, the autofocus technology commonly used in power transmission line monitoring equipment is based on a sharpness evaluation value. This method assesses the sharpness of the image and then automatically adjusts the focus based on the evaluation result to achieve a clear image. However, in nighttime environments, factors such as insufficient light, image noise, and strong point light sources can easily interfere with the sharpness evaluation value, leading to inaccuracies. This can cause the imaging equipment to focus inaccurately in nighttime conditions, increasing the probability of defocusing at night. Summary of the Invention

[0004] This specification provides one or more embodiments of an autofocus method, device, and medium based on low illumination to solve the technical problems mentioned in the background art.

[0005] One or more embodiments of this specification employ the following technical solutions:

[0006] This specification provides one or more embodiments of an autofocus method based on low illumination, the method comprising:

[0007] When the transmission line is monitored by the monitoring equipment, if the illuminance is greater than the preset illuminance value, the automatic focusing position data of the monitoring equipment is obtained;

[0008] If the autofocus of the monitoring device does not lose focus, the autofocus position data is set as sample data;

[0009] The specified location data for autofocus is determined based on the sample data;

[0010] When the illuminance is not greater than the preset illuminance value, the monitoring device focuses based on the data at the specified location.

[0011] It should be noted that the embodiments in this specification, through the above content, have the following beneficial effects:

[0012] Improved autofocus accuracy: By directly using data from a specified location for focusing in low-light conditions, it avoids inaccurate focusing caused by interference with sharpness evaluation values ​​in low-light environments. This reduces the probability of defocusing and improves the imaging quality and accuracy of monitoring equipment in nighttime environments.

[0013] Reduced computational complexity: Eliminating the need to calculate and adjust sharpness evaluation values ​​at night saves computational resources and time, and improves focusing speed and efficiency.

[0014] The performance of the monitoring equipment has been optimized: by utilizing effective autofocus position data acquired under normal illumination, accurate focusing is ensured even under low illumination, thereby improving the overall performance and reliability of the transmission line monitoring equipment.

[0015] Furthermore, determining the specified position data for autofocus based on the sample data includes:

[0016] The autofocus position range is determined based on the sample data, and the specified position data is determined based on the position range.

[0017] Furthermore, when the illuminance is not greater than the preset illuminance value, focusing by the monitoring device based on the specified location data includes:

[0018] When the illuminance is not greater than the preset illuminance value, the monitoring device automatically focuses to obtain the current automatic focusing position data.

[0019] If the current autofocus position data is not within the specified position range, focus is performed based on the specified position data.

[0020] It should be noted that the embodiments in this specification, through the above content, have the following beneficial effects:

[0021] Ensuring image quality: In low-light conditions, automatic focusing and focusing based on specified location data can ensure image clarity and accuracy, reducing blurring and out-of-focus issues. This is of great significance for power transmission line monitoring that requires high-quality images.

[0022] Improving monitoring effectiveness: For monitoring equipment, accurate focusing provides a clearer image of the target, helping monitoring personnel to better observe and analyze the situation in the monitored area. This helps to detect anomalies and problems in a timely manner, improving the effectiveness and accuracy of monitoring.

[0023] Adaptable to low-light environments: The preset illuminance value allows the monitoring equipment to automatically adjust its focusing mode under low-light conditions to adapt to environmental changes. This maintains good focusing performance under different lighting conditions, expanding the applicability of the monitoring equipment.

[0024] Saving time and manpower: By using automatic focusing and focusing based on specified location data, the time and labor costs of manual focusing can be reduced. The monitoring equipment can automatically complete the focusing process, improving work efficiency and reducing human error.

[0025] Enhancing system stability: Stable focusing is crucial for the normal operation of monitoring equipment. By combining autofocus with data from specified locations, the stability and reliability of focusing can be improved, reducing system failures or performance degradation caused by focusing problems.

[0026] Furthermore, determining the specified position data for autofocus based on the sample data includes:

[0027] The sample data is stored in a cache.

[0028] If the amount of sample data in the buffer meets the preset requirements, the data at the specified position for automatic focusing is determined based on the sample data.

[0029] It should be noted that the embodiments in this specification, through the above content, have the following beneficial effects:

[0030] Improving autofocus accuracy: By storing a sufficient number of sample data points to determine the data for a given location, the effects of randomness and uncertainty can be reduced. More data provides more comprehensive information, making autofocus more accurate and reliable.

[0031] Adapting to different scenarios: The sample data comes from different autofocus positions, and the specified position data determined based on this data can adapt to different scenario conditions. In this way, autofocus can better cope with complex environmental changes and provide more stable and consistent focusing results.

[0032] Improve focusing efficiency: By determining the data at a specified location based on sample data, complex calculations and adjustments can be avoided in each focusing operation. Focusing directly using the specified location data can speed up the focusing process and improve work efficiency.

[0033] Reducing focus errors: Using sample data to determine the data for a specific location can reduce the likelihood of focus errors. More accurate data for the specified location helps avoid focus errors caused by environmental factors or image processing errors, thereby improving image quality.

[0034] Furthermore, if the autofocus of the monitoring device loses focus, the method further includes:

[0035] Clear the sample data in the cache area.

[0036] It should be noted that the embodiments in this specification, through the above content, have the following beneficial effects:

[0037] Improving focus accuracy: By clearing the sample data in the buffer, erroneous data from out-of-focus situations can be prevented from affecting subsequent focusing operations. This allows the system to recollect valid sample data the next time focusing is attempted, thus improving focusing accuracy.

[0038] Adapting to changing scenarios: Clearing sample data allows the system to adapt to changes in the environment more quickly. If the scenario changes significantly (e.g., lighting conditions, target distance, etc.), the old sample data may no longer be applicable. Clearing it helps the system update the data in a timely manner to adapt to the new scenario.

[0039] To prevent errors from persisting: When autofocus goes out of focus, the sample data may contain inaccurate or incorrect information. Retaining this erroneous data may cause the system to continue making mistakes in subsequent focusing operations. Clearing the buffer prevents errors from persisting and ensures that the system focuses based on new, correct data.

[0040] Improving system stability: Removing out-of-focus sample data reduces invalid data and interference factors in the system. This helps improve system stability and reliability, and reduces focusing problems caused by data anomalies.

[0041] Furthermore, clearing the sample data in the cache includes:

[0042] When the monitoring device performs automatic focusing, if the number of consecutive defocusing events exceeds a preset threshold, the sample data in the buffer area will be cleared.

[0043] It should be noted that the embodiments in this specification, through the above content, have the following beneficial effects:

[0044] Adapting to complex environments: A high number of consecutive out-of-focus events may indicate a complex or unstable environment. Clearing the sample data allows the system to start collecting data again to adapt to the new environment, thus better handling complex and changing situations and improving the stability and reliability of the focusing effect.

[0045] Preventing error accumulation: Persistent defocusing can lead to a buildup of erroneous information in the sample data. Clearing this data can prevent the accumulation and propagation of errors, ensuring that the system uses more accurate information in subsequent focusing operations and reducing focusing problems caused by erroneous data.

[0046] Timely adjustment of focusing strategy: Continuous defocusing indicates that the current focusing strategy may need adjustment. Clearing the sample data provides the system with an opportunity to re-evaluate and adjust the focusing strategy, enabling it to adapt to the latest environmental information and improve focusing efficiency and effectiveness.

[0047] Furthermore, multiple sample data sets are provided, and the step of determining the specified position data for autofocus based on the sample data includes:

[0048] Determine the mean and standard deviation of the sample data;

[0049] The location interval is determined based on the average value and the standard deviation value;

[0050] The average value of the sample data in the specified location interval is calculated to obtain the specified location data.

[0051] It should be noted that the embodiments in this specification, through the above content, have the following beneficial effects:

[0052] Improving focusing accuracy: By calculating the average of the sample data, a value representing the overall characteristics of the sample can be obtained. Meanwhile, the standard deviation reflects the dispersion of the sample data. Combining these two parameters to determine the data at a specified location allows for a more accurate estimation of the autofocus position, thus improving focusing accuracy.

[0053] Reducing the impact of noise and outliers: Standard deviation can help identify and reduce the impact of noise and outliers in sample data. Outliers may be caused by measurement errors or other interference factors; by considering the standard deviation, these outliers can be better excluded from interfering with the determination of focus position.

[0054] Enhancing system robustness: Using the mean and standard deviation to determine data at a specified location makes the system more robust to variations in sample data and noise. Even if individual sample data have biases or errors, the calculation of the mean and standard deviation can comprehensively consider multiple data points, reducing the impact of a single data point on the results.

[0055] Adapting to different sample distributions: Different sample data may have different distribution characteristics. By calculating the mean and standard deviation, it is possible to better adapt to different distributions, thereby more accurately determining the data at the specified location for autofocus and improving the system's adaptability in various situations.

[0056] Providing reliable reference points: The mean and standard deviation values ​​can serve as reliable reference points for determining data at a specified location in autofocus. They provide a benchmark, helping the system make consistent focusing decisions under different environments and conditions.

[0057] Optimized performance and efficiency: By quickly calculating the mean and standard deviation, data at a specified location can be determined without adding excessive computational complexity. This improves the speed and efficiency of determining the autofocus position, making it more suitable for real-time applications.

[0058] Furthermore, if the illuminance is greater than the preset illuminance value, after determining the designated position data for autofocus based on the sample data, the method further includes:

[0059] If the number of autofocus attempts exceeds the preset number, the focusing position of the monitoring device is locked based on the specified location data;

[0060] Acquire the autofocus position data of the monitoring device;

[0061] If the deviation between the specified location data and the autofocus location data is greater than a preset deviation value, then the focus position of the monitoring device based on the specified location data is locked out.

[0062] Clear the sample data and generate new sample data;

[0063] Based on the new sample data, determine the new designated location data for autofocus.

[0064] It should be noted that the embodiments in this specification, through the above content, have the following beneficial effects:

[0065] Improving focusing accuracy: By acquiring autofocus position data and comparing it with data at a specified position, the accuracy of the specified position data can be verified. If the deviation is greater than a preset deviation value, it indicates that the specified position data may be inaccurate, requiring the generation of new sample data and the determination of new specified position data, thereby improving focusing accuracy.

[0066] Adapting to Environmental Changes: The environment in which monitoring equipment operates may change, such as lighting conditions and object positions. If the data for a specified location was determined under previous environmental conditions, it may no longer be accurate after environmental changes. By acquiring autofocus location data and comparing it with the data for the specified location, deviations can be detected in a timely manner, and new sample data can be generated, thereby adapting to environmental changes and improving focusing accuracy.

[0067] Furthermore, before exiting the process of locking the focusing position of the monitoring device based on the specified location data, the method further includes:

[0068] Determine whether the deviation between the specified position data and a preset number of consecutive autofocus position data is greater than the preset deviation value;

[0069] If so, execute the exit procedure to lock the focus position of the monitoring device based on the specified location data.

[0070] It should be noted that the embodiments in this specification, through the above content, have the following beneficial effects:

[0071] Improve focusing accuracy: By judging the deviation between the specified position data and the continuously preset number of autofocus position data, it can ensure that the focus position deviation is large and exit the lock in time, avoiding the continued focusing based on inaccurate specified position data, thereby improving the focusing accuracy.

[0072] Reduce error accumulation: Deviance judgment based on a preset number of consecutive autofocus position data can avoid misjudgments caused by a single data deviation. If multiple consecutive data deviations are greater than the preset deviation value, the inaccuracy of the specified position data can be more confirmed, reducing error accumulation.

[0073] Furthermore, the cache area is a circular cache area;

[0074] If new data is added to the cache and the cache is not full, the method further includes:

[0075] The newly added data is stored at the end of the cache area;

[0076] If new data is added to the cache, and the cache is already full, the method further includes:

[0077] Remove the header data from the cache area and store the new data at the tail of the cache area.

[0078] It should be noted that the embodiments in this specification, through the above content, have the following beneficial effects:

[0079] Improve data processing efficiency: By storing new data at the end of the buffer, data can be quickly added to the buffer, avoiding frequent data movement and copying, thereby improving data processing efficiency.

[0080] Optimize data storage: For a full cache, by removing the header data and storing the new data at the tail, the cache capacity can be kept unchanged, avoiding data overflow and loss.

[0081] Achieving data recycling: Since the cache is circular, when the cache is full, the head data is removed and the new data is stored at the tail, which can achieve data recycling and reduce data waste.

[0082] Supports real-time data processing: In real-time data processing scenarios, the cache helps balance the speed of data generation and processing. New data can be stored in the cache in a timely manner for subsequent processing, while avoiding data loss due to a full cache.

[0083] This specification provides one or more embodiments of an autofocus device based on low light conditions, comprising:

[0084] At least one processor; and,

[0085] A memory communicatively connected to the at least one processor; wherein,

[0086] The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to:

[0087] When the transmission line is monitored by the monitoring equipment, if the illuminance is greater than the preset illuminance value, the automatic focusing position data of the monitoring equipment is obtained;

[0088] If the autofocus of the monitoring device does not lose focus, the autofocus position data is set as sample data;

[0089] The specified location data for autofocus is determined based on the sample data;

[0090] When the illuminance is not greater than the preset illuminance value, the monitoring device focuses based on the data at the specified location.

[0091] This specification provides one or more embodiments of a non-volatile computer storage medium storing computer-executable instructions, which, when executed by a computer, can perform the following:

[0092] When the transmission line is monitored by the monitoring equipment, if the illuminance is greater than the preset illuminance value, the automatic focusing position data of the monitoring equipment is obtained;

[0093] If the autofocus of the monitoring device does not lose focus, the autofocus position data is set as sample data;

[0094] The specified location data for autofocus is determined based on the sample data;

[0095] When the illuminance is not greater than the preset illuminance value, the monitoring device focuses based on the data at the specified location.

[0096] The above-described at least one technical solution used in the embodiments of this specification can achieve the following beneficial effects:

[0097] Improved autofocus accuracy: By directly using data from a specified location for focusing in low-light conditions, it avoids inaccurate focusing caused by interference with sharpness evaluation values ​​in low-light environments. This reduces the probability of defocusing and improves the imaging quality and accuracy of monitoring equipment in nighttime environments.

[0098] Reduced computational complexity: Eliminating the need to calculate and adjust sharpness evaluation values ​​at night saves computational resources and time, and improves focusing speed and efficiency.

[0099] The performance of the monitoring equipment has been optimized: by utilizing effective autofocus position data acquired under normal illumination, accurate focusing is ensured even under low illumination, thereby improving the overall performance and reliability of the transmission line monitoring equipment. Attached Figure Description

[0100] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:

[0101] Figure 1 A flowchart illustrating a low-light-based autofocus method provided for one or more embodiments of this specification;

[0102] Figure 2 A sample data acquisition process provided for one or more embodiments of this specification;

[0103] Figure 3 This is a schematic diagram of a low-light-based autofocus device provided for one or more embodiments of this specification. Detailed Implementation

[0104] This specification provides an embodiment of an autofocusing method, device, and medium based on low illumination.

[0105] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0106] Figure 1 This diagram illustrates a low-light-based autofocus method for one or more embodiments of this specification, which can be executed by an autofocus system. Certain input parameters or intermediate results in the process can be manually adjusted to help improve accuracy.

[0107] The method flow steps of the embodiments in this specification are as follows:

[0108] S102, when the transmission line is monitored by the monitoring equipment, if the illuminance is greater than the preset illuminance value, the automatic focusing position data of the monitoring equipment is obtained.

[0109] In the embodiments of this specification, S102 described above can be implemented through the following specific implementation:

[0110] Monitoring equipment preparation: Select monitoring equipment with autofocus function and data output interface, and install it at the power transmission line monitoring point to ensure that the equipment can work normally and accurately measure the illuminance. The monitoring equipment can be a camera.

[0111] Preset illuminance value setting: Based on the actual situation and the daytime illuminance range, set a suitable preset illuminance value. This value can be determined through experiments or by referring to relevant standards.

[0112] Light sensor installation: Install a light sensor near the monitoring equipment to detect ambient illuminance in real time. The light sensor should have high accuracy and stability, and be able to accurately measure illuminance values.

[0113] Data Acquisition and Transmission: Connect the light sensor to the monitoring equipment to enable the equipment to acquire illuminance data in real time. Simultaneously, establish a data transmission channel to transmit the autofocus position data acquired by the monitoring equipment to the backend processing system.

[0114] Back-end processing system: A back-end processing system is built to receive and process data transmitted from the monitoring equipment. The back-end processing system can be computer software or dedicated data processing equipment.

[0115] Data processing and analysis: In the backend processing system, the received data is processed and analyzed in real time. When the illuminance exceeds the preset illuminance value, the acquisition of autofocus position data is triggered, and the data is stored and recorded.

[0116] Data storage and management: The acquired autofocus position data is effectively stored and managed for subsequent querying and analysis. Databases or data storage systems can be used to store the data.

[0117] S104, if the autofocus of the monitoring device does not lose focus, the autofocus position data is set as sample data.

[0118] In the embodiments of this specification, S104 described above can be implemented through the following specific implementation:

[0119] Define sample data: Explicitly define the conditions for setting the autofocus position data as sample data, i.e., when autofocus is not out of focus.

[0120] Data recording: During the monitoring process, the automatic focusing position data of the monitoring equipment is recorded in real time.

[0121] In the embodiments of this specification, the method for detecting whether the image is out of focus is as follows:

[0122] 1. Detecting Out-of-Focus Image Based on Image Gradient Evaluation Functions: Image gradient represents the degree of change in pixel values ​​within an image; a larger gradient indicates sharper edges and details. By using a chosen sharpness evaluation function to calculate the image gradient, image sharpness can be assessed, thus determining whether the image is out of focus. Sharpness evaluation functions include the sum of squared gradients, average gradient value, and gradient entropy.

[0123] 2. Focus Detection Algorithm: Utilizing focus detection algorithms from computer vision technology, the image from the monitoring device is analyzed to determine the position of the focus. A change in the focus position may indicate that the image is out of focus.

[0124] 3. Compare with reference image: Acquire a reference image of the transmission line under normal focusing conditions beforehand and compare it with the real-time captured image. If there is a significant difference, it may indicate that the image is out of focus.

[0125] S106, determine the specified position data for autofocus based on the sample data.

[0126] In the embodiments of this specification, the sample data can be stored in a buffer area; if the amount of sample data in the buffer area meets the preset requirements, the specified position data for automatic focusing is determined based on the sample data.

[0127] Furthermore, when determining the specified position data for autofocus, the autofocus position interval can be determined based on the sample data, and the specified position data can be determined based on the position interval. When determining the specified position data based on the position interval, the specified position data can be obtained by averaging the sample data within the position interval.

[0128] It should be noted that the above-mentioned data for determining the designated position for autofocus can be implemented through the following specific implementation scheme:

[0129] Set up a buffer: Create a buffer of appropriate size for the sample data. This buffer can be a data structure in memory, such as a queue or a circular buffer.

[0130] Sample data acquisition and storage: Acquire sample data from relevant data sources and store them one by one in the cache.

[0131] Monitoring data volume: Real-time monitoring of the amount of sample data in the cache to determine whether the preset requirements have been met.

[0132] Determine the autofocus location data based on sample data: Once the data volume meets the preset requirements, use the following method to determine the autofocus location data:

[0133] Data analysis: Analyzing sample data in the buffer, for example by calculating statistical indicators such as the mean and median.

[0134] Pattern recognition: Identifying patterns or features in sample data, such as finding the most frequently occurring data points or specific data trends.

[0135] Curve fitting: Fitting a suitable curve or model based on sample data, such as a quadratic curve, polynomial curve, etc., and determining the peak value or specific location of the curve.

[0136] It should be noted that the embodiments in this specification, through the above content, have the following beneficial effects:

[0137] Improving autofocus accuracy: By storing a sufficient number of sample data points to determine the data for a given location, the effects of randomness and uncertainty can be reduced. More data provides more comprehensive information, making autofocus more accurate and reliable.

[0138] Adapting to different scenarios: The sample data comes from different autofocus positions, and the specified position data determined based on this data can adapt to different scenario conditions. In this way, autofocus can better cope with complex environmental changes and provide more stable and consistent focusing results.

[0139] Improve focusing efficiency: By determining the data at a specified location based on sample data, complex calculations and adjustments can be avoided in each focusing operation. Focusing directly using the specified location data can speed up the focusing process and improve work efficiency.

[0140] Reducing focus errors: Using sample data to determine the data for a specific location can reduce the likelihood of focus errors. More accurate data for the specified location helps avoid focus errors caused by environmental factors or image processing errors, thereby improving image quality.

[0141] Furthermore, if the autofocus of the monitoring device loses focus, the sample data in the buffer can be cleared to ensure that no invalid data remains in the out-of-focus state.

[0142] It should be noted that the embodiments in this specification, through the above content, have the following beneficial effects:

[0143] Improving focus accuracy: By clearing the sample data in the buffer, erroneous data from out-of-focus situations can be prevented from affecting subsequent focusing operations. This allows the system to recollect valid sample data the next time focusing is attempted, thus improving focusing accuracy.

[0144] Adapting to changing scenarios: Clearing sample data allows the system to adapt to changes in the environment more quickly. If the scenario changes significantly (e.g., lighting conditions, target distance, etc.), the old sample data may no longer be applicable. Clearing it helps the system update the data in a timely manner to adapt to the new scenario.

[0145] To prevent errors from persisting: When autofocus goes out of focus, the sample data may contain inaccurate or incorrect information. Retaining this erroneous data may cause the system to continue making mistakes in subsequent focusing operations. Clearing the buffer prevents errors from persisting and ensures that the system focuses based on new, correct data.

[0146] Improving system stability: Removing out-of-focus sample data reduces invalid data and interference factors in the system. This helps improve system stability and reliability, and reduces focusing problems caused by data anomalies.

[0147] Furthermore, when the monitoring device performs automatic focusing, if the number of consecutive defocusing events exceeds a preset threshold, the sample data in the buffer area will be cleared.

[0148] It should be noted that the embodiments in this specification, through the above content, have the following beneficial effects:

[0149] Adapting to complex environments: A high number of consecutive out-of-focus events may indicate a complex or unstable environment. Clearing the sample data allows the system to start collecting data again to adapt to the new environment, thus better handling complex and changing situations and improving the stability and reliability of the focusing effect.

[0150] Preventing error accumulation: Persistent defocusing can lead to a buildup of erroneous information in the sample data. Clearing this data can prevent the accumulation and propagation of errors, ensuring that the system uses more accurate information in subsequent focusing operations and reducing focusing problems caused by erroneous data.

[0151] Timely adjustment of focusing strategy: Continuous defocusing indicates that the current focusing strategy may need adjustment. Clearing the sample data provides the system with an opportunity to re-evaluate and adjust the focusing strategy, enabling it to adapt to the latest environmental information and improve focusing efficiency and effectiveness.

[0152] Furthermore, multiple sample data sets are provided. When determining the designated location data for autofocus based on the sample data, the mean and standard deviation of the sample data can be determined. The location interval is determined based on the mean and standard deviation. The average of the sample data in the location interval is calculated to obtain the designated location data.

[0153] Specifically, in the embodiments of this specification, when determining the data for the designated autofocus position, the sum of all sample data in the buffer area (sum) is calculated first, then the average (avg) of all sample data is calculated, and finally the standard deviation (sig) of all sample data is calculated. This yields an effective value interval [avg-sig, avg+sig]. The minimum value of this interval is rounded down to obtain the minimum value of the effective interval, min = floor(avg-sig). Similarly, the maximum value of this interval is rounded up to obtain the maximum value of the effective interval, max = ceil(avg+sig). The new interval [min, max] is used to filter all sample data, removing data outside the interval range. Finally, the average value that meets the interval requirements is recalculated, and this average value is rounded to the nearest integer as the data for the designated autofocus position.

[0154] It should be noted that the embodiments in this specification, through the above content, have the following beneficial effects:

[0155] Improving focusing accuracy: By calculating the average of the sample data, a value representing the overall characteristics of the sample can be obtained. Meanwhile, the standard deviation reflects the dispersion of the sample data. Combining these two parameters to determine the data at a specified location allows for a more accurate estimation of the autofocus position, thus improving focusing accuracy.

[0156] Reducing the impact of noise and outliers: Standard deviation can help identify and reduce the impact of noise and outliers in sample data. Outliers may be caused by measurement errors or other interference factors; by considering the standard deviation, these outliers can be better excluded from interfering with the determination of focus position.

[0157] Enhancing system robustness: Using the mean and standard deviation to determine data at a specified location makes the system more robust to variations in sample data and noise. Even if individual sample data have biases or errors, the calculation of the mean and standard deviation can comprehensively consider multiple data points, reducing the impact of a single data point on the results.

[0158] Adapting to different sample distributions: Different sample data may have different distribution characteristics. By calculating the mean and standard deviation, it is possible to better adapt to different distributions, thereby more accurately determining the data at the specified location for autofocus and improving the system's adaptability in various situations.

[0159] Providing reliable reference points: The mean and standard deviation values ​​can serve as reliable reference points for determining data at a specified location in autofocus. They provide a benchmark, helping the system make consistent focusing decisions under different environments and conditions.

[0160] Optimize performance and efficiency: By quickly calculating the mean and standard deviation, data at a specified location can be determined without adding excessive computational complexity. This improves the speed and efficiency of determining the autofocus position, making it more suitable for real-time applications.

[0161] Furthermore, after determining the designated autofocus position data based on the sample data, if the number of autofocus attempts exceeds a preset value when the illuminance is greater than the preset value, the focus position of the monitoring device is locked based on the designated position data. The autofocus position data of the monitoring device can be obtained by reading the device's status information or using a corresponding interface. Additionally, when processing images, image processing algorithms can be used to calculate the autofocus position data, which typically requires image preprocessing and analysis to determine the autofocus position data. If the deviation between the designated position data and the autofocus position data exceeds a preset deviation value, the process of locking the monitoring device's focus position based on the designated position data is terminated. The sample data is cleared, and new sample data is generated. New designated autofocus position data is determined based on the new sample data. If the deviation between the designated position data and the autofocus position data does not exceed a preset deviation value, the focus position of the monitoring device continues to be locked based on the designated position data.

[0162] It should be noted that the embodiments in this specification, through the above content, have the following beneficial effects:

[0163] Improving focusing accuracy: By acquiring autofocus position data and comparing it with data at a specified position, the accuracy of the specified position data can be verified. If the deviation is greater than a preset deviation value, it indicates that the specified position data may be inaccurate, requiring the generation of new sample data and the determination of new specified position data, thereby improving focusing accuracy.

[0164] Adapting to Environmental Changes: The environment in which monitoring equipment operates may change, such as lighting conditions and object positions. If the data for a specified location was determined under previous environmental conditions, it may no longer be accurate after environmental changes. By acquiring autofocus location data and comparing it with the data for the specified location, deviations can be detected in a timely manner, and new sample data can be generated, thereby adapting to environmental changes and improving focusing accuracy.

[0165] Furthermore, before exiting the process of locking the focus position of the monitoring device based on the specified location data, it is determined whether the deviation between the specified location data and a consecutive preset number of automatic focus position data is greater than the preset deviation value; if so, the process of exiting the process of locking the focus position of the monitoring device based on the specified location data is executed.

[0166] It should be noted that the embodiments in this specification, through the above content, have the following beneficial effects:

[0167] Improve focusing accuracy: By judging the deviation between the specified position data and the continuously preset number of autofocus position data, it can ensure that the focus position deviation is large and exit the lock in time, avoiding the continued focusing based on inaccurate specified position data, thereby improving the focusing accuracy.

[0168] Reduce error accumulation: Deviance judgment based on a preset number of consecutive autofocus position data can avoid misjudgments caused by a single data deviation. If multiple consecutive data deviations are greater than the preset deviation value, the inaccuracy of the specified position data can be more confirmed, reducing error accumulation.

[0169] S108, when the illuminance is not greater than the preset illuminance value, the monitoring device focuses based on the specified location data.

[0170] In the embodiments of this specification, since the preset illuminance value of S102 is set according to the actual situation and the illuminance range during the day, it can be considered as night if it is not greater than the preset illuminance value. That is, in the case of low illuminance at night, the monitoring device can focus based on the data of the specified location to avoid the low illuminance affecting the effect of automatic focusing.

[0171] Furthermore, the cache area is a circular cache area;

[0172] If new data is added to the cache and the cache is not full, the method further includes:

[0173] The newly added data is stored at the end of the cache area;

[0174] If new data is added to the cache, and the cache is already full, the method further includes:

[0175] Remove the header data from the cache area and store the new data at the tail of the cache area.

[0176] It should be noted that the embodiments in this specification, through the above content, have the following beneficial effects:

[0177] Improve data processing efficiency: By storing new data at the end of the buffer, data can be quickly added to the buffer, avoiding frequent data movement and copying, thereby improving data processing efficiency.

[0178] Optimize data storage: For a full cache, by removing the header data and storing the new data at the tail, the cache capacity can be kept unchanged, avoiding data overflow and loss.

[0179] Achieving data recycling: Since the cache is circular, when the cache is full, the head data is removed and the new data is stored at the tail, which can achieve data recycling and reduce data waste.

[0180] Supports real-time data processing: In real-time data processing scenarios, the cache helps balance the speed of data generation and processing. New data can be stored in the cache in a timely manner for subsequent processing, while avoiding data loss due to a full cache.

[0181] Furthermore, when the illuminance is not greater than the preset illuminance value, during the focusing process by the monitoring device based on the specified location data, the monitoring device can first perform automatic focusing to obtain the current automatic focusing location data. If the current automatic focusing location data is not within the specified location range, it indicates that the current automatic focusing location data is inaccurate. Image acquisition using the current automatic focusing location data may result in defocusing. Therefore, in this embodiment, focusing can be performed based on the specified location data. If the current automatic focusing location data is within the specified location range, focusing can be performed using the current automatic focusing location data.

[0182] It should be noted that the embodiments in this specification, through the above content, have the following beneficial effects:

[0183] Ensuring image quality: In low-light conditions, automatic focusing and focusing based on specified location data can ensure image clarity and accuracy, reducing blurring and out-of-focus issues. This is of great significance for power transmission line monitoring that requires high-quality images.

[0184] Improving monitoring effectiveness: For monitoring equipment, accurate focusing provides a clearer image of the target, helping monitoring personnel to better observe and analyze the situation in the monitored area. This helps to detect anomalies and problems in a timely manner, improving the effectiveness and accuracy of monitoring.

[0185] Adaptable to low-light environments: The preset illuminance value allows the monitoring equipment to automatically adjust its focusing mode under low-light conditions to adapt to environmental changes. This maintains good focusing performance under different lighting conditions, expanding the applicability of the monitoring equipment.

[0186] Saving time and manpower: By using automatic focusing and focusing based on specified location data, the time and labor costs of manual focusing can be reduced. The monitoring equipment can automatically complete the focusing process, improving work efficiency and reducing human error.

[0187] Enhancing system stability: Stable focusing is crucial for the normal operation of monitoring equipment. By combining autofocus with data from specified locations, the stability and reliability of focusing can be improved, reducing system failures or performance degradation caused by focusing problems.

[0188] It should be noted that the embodiments in this specification have the following beneficial effects:

[0189] Improved autofocus accuracy: By directly using data from a specified location for focusing in low-light conditions, inaccurate focusing caused by interference with sharpness evaluation values ​​in low-light environments is avoided. This reduces the probability of defocusing and improves the imaging quality and accuracy of monitoring equipment in nighttime environments.

[0190] Reduced computational complexity: Eliminating the need to calculate and adjust sharpness evaluation values ​​at night saves computational resources and time, and improves focusing speed and efficiency.

[0191] The performance of the monitoring equipment has been optimized: by utilizing effective autofocus position data acquired under normal illumination, accurate focusing is ensured even under low illumination, thereby improving the overall performance and reliability of the transmission line monitoring equipment.

[0192] It should be noted that with the iterative upgrades of image sensor technology, imaging performance in low-light conditions has been significantly improved. For example, low-light cameras have evolved from starlight cameras to super-starlight cameras and blacklight cameras. However, the application of autofocus technology for zoom lenses in low-light environments has developed slowly. This invention is a method to improve autofocus performance in low-light environments.

[0193] Current night vision focusing algorithms are similar to those for white vision, mostly relying on obtaining sharpness evaluation values ​​for automatic focusing. However, in low-light conditions, sharpness evaluation values ​​can be affected by insufficient light, image noise, strong point light sources, and other factors, leading to inaccurate values ​​and a higher probability of defocusing in nighttime environments.

[0194] The purpose of this invention is to solve the problem of high defocusing probability in autofocus algorithms of zoom cameras under low-light conditions. A statistically based autofocus method is disclosed, which processes and analyzes daytime sample data, and applies the analysis results to low-light environments to assist in rapid autofocusing in such conditions.

[0195] To achieve the above-mentioned objectives of this invention, the following specific implementation steps are used. It should be noted that the following implementation steps are a simplified description for an infinity object distance and a certain magnification. Other object distances and magnifications adopt a similar processing flow.

[0196] 1. Initialization

[0197] After the zoom lens is powered on, the first step is to perform an initialization operation. The main purpose of initialization is to read historical sample data, establish a circular buffer (first-in, first-out), and write the historical data into the buffer.

[0198] 2. Sample Data Collection

[0199] First, the normal autofocus algorithm is run. After autofocus is complete, if the current scene is daytime (corresponding to illuminance greater than the preset illuminance value) and focusing is successful, the sharp focused position information is stored in a circular buffer. The buffer follows a first-in, first-out (FIFO) principle: if the buffer is full, the head data is removed and the data is stored at the tail of the buffer; otherwise, the data is directly stored at the tail of the buffer. Finally, this sample data is stored in real time for later analysis and to prevent data loss in the event of a power outage. Data storage requires the inclusion of data integrity verification measures.

[0200] Furthermore, Figure 2 This specification provides a sample data acquisition process according to an embodiment. The figure shows a single sample acquisition process. At the beginning, autofocus ends, and it is determined whether it is daytime mode (which can be determined by whether the illuminance is greater than a preset illuminance value). If not, the process ends. If so, the autofocus count is incremented by 1 (cnt++). It is then determined whether the image is out of focus. If it is, the out-of-focus count is incremented by 1 (clr_cnt++). It is then determined whether clr_cnt > a threshold. If so, the sample space is cleared, and the out-of-focus count is cleared (clr_cnt = 0). If not, the current acquisition ends. If the image is not out of focus, the out-of-focus count is cleared (clr_cnt = 0). It is then determined whether the pre-store is full. If so, the data is placed at the end of the buffer queue, the head of the buffer queue is removed, the sample data is stored, and the current acquisition ends. If not, the data is placed at the end of the buffer queue, the sample data is stored, and the current acquisition ends.

[0201] 3. Sample Analysis

[0202] The program creates a separate analysis thread for real-time analysis of sample data updates. If the buffer is full, it's assumed the system has collected enough samples and is ready for analysis. First, the sum of all sample data in the buffer is calculated (sum). Then, the mean (avg) of all samples is calculated, and finally, the standard deviation (sig) of all samples is calculated. This yields an effective value interval [avg-sig, avg+sig]. The minimum value in this interval is rounded down to obtain the minimum effective value (min = floor(avg-sig)). Similarly, the maximum value in this interval is rounded up to obtain the maximum effective value (max = ceil(avg+sig)).

[0203] The new interval [min, max] is used to filter all sample data, removing data outside the interval. Finally, the average value that meets the interval requirements is recalculated, and this average value is rounded to the nearest integer as the final sharpness position (equivalent to the specified position data for autofocus). The flag at this magnification is set to "locked". This sharpness position can be used as a reference when focusing at night (corresponding to an illuminance not greater than the preset illuminance value).

[0204] 4. Sample space data filling and clearing mechanism

[0205] This invention designs three focus-locking (i.e., locking the sharpness position) modes: instant focus lock, full-range focus lock, and automatic focus lock. Among them, instant focus lock and full-range focus lock require manual triggering, such as by receiving a special ONVIF command or setting a special preset position, while automatic focus lock is triggered by the program judging whether a certain condition is met. Automatic focus lock can be triggered when the autofocus successfully reaches the preset value.

[0206] This invention also includes a focus lock exit mechanism. When the autofocus position deviates significantly from the focus lock position, it is assumed that the focus lock position may be problematic, and focus lock exit should be considered. Additionally, a method for manually triggering focus lock exit is also designed, such as exiting focus lock and clearing the buffer by receiving a special ONVIF command or deleting a special preset bit.

[0207] The essential effects of this invention are:

[0208] 1) By using the method of the present invention, the focusing position can be accurately predicted by statistical analysis of sample data, thereby achieving the purpose of rapid focusing in low-light environments.

[0209] 2) The method of the present invention can be applied to autofocusing applications in various low-light environments.

[0210] Figure 3 A schematic diagram of a low-light-based autofocus device provided for one or more embodiments of this specification, comprising:

[0211] At least one processor; and,

[0212] A memory communicatively connected to the at least one processor; wherein,

[0213] The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to:

[0214] When the transmission line is monitored by the monitoring equipment, if the illuminance is greater than the preset illuminance value, the automatic focusing position data of the monitoring equipment is obtained;

[0215] If the autofocus of the monitoring device does not lose focus, the autofocus position data is set as sample data;

[0216] The specified location data for autofocus is determined based on the sample data;

[0217] When the illuminance is not greater than the preset illuminance value, the monitoring device focuses based on the data at the specified location.

[0218] This specification provides one or more embodiments of a non-volatile computer storage medium storing computer-executable instructions, which, when executed by a computer, can perform the following:

[0219] When the transmission line is monitored by the monitoring equipment, if the illuminance is greater than the preset illuminance value, the automatic focusing position data of the monitoring equipment is obtained;

[0220] If the autofocus of the monitoring device does not lose focus, the autofocus position data is set as sample data;

[0221] The specified location data for autofocus is determined based on the sample data;

[0222] When the illuminance is not greater than the preset illuminance value, the monitoring device focuses based on the data at the specified location.

[0223] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the embodiments for devices and non-volatile computer storage media are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0224] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0225] The above description is merely one or more embodiments of this specification and is not intended to limit this specification. Various modifications and variations can be made to the one or more embodiments of this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of one or more embodiments of this specification should be included within the scope of the claims of this specification.

Claims

1. A low-illumination-based auto-focusing method, characterized in that, The method comprises: When the illumination is greater than a preset illumination value during monitoring of the power transmission line by a monitoring device, obtaining automatic focusing position data of the monitoring device; If the automatic focusing of the monitoring device is not out of focus, setting the automatic focusing position data as sample data; Determining specified position data of automatic focusing according to the sample data; When the illumination is not greater than the preset illumination value, focusing by the monitoring device based on the specified position data.

2. The method of claim 1, wherein, The method further comprises: If the automatic focusing of the monitoring device is out of focus, clearing the sample data in the cache area.

3. The method of claim 2, wherein, The sample data is set to a plurality of, and the method further comprises: Determining the average value and the standard deviation value of the sample data; Determining the position interval according to the average value and the standard deviation value; 4. The method of claim 1, wherein, Obtaining the specified position data by averaging the sample data in the position interval. If the illumination is greater than the preset illumination value, after determining the specified position data of automatic focusing according to the sample data, the method further comprises: If the number of automatic focusing is greater than a preset number, locking the focusing position of the monitoring device based on the specified position data; 5. The method of claim 4, wherein, Obtaining automatic focusing position data of the monitoring device; If the deviation between the specified position data and the automatic focusing position data is greater than a preset deviation value, exiting the locking of the focusing position of the monitoring device based on the specified position data; 6. The method of claim 2, wherein, Clearing the sample data and generating new sample data; Determining new specified position data of automatic focusing according to the new sample data. The method further comprises: Before exiting the locking of the focusing position of the monitoring device based on the specified position data, judging whether the deviation between the specified position data and a continuous preset number of automatic focusing position data is greater than the preset deviation value; 7. The method of claim 1, wherein, If yes, executing the exiting of the locking of the focusing position of the monitoring device based on the specified position data. The method comprises: At least one processor; And The memory is in communication connection with the at least one processor; wherein The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:

8. The method of claim 7, wherein, ​ ​ ​ 9. A low-illumination-based auto-focusing apparatus, characterized by comprising: ​ ​ ​ ​ ​ When the monitoring device monitors the power transmission line, if the illumination is greater than a preset illumination value, automatic focusing position data of the monitoring device is acquired; If the automatic focusing of the monitoring device is not out of focus, the automatic focusing position data is set as sample data; The specified position data of automatic focusing is determined according to the sample data; When the illumination is not greater than the preset illumination value, the monitoring device focuses based on the specified position data.

10. A non-transitory computer storage medium, comprising, The computer executable instructions are stored in the computer, and the computer executable instructions can realize the following steps when executed by the computer: When the monitoring device monitors the power transmission line, if the illumination is greater than a preset illumination value, automatic focusing position data of the monitoring device is acquired; If the automatic focusing of the monitoring device is not out of focus, the automatic focusing position data is set as sample data; The specified position data of automatic focusing is determined according to the sample data; When the illumination is not greater than the preset illumination value, the monitoring device focuses based on the specified position data.