An imaging condition setting method, device, apparatus and system
Patent Information
- Application Number
- CN202611064481.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-16
- Publication Date
- 2026-10-16
AI Technical Summary
[0004]在使用多分区光源时,由于多分区光源具有多个光源分区,那么,在面临不同待测物体(如电子制造工业的零件或者物流行业的包裹等)时,多分区光源应该点亮哪些光源分区,关闭哪些光源分区,并没有有效的实现方式
[0026]As can be seen from the above technical solutions, in this embodiment, a first reference image can be acquired, and a target region on the first reference image can be acquired. The target region includes N image blocks. When imaging the object under test, the multi-zone light source can be controlled to supplement the target light source zones associated with the N image blocks, that is, to supplement the target light source zones associated with the target region (such as the image region desired by the user). In this way, when imaging different objects under test (such as parts in the electronics manufacturing industry or packages in the logistics industry), the multi-zone light source can be controlled to illuminate some light source zones (i.e., target light source zones) and turn off the remaining light source zones according to the user's actual needs, that is, to illuminate the light source zones according to the image region indicated by the user.
Smart Images

Figure CN122934077A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine vision technology, and in particular to a method, apparatus, device and system for setting imaging conditions. Background Technology
[0002] With the rapid development of machine vision inspection technology, its application in manufacturing is becoming increasingly widespread. In machine vision systems, multi-zone light sources feature multiple zones of illumination and multi-directional lighting. Regarding multiple zones of illumination: while ordinary light sources operate with uniform illumination, multi-zone light sources divide the light source into multiple zones (i.e., light source partitions), allowing each partition to illuminate independently. This provides more precise control for the machine vision system, ensuring optimal visual inspection results. Regarding multi-directional lighting: in many cases, simultaneous illumination from two directions is required to achieve the desired effect. Multi-zone light sources, with their multiple light source partitions, offer greater flexibility and facilitate a more comprehensive analysis and evaluation of the object under test.
[0003] Applications of multi-segment light sources include: 1. Surface unevenness detection: Used in industries such as electronics manufacturing and automotive to detect minute unevenness on the surface of objects. 2. Background defect detection: When facing complex backgrounds, multi-segment light sources can highlight key defects, minimize background interference, and improve the accuracy of defect detection. 3. Character reading: In the packaging, logistics, or other industries where character reading is required, the multi-directional lighting of multi-segment light sources can increase character clarity and provide a higher character reading success rate. 4. Use in conjunction with photometric stereo algorithms: Multi-segment light sources work in conjunction with photometric stereo algorithms to provide advanced visual inspection solutions, obtaining more accurate results in complex inspection scenarios.
[0004] When using a multi-zone light source, since it has multiple light source zones, there is no effective way to determine which light source zones should be lit and which should be turned off when dealing with different objects under test (such as parts in the electronics manufacturing industry or packages in the logistics industry). Summary of the Invention
[0005] In a first aspect, this application provides a method for setting imaging conditions, the method comprising: Acquire the first reference image; Obtain the target region on the first reference image; wherein the first reference image includes M image blocks, M is greater than 1, and the target region includes N image blocks from the M image blocks, N is greater than or equal to 1; wherein the multi-zone light source corresponds to K light source zones, K is greater than 1, and there is an association between the M image blocks and the K light source zones; Based on the aforementioned correlation, the target light source partition corresponding to the target area is determined.
[0006] For example, the method further includes: acquiring a second reference image; Target imaging conditions are set based on the reference imaging conditions corresponding to the second reference image; wherein, the reference imaging conditions are configured to generate the second reference image; the target imaging conditions are configured to generate a target image, which is used for a machine vision task; the target imaging conditions include supplementary lighting parameters, which indicate supplementary lighting based on the target light source partition.
[0007] For example, setting the target imaging condition based on the reference imaging condition corresponding to the second reference image includes: setting the reference imaging condition as the target imaging condition; Alternatively, the second reference image may be optimized and adjusted according to the obtained adjustment requirements; the target imaging conditions may be set based on the imaging conditions corresponding to the optimized second reference image.
[0008] For example, optimizing the second reference image according to the obtained adjustment requirements includes: optimizing the second reference image according to at least one optimization method corresponding to the adjustment requirements.
[0009] For example, optimizing the second reference image according to at least one optimization method corresponding to the adjustment requirement includes at least one of the following methods: An imaging parameter adjustment instruction is obtained, and the reference imaging parameters corresponding to the second reference image are adjusted based on the imaging parameter adjustment instruction to optimize the second reference image; wherein, the adjustment requirement is the imaging parameter adjustment instruction; the imaging parameter adjustment instruction is input through interactive operation of the imaging parameter adjustment control provided in the graphical user interface; Obtain an optimization direction confirmation command, and adjust the imaging parameters corresponding to the optimization direction based on the optimization direction confirmation command to optimize the second reference image; wherein, the adjustment requirement is the optimization direction confirmation command; the optimization direction confirmation command is input by selecting the optimization direction function options provided in the graphical user interface; Natural language describing the adjustment requirements is obtained, semantic parsing is performed on the natural language to obtain the semantic parsing result, and the imaging parameters indicated by the semantic parsing result are adjusted based on the semantic parsing result to optimize the second reference image; wherein, the adjustment requirements are natural language.
[0010] For example, the semantic parsing result includes the image features to be adjusted and the adjustment target; The semantic parsing of the natural language to obtain the semantic parsing result includes: The natural language is parsed to identify keywords, and a pre-established mapping relationship between keywords and image feature adjustment direction and magnitude is queried to determine the image features to be adjusted and the adjustment target; or, the natural language is input into a pre-trained machine learning model, and the machine learning model is used to determine the image features to be adjusted and the adjustment target; or, the natural language is input into a large model, and the large model is used to determine the image features to be adjusted and the adjustment target.
[0011] For example, adjusting the imaging parameters indicated by the semantic parsing result based on the semantic parsing result to optimize the second reference image includes: Based on the reference imaging parameters corresponding to the second reference image, and the image features to be adjusted and the adjustment target, the imaging parameters to be adjusted and the parameter search range are determined; based on the imaging parameters to be adjusted and the parameter search range, the reference imaging parameters corresponding to the second reference image are optimized and adjusted.
[0012] For example, the process of determining the association between M image blocks and the K light source partitions specifically includes: acquiring K light source images corresponding to the K light source partitions; wherein, for each light source partition, the multi-partition light source is controlled to illuminate the light source partition, and a light source image corresponding to the light source partition is acquired; for each image block, the contribution intensity of the K light source partitions to the image block is determined based on the K light source images, and a light source partition associated with the image block is selected based on the contribution intensity; the association between the image block and the light source partition is recorded.
[0013] For example, determining the contribution intensity of the K light source partitions to the image block based on the K light source images includes: for each light source partition, determining a difference image based on the light source image and dark field image corresponding to the light source partition; wherein, controlling the multi-partition light source to turn off all light source partitions to obtain the dark field image; determining the contribution intensity of the light source partition to the image block based on the pixel value corresponding to the image block in the difference image; wherein, the contribution intensity includes the average value or summation value of the pixel values.
[0014] For example, the process of acquiring the first reference image or the second reference image includes: acquiring multiple recommended images under multiple imaging conditions; determining a reference image based on the multiple recommended images; wherein the reference image is the first reference image or the second reference image.
[0015] For example, acquiring multiple recommended images under multiple imaging conditions includes: acquiring multiple candidate images under multiple imaging conditions; obtaining an evaluation result of the candidate images based on the image features of the candidate images; and determining the recommended image from the multiple candidate images based on the evaluation result.
[0016] For example, the candidate image includes: an original image acquired based on imaging conditions, and / or a fused image obtained by fusing the acquired original images.
[0017] For example, before determining the recommended image from the plurality of candidate images based on the evaluation result, the method further includes: determining the style category of the candidate images to obtain candidate images of at least one style category; determining the recommended image from the plurality of candidate images based on the evaluation result includes: selecting the recommended image from the candidate images of the at least one style category based on the evaluation result of the candidate images of the at least one style category.
[0018] For example, determining a reference image based on the plurality of recommended images includes: determining the reference image based on the plurality of displayed recommended images; wherein, the method of displaying the plurality of recommended images includes: displaying the plurality of recommended images through a first visualization interface; wherein, when there are recommended images of multiple style categories, the first visualization interface displays recommended images of the multiple style categories; or, displaying a recommended image of one style category through a second visualization interface; and when there are recommended images of multiple style categories and a style category switching instruction is detected, switching the recommended image displayed in the second visualization interface.
[0019] For example, obtaining the target region on the first reference image includes: receiving an operation command for the first reference image, and obtaining the target region on the first reference image based on the operation command; wherein, receiving the operation command for the first reference image includes: receiving a natural language operation command, the natural language operation command including location information of the target region on the first reference image, and the location information being used to indicate the target region; or, receiving a selection operation command or a click operation command, the selection operation command or the click operation command being used to operate the target region on the first reference image.
[0020] For example, after acquiring the first reference image, the method further includes: receiving a selection command for a reference light source partition among the K light source partitions; and displaying image blocks on the first reference image associated with the reference light source partition based on the association relationship between the M image blocks and the K light source partitions.
[0021] Secondly, this application provides an imaging condition setting device, the device comprising: An acquisition module is used to acquire a first reference image; acquire a target region on the first reference image; wherein the first reference image includes M image blocks, M is greater than 1, and the target region includes N image blocks from the M image blocks, N is greater than or equal to 1; wherein a multi-zone light source corresponds to K light source zones, K is greater than 1, and there is an association relationship between the M image blocks and the K light source zones; a determination module is used to determine the target light source zone corresponding to the target region based on the association relationship.
[0022] Thirdly, this application provides an electronic device, including: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor; the processor is configured to execute the machine-executable instructions to implement the imaging condition setting method of the above example.
[0023] Fourthly, this application provides a machine vision task processing system, comprising: a display unit, an imaging condition setting unit, an image acquisition unit, and a machine vision task processing unit; wherein: the display unit is used to display an image; the image acquisition unit is used to acquire an image; the imaging condition setting unit is used to set imaging conditions according to the imaging condition setting method exemplified above in this application; and the machine vision task processing unit is used to acquire a target image under the imaging conditions set by the imaging condition setting unit, and perform machine vision task processing on the target image under the imaging conditions.
[0024] Fifthly, this application provides a computer program product, which includes a computer program that, when executed by a processor, implements the method for setting imaging conditions as described above.
[0025] In a sixth aspect, this application provides a machine-readable storage medium storing machine-executable instructions that can be executed by a processor; wherein the processor is configured to execute the machine-executable instructions to implement the imaging condition setting method of the above-described example of this application.
[0026] As can be seen from the above technical solutions, in this embodiment, a first reference image can be acquired, and a target region on the first reference image can be acquired. The target region includes N image blocks. When imaging the object under test, the multi-zone light source can be controlled to supplement the target light source zones associated with the N image blocks, that is, to supplement the target light source zones associated with the target region (such as the image region desired by the user). In this way, when imaging different objects under test (such as parts in the electronics manufacturing industry or packages in the logistics industry), the multi-zone light source can be controlled to illuminate some light source zones (i.e., target light source zones) and turn off the remaining light source zones according to the user's actual needs, that is, to illuminate the light source zones according to the image region indicated by the user.
[0027] Users do not need to understand the complex physical layout of light sources; they only need to point out the problem area (i.e., the target area) in the image, and the system can automatically locate and adjust the relevant light sources. This involves partitioning the target light sources across N image blocks, significantly reducing the skill requirements for users. This greatly improves the deployment efficiency and imaging quality of high-precision industrial vision inspection systems and significantly enhances users' understanding of complex light field systems. Attached Figure Description
[0028] Figure 1 This is a flowchart illustrating a method for setting imaging conditions in one embodiment of this application. Figure 2 This is a flowchart illustrating a method for setting imaging conditions in one embodiment of this application. Figure 3 This is a flowchart illustrating a method for setting imaging conditions in one embodiment of this application. Figure 4 This is a flowchart illustrating a method for setting imaging conditions in one embodiment of this application. Figure 5 This is a schematic diagram of the imaging condition setting device in one embodiment of this application; Figure 6 This is a hardware structure diagram of an electronic device according to one embodiment of this application. Detailed Implementation
[0029] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of this application, and to make the above-mentioned objectives, features and advantages of the embodiments of this application more apparent and understandable, the technical solutions in the embodiments of this application will be further described in detail below with reference to the accompanying drawings.
[0030] It should be noted that the sequence number of each step in the embodiments of this application does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0031] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms “a,” “the,” and “the” as used in this application and claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to any and all possible combinations comprising one or more of the associated listed items.
[0032] It should be understood that although the terms first, second, third, etc., may be used in this application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" may also be interpreted as "when," "when," or "in response to determination."
[0033] This application proposes a method for setting imaging conditions, which can be applied to electronic devices such as personal computers, laptops, smart terminals, servers, cloud devices, etc.
[0034] See Figure 1 The diagram shown is a flowchart of the method, which may include: Step 101: Obtain the first reference image.
[0035] Step 102: Obtain the target region on the first reference image; wherein, the first reference image may include M image blocks, M is greater than 1, and the target region may include N image blocks from the M image blocks, N may be greater than or equal to 1; wherein, the multi-zone light source may correspond to K light source zones, K may be greater than 1, and there is a correlation between the M image blocks and the K light source zones.
[0036] For example, regarding the relationship between a target region and N image patches, M image patches from the first reference image can be displayed for the user to select. The user then selects N image patches from these M patches, which can then be used as the target region. Alternatively, the user can first select the target region, and then the corresponding N image patches can be determined from the first reference image. In short, any method that allows N image patches to be used as the target region is acceptable.
[0037] For example, the relationships can be pre-maintained based on experience or maintained according to the methods proposed in subsequent embodiments of this application. The target region may include all or part of the first reference image. The target region can be determined at any time. For example, before acquiring the first reference image, such as as the first step in the process, the target region can be determined interactively based on the acquired image. This target region can be continued in subsequent processes. Alternatively, the target region can be determined on the first reference image after it has been obtained.
[0038] Step 103: Based on this relationship, determine the target light source partition corresponding to the target area.
[0039] For example, multiple images corresponding to multiple candidate imaging conditions can also be acquired. These candidate imaging conditions are configured to generate images and may include supplementary lighting parameters indicating supplementary lighting based on a target light source partition. Based on this, an image can be selected from the multiple images (e.g., the image with the best quality, or the user can select an image from multiple images), and target imaging conditions are set based on the candidate imaging conditions corresponding to the selected image. The target imaging conditions are configured to generate a target image, which is used for the machine vision task. The target imaging conditions may include supplementary lighting parameters indicating supplementary lighting based on a target light source partition.
[0040] For example, a second reference image may also be acquired; target imaging conditions may be set based on the reference imaging conditions corresponding to the second reference image; wherein the reference imaging conditions are configured to generate the second reference image; the target imaging conditions are configured to generate a target image, which is used for the machine vision task; the target imaging conditions may include supplementary lighting parameters, which indicate supplementary lighting based on the target light source partition.
[0041] For example, after obtaining the target imaging conditions, these conditions can be applied only to the current image, meaning the current image is acquired based on the target imaging conditions. Alternatively, the target imaging conditions can be applied to both the current and subsequent images for automatic imaging, meaning the current image is acquired based on the target imaging conditions, and subsequent images are acquired based on the target imaging conditions. In other words, in subsequent processes, images are generated according to the target imaging conditions for detection. Furthermore, the imaging conditions can be adjusted as needed during subsequent processes.
[0042] For example, after setting the target imaging conditions, the mapping relationship between the target imaging conditions and the target light source partition can be recorded. The target imaging conditions are used for imaging, and the target light source partition is used to control the multi-partition light source to supplement the target light source partition. The target imaging conditions and target light source partition can be applied to the image acquisition of the current object to be detected (current image and subsequent images), and the target imaging conditions and target light source partition can also be applied to the image acquisition of other objects to be detected (current image and subsequent images).
[0043] For example, setting target imaging conditions based on the reference imaging conditions corresponding to the second reference image may include, but is not limited to: setting the reference imaging conditions as target imaging conditions; or, optimizing and adjusting the second reference image according to the obtained adjustment requirements; setting target imaging conditions based on the imaging conditions corresponding to the optimized second reference image, such as setting the imaging conditions as target imaging conditions. Optimization and adjustment of the second reference image includes, but is not limited to, optimization and adjustment of the reference imaging parameters of the second reference image.
[0044] For example, adjustment requests can include subjective, descriptive, or goal-oriented instructions to change the visual effect or content attributes of the current image. These adjustment requests are not limited to numerical settings of specific image parameters; they can also include instructions that reflect the user's desired final image presentation, such as descriptions of color atmosphere (e.g., "warmer"), local structure (e.g., "make the person's eyes look more expressive"), overall style (e.g., "retro effect"), or object relationships (e.g., "remove clutter from the background").
[0045] For example, adjustments can be made through natural language input, selection of preset options (such as semantic preset options), or interactive operations of parameter adjustment controls.
[0046] In one example, adjustment requests may include parameter adjustment requests. Parameter adjustment requests may include, but are not limited to, any of the following three types: natural language descriptions, semantic preset options (such as "enhance contrast" or "warmer tone"), and direct parameter numerical adjustment instructions.
[0047] It should be noted that for vague requirements input through natural language descriptions or semantic preset options, automated requirement understanding and optimized execution can be achieved. This effectively solves the problem that traditional solutions lack the ability to automatically convert users' subjective and vague semantic descriptions into precise parameter adjustments.
[0048] For example, optimizing the second reference image based on the obtained adjustment requirements may include, but is not limited to: obtaining the adjustment requirements; and optimizing the second reference image according to at least one optimization method corresponding to the adjustment requirements. When optimizing the second reference image using at least one optimization method, the second reference image may be optimized at least once. When optimizing the second reference image multiple times, the same optimization method may be used for multiple optimizations, or different optimization methods may be used for multiple optimizations. For example, optimization method 1 may be used for the first optimization, optimization method 2 for the second optimization, and optimization method 1 for the third optimization.
[0049] For example, optimizing the second reference image according to at least one optimization method corresponding to the adjustment requirements may include, but is not limited to, at least one of the following methods: The system obtains an imaging parameter adjustment command and adjusts the reference imaging parameters corresponding to the second reference image based on the imaging parameter adjustment command to optimize the second reference image; wherein, the adjustment requirement is the imaging parameter adjustment command; the imaging parameter adjustment command is input through interactive operation of the imaging parameter adjustment control provided in the graphical user interface.
[0050] Obtain the optimization direction confirmation command, and adjust the imaging parameters corresponding to the optimization direction based on the optimization direction confirmation command to optimize the second reference image; wherein, the adjustment requirement is the optimization direction confirmation command; the optimization direction confirmation command is input by selecting the optimization direction function options provided in the graphical user interface.
[0051] Natural language describing the adjustment requirements is obtained, semantic parsing is performed on the natural language to obtain the semantic parsing results, and the imaging parameters indicated by the semantic parsing results are adjusted based on the semantic parsing results to optimize the second reference image; wherein, the adjustment requirements are natural language.
[0052] Of course, the above are just a few examples of optimization methods, and no restrictions are placed on this optimization method.
[0053] In one example, the system can provide imaging parameter adjustment controls through a graphical user interface, which can be used to adjust the imaging parameters according to actual needs. Imaging parameters may include, but are not limited to, the brightness of the target light source zone, exposure time, and gain.
[0054] For any imaging parameter, the imaging parameter adjustment control may include a strip-shaped sliding track and a slider that can slide on the track, and / or, imaging parameter increase buttons (such as "+" function buttons) and imaging parameter decrease buttons (such as "-" function buttons). Users can adjust the imaging parameter by dragging the slider (e.g., moving the slider with a mouse or touch). And / or, users can adjust the imaging parameter by clicking the imaging parameter increase or decrease buttons (e.g., clicking function buttons with a mouse or touchscreen). Accordingly, the system can obtain imaging parameter adjustment instructions by detecting interactive operation commands to the imaging parameter adjustment controls provided in the graphical user interface, and adjust the imaging parameters based on the obtained imaging parameter adjustment instructions, thereby achieving optimized adjustment of the second reference image.
[0055] In one example, the system can provide optimization direction options through a graphical user interface (GUI). These options allow users to select the optimization direction for imaging conditions based on actual needs, such as increasing brightness or contrast. For instance, the system can display one or more preset optimization direction options (e.g., "increase brightness," "decrease brightness," etc.) through the GUI. Users can select at least one optimization direction from these preset options through interactive operations such as clicking or checking boxes. Correspondingly, the system can obtain an optimization direction confirmation instruction by detecting the selection operation command of the optimization direction option provided in the GUI, determine the adjustment requirements based on the confirmation instruction, and determine the target imaging parameters corresponding to the confirmed optimization direction. Then, by adjusting the target imaging parameters, the system optimizes the second reference image.
[0056] For example, the system backend can automatically map the selected optimization direction to core imaging parameters such as camera exposure time and gain, thereby determining the corresponding optimization method. For instance, each optimization direction corresponds to a set of preset imaging parameter linkage strategies. For example, to improve brightness, the system can prioritize increasing the image signal-to-noise ratio by extending the exposure time, and then automatically increase the gain to avoid motion blur once the exposure reaches its limit. Users can achieve image optimization adjustments without needing to understand complex light-sensing principles.
[0057] In one example, the system can provide an input interface for adjusting requirements via natural language input. This interface allows the user to input natural language describing the adjustment needs based on actual requirements. For instance, the natural language describing the adjustment needs can include, but is not limited to, at least one of text, audio, images, and video. For example, the system can perform semantic parsing on the input natural language to obtain the semantic parsing result, determine the imaging parameters indicated by the semantic parsing result, and then optimize the reference image by adjusting the imaging parameters indicated by the semantic parsing result.
[0058] For example, the above-mentioned input methods for adjustment requirements can be used in combination. For instance, users can fine-tune local effects using natural language based on a selected optimization direction.
[0059] For example, the semantic parsing result may include the image features to be adjusted and the adjustment target; performing semantic parsing on natural language to obtain the semantic parsing result may include, but is not limited to: performing semantic parsing on the acquired natural language to determine the image features to be adjusted and the adjustment target; and optimizing and adjusting the second reference image according to at least one optimization method corresponding to the image features to be adjusted and the adjustment target.
[0060] For example, semantic parsing of the adjustment request can be used to determine the image features to be adjusted and the adjustment target. For instance, if the adjustment request is "increase the brightness a little," then the image feature to be adjusted can be determined as image brightness, and the adjustment target is to increase the image brightness (the adjustment range can be determined based on "a little"). As another example, if the adjustment request is "the contrast is not strong enough," then the image feature to be adjusted can be determined as contrast, and the adjustment target is to increase the contrast (the adjustment range can be determined based on "not strong enough").
[0061] For example, the semantic parsing result may include the image features to be adjusted and the adjustment target; performing semantic parsing on natural language to obtain the semantic parsing result may include, but is not limited to: parsing keywords in natural language, querying the pre-established mapping relationship between keywords and image feature adjustment direction and magnitude based on the keywords, and determining the image features to be adjusted and the adjustment target; or, inputting natural language into a pre-trained machine learning model and using the machine learning model to determine the image features to be adjusted and the adjustment target; or, inputting natural language into a large model and using the large model to determine the image features to be adjusted and the adjustment target.
[0062] For example, a mapping relationship between keywords (such as "bright," "dark," and "red") and the direction and magnitude of image feature adjustments can be pre-established (such as a mapping dictionary that records the mapping relationship between keywords and the direction and magnitude of image feature adjustments). Accordingly, the keywords in the obtained adjustment requirements can be parsed, and the pre-established mapping relationship between keywords and the direction and magnitude of image feature adjustments (such as a mapping dictionary) can be queried to determine the image features to be adjusted and the adjustment target.
[0063] For example, machine learning models for semantic parsing and parameter mapping, such as sequence-to-sequence models, CNN (Convolutional Neural Network) models, or RNN (Recurrent Neural Network) models, can be pre-trained. These models can learn the mapping relationship from natural language text to parameter adjustment vectors and output optimization targets for one or more image quality metrics based on the input natural language text, such as increasing the average brightness to a certain range or adjusting the mean of a specific color channel to a target value. Accordingly, the obtained adjustment requirements can be input into the pre-trained machine learning model to determine the image features to be adjusted and the adjustment targets.
[0064] For example, large models can be used to perform natural language parsing, and the powerful reasoning capabilities of large models can be used to determine the image features to be adjusted and the adjustment targets corresponding to the adjustment requirements.
[0065] For example, adjusting the imaging parameters indicated by the semantic parsing results to optimize the second reference image based on the semantic parsing results may include: determining the imaging parameters to be adjusted and the parameter search range based on the reference imaging parameters corresponding to the second reference image, as well as the features of the image to be adjusted and the adjustment target; and optimizing the reference imaging parameters corresponding to the second reference image based on the imaging parameters to be adjusted and the parameter search range. For instance, when optimizing the reference imaging parameters based on the imaging parameters to be adjusted and the parameter search range, the reference imaging parameters may be optimized at least once. When optimizing the reference imaging parameters multiple times, the same parameter search range may be used for multiple optimizations, or different parameter search ranges may be used. For example, the parameter search range may be obtained based on a single interaction, and this parameter search range may be used for multiple optimizations; or, the parameter search range 1 may be obtained based on the first interaction, and this parameter search range 1 may be used for the first optimization; the parameter search range 2 may be obtained based on the second interaction, and this parameter search range 2 may be used for the second optimization; and so on, multiple parameter search ranges may be obtained through multiple interactions.
[0066] For example, the search space for imaging parameters can be actively narrowed based on the baseline imaging parameters of the second reference image, combined with the features of the image to be adjusted and the adjustment target determined through semantic parsing. As one example, parameter sampling points during the candidate image acquisition stage can be filtered, retaining parameter combinations relevant to the adjustment target and filtering out other parameter combinations. As another example, a parameter subspace can be defined through boundary constraints to narrow the search space for imaging parameters. It should be noted that the above two methods for narrowing the search space for imaging parameters can be used in combination to further improve the efficiency of imaging optimization and adjustment.
[0067] For example, the aforementioned optimization adjustment of baseline imaging parameters based on the imaging parameters to be adjusted and the parameter search range can include: using an adaptive optimization algorithm to optimize the baseline imaging parameters, with the adjustment target as the objective function, based on the imaging parameters to be adjusted and the parameter search range. When the imaging parameters to be adjusted and the parameter adjustment range are determined, an adaptive optimization search method can be used to optimize the baseline imaging parameters. For example, within the determined parameter adjustment range (also called the parameter search space), with the determined adjustment target as the objective function, an adaptive optimization algorithm (such as a Bayesian optimization algorithm) can be used for iterative search. The direction and step size of parameter changes can be dynamically determined by the algorithm. Each iteration acquires images and performs image quality evaluation, gradually approaching the optimal solution.
[0068] For example, genetic algorithms or gradient descent algorithms can be used to optimize and adjust the baseline imaging parameters when optimizing the objective function.
[0069] For example, optimizing the baseline imaging parameters based on the imaging parameters to be adjusted and the parameter search range can include: determining a discrete parameter grid based on the parameter search range; and determining the optimized imaging parameters based on the quality assessment results of images acquired when the imaging parameters to be adjusted are at each discrete parameter grid point. For instance, given the imaging parameters to be adjusted and the parameter adjustment range, a custom grid search method can be used to optimize the baseline imaging parameters and determine the optimized imaging parameters. For example, within the determined parameter search range, a discrete parameter grid can be defined based on a user-defined or system-defined step size, and images at each grid point can be acquired sequentially. Through image quality assessment, the final output image that meets the adjustment target is determined, thus determining the optimized imaging parameters. For example, the step size of the discrete parameter grid may be smaller than the parameter adjustment step size of the initially acquired candidate images.
[0070] It should be noted that the two methods for optimizing and adjusting the above-mentioned benchmark imaging parameters can be used in combination to further improve the optimization effect of the imaging parameters.
[0071] For example, the mapping relationship between the second reference image, adjustment requirements, and the imaging conditions corresponding to the optimized second reference image can also be recorded to realize the learning of user preferences or scene preferences. In subsequent processes, for the same user or scene adjustment requirements, candidate images can be obtained and recommended images can be determined based on the recorded mapping relationship and the recorded imaging conditions, or target imaging conditions can be set based on the recorded imaging conditions.
[0072] For example, the process of determining the association between M image blocks and K light source partitions may include, but is not limited to: obtaining K light source images corresponding to the K light source partitions; wherein, for each light source partition, controlling multiple light sources to illuminate the light source partition and obtaining the light source image corresponding to the light source partition; for each image block, determining the contribution intensity of the K light source partitions to the image block based on the K light source images, selecting the light source partition associated with the image block based on the contribution intensity; and recording the association between the image block and the light source partition.
[0073] For example, determining the contribution intensity of K light source partitions to an image patch based on K light source images may include, but is not limited to: for each light source partition, determining a difference image based on the light source image and dark field image corresponding to that light source partition; wherein, controlling the multi-partition light source to turn off all light source partitions to obtain a dark field image; determining the contribution intensity of the light source partition to the image patch based on the pixel value corresponding to the image patch in the difference image; wherein, the contribution intensity includes the average value or summation value of the pixel values.
[0074] For example, the process of acquiring the first reference image or the second reference image may include, but is not limited to: acquiring multiple recommended images under multiple imaging conditions; determining a reference image based on the multiple recommended images; wherein the reference image may be the first reference image or the second reference image.
[0075] For example, acquiring multiple recommended images under multiple imaging conditions may include, but is not limited to: acquiring multiple candidate images under multiple imaging conditions; obtaining evaluation results of the candidate images based on their image features; and determining recommended images from the multiple candidate images based on the evaluation results.
[0076] For example, imaging conditions correspond to the final image, which may include lighting parameters (brightness, zones, etc.), camera shooting parameters (exposure, gain, etc.), and image processing parameters for the captured image.
[0077] For example, imaging conditions are used for imaging. Imaging conditions can include any variable factors or states that can affect the characteristics or quality of the acquired image during image acquisition, and there are no restrictions on the content of these imaging conditions.
[0078] For example, in addition to lighting parameters, imaging conditions may include, but are not limited to, imaging parameters (e.g., exposure time, gain, white balance, contrast, gamma value, etc.). Optionally, imaging conditions may also include other physical or environmental factors that can cause image differences, such as ambient temperature, ambient humidity, the specific state of the subject, or any combination of the aforementioned factors.
[0079] For example, changing imaging conditions can be achieved by physically replacing filters with different wavelengths. Or, changing imaging conditions can be achieved by altering the color temperature of the ambient lighting.
[0080] For example, imaging parameters may include, but are not limited to, light source combinations and / or ISP (Image Signal Processor) parameters. Specifically: Light source combinations: control the activation of multiple built-in / external LED (Light-Emitting Diode) light sources (such as ring lights, coaxial lights, and bar lights) with different brightness and angle combinations. ISP parameters: systematically adjust one or more of the following parameters: exposure time, gain, white balance, contrast, and gamma value.
[0081] For example, a camera (the camera whose imaging conditions need to be set) can be used to acquire image sequences under different imaging conditions according to a preset sampling strategy. Based on the acquired image sequences, multiple candidate images can be determined. For example, the sampling strategy can include, but is not limited to, grid search, random sampling, or adaptive sampling based on prior knowledge (such as Latin hypercube sampling).
[0082] For example, candidate images may include, but are not limited to: original images acquired based on imaging conditions, and / or fused images obtained by fusing the acquired original images. For instance, candidate images may include the acquired original images. For instance, candidate images may include fused images obtained by fusing the acquired original images. For instance, candidate images may include both original images and fused images.
[0083] For example, to optimize image recommendation and improve imaging optimization efficiency, image fusion can be enabled on demand. When image fusion is enabled, images that meet the fusion conditions from the original images are fused. For example, HDR (High Dynamic Range Imaging) can fuse images with different exposures, or photometric stereo vision technology can be applied to fuse images with different lighting directions to enhance texture and eliminate reflections.
[0084] It is important to note that before determining the target light source partition, imaging conditions unrelated to the target light source partition can be acquired. Original images are then acquired based on these imaging conditions, and candidate images are subsequently obtained from the original images. Evaluation results are obtained based on the image features of the candidate images. Based on the evaluation results, a recommended image is determined from multiple candidate images, and a first reference image is determined based on the recommended image. After determining the target light source partition, imaging conditions related to the target light source partition (i.e., imaging conditions for supplemental lighting of the target light source partition) can be acquired. Original images are then acquired based on these imaging conditions, and candidate images are subsequently obtained from the original images. Evaluation results are obtained based on the image features of the candidate images. Based on the evaluation results, a recommended image is determined from multiple candidate images. A second reference image is determined based on the recommended image.
[0085] Furthermore, before determining the target light source partition, imaging conditions unrelated to the target light source partition can be acquired. Based on these imaging conditions, an original image can be acquired and directly used as the first reference image. Alternatively, the original images can be fused to obtain a fused image, which can then be directly used as the first reference image. After determining the target light source partition, imaging conditions related to the target light source partition can be acquired. Based on these imaging conditions, an original image can be acquired and directly used as the second reference image. Alternatively, the original images can be fused to obtain a fused image, which can then be directly used as the second reference image.
[0086] For example, in the process of obtaining an evaluation result for a candidate image based on its image features, the candidate image can be evaluated based on the image features of a specified region of the candidate image to obtain the evaluation result. For instance, the specified region may include all or part of the candidate image. When the specified region includes a part of the candidate image, the specified region can be determined automatically and / or manually.
[0087] In one example, the specified region can be determined automatically. For instance, a specified region can be automatically determined from a candidate image based on preset rules. These preset rules may include, but are not limited to: identifying regions in the candidate image that meet preset saliency conditions as the specified region; or identifying the region in the candidate image where a specific object (such as a specific target object) is located as the specified region; or, based on a trained region detection model, performing region detection on the candidate image and identifying the region of interest (ROI) output by the model as the specified region.
[0088] In one example, the specified region can be determined manually. For instance, a region in a candidate image can be determined based on a region specification command received through interactive operations via a graphical user interface. For example, a user can input a region specification command through interactive operations via the graphical user interface, such as touch operation, mouse selection, or stylus selection; the system can then respond to this region specification command and determine the specified region in the candidate image.
[0089] In one example, the specified area can be determined using a combination of automatic and manual methods. For instance, one or more areas can be initially determined using the automatic method described above, and these areas can be displayed to the user in the graphical user interface. In response to the user's confirmation, adjustment, or reassignment of these areas, the specified area is finally determined. Thus, while ensuring processing efficiency, the user's personalized needs can be met.
[0090] For example, when the specified region includes a portion of the candidate image, the number of specified regions can be one or more.
[0091] For example, in the process of obtaining the evaluation result of the candidate image based on the image features of the candidate image, the evaluation result may include quantifiable or descriptive analytical conclusions obtained based on the pixel data, feature information or deep learning model output of the image, which may include, but are not limited to, one or more of the following: quality evaluation result, content recognition result, anomaly detection result or matching similarity result.
[0092] Taking quality assessment as an example, the image features used for quality assessment can include, but are not limited to, one or more features from traditional image features (sharpness, contrast, noise level, and brightness distribution uniformity, etc.) and image features extracted by deep learning networks. Quality scores can be weighted based on one or more features. For example, the quality assessment result can include a quality score. Similarly, taking content recognition or anomaly detection as an example, the corresponding evaluation metrics can include one or more features from traditional image features and features extracted by deep learning; the evaluation result can specifically include category labels, confidence scores, or defect masks, etc.
[0093] It should be noted that each of the above types can be used independently or in combination as a specific example of "evaluation results".
[0094] When there are multiple specified regions, the image features of each specified region can be extracted separately, and the image features of each specified region can be fused or weighted to obtain the evaluation results of the candidate images.
[0095] Once the evaluation results of the candidate images are determined, the recommended images can be selected from them based on those results. For example, the N (N≥1) candidate images with the highest quality scores (i.e., candidate images with higher quality scores) can be selected as the recommended images.
[0096] For example, once recommended images have been determined in the manner described above, they can be displayed so that relevant personnel can view and compare them. For instance, the determined recommended images can be displayed as an image list, a thumbnail grid, or a carousel. For example, the recommended images can be displayed in descending order of evaluation results (e.g., in descending order of quality scores). Relevant personnel can view the displayed recommended images and select a benchmark image from among the multiple recommended images, such as selecting a first benchmark image or a second benchmark image from among the multiple recommended images.
[0097] For example, users can select a first or second reference image from the displayed recommended images using interactive methods such as touchscreen clicks or mouse clicks. The system can respond to the received selection command and determine the first or second reference image. After obtaining the first reference image, it can be displayed to determine the target region on the first reference image, and then determine the target light source partition corresponding to the target region. Furthermore, after obtaining the second reference image, target imaging conditions can be set based on the reference imaging conditions corresponding to the second reference image.
[0098] For example, target imaging conditions can be used to obtain images for machine vision tasks. For instance, the current image can be plotted according to the target imaging conditions, and machine vision tasks (e.g., defect detection, classification, measurement, etc.) can be performed based on the current image.
[0099] In some approaches, images can be continuously generated and machine vision tasks can be performed based on the generated images, according to the target imaging conditions. For example, in a workpiece defect detection production line scenario, the second reference image obtained by the aforementioned method can be confirmed based on the first few workpieces, thereby determining the target imaging conditions. For subsequent workpieces, images can also be generated and detected based on the target imaging conditions. It is understood that the second reference image can be replaced or adjusted in subsequent detection, i.e., the target imaging conditions can be changed or optimized.
[0100] For example, before determining the recommended image from multiple candidate images based on the evaluation results, the style category of the candidate images can be determined to obtain candidate images of at least one style category. Determining the recommended image from multiple candidate images based on the evaluation results may include: selecting the recommended image from the candidate images of at least one style category based on the evaluation results of the candidate images of at least one style category.
[0101] For example, to optimize image recommendation, recommended images can be selected based on style categories, with one or more recommended images chosen for each style category. Based on this, before determining the recommended images, style clustering can be performed on the candidate images to determine the style category of each candidate image, resulting in at least one style category. Style categories can include, but are not limited to, high contrast, uniform brightness, texture enhancement, or color fidelity. Specifically: High contrast (style A): Highlights edges and defects. Uniform brightness (style B): Provides uniform overall illumination and reduces shadows. Texture enhancement (style C): Emphasizes surface texture through techniques such as photometric stereo. Color fidelity (style D): Achieves the highest color reproduction accuracy. For instance, unsupervised machine learning algorithms (such as K-Means, DBSCAN) or deep autoencoders can be used to cluster image features, grouping images with similar imaging effects (such as candidate images) into one category.
[0102] Once the style category of the candidate images is determined, a recommended image can be selected from the candidate images of at least one style category based on the evaluation results of the candidate images of at least one style category.
[0103] In one example, a recommended image can be determined for candidate images of a style category. For instance, for any style category, the candidate image with the best quality assessment result (e.g., the highest quality score) can be selected as the recommended image from the candidate images of that style category.
[0104] For example, determining a reference image (i.e., a first reference image or a second reference image) based on multiple recommended images may include: determining the reference image based on the multiple recommended images presented.
[0105] The method for displaying multiple recommended images may include, but is not limited to, displaying multiple recommended images through a first visualization interface; wherein, when there are recommended images of multiple style categories, the first visualization interface displays recommended images of multiple style categories simultaneously. For example, for a given set of recommended images, the recommended images can be displayed together through the first visualization interface.
[0106] Taking a single recommended image for one style category as an example. If the recommended image only includes images from a single style category, the first visualization interface displays the recommended image as a single image or a centered, enlarged version. If the recommended image contains images from multiple style categories, the first visualization interface can display recommended images from each style category simultaneously. For example, a segmented, side-by-side layout can be used to display recommended images in the first visualization interface: the image display area is divided into multiple vertically arranged sub-blocks according to style category, each sub-block has a style title at the top, and only recommended images of that style category are displayed within the block. Users can browse recommended images of different style categories in parallel on the same screen without switching tabs.
[0107] For example, suppose the recommended images are categorized into three styles: A through C, with one recommended image for each style category. The first visualization interface displays three sections from top to bottom: the first section is titled "Style A," displaying the recommended image for that style category; the second section is titled "Style B," displaying the recommended image for that style category; and the third section is titled "Style C," displaying the recommended image for that style category. Based on this, users can view all three recommended images from different style categories at once through the first visualization interface.
[0108] In another example, a method for displaying multiple recommended images may include, but is not limited to: displaying recommended images of one style category through a second visualization interface; and switching the recommended images displayed in the second visualization interface when multiple style categories exist and a style category switching command is detected. For example, recommended images can be displayed one style category at a time through the second visualization interface. Only a single style category's recommended image is displayed in this second visualization interface at any given time. For instance, when multiple style categories exist, the user can switch the style category of the recommended images displayed in the second visualization interface as needed. For example, the user can trigger the style category switching command through interactive methods such as touch, mouse click, or gesture swipe.
[0109] For example, the second visual interface may include "style category switching function buttons" (e.g., a left arrow to switch to the previous style category; a right arrow to switch to the next style category; or an up arrow to switch to the previous style category; and a down arrow to switch to the next style category), which users can trigger by touch or mouse click. Alternatively, the second visual interface may include function option buttons corresponding to different style categories, which users can select by touch or mouse click.
[0110] When multiple style categories of recommended images exist, and a style category switching command is detected, the currently displayed style category in the second visualization interface can be switched to the target style category based on the detected command, and the interface can be refreshed accordingly to display recommended images under the target style category. For example, suppose there are recommended images in three style categories: A through C. The current second visualization interface displays recommended images for style A. A style tab bar is located at the top of the interface, displaying three clickable tabs: "Style A," "Style B," and "Style C." When the user clicks the "Style B" tab, a style category switching command is generated, and the second visualization interface switches to displaying recommended images under the "Style B" category.
[0111] For example, obtaining a target region on a first reference image may include, but is not limited to: receiving an operation command for the first reference image, and obtaining the target region on the first reference image based on the operation command; wherein, receiving an operation command for the first reference image may include, but is not limited to: receiving a natural language operation command, the natural language operation command including the location information of the target region on the first reference image, and the location information being used to indicate the target region; or, receiving a selection operation command or a click operation command, the selection operation command or the click operation command being used to operate the target region on the first reference image.
[0112] For example, after acquiring the first reference image, a selection command for the reference light source partition among the K light source partitions can also be received; based on the association between the M image blocks and the K light source partitions, the image blocks on the first reference image associated with the reference light source partitions are displayed.
[0113] As can be seen from the above technical solutions, in this embodiment, a first reference image can be acquired, and a target region on the first reference image can be acquired. The target region includes N image blocks. When imaging the object under test, the multi-zone light source can be controlled to supplement the target light source zones associated with the N image blocks, that is, to supplement the target light source zones associated with the target region (such as the image region desired by the user). In this way, when imaging different objects under test (such as parts in the electronics manufacturing industry or packages in the logistics industry), the multi-zone light source can be controlled to illuminate some light source zones (i.e., target light source zones) and turn off the remaining light source zones according to the user's actual needs, that is, to illuminate the light source zones according to the image region indicated by the user.
[0114] By establishing the correlation between image patches and light source partitions, efficient fine adjustment of local illumination is achieved. This is mainly applied to scenarios with high requirements for local illumination quality, such as high-precision industrial inspection, product appearance analysis, surface concavity and convexity detection, background defect detection, and character reading. A two-stage optimization framework combining "global coarse screening" and "local fine adjustment" is proposed. In the "global coarse screening" stage, multiple images are acquired based on imaging conditions, and a benchmark image is recommended from these images. In the "local fine adjustment" stage, a light field calibration method based on image patches is introduced to achieve accurate and robust mapping from image regions to light source partitions, supporting intuitive and efficient local fine adjustment. This enables intelligent and efficient parameter space dimensionality reduction, making local optimization feasible and rapid.
[0115] Users do not need to understand the complex physical layout of light sources; they only need to point out the problem area (i.e., the target area) in the image, and the system can automatically locate and adjust the relevant light sources. This involves partitioning the target light sources across N image blocks, significantly reducing the skill requirements for users. This greatly improves the deployment efficiency and imaging quality of high-precision industrial vision inspection systems and significantly enhances users' understanding of complex light field systems.
[0116] The technical solutions described above in the embodiments of this application will be explained below in conjunction with specific application scenarios.
[0117] This application proposes a method for setting imaging conditions, which relates to the fields of machine vision, intelligent imaging, and control technology. The multi-zone light source can be a large-scale light source system with multiple light source zones (e.g., dozens of light source zones), and light source control can be performed on the multi-zone light source. In this embodiment, the multi-zone light source can have K light source zones (the multi-zone light source corresponds to K light source zones), where K can be a positive integer greater than 1. For ease of description, four light source zones are used as an example, such as light source zone 1, light source zone 2, light source zone 3, and light source zone 4.
[0118] For example, multi-zone light sources have features such as multi-zone illumination and multi-directional lighting. Regarding multi-zone illumination: A multi-zone light source can be divided into multiple light source zones, each illuminated independently, providing more precise control for the machine vision system to ensure optimal visual inspection results. Regarding multi-directional lighting: A multi-zone light source has multiple light source zones, enabling illumination from multiple directions.
[0119] Applications of multi-zone light sources include: 1. Surface unevenness detection: Used in industries such as electronics manufacturing and automotive to detect minute unevenness on the surface of objects. 2. Background defect detection: When facing complex backgrounds, multi-zone light sources can highlight key defects, minimize background interference, and improve the accuracy of defect detection. 3. Character reading: In the packaging, logistics, or other industries where character reading is required, the multi-directional lighting of multi-zone light sources can increase character clarity and provide a higher character reading success rate. 4. Use in conjunction with photometric stereo algorithms: Multi-zone light sources work in conjunction with photometric stereo algorithms to provide advanced visual inspection solutions, obtaining more accurate results in complex inspection scenarios. Of course, the above are just a few examples of applications of multi-zone light sources, and this embodiment does not limit the scope of applications.
[0120] For example, this embodiment proposes a two-stage optimization method for controlling multi-zone light sources, namely a two-stage optimization method combining "global coarse screening" and "local fine-tuning". See [link to documentation]. Figure 2 The diagram shows a flowchart of the method for setting imaging conditions. The first stage is the "global coarse screening" stage, in which multiple images are acquired through imaging parameters, and a first reference image is recommended from these images.
[0121] The second stage is the "local fine-tuning" stage. In the "local fine-tuning" stage, a light field calibration method based on image blocks is introduced to achieve accurate and robust mapping from image regions to light source partitions.
[0122] For example, in the first stage, an overall imaging style is quickly recommended through imaging parameter space sampling, and a first reference image is recommended to the user. In the second stage, a light field calibration technique based on image patches is introduced to achieve accurate and robust mapping from image regions to light source partitions, thereby supporting intuitive and efficient local fine-tuning.
[0123] In one possible implementation, for the "global coarse screening" stage, this application proposes a method for setting imaging conditions. The management device (control device) for the multi-zone light source can be an electronic device, such as a personal computer, laptop, smart terminal, server, cloud device, etc. The type of management device is not limited, as long as it can manage the multi-zone light source.
[0124] See Figure 3 The diagram shown illustrates a flowchart of a method for setting imaging conditions, which may include: Step 301: The management device acquires multiple imaging parameters. For example, each imaging parameter may include light source parameters, or it may include both light source parameters and ISP parameters.
[0125] For example, the light source parameters may include, but are not limited to, candidate light source zones among K light source zones and the light source brightness of the candidate light source zones. The ISP parameters may include, but are not limited to, at least one of exposure time, gain, white balance, contrast, and gamma value.
[0126] For example, imaging parameter a11 may include light source parameter b1 and ISP parameter c1, imaging parameter a12 may include light source parameter b1 and ISP parameter c2, imaging parameter a13 may include light source parameter b1 and ISP parameter c3, and so on. Under the same light source parameter, different ISP parameters correspond to different imaging parameters.
[0127] Imaging parameter a21 may include light source parameter b2 and ISP parameter c1, imaging parameter a22 may include light source parameter b2 and ISP parameter c2, imaging parameter a23 may include light source parameter b2 and ISP parameter c3, and so on. Under the same ISP parameter, different light source parameters correspond to different imaging parameters.
[0128] For example, for each light source parameter, the light source parameter may include candidate light source partitions, which may be some or all of the K light source partitions. Taking 4 light source partitions as an example, for light source parameter b1, the candidate light source partition may be light source partition 1; for light source parameter b2, the candidate light source partitions may be light source partition 1 and light source partition 2; for light source parameter b3, the candidate light source partitions may be light source partition 1, light source partition 2 and light source partition 3, and so on.
[0129] Regarding which light source zones to use as candidate light source zones for each light source parameter, this embodiment does not impose any restrictions. Light source zones can be arbitrarily selected as candidate light source zones according to actual needs.
[0130] For example, for K light source partitions of a multi-zone light source, the K light source partitions can be divided into multiple levels. Candidate light source partitions can include one light source partition from each level. For example, for light source parameter b1, candidate light source partitions can include the first light source partition of each level; for light source parameter b2, candidate light source partitions can include the second light source partition of each level, and so on.
[0131] For example, for K light source zones of a multi-zone light source, the K light source zones can be divided into multiple angular regions (i.e., the angular region where the light source direction points to the light source zone). Candidate light source zones can include one light source zone in each angular region. For example, for light source parameter b1, candidate light source zones can include the first light source zone in each angular region; for light source parameter b2, candidate light source zones can include the second light source zone in each angular region, and so on.
[0132] For example, a candidate light source partition can include one light source partition for each combination (a combination of layer and angle regions). For instance, for light source parameter b1, the candidate light source partition can include the first light source partition for each combination; for light source parameter b2, the candidate light source partition can include the second light source partition for each combination, and so on. Obviously, in this approach, multiple partitioned light sources can be divided into multiple light source parameters according to different layers and different angles based on the multi-layered and multi-angled physical characteristics of the partitioned light sources.
[0133] For example, for each light source parameter, the light source parameter may also include the light source brightness of the candidate light source partition. For instance, light source parameter b1 may also include the light source brightness of light source partition 1 (e.g., brightness value 1; different light source parameters may correspond to different light source brightnesses for light source partition 1), light source parameter b2 may also include the light source brightness of light source partition 1 (e.g., brightness value 2) and the light source brightness of light source partition 2 (e.g., brightness value 1), light source parameter b3 may also include the light source brightness of light source partition 1 (e.g., brightness value 2), the light source brightness of light source partition 2 (e.g., brightness value 2), and the light source brightness of light source partition 3 (e.g., brightness value 1), and so on.
[0134] In summary, the light source parameters can be obtained, such as light source parameter b1 including light source partition 1 and brightness value 1, light source parameter b2 including light source partition 1 and brightness value 2, light source partition 2 and brightness value 1, and light source parameter b3 including light source partition 1 and brightness value 2, light source partition 2 and brightness value 2, and light source partition 3 and brightness value 1.
[0135] For example, taking each ISP parameter as an example where both exposure time and contrast are included, the processing method for gain, white balance, and gamma value is similar. ISP parameter c1 includes exposure time 1 and contrast 1, ISP parameter c2 includes exposure time 1 and contrast 2, ISP parameter c3 includes exposure time 2 and contrast 1, and so on. Different exposure times correspond to different ISP parameters, different contrasts correspond to different ISP parameters, and any combination of exposure time and contrast constitutes multiple ISP parameters.
[0136] After obtaining the ISP parameters and light source parameters, different light source parameters correspond to different imaging parameters, and different ISP parameters correspond to different imaging parameters. Any combination of ISP parameters and light source parameters constitutes multiple imaging parameters.
[0137] Step 302: The management device acquires multiple raw images under multiple imaging parameters.
[0138] For example, if an object to be measured exists within the camera's field of view, the management device can send light source parameter b1 from imaging parameter a11 to the multi-zone light source and ISP parameter c1 from imaging parameter a11 to the camera. Based on this, the multi-zone light source uses light source parameter b1 for illumination, and the camera uses ISP parameter c1 to acquire an image of the object to be measured. This image is the original image under imaging parameter a11, and this original image includes the object to be measured. For instance, the process of the multi-zone light source illuminating with light source parameter b1 and the process of the camera acquiring an image of the object to be measured using ISP parameter c1 can be executed synchronously.
[0139] When a multi-zone light source uses light source parameter b1 for illumination, considering that light source parameter b1 includes light source zone 1 (i.e., candidate light source zone) and brightness value 1 (i.e. light source brightness), the multi-zone light source uses brightness value 1 to illuminate light source zone 1, that is, to light up light source zone 1, while other light source zones are turned off.
[0140] Furthermore, the management device can send the light source parameter b1 from imaging parameter a12 to the multi-zone light source and the ISP parameter c2 from imaging parameter a12 to the camera. Based on this, the multi-zone light source uses the light source parameter b1 for illumination, and the camera uses the ISP parameter c2 to acquire an image of the object under test. This image is the original image under imaging parameter a12, and this original image includes the object under test.
[0141] Furthermore, the management device can send the light source parameter b2 from imaging parameter a21 to the multi-zone light source and the ISP parameter c1 from imaging parameter a21 to the camera. Based on this, the multi-zone light source uses the light source parameter b2 for illumination, and the camera uses the ISP parameter c1 to acquire an image of the object under test. This image is the original image under imaging parameter a21, and this original image includes the object under test.
[0142] Similarly, the camera can capture multiple raw images under multiple imaging parameters and send these raw images to the management device, which then acquires the multiple raw images under multiple imaging parameters.
[0143] Step 303: The management device acquires multiple fused images. Each fused image is obtained by fusing at least two original images. For example, two original images can be fused to obtain a fused image, or three or more original images can be fused to obtain a fused image.
[0144] For example, after obtaining multiple original images, image fusion techniques can be used. For instance, HDR (High Dynamic Range) imaging technology can be used to fuse original images with different exposures to obtain a fused image. Alternatively, photometric stereoscopic vision technology can be used to fuse original images with different lighting directions to obtain a fused image. Of course, the above are just examples of fusion methods and are not limiting. By fusing original images, texture can be enhanced and reflections can be eliminated.
[0145] Step 304: The management device clusters multiple candidate images to obtain multiple clusters.
[0146] For example, step 303 is optional. If step 303 is executed, the multiple candidate images include the original images (such as all original images or some original images) and the fused images (such as all fused images or some fused images). That is, multiple clusters are obtained by clustering multiple original images and multiple fused images.
[0147] Alternatively, if step 303 is not performed, the multiple candidate images will only include the original images (such as all original images or part of the original images), that is, multiple clusters will be obtained by clustering the multiple original images.
[0148] For example, when clustering multiple candidate images to obtain multiple clusters, each cluster can include candidate images of the same style (such as the original image and the fused image, or the original image), that is, candidate images of the same style can be divided into the same cluster.
[0149] For example, multiple styles can be pre-configured, such as Style A, Style B, Style C, and Style D, which can be configured according to actual needs. Style A can be a high-contrast style, which groups all images that highlight edges and defects into the same cluster. Style B can be a uniform brightness style, which groups all images with uniform overall lighting and reduced shadows into the same cluster. Style C can be a texture enhancement style, which groups all images that highlight surface textures into the same cluster. Style D can be a color-realistic style, which groups all images with high color fidelity into the same cluster. Of course, the above are just a few examples of styles and are not intended to be limiting.
[0150] For example, the management device can use unsupervised machine learning algorithms (such as K-Means, DBSCAN (Density-Based Spatial Clustering of Applications with Noise), etc.) to cluster multiple candidate images, obtaining clusters for style A, style B, style C, and style D. Alternatively, the management device can use a deep autoencoder to cluster multiple candidate images, obtaining clusters for style A, style B, style C, and style D. Or, other methods can be used to cluster multiple candidate images. By clustering multiple candidate images, candidate images with similar imaging effects are grouped into one category.
[0151] Step 305: For each cluster, the management device selects a first reference image from all candidate images in that cluster based on the image quality of each candidate image within that cluster. For example, the management device selects the candidate image with the better image quality from all candidate images in that cluster as the first reference image.
[0152] For example, for a cluster of style A, the management device determines the image quality of each candidate image within that cluster and selects the candidate image with the best image quality as the first reference image, or selects multiple candidate images with relatively good image quality as the first reference image. Thus, candidate images are selected from the cluster of style A as the first reference image. Similarly, candidate images are selected from the cluster of style B, the cluster of style C, and the cluster of style D. In summary, the first reference image can include candidate images from each cluster.
[0153] For example, step 304 is optional. If step 304 is not executed, that is, if multiple candidate images are not clustered, then the management device directly determines the image quality of each candidate image (without involving clusters) and selects the candidate image with the best image quality as the first reference image, or selects multiple candidate images with relatively good image quality as the first reference image. In this way, a candidate image is selected from all candidate images as the first reference image.
[0154] For example, when a management device determines the image quality (such as an image quality score) of a candidate image, it can perform an image quality assessment on the candidate image to obtain the image quality of the candidate image.
[0155] For example, the image features used for quality assessment may include a first type of image features, which may include at least one of sharpness, contrast, noise level, and brightness distribution uniformity. The management device extracts the first type of image features of the candidate image and determines the image quality of the candidate image based on the first type of image features. For example, each first type of image feature corresponds to a quality score. The quality scores corresponding to all first type of image features are weighted and calculated to obtain the image quality of the candidate image.
[0156] Alternatively, the image features used for quality assessment may include a second type of image features, which may include image features extracted by a deep learning network. The management device may input the candidate image into the deep learning network to obtain the second type of image features and determine the image quality of the candidate image based on the second type of image features.
[0157] Alternatively, the image features used for quality assessment include a first type of image features and a second type of image features, and the management device determines the image quality of the candidate image based on the first type of image features and the second type of image features.
[0158] For example, if style clustering is not enabled, the management device selects the top P images with higher image quality as the first reference images to present to the user based on the image quality of each candidate image.
[0159] If style clustering is enabled, for each cluster (cluster center), based on the image quality of each candidate image within that cluster, the management device selects the top P images with the highest image quality as the first reference images to present to the user. This allows images with multiple imaging styles to be presented to the user as the first reference images.
[0160] In summary, during the "global coarse screening" stage, the management device controls the camera to continuously acquire multiple image sequences under different imaging parameters according to a preset sampling strategy (including but not limited to grid search, random sampling, or adaptive sampling based on prior knowledge, such as Latin hypercube sampling), in order to efficiently cover the parameter space. Based on this, multiple raw images can be obtained. Then, a first reference image can be acquired based on these raw images and displayed to the user, realizing multi-parameter sampling and stylized recommendation.
[0161] In one possible implementation, for the "local fine-tuning" stage, this application proposes a method for setting imaging conditions, whereby local fine-tuning is used to achieve local fine optimization based on light field mapping. See also Figure 4 The diagram shown illustrates a flowchart of a method for setting imaging conditions, which may include: Step 401: The management device acquires the K light source images corresponding to the K light source partitions.
[0162] For example, for each light source zone, multiple light sources can be controlled to illuminate that light source zone while turning off the other light source zones, thereby obtaining the light source image corresponding to that light source zone.
[0163] For example, the K light source zones may include light source zone 1, light source zone 2, light source zone 3, and light source zone 4, where the object to be measured exists within the camera's field of view. The management device can control the multiple light source zones to illuminate light source zone 1 (e.g., using a specified brightness value), and the management device can control the camera to capture an image of the object to be measured; this image is the light source image d1 corresponding to light source zone 1. The management device can control the multiple light source zones to illuminate light source zone 2, and control the camera to capture an image of the object to be measured; this image is the light source image d2 corresponding to light source zone 2. The management device can control the multiple light source zones to illuminate light source zone 3, and control the camera to capture an image of the object to be measured; this image is the light source image d3 corresponding to light source zone 3. The management device can control the multiple light source zones to illuminate light source zone 4, and control the camera to capture an image of the object to be measured; this image is the light source image d4 corresponding to light source zone 4.
[0164] Step 402: The management device controls the multi-zone light source to turn off all light source zones and acquire a dark field image.
[0165] For example, the management device controls the multi-zone light source to turn off light source zone 1, light source zone 2, light source zone 3 and light source zone 4, and controls the camera to acquire an image of the object under test. This image is a dark field image.
[0166] Step 403: For each light source zone, the management device determines the difference image corresponding to the light source zone, which can also be called the difference image, based on the light source image and dark field image corresponding to the light source zone.
[0167] For example, the management device determines the difference image e1 corresponding to the light source partition 1 based on the light source image d1 and the dark field image. That is, the difference image between the light source image d1 and the dark field image is used as the difference image e1.
[0168] The management device determines the differential image e2 corresponding to light source partition 2 based on the light source image d2 and the dark field image; the management device determines the differential image e3 corresponding to light source partition 3 based on the light source image d3 and the dark field image; and the management device determines the differential image e4 corresponding to light source partition 4 based on the light source image d4 and the dark field image.
[0169] Step 404: The management device divides the differential image into M image blocks, where M is a positive integer greater than 1.
[0170] For example, the size of the light source image is the same as the size of the difference image. Therefore, the light source image also includes M image blocks. The size of the reference image is the same as the size of the light source image. Therefore, the reference image also includes M image blocks. The M image blocks of the reference image correspond one-to-one with the M image blocks of the difference image.
[0171] For example, a difference image (reference image) can be divided into image blocks (grid blocks) of fixed size (such as 16×16, 16×32, etc.), and different image blocks can be the same size. In practical applications, a difference image (reference image) can also be divided into image blocks of different sizes.
[0172] Step 405: For each image block, the management device determines the contribution intensity of the light source partition to the image block based on the pixel values corresponding to that image block in the differential image of the light source partition. The contribution intensity may include the average of all pixel values or the sum of all pixel values.
[0173] For example, the management device determines the contribution strength of light source partition 1 to the image block based on the pixel values corresponding to the image block in the difference image e1. For instance, it may use the average of all pixel values corresponding to the image block in the difference image e1 as the contribution strength of light source partition 1. Alternatively, it may use the sum of all pixel values corresponding to the image block in the difference image e1 as the contribution strength of light source partition 1. Or, it may use the weighted average of all pixel values corresponding to the image block in the difference image e1 (i.e., different pixel positions may correspond to different weights) as the contribution strength of light source partition 1.
[0174] Based on the pixel values corresponding to the image block in the differential image e2, the management device can determine the contribution intensity of light source partition 2 to the image block. Based on the pixel values corresponding to the image block in the differential image e3, the management device can determine the contribution intensity of light source partition 3 to the image block. Based on the pixel values corresponding to the image block in the differential image e4, the management device can determine the contribution intensity of light source partition 4 to the image block.
[0175] Step 406: For each image block, the management device selects the light source partition associated with the image block based on the contribution intensity of the K light source partitions to the image block, and records the association relationship between the image block and the light source partition.
[0176] For example, after obtaining the contribution intensity of K light source partitions to the image patch, the K light source partitions can be sorted in descending order of contribution intensity, and the top W light source partitions in the sorted order can be selected as the light source partitions associated with the image patch. W can be a positive integer, such as 1, 2, 3, etc. Alternatively, the K light source partitions can be sorted in ascending order of contribution intensity, and the top W light source partitions after sorting can be selected as the light source partitions associated with the image patch. Obviously, for each image patch, the contribution intensity of all light source partitions (i.e., the K light source partitions) to the image patch can be analyzed, and the top W light source partitions with the highest contribution intensity can be selected as the associated light source partitions of the image patch.
[0177] Then, the association between the image patch and the light source partition (the associated light source partition of the image patch) can be recorded in the light field mapping dictionary. For example, a light field mapping dictionary can be constructed where the key is the image patch identifier, and the value is the light source partition identifier and the contribution strength of the light source partition to the image patch. The light field mapping dictionary establishes a robust mapping relationship from the image patch to the light source partition.
[0178] For example, see Table 1, which shows an example of a light field mapping dictionary. In the light field mapping dictionary, the contribution intensity of the light source partition to the image patch is optional, meaning that the contribution intensity can also be omitted. Table 1 illustrates this by selecting two light source partitions as the light source partitions associated with the image patch.
[0179] Table 1 Step 407: The management device displays a first reference image, which may include the object to be measured.
[0180] For example, referring to steps 301-305, since the first reference image is obtained based on the original image and the original image includes the object to be tested, the first reference image may include the object to be tested.
[0181] When displaying the first reference image, one first reference image can be displayed for the user to view, or multiple first reference images (such as first reference images of different styles) can be displayed for the user to view.
[0182] Step 408: The management device receives an operation command for the first reference image, which indicates a target region on the first reference image. For example, the first reference image includes M image blocks, and the target region may include N image blocks from the M image blocks, where N is a positive integer greater than or equal to 1.
[0183] In one possible implementation, the management device can display a first reference image on a user interface, allowing the user to view the first reference image and determine which areas need to be illuminated by the multi-zone light source. Based on this, the management device can receive natural language operation commands (i.e., operation commands for the first reference image), which can be natural language input by the user. For example, the natural language operation command may include location information of a target area on the first reference image, and this location information is used to indicate the target area (i.e., the area that needs to be illuminated by the multi-zone light source) on the first reference image.
[0184] For example, there may be an operation marker at a certain location on the user interface (such as a shadow in the lower right corner). Natural language can be entered at that location. For instance, if a user enters natural language at the shadowed location in the lower right corner, this natural language will serve as a natural language operation command, and this natural language can include the location information of the target area.
[0185] For example, the target region can be a rectangular region, and the location information can include the coordinates of the four vertices of the rectangular region (coordinates in the first reference image); or, the location information can include the coordinates of one vertex of the rectangular region (such as the top-left vertex, bottom-left vertex, top-right vertex, bottom-right vertex, and center point), the length of the rectangular region, and the width of the rectangular region. As another example, the target region can be a non-rectangular region, and the location information can include the coordinates of all vertices of the non-rectangular region. As yet another example, the target region can be a circular region, and the location information can include the coordinates of the center point and the radius.
[0186] In one possible implementation, the management device can display a first reference image on a user interface, allowing the user to view the first reference image and determine which areas need to be illuminated by the multi-zone light source. The user can also select these areas on the first reference image. Based on this, the management device can receive a selection operation command (i.e., an operation command for the first reference image), which is used to operate on target areas on the reference image, indicating the target areas that need to be illuminated by the multi-zone light source.
[0187] Alternatively, the user can click on a target area on the first reference image. Based on this, the management device can receive a click operation command (i.e., an operation command for the first reference image), and the click operation command is used to operate on the target area on the first reference image, indicating the target area that needs to be illuminated by the multi-zone light source.
[0188] In summary, during user interaction, users can specify the target area to be optimized by directly selecting / clicking, and the management device can receive operation commands and know the target area.
[0189] For example, the first reference image may include M image blocks, and when the management device learns of a target region on the first reference image, the target region may include N image blocks from the M image blocks. For instance, if the target region includes part or all of an image block, then that image block belongs to the N image blocks.
[0190] For example, considering that multiple light sources correspond to K light source zones, and that there is a correlation between M image blocks and K light source zones, the correlation between image blocks and light source zones has been recorded in the light field mapping dictionary. Based on this, after obtaining N image blocks of the target area, the management device can also know the light source zones associated with the N image blocks, that is, it can know the target light source zones associated with the target area.
[0191] For example, after displaying the first reference image, the management device can also receive a selection command for a reference light source partition among the K light source partitions. The reference light source partition can be at least one of the K light source partitions. Based on this, referring to the light field mapping dictionary, the association relationship between image blocks and light source partitions has been recorded. Based on the association relationship between M image blocks and K light source partitions, the management device can also know the image blocks associated with the reference light source partitions and mark the image blocks associated with the reference light source partitions on the first reference image, such as by highlighting these image blocks on the first reference image.
[0192] For example, the management device displays a first reference image on the user interface, and the user enters information about the reference light source partition (i.e., a selection command for the reference light source partition) on the user interface. By marking the image blocks associated with the reference light source partition, the user can see which image blocks the reference light source partition is associated with.
[0193] In summary, when a user clicks or selects a target area on the reference image, the management device can identify the target light source partition associated with that target area and highlight it. Furthermore, when a user selects a reference light source partition, the management device can identify the image blocks associated with that reference light source partition (i.e., the image blocks most significantly affected by the reference light source partition, such as image blocks with a contribution intensity greater than a certain threshold) and highlight them.
[0194] This visualized two-way mapping method greatly enhances users' understanding of complex light field systems, making the originally abstract adjustment process intuitive and controllable, and realizing the visualization of calibration results.
[0195] Step 409: Manage the equipment to acquire target imaging parameters.
[0196] For example, in this case, taking imaging conditions as imaging parameters, where target imaging parameters represent target imaging conditions, the management device can acquire a second reference image and set the target imaging parameters based on the reference imaging parameters corresponding to the second reference image. If there is only one second reference image, the target imaging parameters are set based on the reference imaging parameters corresponding to that second reference image; if there are multiple second reference images, the target imaging parameters are set based on the reference imaging parameters corresponding to one of the second reference images.
[0197] The acquisition method for the second reference image is similar to that for the first reference image, with the following differences: Before determining the target light source partition, imaging parameters unrelated to the target light source partition can be acquired. Based on these imaging parameters, an original image is acquired, and candidate images are then obtained from the original image. A recommended image is determined from multiple candidate images, and the first reference image is determined based on the recommended image. Alternatively, after determining the target light source partition, imaging parameters related to the target light source partition (i.e., imaging parameters for supplemental lighting of the target light source partition) can be acquired. Based on these imaging parameters, an original image is acquired, and candidate images are then obtained from the original image. A recommended image is determined from multiple candidate images, and the second reference image is determined based on the recommended image.
[0198] When setting target imaging parameters based on the reference imaging parameters corresponding to the second reference image, the reference imaging parameters can be set as the target imaging parameters; alternatively, the second reference image can be optimized and adjusted according to the obtained adjustment requirements; and the target imaging parameters can be set based on the imaging parameters corresponding to the optimized second reference image. How to optimize and adjust the second reference image will not be repeated here.
[0199] In another possible implementation, the management device acquires multiple imaging parameters. For example, each imaging parameter may include a light source parameter, or it may include both a light source parameter and an ISP parameter. The light source parameter may include, but is not limited to, a target light source zone and its brightness. The ISP parameter may include, but is not limited to, at least one of exposure time, gain, white balance, contrast, and gamma value. For example, assuming the target light source zones are light source zone 1 and light source zone 2, the first light source parameter includes light source zone 1 and its brightness value 1 (light source brightness), and light source zone 2 and its brightness value 1; the second light source parameter includes light source zone 1 and its brightness value 1, light source zone 2 and its brightness value 2, and so on. Clearly, each light source parameter includes light source zone 1 and light source zone 2, and different combinations of the brightness values of light source zone 1 and light source zone 2 can correspond to different light source parameters. Based on this, the brightness of the light source in different light source parameters may be the same or different, that is, the brightness of the light source in different imaging parameters may be the same or different.
[0200] After obtaining the ISP parameters and light source parameters, different light source parameters correspond to different imaging parameters, and different ISP parameters correspond to different imaging parameters. Any combination of ISP parameters and light source parameters constitutes multiple imaging parameters.
[0201] Then, the management device acquires multiple raw images under multiple imaging parameters. For example, if there is an object to be measured within the camera's field of view, for each imaging parameter, the management device can send the light source parameters from the imaging parameters to the multi-zone light source and the ISP parameters from the imaging parameters to the camera. Based on this, the multi-zone light source uses these light source parameters for illumination, and the camera uses these ISP parameters to acquire an image of the object to be measured; this image is the raw image under these imaging parameters. For example, the process of the multi-zone light source illuminating using the light source parameters and the process of the camera acquiring an image of the object to be measured using the ISP parameters can be executed synchronously. For example, when the multi-zone light source illuminates using the light source parameters, considering that the light source parameters include the target light source zone and the light source brightness of the target light source zone, the multi-zone light source uses this light source brightness to illuminate the target light source zone, that is, to illuminate the target light source zone while other light source zones are turned off.
[0202] In summary, the camera can capture multiple raw images under multiple imaging parameters and send these raw images to the management device, which then acquires the multiple raw images under multiple imaging parameters.
[0203] Then, the management device selects a target imaging parameter from multiple imaging parameters based on multiple raw images. For example, it determines the image quality (e.g., image quality score) of each raw image and selects the imaging parameter corresponding to the raw image with the best image quality as the target imaging parameter. Alternatively, it identifies raw images with image quality greater than a preset threshold and randomly selects an imaging parameter from the imaging parameters corresponding to these raw images as the target imaging parameter. Or, the management device displays multiple raw images to the user, who then selects one raw image and uses the imaging parameter corresponding to that raw image as the target imaging parameter.
[0204] In summary, the management device can obtain the target imaging parameters. Based on these parameters, when imaging the object under test, the management device controls the multi-zone light source to illuminate the light source zones associated with N image blocks according to the light source brightness in the target imaging parameters. For example, during image acquisition, multiple objects under test can be placed sequentially within the camera's field of view, and then images of each object under test can be acquired based on the target imaging parameters.
[0205] When multiple objects to be tested are placed within the camera's field of view, and these objects are of the same type as those used in the calibration process, when acquiring images of a new type of object, the calibration process is re-executed for the new type of object to obtain its target imaging parameters. Then, the image acquisition process for the new type of object is performed based on these target imaging parameters. Alternatively, the image acquisition process for the new type of object can be performed using existing target imaging parameters.
[0206] For example, the management device sends the light source parameters from the target imaging parameters to the multi-zone light source and the ISP parameters from the target imaging parameters to the camera (optional; if the target imaging parameters do not include ISP parameters, the camera uses the default ISP parameters). Therefore, when the target imaging parameters do not change, the management device only needs to send the light source parameters and ISP parameters once, without needing to send them repeatedly. For each image acquisition, the multi-zone light source uses these light source parameters for illumination, and the camera uses these ISP parameters to acquire the image of the object under test.
[0207] In summary, the management device can identify all image blocks covered by a user-specified target area, query the light field mapping dictionary, merge and deduplicate the light source partitions associated with these image blocks, and quickly find the target light source partitions associated with N image blocks. This enables interactive fine-tuning based on mapping relationships and intelligent locking of associated partitions. Then, the search space is focused on the parameters (such as light source brightness) of this set of light source partitions. Using the user-described optimization objective (e.g., "eliminating shadows" mapped to increasing local brightness) as the objective function, efficient algorithms such as Bayesian optimization are used for iterative searching within this constrained space. In each iteration, the parameters of the target light source partitions are adjusted, and new images are acquired for image quality evaluation until an image meeting the user's requirements is output, completing parameter space focusing and optimization, i.e., finding the target imaging parameters.
[0208] As can be seen from the above technical solutions, in the embodiments of this application, the correlation between image blocks and light source partitions is established through light field calibration technology, so as to realize the robust mapping between the target area and the target light source partition, and achieve efficient fine adjustment of local illumination. It is mainly applied to high-precision industrial inspection, product appearance analysis, surface concavity and convexity detection, background defect detection, character reading and other scenarios with high requirements for local lighting quality.
[0209] A two-stage optimization framework combining "global coarse screening" and "local fine-tuning" is proposed. In the "global coarse screening" stage, multiple images are acquired through imaging parameters, and a first reference image is recommended from among the multiple images. In the "local fine-tuning" stage, a light field calibration method based on image patches is introduced to achieve accurate and robust mapping from the target region to the target light source partition, supporting intuitive and efficient local fine-tuning, realizing intelligent and efficient parameter space dimensionality reduction, making local optimization feasible and rapid, and effectively solving the imaging optimization problem in ultra-high-dimensional parameter space.
[0210] Based on the light field calibration technology that associates image patches and light source partitions, a robust and accurate mapping from the target region to the target light source partition is achieved by constructing a light field mapping dictionary, laying the foundation for local optimization. Using the light field mapping dictionary, the user-specified target region is quickly converted into a subset of light source partitions, achieving intelligent and efficient parameter space dimensionality reduction, making local optimization feasible and rapid, and achieving precise parameter space focusing.
[0211] Users do not need to understand the complex physical layout of light sources; they only need to point out the problem area (i.e., the target area) in the image, and the system can automatically locate and adjust the relevant light sources. This involves partitioning the target light source across N image blocks, significantly reducing the skill requirements for users and enabling intuitive and efficient guided interaction. This greatly improves the deployment efficiency and imaging quality of high-precision industrial vision inspection systems, significantly enhances users' understanding of complex light field systems, and is suitable for debugging large-scale, multi-partition light sources. It transforms the debugging of complex multi-partition light sources from an experience-based manual process into a quantifiable and replicable automated workflow.
[0212] In one possible implementation, taking PCB component detection as an example, in the first stage, 40 light source partitions (7 layers of light source partitions, each with different angle partitions) are divided into 7 regions according to different levels. Each region is combined with different angles, and the brightness of each light source partition is traversed at equal intervals of 100, generating a total of 200 sets of light source parameters. Three styles (overall uniform, solder joint highlighting, and shadowless mode) are recommended through image quality evaluation. In the second stage, each light source partition is illuminated one by one, establishing a mapping relationship between the light source partitions and the PCB component areas (i.e., image blocks), and outputting a light field mapping dictionary. During fine-tuning, if the user finds a "shadow in a corner," they select that target area. By querying the light field mapping dictionary, the light source partitions affecting the target area are identified, such as #15, #16, and #22. During optimization, with the goal of "improving the average brightness of the selected area," only the brightness of these three light source partitions is adjusted. After several iterations, the shadows are effectively eliminated without affecting other parts of the image, resulting in good detection performance.
[0213] Based on the same application concept as the above method, this application proposes a machine vision task processing system, including: a display unit, an imaging condition setting unit, an image acquisition unit, and a machine vision task processing unit; wherein: the display unit is used to display an image; the image acquisition unit is used to acquire an image; the imaging condition setting unit is used to set imaging conditions according to the imaging condition setting method of the above example of this application; the machine vision task processing unit is used to acquire a target image under the imaging conditions set by the imaging condition setting unit, and perform machine vision task processing on the target image under the imaging conditions.
[0214] For example, the display unit may include, but is not limited to, a liquid crystal display (LCD), an organic light-emitting diode (OLED) screen, a projection display device, or a display module integrated with a terminal device (such as a computer monitor, an industrial touch screen, or a mobile device screen).
[0215] For example, the image acquisition unit may include, but is not limited to, industrial cameras, webcams, line scan cameras, area scan cameras, infrared / thermal imaging cameras, or imaging modules with optical lenses and image sensors (such as CMOS or CCD sensors).
[0216] For example, machine vision tasks may include, but are not limited to: target detection and recognition (such as workpiece classification and defect detection), target tracking and localization, image segmentation (semantic segmentation / instance segmentation), size measurement and calibration, QR code / character recognition (OCR), pose estimation, 3D reconstruction, motion analysis, quality grading, scene anomaly detection, etc.
[0217] For example, the machine vision task processing unit may acquire a target image under set imaging conditions, including but not limited to: controlling the image acquisition unit to acquire a target image under the set imaging conditions; or, processing the image acquired by the image acquisition unit to obtain a target image under the set imaging conditions.
[0218] Based on the same concept as the method described above, this application proposes an imaging condition setting device, see [link to relevant documentation]. Figure 5 The diagram shown is a structural schematic of the device, which may include: Acquisition module 51 is used to acquire a first reference image; acquire a target region on the first reference image; wherein, the first reference image includes M image blocks, M is greater than 1, the target region includes N image blocks from the M image blocks, N is greater than or equal to 1; the multi-zone light source corresponds to K light source zones, K is greater than 1, and there is an association relationship between the M image blocks and the K light source zones; determination module 52 is used to determine the target light source zone corresponding to the target region based on the association relationship.
[0219] For example, the acquisition module 51 is further configured to acquire a second reference image; the device further includes: a processing module, configured to set target imaging conditions based on reference imaging conditions corresponding to the second reference image; wherein the reference imaging conditions are configured to generate the second reference image; the target imaging conditions are configured to generate a target image, the target image being used for a machine vision task; the target imaging conditions include supplementary lighting parameters, the supplementary lighting parameters indicating supplementary lighting based on the target light source partition.
[0220] For example, when the processing module sets the target imaging condition based on the reference imaging condition corresponding to the second reference image, it is specifically used to: set the reference imaging condition as the target imaging condition; or, optimize and adjust the second reference image according to the obtained adjustment requirements; and set the target imaging condition based on the imaging condition corresponding to the optimized second reference image.
[0221] For example, when the processing module optimizes the second reference image according to the obtained adjustment requirements, it specifically performs the following: optimizes the second reference image according to at least one optimization method corresponding to the adjustment requirements.
[0222] For example, when the processing module optimizes the second reference image according to at least one optimization method corresponding to the adjustment requirement, it specifically employs at least one of the following methods: obtaining an imaging parameter adjustment instruction, and adjusting the reference imaging parameters corresponding to the second reference image based on the imaging parameter adjustment instruction to optimize the second reference image; wherein, the adjustment requirement is the imaging parameter adjustment instruction; the imaging parameter adjustment instruction is input through interactive operation of the imaging parameter adjustment control provided in the graphical user interface; obtaining an optimization direction confirmation instruction, and adjusting the imaging parameters corresponding to the optimization direction based on the optimization direction confirmation instruction to optimize the second reference image; wherein, the adjustment requirement is the optimization direction confirmation instruction; the optimization direction confirmation instruction is input through selection operation of the optimization direction function option provided in the graphical user interface; obtaining natural language describing the adjustment requirement, performing semantic parsing on the natural language to obtain a semantic parsing result, and adjusting the imaging parameters indicated by the semantic parsing result based on the semantic parsing result to optimize the second reference image; wherein, the adjustment requirement is natural language.
[0223] For example, the semantic parsing result includes the image features to be adjusted and the adjustment target; the processing module performs semantic parsing on the natural language to obtain the semantic parsing result, specifically for: parsing keywords in the natural language, querying the pre-established mapping relationship between keywords and image feature adjustment direction and magnitude based on the keywords, and determining the image features to be adjusted and the adjustment target; or, inputting the natural language into a pre-trained machine learning model, and using the machine learning model to determine the image features to be adjusted and the adjustment target; or, inputting the natural language into a large model, and using the large model to determine the image features to be adjusted and the adjustment target.
[0224] For example, when the processing module adjusts the imaging parameters indicated by the semantic parsing result based on the semantic parsing result to optimize the second reference image, it specifically performs the following steps: determining the imaging parameters to be adjusted and the parameter search range based on the reference imaging parameters corresponding to the second reference image, as well as the image features to be adjusted and the adjustment target; and optimizing the reference imaging parameters corresponding to the second reference image based on the imaging parameters to be adjusted and the parameter search range.
[0225] For example, the determining module 52 is further configured to, during the process of determining the association between M image blocks and the K light source partitions, acquire K light source images corresponding to the K light source partitions; wherein, for each light source partition, the multi-partition light source is controlled to illuminate the light source partition, and a light source image corresponding to the light source partition is acquired; for each image block, the contribution intensity of the K light source partitions to the image block is determined based on the K light source images, and a light source partition associated with the image block is selected based on the contribution intensity; and the association between the image block and the light source partition is recorded.
[0226] For example, when determining the contribution intensity of the K light source partitions to the image block based on the K light source images, the determining module 52 is specifically used to: for each light source partition, determine a difference image based on the light source image and dark field image corresponding to the light source partition; wherein, control the multi-partition light source to turn off all light source partitions and obtain the dark field image; determine the contribution intensity of the light source partition to the image block based on the pixel value corresponding to the image block in the difference image; wherein, the contribution intensity includes the average value or summation value of the pixel values.
[0227] For example, the acquisition module 51 is further configured to acquire multiple recommended images under multiple imaging conditions during the process of acquiring the first reference image or the second reference image; and determine a reference image based on the multiple recommended images; wherein the reference image is the first reference image or the second reference image.
[0228] For example, when the acquisition module 51 acquires multiple recommended images under multiple imaging conditions, it is specifically used to: acquire multiple candidate images under multiple imaging conditions; obtain an evaluation result of the candidate images based on the image features of the candidate images; and determine the recommended image from the multiple candidate images based on the evaluation result.
[0229] For example, the candidate image includes: an original image acquired based on imaging conditions, and / or a fused image obtained by fusing the acquired original images.
[0230] For example, the acquisition module 51 is further configured to determine the style category of the candidate images before determining the recommended image from the plurality of candidate images based on the evaluation result, thereby obtaining candidate images of at least one style category; when the acquisition module 51 determines the recommended image from the plurality of candidate images based on the evaluation result, it is specifically configured to: select the recommended image from the candidate images of the at least one style category based on the evaluation result of the candidate images of the at least one style category.
[0231] For example, when the acquisition module 51 determines the reference image based on the plurality of recommended images, it is specifically used to: determine the reference image based on the plurality of recommended images displayed; wherein, when the acquisition module displays the plurality of recommended images, it is specifically used to: display the plurality of recommended images through a first visualization interface; wherein, when there are recommended images of multiple style categories, the first visualization interface displays recommended images of the multiple style categories; or, the first visualization interface displays recommended images of one style category; when there are recommended images of multiple style categories and a style category switching instruction is detected, the recommended image displayed in the second visualization interface is switched.
[0232] For example, when the acquisition module 51 acquires the target region on the first reference image, it is specifically used to: receive an operation command for the first reference image, and acquire the target region on the first reference image based on the operation command; when the acquisition module receives the operation command for the first reference image, it is specifically used to: receive a natural language operation command, the natural language operation command including the location information of the target region on the first reference image, and the location information is used to indicate the target region; or, receive a selection operation command or a click operation command, the selection operation command or the click operation command being used to operate the target region on the first reference image.
[0233] For example, the acquisition module 51 is further configured to, after acquiring the first reference image, receive a selection command for a reference light source partition among the K light source partitions; and display the image blocks on the first reference image associated with the reference light source partition based on the association relationship between the M image blocks and the K light source partitions.
[0234] Based on the same concept as the above method, this application proposes an electronic device (i.e., a management device), see [link to relevant documentation]. Figure 6 As shown, it includes: a processor 61 and a machine-readable storage medium 62, the machine-readable storage medium 62 storing machine-executable instructions that can be executed by the processor 61; the processor 61 is used to execute the machine-executable instructions to implement the imaging condition setting method disclosed in the above example.
[0235] Based on the same concept as the above method, this application also provides a machine-readable storage medium storing a plurality of computer instructions, which, when executed by a processor, can implement the imaging condition setting method disclosed in the above examples of this application.
[0236] The aforementioned machine-readable storage medium can be any electronic, magnetic, optical, or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, machine-readable storage media can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or combinations thereof.
[0237] Based on the same concept as the methods described above, this application also provides a computer program product, which includes a computer program. When executed by a processor, the computer program implements the method for setting imaging conditions disclosed in the examples above.
[0238] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, 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, embodiments of this application can take the form of a computer program product implemented 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.
[0239] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for setting imaging conditions, characterized in that, The method comprises: acquiring a first reference image; acquiring a target region on the first reference image; wherein the first reference image comprises M image blocks, M is greater than 1, the target region comprises N image blocks in the M image blocks, N is greater than or equal to 1; wherein a multi-partition light source corresponds to K light source partitions, K is greater than 1, and the M image blocks and the K light source partitions have an association relationship; determining a target light source partition corresponding to the target region based on the association relationship.
2. The method according to claim 1, characterized in that, The method further comprises: acquiring a second reference image; setting a target imaging condition based on a reference imaging condition corresponding to the second reference image; wherein the reference imaging condition is configured to generate the second reference image; the target imaging condition is configured to generate a target image, which is used for a machine vision task; the target imaging condition comprises a light compensation parameter, which indicates light compensation based on the target light source partition.
3. The method of claim 2, wherein: the setting of the target imaging condition based on the reference imaging condition corresponding to the second reference image comprises: setting the reference imaging condition as the target imaging condition; or, according to an acquired adjustment requirement, optimizing and adjusting the second reference image; and setting the target imaging condition based on an imaging condition corresponding to the optimized second reference image.
4. The method of claim 3, wherein: the optimizing and adjusting of the second reference image according to the acquired adjustment requirement comprises: optimizing and adjusting the second reference image according to at least one optimization method corresponding to the adjustment requirement.
5. The method of claim 4, wherein: the optimizing and adjusting of the second reference image according to the at least one optimization method corresponding to the adjustment requirement comprises at least one of the following methods: acquiring an imaging parameter adjustment instruction, and adjusting a reference imaging parameter corresponding to the second reference image based on the imaging parameter adjustment instruction to optimize and adjust the second reference image; wherein the adjustment requirement is the imaging parameter adjustment instruction; and the imaging parameter adjustment instruction is input by interacting with an imaging parameter adjustment control provided in a graphical user interface; acquiring an optimization direction confirmation instruction, and adjusting an imaging parameter corresponding to an optimization direction based on the optimization direction confirmation instruction to optimize and adjust the second reference image; wherein the adjustment requirement is the optimization direction confirmation instruction; and the optimization direction confirmation instruction is input by selecting an optimization direction function option provided in a graphical user interface; acquiring a natural language for describing an adjustment requirement, performing semantic analysis on the natural language to obtain a semantic analysis result, and adjusting an imaging parameter indicated by the semantic analysis result based on the semantic analysis result to optimize and adjust the second reference image; wherein the adjustment requirement is the natural language.
6. The method of claim 5, wherein: the semantic analysis result comprises an image feature to be adjusted and an adjustment target. The semantic analysis of the natural language obtains a semantic analysis result, and the semantic analysis comprises: Analyzing a keyword in the natural language, and querying a pre-established mapping relationship between the keyword and an image feature adjustment direction and amplitude according to the keyword to determine an image feature to be adjusted and an adjustment target; Or, inputting the natural language into a pre-trained machine learning model, and determining the image feature to be adjusted and the adjustment target by using the machine learning model; Or, inputting the natural language into a large model, and determining the image feature to be adjusted and the adjustment target by using the large model.
7. The method of claim 6, wherein: The adjustment of the imaging parameter indicated by the semantic analysis result based on the semantic analysis result comprises: determining an imaging parameter to be adjusted and a parameter search range according to the reference imaging parameter corresponding to the second reference image and the image feature to be adjusted and the adjustment target; and optimizing and adjusting the reference imaging parameter corresponding to the second reference image according to the imaging parameter to be adjusted and the parameter search range.
8. The method of any one of claims 1-7, wherein: The determination of the association relationship between the M image blocks and the K light source partitions comprises: obtaining K light source images corresponding to the K light source partitions; wherein, for each light source partition, the multi-partition light source is controlled to light the light source partition, and a light source image corresponding to the light source partition is obtained; for each image block, determining a contribution intensity of the K light source partitions to the image block based on the K light source images, and selecting a light source partition associated with the image block based on the contribution intensity; recording the association relationship between the image block and the light source partition.
9. The method according to claim 8, characterized in that, The determination of the contribution intensity of the K light source partitions to the image block based on the K light source images comprises: for each light source partition, determining a difference image based on the light source image corresponding to the light source partition and a dark field image; wherein, the multi-partition light source is controlled to turn off all light source partitions, and the dark field image is obtained; determining the contribution intensity of the light source partition to the image block based on a pixel value corresponding to the image block in the difference image; wherein, the contribution intensity comprises an average value or a summation value of the pixel value.
10. The method of any one of claims 1-7, wherein: the obtaining process of the first reference image or the second reference image comprises: obtaining a plurality of recommended images under a plurality of imaging conditions; determining a reference image based on the plurality of recommended images; wherein, the reference image is the first reference image or the second reference image.
11. The method of claim 10, wherein: the obtaining of the plurality of recommended images under the plurality of imaging conditions comprises: obtaining a plurality of candidate images under a plurality of imaging conditions; obtaining an evaluation result of the candidate image according to an image feature of the candidate image; determining the recommended image from the plurality of candidate images according to the evaluation result.
12. The method of claim 11, wherein: The candidate images include original images collected based on imaging conditions and / or fusion images obtained by fusing the collected original images.
13. The method of claim 11, wherein, Before determining the recommended image from the plurality of candidate images according to the evaluation results, the method further comprises: determining a style category of the candidate images to obtain candidate images of at least one style category; Determining the recommended image from the plurality of candidate images according to the evaluation results comprises: Selecting the recommended image from the candidate images of the at least one style category according to the evaluation results of the candidate images of the at least one style category.
14. The method of claim 10, wherein, Determining the reference image based on the plurality of recommended images comprises: determining the reference image based on the plurality of recommended images displayed; and wherein the method of displaying the plurality of recommended images comprises: Displaying the plurality of recommended images through a first visual interface; wherein, in the case that there are recommended images of multiple style categories, the first visual interface displays the recommended images of the multiple style categories; Or, Displaying the recommended images of one style category through a second visual interface; In the case that there are recommended images of multiple style categories and a style category switching instruction is detected, switching the recommended images displayed in the second visual interface.
15. The method of any one of claims 1-7, wherein, The target region on the first reference image is obtained by receiving an operation command for the first reference image and obtaining the target region on the first reference image based on the operation command; The operation command for the first reference image is received by: Receiving a natural language operation command, wherein the natural language operation command includes position information of the target region on the first reference image, and the position information is used to indicate the target region; Or, receiving a circle selection operation command or a click operation command, wherein the circle selection operation command or the click operation command is used to operate the target region on the first reference image.
16. The method of any one of claims 1-7, wherein, After obtaining the first reference image, the method further comprises: Receiving a selection command for a reference light source partition in the K light source partitions; Displaying the image blocks on the first reference image associated with the reference light source partition based on the association relationship between the M image blocks and the K light source partitions.
17. An apparatus for setting an imaging condition, characterized by comprising: The device comprises: An obtaining module is configured to obtain a first reference image and a target region on the first reference image, wherein the first reference image includes M image blocks, M is greater than 1, the target region includes N image blocks in the M image blocks, N is greater than or equal to 1; wherein a multi-partition light source corresponds to K light source partitions, K is greater than 1, and the M image blocks and the K light source partitions have an association relationship; A determining module is configured to determine a target light source partition corresponding to the target region based on the association relationship.
18. The apparatus of claim 17, wherein, the acquisition module is further configured to acquire a second reference image; and the apparatus further comprises a processing module configured to set a target imaging condition based on a reference imaging condition corresponding to the second reference image, wherein the reference imaging condition is configured to generate the second reference image, and the target imaging condition is configured to generate a target image used for a machine vision task, and the target imaging condition comprises a light compensation parameter indicating light compensation based on the target light source partition; alternatively, the processing module is configured to set the target imaging condition based on the reference imaging condition corresponding to the second reference image, or to perform an optimized adjustment on the second reference image according to an acquired adjustment requirement, and set the target imaging condition based on an imaging condition corresponding to the second reference image after the optimized adjustment; alternatively, the processing module is configured to perform the optimized adjustment on the second reference image according to the acquired adjustment requirement, by using at least one optimization method corresponding to the adjustment requirement; alternatively, the processing module is configured to perform the optimized adjustment on the second reference image according to the at least one optimization method corresponding to the adjustment requirement, by using at least one of the following methods: acquiring an imaging parameter adjustment instruction, and adjusting a reference imaging parameter corresponding to the second reference image based on the imaging parameter adjustment instruction to perform the optimized adjustment on the second reference image, wherein the adjustment requirement is the imaging parameter adjustment instruction, and the imaging parameter adjustment instruction is input by interacting with an imaging parameter adjustment control provided in a graphical user interface; acquiring an optimization direction confirmation instruction, and adjusting an imaging parameter corresponding to an optimization direction based on the optimization direction confirmation instruction to perform the optimized adjustment on the second reference image, wherein the adjustment requirement is the optimization direction confirmation instruction, and the optimization direction confirmation instruction is input by selecting an optimization direction function option provided in the graphical user interface; acquiring a natural language used to describe the adjustment requirement, performing semantic analysis on the natural language to obtain a semantic analysis result, and adjusting an imaging parameter indicated by the semantic analysis result based on the semantic analysis result to perform the optimized adjustment on the second reference image, wherein the adjustment requirement is the natural language; and Or, the semantic analysis result includes an image feature to be adjusted and an adjustment target; the processing module, when performing semantic analysis on the natural language to obtain a semantic analysis result, is specifically configured to: analyze a keyword in the natural language, query a pre-established mapping relationship between the keyword and an image feature adjustment direction and magnitude according to the keyword, and determine the image feature to be adjusted and the adjustment target; or input the natural language into a pre-trained machine learning model, and determine the image feature to be adjusted and the adjustment target by using the machine learning model; or input the natural language into a large model, and determine the image feature to be adjusted and the adjustment target by using the large model; Or, the processing module, when adjusting the imaging parameter indicated by the semantic analysis result to optimize and adjust the second reference image, is specifically configured to: determine an imaging parameter to be adjusted and a parameter search range according to the reference imaging parameter corresponding to the second reference image and the image feature to be adjusted and the adjustment target; and optimize and adjust the reference imaging parameter corresponding to the second reference image according to the imaging parameter to be adjusted and the parameter search range; Or, the determining module is further configured to, in the process of determining the association relationship between the M image blocks and the K light source partitions, acquire K light source images corresponding to the K light source partitions; for each light source partition, the multi-partition light source is controlled to perform lighting on the light source partition, and a light source image corresponding to the light source partition is acquired; for each image block, the contribution intensity of the K light source partitions to the image block is determined based on the K light source images, and a light source partition associated with the image block is selected based on the contribution intensity; and the association relationship between the image block and the light source partition is recorded. Or, the determining module, when determining the contribution intensity of the K light source partitions to the image block based on the K light source images, is specifically configured to: for each light source partition, a difference image is determined based on the light source image corresponding to the light source partition and a dark field image; the multi-partition light source is controlled to be turned off all light source partitions, and the dark field image is acquired; and the contribution intensity of the light source partition to the image block is determined based on a pixel value corresponding to the image block in the difference image; wherein the contribution intensity includes an average value or a summation value of the pixel value. Or, the acquiring module is further configured to, in the process of acquiring the first reference image or the second reference image, acquire a plurality of recommended images under a plurality of imaging conditions; and determine a reference image based on the plurality of recommended images; the reference image is the first reference image or the second reference image. Or, the acquiring module, when acquiring a plurality of recommended images under a plurality of imaging conditions, is specifically configured to: acquire a plurality of candidate images under a plurality of imaging conditions; obtain an evaluation result of the candidate images according to image features of the candidate images; and determine the recommended images from the plurality of candidate images according to the evaluation result. Or, the candidate images include: original images acquired based on imaging conditions, and / or fusion images obtained by fusing the acquired original images. Alternatively, the obtaining module is further configured to determine a style category of the candidate image according to the evaluation result, to obtain candidate images of at least one style category, and determine the recommended image from the candidate images according to the evaluation result. Alternatively, the obtaining module is further configured to determine the reference image based on the plurality of recommended images, and the obtaining module is specifically configured to: determine the reference image based on the plurality of recommended images displayed, and the obtaining module is specifically configured to: display the plurality of recommended images through a first visual interface, and in a case where there are recommended images of a plurality of style categories, the first visual interface displays the recommended images of the plurality of style categories, or display the recommended images of one style category through a second visual interface, and in a case where there are recommended images of a plurality of style categories and a style category switching instruction is detected, switch the recommended images displayed in the second visual interface. Alternatively, the obtaining module is further configured to: receive an operation command for the first reference image, and obtain the target region on the first reference image based on the operation command, and the obtaining module is specifically configured to: receive a natural language operation command, the natural language operation command including position information of the target region on the first reference image, and the position information is used to indicate the target region, or receive a circle selection operation command or a click operation command, and the circle selection operation command or the click operation command is used to operate the target region on the first reference image. Alternatively, the obtaining module is further configured to: after obtaining the first reference image, receive a selection command for a reference light source partition in the K light source partitions, and display the image block associated with the reference light source partition on the first reference image based on the association relationship between the M image blocks and the K light source partitions.
19. An electronic device, comprising: Comprising: a processor and a machine readable storage medium, the machine readable storage medium stores machine executable instructions executable by the processor; the processor is configured to execute the machine executable instructions to implement the method in any of claims 1-16.
20. A machine vision task processing system, characterized by Comprising: a display unit, an imaging condition setting unit, an image acquisition unit, and a machine vision task processing unit; wherein: the display unit is configured to display an image; the image acquisition unit is configured to acquire an image; the imaging condition setting unit is configured to set an imaging condition according to the method in any of claims 1-16; the machine vision task processing unit is configured to acquire a target image under the imaging condition set by the imaging condition setting unit, and perform machine vision task processing on the target image under the imaging condition.