A method and system for precise adjustment of factory lighting based on machine vision
By combining machine vision and mapping models with the coordinated control of LED light source units and reflector units, the system achieves full-area, real-time, and precise light adjustment within the cultivation plant, solving the problems of low precision and high cost in traditional light adjustment and providing an efficient light management system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FUJIAN PROV AGRI MACHANIZATION INST
- Filing Date
- 2026-04-23
- Publication Date
- 2026-06-09
AI Technical Summary
Traditional factory cultivation suffers from low precision and slow response in light regulation, making it impossible to achieve localized differentiated control. Intelligent supplemental lighting systems have complex wiring and high costs, and lack surface light field information.
Machine vision is used to acquire real-time image data of the cultivation plant. The light parameter deviation is calculated through a mapping model, and collaborative control commands are generated. LED light source units and reflector units are used for precise adjustment to build a full-domain, real-time intelligent light management system.
It enables real-time and precise light perception and control across the entire cultivation plant, reducing system deployment costs, improving the accuracy and robustness of light parameter inversion, adapting to different layouts and scales, and providing multiple degrees of freedom for light adjustment.
Smart Images

Figure CN122179956A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent control and automation of agricultural environment, and in particular to a method and system for precise adjustment of factory lighting based on machine vision. Background Technology
[0002] The growth morphology, accumulation of secondary metabolites, and quality of medicinal fungi such as Ganoderma lucidum are greatly affected by light parameters, including illuminance, light quality, and photoperiod. For example, under low light conditions, the cap of Ganoderma lucidum thickens and its color deepens, but its growth rate may be limited. In traditional factory cultivation, light is mainly regulated by manually adjusting the position of lamps, replacing filters, or using shade nets. This method suffers from problems such as low adjustment precision, slow response speed, inability to achieve localized differentiated control, and poor automation.
[0003] Existing intelligent supplemental lighting systems mostly rely on discrete light sensors arranged in the cultivation bed, which has drawbacks such as complex wiring, high cost, limited monitoring points, and loss of planar light field information.
[0004] Therefore, there is an urgent need for an intelligent light management system that can perceive and control the cultivation space in a comprehensive, real-time and precise manner. Summary of the Invention
[0005] To address the aforementioned problems in the prior art, this application provides a machine vision-based method and system for precise adjustment of factory lighting, enabling intelligent lighting control of the entire cultivation factory area in real time and with high precision.
[0006] To achieve the above objectives, the technical solution adopted in this application is as follows: In a first aspect, this application provides a machine vision-based method for precise adjustment of factory lighting, comprising the following steps: Acquire real-time image data inside the cultivation plant; The real-time image data is input into the mapping model to obtain the current illumination parameters of each zone in the cultivation plant. The mapping model has a mapping relationship between image features and illumination parameters. Calculate the real-time deviation between the current illumination parameters and the target illumination parameters for each partition; Based on the real-time deviation, corresponding collaborative control commands are generated for each partition, and the lighting conditions of each partition are adjusted through the collaborative control commands. Repeat the above steps until the target lighting parameters are achieved.
[0007] The beneficial effects of this application are as follows: by acquiring real-time images of the cultivation plant, using a mapping model to calculate the current illumination parameters of each zone, calculating the real-time deviation from the target parameters, generating collaborative control commands, and repeating the above closed-loop steps until the target is met, intelligent illumination can be achieved for the entire cultivation plant in real time and with precise perception and control.
[0008] Optionally, the real-time image data is RAW format image data, and the training steps of the mapping model include: In a closed cultivation workshop using only the system's own light source, the actual illuminance and color temperature were measured simultaneously at the gridded positions of the cultivation layer using a standard light meter, and the corresponding RAW images were acquired. Extract the image feature vector from the RAW image, the image feature vector including the mean and standard deviation of the red, green and blue channels of the predetermined color block region; The mapping model is obtained by training using regression analysis or machine learning methods.
[0009] As described above, by using RAW format image data, gridded standard illuminometer calibration, and machine learning training, the linear characteristics of RAW data are fully utilized, avoiding the information loss of traditional gamma-corrected images, significantly improving the accuracy and robustness of illumination parameter inversion, and reducing system deployment costs.
[0010] Optionally, the training step of the mapping model further includes: Dark current correction is performed using the linearity of RAW data.
[0011] Optionally, the training step of the mapping model further includes: The neural network is trained using an attention mechanism, which is to increase the attention weight of the target area on the cultivation bed surface.
[0012] As described above, by introducing a neural network with an attention mechanism, the mapping model can adaptively focus on target areas such as the cultivation bed surface, effectively eliminating interference from a fixed background and further improving the accuracy of light parameter extraction in complex cultivation plant environments.
[0013] Optionally, the training step of the mapping model further includes: Add physical constraints for illuminance and color temperature to the loss function; The spatial coordinates of each sampling point in the training data are used as one of the input features to fit the attenuation function of the light field in the spatial location, and a general inversion model that is spatially adaptive is trained and used as the mapping model.
[0014] As described above, by adding a physical constraint term to the loss function and using the spatial coordinates of the sampling points as input features, the model can learn and correct the natural attenuation of the light field in space, establishing a general inversion model applicable to the entire cultivation plant space. This achieves accurate mapping from local calibration to the entire domain, greatly enhancing the system's adaptability to different layouts and scales.
[0015] Optionally, before inputting the real-time image data into the mapping model, the method further includes: The real-time image data is stitched and corrected, and the image pixels of the real-time image data are mapped to each partition according to the digital map of the cultivation plant.
[0016] Optionally, the real-time deviation includes illuminance deviation and color temperature deviation, and the step of generating collaborative control commands based on the real-time deviation includes: When the absolute value of the illuminance deviation exceeds the first deviation threshold, an instruction is generated to adjust the driving current of one or more LED light source units covering the corresponding partition. When the absolute value of the color temperature deviation exceeds the second deviation threshold, an instruction is generated to adjust the color temperature of the corresponding LED light source unit or the RGB channel mixing ratio. When the illumination is uneven within a partition or between adjacent areas, the target deflection angle of the reflector unit is calculated by the geometric optical model, and a corresponding angle adjustment command is generated. The reflector unit is a two-degree-of-freedom reflector unit, which accurately deflects and reflects light through pitch motors and azimuth motors. The LED light source units and reflector units are arranged alternately in an array within the cultivation plant.
[0017] Optionally, generating the collaborative control instructions corresponding to each partition includes: The real-time deviation is converted into a control quantity using a PID controller or a fuzzy controller.
[0018] Optionally, the sampling adjustment period for repeating the above steps is 30-60 seconds.
[0019] Secondly, this application provides a machine vision-based precise lighting adjustment system for a factory, including an image acquisition unit, an LED light source unit, a reflector unit, and a central controller arranged in a cultivation factory. The central controller is used to execute a machine vision-based precise lighting adjustment method for a factory according to the first aspect.
[0020] The second aspect provides a machine vision-based precise lighting adjustment system for factory buildings, referring to the description of the machine vision-based precise lighting adjustment method for factory buildings provided in the first aspect. Attached Figure Description
[0021] Figure 1This is a schematic diagram of the main process of a machine vision-based method for precise adjustment of factory lighting according to an embodiment of this application; Figure 2 This is a schematic diagram of the architecture of a machine vision-based precision lighting adjustment system for a factory, according to an embodiment of this application. Detailed Implementation
[0022] To better understand the above technical solutions, exemplary embodiments of this application will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this application can be understood more clearly and thoroughly, and that the scope of this application can be fully conveyed to those skilled in the art.
[0023] The embodiments of this application are applied to industrialized cultivation scenarios such as medicinal fungi. Existing technologies mainly rely on manual adjustment of lamp positions or replacement of filter films, resulting in low adjustment accuracy, slow response, and inability to achieve localized differentiated control. In contrast, intelligent supplemental lighting systems often use discrete sensors, which suffer from problems such as complex wiring, high cost, and lack of planar light field information.
[0024] Therefore, in various embodiments of this application, real-time image data of the cultivation plant is acquired; the real-time image data is input into a mapping model to obtain the current illumination parameters of each zone within the cultivation plant, and the mapping model has a mapping relationship between image features and illumination parameters; the real-time deviation between the current illumination parameters and the target illumination parameters of each zone is calculated; based on the real-time deviation, corresponding collaborative control commands for each zone are generated, and the illumination of each zone is adjusted through the collaborative control commands; the above steps are repeated until the target illumination parameters are reached. This achieves intelligent illumination control of the entire cultivation plant in real-time and with precise perception.
[0025] It should be noted that the cultivation facility of this application uses a high-reflectivity, low-gloss diffuse reflection material on its inner surface to form a uniform background light field and reduce the interference of local specular reflection on perception. The diffuse reflection material can be a white ultra-low gloss polyester coating, etc. Furthermore, the cultivation facility can be kept completely sealed and opaque during the cultivation of Ganoderma lucidum by covering the windows, relying on a fresh air system, and eliminating the introduction of natural light. Therefore, the system only needs to handle known and controllable LED light sources, without compensating for or counteracting changing natural light, thus improving control stability and accuracy.
[0026] The present application will now be described in further detail with reference to the accompanying drawings and embodiments.
[0027] This application provides a machine vision-based method for precise adjustment of factory lighting, such as... Figure 1 As shown, the method includes the following: Step 100: Obtain real-time image data inside the cultivation plant.
[0028] At the start of each sampling adjustment period T, all image acquisition units, i.e., cameras, are synchronously triggered to acquire RAW format images I covering the entire cultivation plant. current For image I current The images are stitched together, corrected, and mapped to physical cultivation zones based on the digital map. i .
[0029] In this embodiment, before inputting real-time image data into the mapping model, the following steps are also included: The real-time image data is stitched and corrected, and the image pixels of the real-time image data are mapped to each partition according to the digital map of the cultivation plant.
[0030] Step 200: Input the real-time image data into the mapping model to obtain the current illumination parameters of each zone in the cultivation plant. The mapping model has the mapping relationship between image features and illumination parameters.
[0031] For each partition Zone i Extract the pixel data of the corresponding image region and calculate its feature vector f. i The eigenvector f i Input a calibrated mapping model M, output the current illuminance estimate L for that partition. i and color temperature estimate CT i , as the current illumination parameter.
[0032] Step 300: Calculate the real-time deviation between the current illumination parameters and the target illumination parameters for each partition.
[0033] Specifically, the real-time deviation of parameters for each partition is calculated: ΔL i =L target_i -L i ; ΔCT i =CT target_i -CT i In the formula, L target_i T is the target illuminance parameter. target_i The target color temperature parameter.
[0034] Step 400: Based on the real-time deviation, generate corresponding collaborative control commands for each partition, and adjust the lighting conditions of each partition through the collaborative control commands.
[0035] In this embodiment, the real-time deviation includes illuminance deviation and color temperature deviation. A coordinated control command is generated based on the real-time deviation, including: a. When the absolute value of the illuminance deviation exceeds the first deviation threshold, an instruction is generated to adjust the drive current of one or more LED light source units covering the corresponding zone.
[0036] b. When the absolute value of the color temperature deviation exceeds the second deviation threshold, an instruction is generated to adjust the color temperature of the corresponding LED light source unit or the RGB channel mixing ratio.
[0037] c. When the illumination is uneven within a partition or between adjacent areas, the target deflection angle of the reflector unit is calculated through a geometric optics model, and the corresponding angle adjustment command is generated. The reflector unit is a two-degree-of-freedom reflector unit, which accurately deflects the reflected light through pitch motors and azimuth motors.
[0038] Among them, if Zone i If there is uneven illumination within or between adjacent areas, calculate the target deflection angle (θ) of the mirror unit that can improve this situation. x ,θ y (), determined by a geometric optics model.
[0039] In this embodiment, the LED light source unit and the reflector unit are arranged alternately in an array inside the cultivation plant.
[0040] This includes generating collaborative control instructions for each partition, including: PID controllers or fuzzy controllers are used to convert real-time deviations into control quantities.
[0041] Specifically, a PID (Proportional-Integral-Derivative Controller) or a fuzzy controller is used to convert the above deviations into smooth and stable control quantities, thereby avoiding system oscillations.
[0042] Step 500: Repeat the above steps until the target lighting parameters are achieved.
[0043] The central controller sends control commands, such as PWM (Pulse Width Modulation) signals and motor rotation commands, to the corresponding execution units via the bus. After all units have completed their actions, the system waits for a fixed sampling and adjustment period T, such as 30-60 seconds, and then returns to step 100 to start the next control cycle, forming a closed loop.
[0044] In one embodiment, if the real-time image data is in RAW (RAW Image File) format, then the training steps of the mapping model include: Step 001: In a closed cultivation workshop using only the system's own light source, simultaneously measure the actual illuminance and color temperature at the gridded positions of the cultivation layer using a standard light meter, and acquire the corresponding RAW images.
[0045] Step 002: Extract the image feature vector of the RAW image. The image feature vector includes the mean and standard deviation of the red, green and blue channels of the predetermined color block region.
[0046] The image feature vector includes the mean and standard deviation of the R, G, and B channels of a predetermined color patch region.
[0047] Step 003: Train the mapping model using regression analysis or machine learning methods.
[0048] In this embodiment, machine learning includes support vector machines, neural networks, and so on.
[0049] Therefore, by making full use of the linear characteristics of RAW data, the information loss of traditional gamma-corrected images is avoided, significantly improving the accuracy and robustness of illumination parameter inversion, while reducing system deployment costs.
[0050] In one embodiment, the training step of the mapping model further includes: a. Dark current correction is performed using the linearity of RAW data.
[0051] One implementation of dark current correction involves pre-capturing a completely black image through a blocked lens, using its pixel values as dark current noise, and subtracting them from all images to ensure that the pixel values are linearly related to the LED light intensity. This method is more helpful in accurately determining the current ambient light parameters than traditional RGB images that have undergone nonlinear gamma correction.
[0052] b. A neural network with an attention mechanism is used for training, whereby the attention weight of the target area on the cultivation bed is increased.
[0053] Among them, by introducing neural network training with an attention mechanism, the mapping model can adaptively focus on target areas such as the cultivation bed surface, effectively eliminating the interference of a fixed background and further improving the accuracy of light parameter extraction in complex cultivation plant environments.
[0054] c. Add physical constraints for illuminance and color temperature to the loss function.
[0055] In this process, physical constraints are added to ensure that the predicted illuminance and color temperature are physically self-consistent.
[0056] d. The spatial coordinates of each sampling point in the training data are used as one of the input features to fit the attenuation function of the light field in the spatial position, and a general inversion model that is spatially adaptive is trained and used as the mapping model.
[0057] By adding a physical constraint term to the loss function and using the spatial coordinates of the sampling points as input features, the model can learn and correct the natural attenuation of the light field in space, establishing a general inversion model applicable to the entire cultivation plant space. This achieves accurate mapping from local calibration to the entire domain, greatly enhancing the system's adaptability to different layouts and scales.
[0058] In summary, this application has the following beneficial effects: First, by using machine vision to replace the traditional discrete physical sensor network, area-based, non-contact illumination monitoring is achieved, completely eliminating the complex wiring and blind spot problems of point sensor deployment, reducing system complexity and cost, and obtaining environmental information with higher spatial resolution at the same cost.
[0059] Secondly, through the matrix-style cross-layout and coordinated control of LED light source units and two-degree-of-freedom reflector units, the light intensity, spectrum, irradiation angle and range can be multi-dimensionally adjusted, which can meet the differentiated light requirements of different parts of crops such as Ganoderma lucidum and provide a spatial adjustment degree of freedom far exceeding that of a single smart lamp.
[0060] Third, a complete feedback system with perception, decision-making, and execution capabilities has been constructed, which can continuously learn from environmental changes, dynamically adjust strategies, and automatically maintain preset lighting environment goals, thus achieving an upgrade from manual intervention to system autonomy.
[0061] Fourth, the system architecture and method described above are not only applicable to the industrialized cultivation of medicinal fungi, but can also be extended to other high-value crop production, industrial testing, biological experiments and other fields that require precise light control.
[0062] In one embodiment, such as Figure 2 As shown, this application also provides a machine vision-based precise lighting adjustment system for a factory, including an image acquisition unit 201, an LED light source unit 202, a reflector unit 203, and a central controller 204 arranged in a cultivation factory. The central controller 204 is used to execute a machine vision-based precise lighting adjustment method for a factory according to the above embodiments.
[0063] The image acquisition unit 201 includes a main camera and a secondary camera installed on the side wall of the plant. The main camera is an industrial camera that supports RAW format and is responsible for acquiring the main field of view image of the cultivation area. The secondary camera is used to cover the blind spot of the main camera. The two work together to realize real-time image data of the entire scene in the cultivation plant.
[0064] The LED light source units and reflector units are arranged alternately in an array on the top of the cultivation plant to form a matrix-type lighting adjustment device. Specifically, it also includes an adjustment substrate with an optical mirror surface and regularly arranged mounting holes. The LED light source units are installed in some of the mounting holes on the adjustment substrate and can independently adjust the brightness, color temperature, and RGB spectrum output. The reflector units are installed in the other part of the mounting holes on the adjustment substrate. Specifically, they are two-degree-of-freedom reflector units that can accurately deflect and reflect light through pitch motors and azimuth motors.
[0065] This embodiment of a machine vision-based factory lighting precision adjustment system only... Figure 2 The block diagrams shown here relate to some structures of the present application and do not constitute a limitation on the apparatus to which the present application is applied. Specific apparatuses may include more or fewer components than shown in the diagrams, or may combine certain components, or may have different component arrangements. Furthermore, the machine vision-based factory lighting precision adjustment system of this embodiment can operate on an operating system stored in memory, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.
[0066] In addition, the specific descriptions of the technical effects and steps of the machine vision-based factory lighting precision adjustment system in the above embodiments are all based on the relevant descriptions of the machine vision-based factory lighting precision adjustment method in the embodiments.
[0067] Since the systems / devices described in the above embodiments of this application are systems / devices used to implement the methods of the above embodiments of this application, those skilled in the art can understand the specific structure and modifications of the system / devices based on the methods described in the above embodiments of this application, and therefore will not be repeated here. All systems / devices used in the methods of the above embodiments of this application fall within the scope of protection of this application.
[0068] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0069] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions.
[0070] It should be noted that any reference numerals placed between parentheses in the claims should not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The words "a" or "an" preceding a component do not exclude the presence of a plurality of such components. This application can be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In claims that enumerate several means, several of these means may be embodied by the same hardware. The use of the terms first, second, third, etc., is merely for convenience of expression and does not indicate any order. These terms can be understood as part of the component names.
[0071] Furthermore, it should be noted that in the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0072] Although preferred embodiments of this application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the claims should be interpreted to include the preferred embodiments as well as all changes and modifications falling within the scope of this application.
[0073] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if these modifications and variations fall within the scope of the claims of this application and their equivalents, then this application should also include these modifications and variations.
Claims
1. A method for precise adjustment of factory lighting based on machine vision, characterized in that, Includes the following steps: Acquire real-time image data inside the cultivation plant; The real-time image data is input into the mapping model to obtain the current illumination parameters of each zone in the cultivation plant. The mapping model has a mapping relationship between image features and illumination parameters. Calculate the real-time deviation between the current illumination parameters and the target illumination parameters for each partition; Based on the real-time deviation, corresponding collaborative control commands are generated for each partition, and the lighting conditions of each partition are adjusted through the collaborative control commands. Repeat the above steps until the target lighting parameters are achieved.
2. The method for precise adjustment of factory lighting based on machine vision according to claim 1, characterized in that, The real-time image data is in RAW format, and the training steps of the mapping model include: In a closed cultivation workshop using only the system's own light source, the actual illuminance and color temperature were measured simultaneously at the gridded positions of the cultivation layer using a standard light meter, and the corresponding RAW images were acquired. Extract the image feature vector from the RAW image, the image feature vector including the mean and standard deviation of the red, green and blue channels of the predetermined color block region; The mapping model is obtained by training using regression analysis or machine learning methods.
3. The method for precise adjustment of factory lighting based on machine vision according to claim 2, characterized in that, The training steps of the mapping model also include: Dark current correction is performed using the linearity of RAW data.
4. A method for precise adjustment of factory lighting based on machine vision according to claim 2 or 3, characterized in that, The training steps of the mapping model also include: The neural network is trained using an attention mechanism, which is to increase the attention weight of the target area on the cultivation bed surface.
5. The method for precise adjustment of factory lighting based on machine vision according to claim 4, characterized in that, The training steps of the mapping model also include: Add physical constraints for illuminance and color temperature to the loss function; The spatial coordinates of each sampling point in the training data are used as one of the input features to fit the attenuation function of the light field in the spatial location, and a general inversion model that is spatially adaptive is trained and used as the mapping model.
6. The method for precise adjustment of factory lighting based on machine vision according to claim 1, characterized in that, Before inputting the real-time image data into the mapping model, the process also includes: The real-time image data is stitched and corrected, and the image pixels of the real-time image data are mapped to each partition according to the digital map of the cultivation plant.
7. The method for precise adjustment of factory lighting based on machine vision according to claim 1, characterized in that, The real-time deviation includes illuminance deviation and color temperature deviation, and the generation of collaborative control commands based on the real-time deviation includes: When the absolute value of the illuminance deviation exceeds the first deviation threshold, an instruction is generated to adjust the driving current of one or more LED light source units covering the corresponding partition. When the absolute value of the color temperature deviation exceeds the second deviation threshold, an instruction is generated to adjust the color temperature of the corresponding LED light source unit or the RGB channel mixing ratio. When the illumination is uneven within a partition or between adjacent areas, the target deflection angle of the reflector unit is calculated by the geometric optical model, and a corresponding angle adjustment command is generated. The reflector unit is a two-degree-of-freedom reflector unit, which accurately deflects and reflects light through pitch motors and azimuth motors. The LED light source units and reflector units are arranged alternately in an array within the cultivation plant.
8. The method for precise adjustment of factory lighting based on machine vision according to claim 7, characterized in that, The generation of collaborative control instructions corresponding to each partition includes: The real-time deviation is converted into a control quantity using a PID controller or a fuzzy controller.
9. The method for precise adjustment of factory lighting based on machine vision according to claim 1, characterized in that, The sampling adjustment period for repeating the above steps is 30-60 seconds.
10. A machine vision-based precision lighting adjustment system for factory buildings, characterized in that, The invention includes an image acquisition unit, an LED light source unit, a reflector unit, and a central controller arranged in a cultivation workshop. The central controller is used to execute a machine vision-based method for precise adjustment of workshop lighting as described in any one of claims 1 to 9.