Self-adaptive optical compensation method and system for fruit sorting equipment
By establishing a temperature compensation model and a lightweight intelligent compensation network, the problem of light attenuation caused by light source aging and pollution in fruit sorting equipment was solved, realizing adaptive compensation of the light source and improving image acquisition quality and sorting accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-11
- Publication Date
- 2026-03-24
AI Technical Summary
The existing fruit sorting equipment suffers from light attenuation problems caused by aging, temperature changes, and contamination of optical components in the LED light source, resulting in a decline in image acquisition quality and difficulty in dynamically adapting to complex working conditions.
By establishing a temperature compensation model and combining the grayscale values of the background image to calculate the light source status index, and using a lightweight intelligent compensation network to generate compensation parameters, the light source can achieve self-sensing, self-diagnosis, and self-adjustment, and dynamically optimize image acquisition parameters.
It improves the image stability and adaptability of fruit sorting equipment in complex environments, ensures sorting accuracy and reliability, reduces errors, and improves the accuracy and efficiency of the sorting process.
Smart Images

Figure CN121725201A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of optical compensation, and in particular to an adaptive optical compensation method and system for fruit sorting equipment. Background Technology
[0002] In fruit sorting equipment, a stable lighting environment is crucial for ensuring image acquisition quality and sorting accuracy. Currently, most sorting systems use LED light sources in conjunction with industrial cameras for fruit appearance inspection, such as color, size, and defects. However, during long-term operation, LED light sources experience light decay due to prolonged working time and temperature changes. Simultaneously, optical windows or lenses are susceptible to contamination from dust, moisture, and oil, leading to reduced or uneven light intensity illuminating the fruit surface. This, in turn, results in decreased brightness, reduced contrast, and blurred details in the acquired images.
[0003] In existing technologies, some solutions employ fixed gain compensation or periodic manual dimming to address light source attenuation, but these methods cannot dynamically adapt to complex operating conditions. Some improved methods attempt simple compensation by monitoring light source current or temperature, but these fail to effectively distinguish between normal aging and abnormal attenuation caused by external contamination, leading to insufficient or excessive compensation. Furthermore, most systems lack a closed-loop feedback mechanism for image quality, making it difficult to guarantee long-term operational stability.
[0004] Therefore, how to achieve intelligent perception and accurate compensation of light source status, and improve the system's adaptability under different environments and usage stages, has become an urgent technical challenge. Summary of the Invention
[0005] This application provides an adaptive optics compensation method and system for fruit sorting equipment, which solves the technical problem of light attenuation caused by LED light source aging over time, temperature changes, and optical component contamination in existing fruit sorting equipment.
[0006] To achieve the above objectives, this application adopts the following technical solution: Firstly, an adaptive optical compensation method for a fruit sorting device is provided, comprising: The initial brightness and current temperature of the fruit sorting environment are obtained, and a temperature compensation model for light source attenuation is established. Background images of the fruit sorting environment are collected, and the average gray value of the background image is calculated. Based on the temperature compensation model, the current average gray value, and the current light source temperature, the light source status index of the fruit sorting environment is calculated. The background image is an image without fruit. Based on the light source status indicators and the type of fruit to be sorted, compensation parameters are generated for the image acquisition device; based on the compensation parameters, the corrected compensated image is obtained.
[0007] Based on the above technical solution, the adaptive optics compensation method for fruit sorting equipment provided in this application accurately assesses the aging and contamination status of the light source by combining a temperature compensation model with the background image; it adopts a dual-mode acquisition of background data, combining periodic and abnormal triggering, to balance efficiency and responsiveness; it utilizes light source status indicators to achieve attenuation attribution analysis and integrates fruit type and image quality characteristics, intelligently generating compensation parameters through a lightweight network that coordinates hardware-driven and software-enhanced approaches; finally, it ensures the compensation effect through closed-loop verification. The overall solution achieves self-sensing, self-diagnosis, and self-adjustment of the illumination system, improving the stability, adaptability, and intelligence level of fruit sorting images, and ensuring sorting accuracy and reliability under long-term operation.
[0008] In conjunction with the first aspect above, in one possible implementation, establishing the temperature compensation model for light source attenuation includes: ; Where L is the current brightness. Initial brightness, t is the attenuation factor, k is the attenuation coefficient, and t is the total working time of the LED light source from startup to the present. Here is the temperature coefficient, and T is the current temperature. This is a reference temperature.
[0009] In conjunction with the first aspect above, in one possible implementation, calculating the average grayscale value of the background image includes: Get the grayscale value of each pixel in the background image, as well as the width and height of the background image; Through formula The average grayscale value EHD of the background image is calculated; where i is the pixel number in the background image, W is the width of the background image, H is the height of the background image, and HDi is the grayscale value of the i-th pixel in the background image.
[0010] In conjunction with the first aspect above, in one possible implementation, the calculation of the light source status index of the fruit sorting environment includes: Calculate the background brightness attenuation rate BLS = EHD / JHD; where JHD is the base gray value of the background image; Based on a temperature compensation model for light source attenuation and the current light source temperature, the theoretical attenuation factor of the fruit sorting environment image is calculated using a formula. ; Based on the background brightness attenuation rate and the theoretical attenuation factor, the light source status index GZB is calculated using the formula GZB=BLS / LSY.
[0011] In conjunction with the first aspect above, in one possible implementation, the light source state index includes: If GZB is within the preset threshold range, it means that the actual attenuation of the light source is equal to the theoretical attenuation. If GZB is less than the preset threshold range, it means that the actual attenuation of the light source is less than the theoretical attenuation. If GZB is greater than the preset threshold range, it means that the actual attenuation of the light source is greater than the theoretical attenuation.
[0012] In conjunction with the first aspect above, in one possible implementation, generating compensation parameters for the image acquisition device based on the light source status index and the type of fruit to be sorted includes: The light source state indicators and the type of fruit to be sorted are input into the pre-trained lightweight intelligent compensation network LICC-Net, which outputs the optimal light source compensation parameters. The compensation parameters include light source driving parameters and camera image processing parameters.
[0013] In conjunction with the first aspect above, in one possible implementation, the lightweight intelligent compensation network LICC-Net includes: The lightweight intelligent compensation network LICC-Net includes a first input branch, a second input branch, a feature extraction and fusion layer, and a dual-output decoupling layer; The first input branch is used to receive structured input data, which includes light source status indicators and the type of fruit to be sorted. The second input branch is used to receive the image quality feature map; wherein the image quality feature map is a uniformity heatmap and a sharpness heatmap generated after preprocessing the background image, and the size of the image quality feature map is smaller than the size of the original background image; The feature extraction and fusion layer includes: In the first input branch, the structured input data is encoded through a fully connected layer; In the second input branch, features are extracted from the image quality feature map through at least one depth-separable convolutional layer; In the middle layer of the network, the features of the first and second branches are weighted and fused through the channel-space attention module to generate a fused feature vector; The dual-output decoupling layer consists of two independent sub-networks: The first sub-network is used to generate light source driving parameters based on the fused feature vector; The second sub-network is used to generate camera image processing parameters based on the fused feature vector.
[0014] In conjunction with the first aspect above, in one possible implementation, obtaining the corrected compensated image based on the compensation parameters includes: S1. Receive the light source driving parameters and camera image processing parameters output by the lightweight intelligent compensation network LICC-Net; S2. Adjust the driving signal of the LED light source module according to the light source driving parameters to change the luminous intensity of the light source; S3. While adjusting the light source, perform pixel-level image enhancement processing on the fruit images acquired in real time by the industrial camera according to the camera image processing parameters; wherein, the image enhancement processing includes at least one of dynamic range adjustment, nonlinear gain mapping and local contrast optimization; S4. The fruit image after image enhancement is used as the corrected compensation image for subsequent fruit quality analysis and sorting.
[0015] In conjunction with the first aspect described above, in one possible implementation, obtaining the corrected compensated image further includes: When the conveyor belt enters the fruitless state again, the background image is re-captured; The light source status index is recalculated based on the newly acquired background image; If the light source status indicator is within the preset threshold range, the compensation is confirmed to be successful; if the light source status indicator still exceeds the preset threshold range, a compensation failure alarm is triggered.
[0016] Secondly, this application provides an adaptive optical compensation system for a fruit sorting device, comprising: a modeling module, an analysis module, and a compensation module; wherein, the modeling module is used to acquire the initial brightness and current temperature of the fruit sorting environment, and establish a temperature compensation model for light source attenuation; the analysis module is used to acquire a background image of the fruit sorting environment, calculate the average gray value of the background image; and calculate the light source status index of the fruit sorting environment based on the temperature compensation model, the current average gray value, and the current light source temperature; the compensation module is used to generate compensation parameters for the image acquisition device based on the light source status index and the type of fruit to be sorted; and acquire a corrected compensated image based on the compensation parameters.
[0017] This application provides an adaptive optics compensation method and system for fruit sorting equipment. By constructing a light source attenuation model that incorporates the effects of time and temperature, and combining this with brightness detection using background images captured when there is no fruit, the system's health status can be accurately assessed. Both periodic and event-triggered mechanisms are employed to capture background images, ensuring system efficiency and enhancing the ability to handle abnormal situations. Light source status indicators effectively identify normal aging and abnormal contamination phenomena. Furthermore, by combining the types of fruit to be sorted with collaborative compensation parameters generated by a lightweight intelligent compensation network, optimized coordination between hardware lighting and software enhancement is achieved. Finally, a closed-loop verification mechanism ensures the effectiveness of the compensation, significantly improving the image stability, adaptability, and intelligence level of the fruit sorting system in complex working environments, thereby guaranteeing long-term stable sorting accuracy. This method not only improves the accuracy and efficiency of fruit sorting but also reduces errors caused by light source attenuation or changes in external conditions, making the entire sorting process more scientific and rational.
[0018] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description
[0019] Figure 1 A system architecture diagram of an adaptive optics compensation system for a fruit sorting device provided in this application embodiment; Figure 2 A flowchart illustrating an adaptive optics compensation method for a fruit sorting device provided in this application embodiment; Figure 3 This is a schematic diagram of an adaptive optics compensation process provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an adaptive optical compensation device for a fruit sorting equipment provided in an embodiment of this application; Figure 5 This is a schematic diagram of the hardware structure of an adaptive optical compensation device for a fruit sorting equipment provided in an embodiment of this application. Detailed Implementation
[0020] The technical solution of the present invention will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] The adaptive optics compensation method for a fruit sorting device provided in this application embodiment can be applied to an adaptive optics compensation system for a fruit sorting device, such as... Figure 1 As shown, the system includes: a modeling module, an analysis module, and a compensation module; The modeling module is used to obtain the initial brightness and current temperature of the fruit sorting environment and to establish a temperature compensation model for light source attenuation. The analysis module is used to collect background images of the fruit sorting environment and calculate the average gray value of the background images; based on the temperature compensation model, the current average gray value, and the current light source temperature, it calculates the light source status index of the fruit sorting environment. The compensation module is used to generate compensation parameters for the image acquisition device based on the light source status indicators and the type of fruit to be sorted; and to obtain the corrected compensated image based on the compensation parameters.
[0022] To address the technical problem of light attenuation caused by LED light source aging over time, temperature changes, and optical component contamination in existing fruit sorting equipment, this application provides an adaptive optics compensation method for fruit sorting equipment. The method includes: acquiring the initial brightness and current temperature of the fruit sorting environment, and establishing a temperature compensation model for light source attenuation; acquiring a background image of the fruit sorting environment and calculating the average grayscale value of the background image; calculating the light source status index of the fruit sorting environment based on the temperature compensation model, the current average grayscale value, and the current light source temperature; wherein the background image is an image without fruit; generating compensation parameters for the image acquisition device based on the light source status index and the type of fruit to be sorted; and based on the compensation... The system obtains corrected and compensated images by combining temperature compensation models for light source attenuation with brightness perception of the background image. Based on this, it achieves accurate assessment and intelligent compensation of the light source state by combining temperature compensation models for light source attenuation with brightness perception of the background image. In the absence of fruit, the system effectively separates normal attenuation caused by time and temperature from abnormal attenuation caused by factors such as contamination by using normalized light source state indicators. This avoids interference from fruit type, color, and surface characteristics on brightness measurement and ensures the accuracy of state assessment. Furthermore, it integrates the types of fruit to be sorted for differentiated compensation, enabling the system to dynamically optimize image acquisition parameters and ultimately obtain corrected images with uniform illumination and clear details. This significantly improves the stability, adaptability, and recognition accuracy of the sorting system under complex working conditions.
[0023] like Figure 2 As shown in the embodiment of this application, an adaptive optics compensation method for a fruit sorting device includes: S201. Obtain the initial brightness and current temperature of the fruit sorting environment, and establish a temperature compensation model for light source attenuation.
[0024] In some implementations, a high-precision temperature sensor, such as an NTC thermistor or a DS18B20 digital temperature sensor, is installed near the light source to monitor the temperature of the heat sink base of the light source module in real time.
[0025] The current temperature is obtained by reading data from the temperature sensor using a microcontroller or industrial computer.
[0026] S202. Collect background images of the fruit sorting environment.
[0027] The background image must be captured when there is no fruit on the conveyor belt to ensure a clean background that is not affected by fruit reflections or obstructions.
[0028] In some implementations, the triggering condition is: periodic triggering: after processing N fruits, such as automatically triggering background image acquisition once every 500 fruits.
[0029] Event trigger: When the device is started or restarted and runs for the first time, if the light source status indicator GZB is abnormal, such as GZB>1.3, verification data acquisition is triggered.
[0030] S203. Calculate the current average gray value of the background image.
[0031] S204. Based on the temperature compensation model, the current average gray value, and the current light source temperature, calculate the light source status index of the fruit sorting environment.
[0032] S205. Generate compensation parameters for the image acquisition device based on the light source status indicators and the type of fruit to be sorted.
[0033] S206. Based on the compensation parameters, obtain the corrected compensated image.
[0034] Based on the above technical solutions, the adaptive optics compensation method for fruit sorting equipment provided in this application establishes a light source attenuation model that integrates time and temperature factors, and monitors brightness using background images without fruit, thereby achieving accurate assessment of the health status of the light source system. A background acquisition mechanism combining periodic and event-triggered methods balances system operating efficiency and abnormal response capabilities. Light source status indicators effectively distinguish between normal aging and abnormal contamination, and a lightweight intelligent compensation network combining fruit type and multimodal input generates collaborative compensation parameters, achieving coordinated optimization of hardware illumination and software enhancement. Finally, a closed-loop verification mechanism ensures the effectiveness of the compensation, significantly improving the image stability, adaptability, and intelligence level of the fruit sorting system under complex working conditions, and guaranteeing long-term reliability of sorting accuracy.
[0035] In one possible implementation of this application embodiment, the temperature compensation model for light source attenuation in S201 is as follows: ; Where L is the current brightness. Initial brightness, t is the attenuation factor, k is the attenuation coefficient, and t is the total working time of the LED light source from startup to the present. Here is the temperature coefficient, and T is the current temperature. This is a reference temperature.
[0036] It should be pointed out that, This is a multiplier factor for the total aging rate, reflecting the concept of "temperature compensation." Among them, The temperature difference between the current temperature and the reference temperature. If... This indicates that the light source is operating at a "high temperature," accelerating aging; if This slows down the aging process. : The amount of temperature that corrects for the aging rate. The greater the temperature difference, the greater the correction.
[0037] when When the multiplier factor is 1, the decay rate is k.
[0038] when When the multiplier factor is greater than 1, the decay rate increases and the decay speeds up.
[0039] when When the multiplier factor is less than 1, the decay rate decreases and the decay slows down.
[0040] Based on the above technical solution, this temperature compensation model for light source attenuation achieves accurate prediction and compensation for changes in light source brightness by precisely quantifying the impact of temperature on the aging rate of the light source. Utilizing an exponential form combined with temperature coefficients and time factors, it not only accurately reflects the actual attenuation of the light source at different operating temperatures but also effectively distinguishes between normal aging and abnormal wear, ensuring the accuracy of brightness assessment from startup to any given moment; particularly, the introduction of a temperature compensation factor [1+ (T- The system dynamically adjusts the aging rate according to the ambient temperature, enabling it to adapt to different operating environments, extend the lifespan of the light source, maintain the stability of the light intensity, and thus improve the reliability and consistency of the system based on this light source. For example, the quality and efficiency of image acquisition in fruit sorting environments are significantly optimized.
[0041] In one possible implementation of this application embodiment, the above-mentioned S203 can be implemented through the following process: Get the grayscale value of each pixel in the background image, as well as the width and height of the background image; Through formula The average grayscale value EHD of the background image is calculated; where i is the pixel number in the background image, W is the width of the background image, H is the height of the background image, and HDi is the grayscale value of the i-th pixel in the background image.
[0042] It should be noted that EHD represents the total light intensity of the light source illuminating the camera sensor under the current conditions.
[0043] Based on the above technical solution, the average gray value EHD, representing the overall illumination level, is obtained by calculating the arithmetic mean of the gray values of all pixels in the background image. As a comprehensive representation of the output light intensity of the light source system, EHD can accurately reflect the actual brightness received by the camera under the current lighting conditions. Moreover, it is simple to calculate, has high real-time performance, and is suitable for high-speed sorting scenarios. At the same time, since the background image is acquired without fruit, the interference of differences in the measured object is avoided, so that EHD is only related to the light source state, optical system, and imaging parameters, ensuring the stability and comparability of the measurement. This provides reliable and consistent benchmark data support for subsequent light source attenuation analysis, state diagnosis, and intelligent compensation.
[0044] In one possible implementation of this application embodiment, the above-mentioned S204 can be implemented through the following process: Calculate the background brightness attenuation rate BLS = EHD / JHD; where JHD is the base gray value of the background image; Based on a temperature compensation model for light source attenuation and the current light source temperature, the theoretical attenuation factor of the fruit sorting environment image is calculated using a formula. ; Based on the background brightness attenuation rate and the theoretical attenuation factor, the light source status index GZB is calculated using the formula GZB=BLS / LSY.
[0045] The light source status index represents the ratio of actual attenuation to theoretical attenuation, which is the normalized degree of abnormal attenuation.
[0046] If GZB is within the preset threshold range, it means that the performance degradation of the light source lighting system is within the expected range and belongs to normal aging, so there is no need for excessive compensation. If GZB is less than the preset threshold range, it means that the performance of the light source lighting system has decreased less than expected, the light source is in good condition, or even better than expected.
[0047] If GZB is greater than the preset threshold range, it indicates that the performance degradation of the light source lighting system is far greater than expected, and there is an anomaly, such as dust, oil, or water vapor accumulation on the lens / light source window, requiring strong compensation or a cleaning warning.
[0048] Based on the above technical solution, by introducing the light source status index GZB, the actual observed background brightness attenuation rate is normalized and compared with the theoretical attenuation factor based on the time-temperature model. Its core advantages are: it can effectively isolate the expected attenuation caused by normal aging and temperature fluctuations, and accurately identify abnormal performance degradation caused by unexpected factors such as lens contamination, oil stains, or water vapor; as a normalized diagnostic index, GZB realizes intelligent judgment of the health status of the light source system, which not only avoids over-adjustment in traditional compensation strategies, but also triggers strong compensation or maintenance warnings in a timely manner when anomalies occur, significantly improving the system's adaptability, operational stability, and maintainability, and ensuring the continuous reliability of image quality during fruit sorting.
[0049] In one possible implementation of this application embodiment, the above-mentioned S205 can be implemented through the following process: The light source state indicators and the type of fruit to be sorted are input into the pre-trained lightweight intelligent compensation network LICC-Net, which outputs the optimal light source compensation parameters. The compensation parameters include light source driving parameters and camera image processing parameters.
[0050] The lightweight intelligent compensation network LICC-Net includes a first input branch, a second input branch, a feature extraction and fusion layer, and a dual-output decoupling layer. The first input branch is used to receive structured input data, which includes light source status indicators and the type of fruit to be sorted. The second input branch is used to receive the image quality feature map; wherein the image quality feature map is a uniformity heatmap and a sharpness heatmap generated after preprocessing the background image, and the size of the image quality feature map is smaller than the size of the original background image; The feature extraction and fusion layer includes: In the first input branch, the structured input data is encoded through a fully connected layer; In the second input branch, features are extracted from the image quality feature map through at least one depth-separable convolutional layer; In the middle layer of the network, the features of the first and second branches are weighted and fused through the channel-space attention module to generate a fused feature vector; The dual-output decoupling layer consists of two independent sub-networks: The first sub-network is used to generate light source driving parameters based on the fused feature vector; The second sub-network is used to generate camera image processing parameters based on the fused feature vector.
[0051] Based on the above technical solution, a lightweight intelligent compensation network LICC-Net is constructed to perform multimodal fusion of light source state indicators, structured data such as fruit type, and background image quality features. It adopts a dual-input branch and attention fusion mechanism, which effectively combines physical model criteria and visual perception information, improving the comprehensiveness and accuracy of compensation decisions. It reduces computational overhead through depthwise separable convolution, ensuring that the model can run in real time on embedded devices. It also adopts a dual-output decoupled structure to generate light source driving parameters and camera image processing parameters respectively, realizing the collaborative optimization of hardware lighting and software enhancement. It not only provides personalized compensation strategies for the optical characteristics of different fruits, but also significantly improves the system's adaptability and image quality stability under complex working conditions, taking into account compensation accuracy, response speed, and engineering practicality.
[0052] In one possible implementation of the embodiments of this application, combined with Figure 2 ,like Figure 3 As shown, the compensation process in S206 above can be implemented through the following steps: S1. Receive the light source driving parameters and camera image processing parameters output by the lightweight intelligent compensation network LICC-Net; S2. Adjust the driving signal of the LED light source module according to the light source driving parameters to change the luminous intensity of the light source; S3. While adjusting the light source, perform pixel-level image enhancement processing on the fruit images acquired in real time by the industrial camera according to the camera image processing parameters; wherein, the image enhancement processing includes at least one of dynamic range adjustment, nonlinear gain mapping and local contrast optimization; S4. The fruit image after image enhancement is used as the corrected compensation image for subsequent fruit quality analysis and sorting.
[0053] It should be noted that when the conveyor belt enters the fruitless state again, the background image is re-acquired; the light source status index is recalculated based on the newly acquired background image; if the light source status index is within the preset threshold range, the compensation is confirmed to be successful; if the light source status index still exceeds the preset threshold range, a compensation failure alarm is triggered or a secondary compensation process is started.
[0054] Based on the above technical solution, this compensation process achieves closed-loop control of light source compensation through the coordinated execution of hardware-driven adjustment and software image enhancement. It synchronously adjusts the light source output and camera image processing in time, ensuring strict alignment between compensation actions and image acquisition, effectively improving the consistency of image quality. Through pixel-level dynamic enhancement technology, it adaptively optimizes the dynamic range, brightness response, and local contrast of the image for different working conditions, significantly improving the usability of sorted images. More importantly, the introduction of a closed-loop verification mechanism based on the background image can re-evaluate the light source status indicators after compensation to determine whether the compensation meets the standards. If it fails, an alarm or secondary compensation is triggered, greatly enhancing the robustness and reliability of the system. This achieves an intelligent leap from "open-loop adjustment" to "closed-loop self-checking," ensuring the long-term stability and accuracy of fruit quality analysis.
[0055] The above primarily describes the solutions of the embodiments of this application from the perspective of device implementation. It is understood that each device, such as an adaptive optics compensation device for a fruit sorting device, includes at least one of the hardware structures and software modules corresponding to each function in order to achieve the above-mentioned functions. Those skilled in the art should readily recognize that, based on the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0056] This application embodiment can divide the adaptive optical compensation device of a fruit sorting equipment into functional units according to the above method example. For example, each function can be divided into a separate functional unit, or two or more functions can be integrated into one processing unit. The integrated unit can be implemented in hardware or as a software functional unit. It should be noted that the unit division in this application embodiment is illustrative and only represents a logical functional division. In actual implementation, there may be other division methods.
[0057] When using integrated units, Figure 4A possible structural schematic diagram of an adaptive optics compensation device (referred to as adaptive optics compensation device 50) for a fruit sorting device involved in the above embodiments is shown. The adaptive optics compensation device 50 includes a processing unit 501 and a communication unit 502, and may also include a storage unit 503. Figure 4 The schematic diagram shown can be used to illustrate the structure of an adaptive optical compensation device for a fruit sorting device involved in the above embodiments.
[0058] when Figure 4 The schematic diagram shown illustrates the structure of an adaptive optics compensation device for a fruit sorting device in the above embodiments. The processing unit 501 is used to control and manage the operation of the adaptive optics compensation device for a fruit sorting device. The communication unit 502 is used for the adaptive optics compensation device for a fruit sorting device to communicate with other devices. The storage unit 503 is used to store the program code and data of the adaptive optics compensation device for a fruit sorting device.
[0059] For example, the communication unit 502 is used to obtain the initial brightness and current temperature of the fruit sorting environment and establish a temperature compensation model for light source attenuation. The processing unit 501 is used to acquire background images of the fruit sorting environment, calculate the average gray value of the background image, and calculate the light source status index of the fruit sorting environment based on the temperature compensation model, the current average gray value and the current light source temperature.
[0060] In one possible implementation, the processing unit 501 is further configured to generate compensation parameters for the image acquisition device based on the light source status index and the type of fruit to be sorted; and to acquire a corrected compensated image based on the compensation parameters.
[0061] The processing unit 501 can be a processor or a controller, and the communication unit 502 can be a communication interface, transceiver, transceiver circuit, transceiver device, etc. The term "communication interface" is a general term and may include one or more interfaces. The storage unit 503 can be a memory. When the adaptive optics compensation device 50 is a chip, the processing unit 501 can be a processor or a controller, and the communication unit 502 can be an input interface and / or an output interface, pins, or circuits, etc. The storage unit 503 can be a storage unit within the chip (e.g., a register, cache, etc.) or a storage unit located outside the chip (e.g., read-only memory (ROM), random access memory (RAM, etc.).
[0062] The communication unit can also be called a transceiver unit. The antenna and control circuit with transceiver functions in the adaptive optics compensation device 50 can be considered as the communication unit 502 of the adaptive optics compensation device 50, and the processor with processing functions can be considered as the processing unit 501 of the adaptive optics compensation device 50. Optionally, the device in the communication unit 502 that implements the receiving function can be considered as a communication unit. The communication unit is used to execute the receiving steps in the embodiments of this application, and the communication unit can be a receiver, a receiver circuit, etc. The device in the communication unit 502 that implements the transmitting function can be considered as a transmitting unit. The transmitting unit is used to execute the transmitting steps in the embodiments of this application, and the transmitting unit can be a transmitter, a transmitter, a transmitting circuit, etc.
[0063] Figure 4 If the integrated units in the process are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this application. Storage media for storing computer software products include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.
[0064] Figure 4 The units in the process can also be called modules; for example, a processing unit can be called a processing module.
[0065] This application also provides a hardware structure diagram of an adaptive optics compensation device (denoted as adaptive optics compensation device 60) for a fruit sorting device, see [link to diagram]. Figure 5 The adaptive optics compensation device 60 includes a processor 601, and optionally, a memory 602 connected to the processor 601.
[0066] In the first possible implementation, see Figure 5The adaptive optics compensation device 60 also includes a transceiver 603. The processor 601, memory 602, and transceiver 603 are connected via a bus. The transceiver 603 is used to communicate with other devices or communication networks. Optionally, the transceiver 603 may include a transmitter and a receiver. The device in the transceiver 603 that implements the receiving function can be considered as a receiver, which is used to perform the receiving steps in the embodiments of this application. The device in the transceiver 603 that implements the transmitting function can be considered as a transmitter, which is used to perform the transmitting steps in the embodiments of this application.
[0067] Based on the first possible implementation method Figure 5 The schematic diagram shown can be used to illustrate the structure of an adaptive optical compensation device for a fruit sorting device involved in the above embodiments.
[0068] in, Figure 5 The diagram also illustrates a system chip in an adaptive optics compensation device for a fruit sorting machine. In this case, the actions performed by the adaptive optics compensation device of the aforementioned fruit sorting machine can be implemented by this system chip. The specific actions performed are described above and will not be repeated here.
[0069] Some of the data in the above formula are calculated by removing dimensions and taking their numerical values. The formula is the closest to the real situation obtained by software simulation of a large amount of collected data. The preset parameters and preset thresholds in the formula are set by those skilled in the art according to the actual situation or obtained through simulation of a large amount of data.
Claims
1. An adaptive optical compensation method for a fruit sorting device, characterized in that, include: The initial brightness and current temperature of the fruit sorting environment are obtained, and a temperature compensation model for light source attenuation is established. Background images of the fruit sorting environment are collected, and the average gray value of the background image is calculated. Based on the temperature compensation model, the current average gray value, and the current light source temperature, the light source status index of the fruit sorting environment is calculated. The background image is an image without fruit. Based on the light source status indicators and the type of fruit to be sorted, compensation parameters are generated for the image acquisition device; based on the compensation parameters, the corrected compensated image is obtained.
2. The adaptive optical compensation method for a fruit sorting device according to claim 1, characterized in that, The establishment of the temperature compensation model for light source attenuation includes: ; Where L is the current brightness. Initial brightness, t is the attenuation factor, k is the attenuation coefficient, and t is the total working time of the LED light source from startup to the present. Here is the temperature coefficient, and T is the current temperature. This is a reference temperature.
3. The adaptive optical compensation method for a fruit sorting device according to claim 1, characterized in that, The calculation of the average grayscale value of the background image includes: Get the grayscale value of each pixel in the background image, as well as the width and height of the background image; Through formula The average grayscale value EHD of the background image is calculated; where i is the pixel number in the background image, W is the width of the background image, H is the height of the background image, and HDi is the grayscale value of the i-th pixel in the background image.
4. The adaptive optical compensation method for a fruit sorting device according to claim 1, characterized in that, The calculation of the light source status indicators for the fruit sorting environment includes: Calculate the background brightness attenuation rate BLS = EHD / JHD; where JHD is the base gray value of the background image; Based on a temperature compensation model for light source attenuation and the current light source temperature, the theoretical attenuation factor of the fruit sorting environment image is calculated using a formula. ; Based on the background brightness attenuation rate and the theoretical attenuation factor, the light source status index GZB is calculated using the formula GZB=BLS / LSY.
5. The adaptive optical compensation method for a fruit sorting device according to claim 4, characterized in that, The light source status indicators include: If GZB is within the preset threshold range, it means that the actual attenuation of the light source is equal to the theoretical attenuation. If GZB is less than the preset threshold range, it means that the actual attenuation of the light source is less than the theoretical attenuation. If GZB is greater than the preset threshold range, it means that the actual attenuation of the light source is greater than the theoretical attenuation.
6. The adaptive optical compensation method for a fruit sorting device according to claim 1, characterized in that, The step of generating compensation parameters for the image acquisition device based on the light source status indicators and the type of fruit to be sorted includes: The light source state indicators and the type of fruit to be sorted are input into the pre-trained lightweight intelligent compensation network LICC-Net, which outputs the optimal light source compensation parameters. The compensation parameters include light source driving parameters and camera image processing parameters.
7. The adaptive optical compensation method for a fruit sorting device according to claim 6, characterized in that, The lightweight intelligent compensation network LICC-Net includes: The lightweight intelligent compensation network LICC-Net includes a first input branch, a second input branch, a feature extraction and fusion layer, and a dual-output decoupling layer; The first input branch is used to receive structured input data, which includes light source status indicators and the type of fruit to be sorted. The second input branch is used to receive the image quality feature map; wherein the image quality feature map is a uniformity heatmap and a sharpness heatmap generated after preprocessing the background image, and the size of the image quality feature map is smaller than the size of the original background image; The feature extraction and fusion layer includes: In the first input branch, the structured input data is encoded through a fully connected layer; In the second input branch, features are extracted from the image quality feature map through at least one depth-separable convolutional layer; In the middle layer of the network, the features of the first and second branches are weighted and fused through the channel-space attention module to generate a fused feature vector; The dual-output decoupling layer consists of two independent sub-networks: The first sub-network is used to generate light source driving parameters based on the fused feature vector; The second sub-network is used to generate camera image processing parameters based on the fused feature vector.
8. The adaptive optical compensation method for a fruit sorting device according to claim 1, characterized in that, The step of obtaining the corrected compensated image based on the compensation parameters includes: S1. Receive the light source driving parameters and camera image processing parameters output by the lightweight intelligent compensation network LICC-Net; S2. Adjust the driving signal of the LED light source module according to the light source driving parameters to change the luminous intensity of the light source; S3. While adjusting the light source, perform pixel-level image enhancement processing on the fruit images acquired in real time by the industrial camera according to the camera image processing parameters; wherein, the image enhancement processing includes at least one of dynamic range adjustment, nonlinear gain mapping and local contrast optimization; S4. The fruit image after image enhancement is used as the corrected compensation image for subsequent fruit quality analysis and sorting.
9. The adaptive optical compensation method for a fruit sorting device according to claim 8, characterized in that, The process of obtaining the corrected compensated image further includes: When the conveyor belt enters the fruitless state again, the background image is re-captured; The light source status index is recalculated based on the newly acquired background image; If the light source status indicator is within the preset threshold range, the compensation is confirmed to be successful; if the light source status indicator still exceeds the preset threshold range, a compensation failure alarm is triggered.
10. An adaptive optical compensation system for a fruit sorting device, operating based on the adaptive optical compensation method for a fruit sorting device according to any one of claims 1-9, characterized in that, include: Modeling module, analysis module, and compensation module; The modeling module is used to obtain the initial brightness and current temperature of the fruit sorting environment and to establish a temperature compensation model for light source attenuation. The analysis module is used to collect background images of the fruit sorting environment and calculate the average gray value of the background images; based on the temperature compensation model, the current average gray value, and the current light source temperature, it calculates the light source status index of the fruit sorting environment. The compensation module is used to generate compensation parameters for the image acquisition device based on the light source status indicators and the type of fruit to be sorted. Based on the compensation parameters, the corrected compensated image is obtained.