Method, apparatus and device for determining input image and storage medium

By acquiring and mapping images of light group areas in traffic light scenarios, and using a preset mapping parameter set to determine the optimal input image, the problem of poor segmentation algorithm performance and inaccurate color restoration in scenarios with large circumscribed rectangles is solved, thus improving the segmentation effect and robustness.

CN122290077APending Publication Date: 2026-06-26JINAN BOGUAN INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411915265.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-24
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In existing technologies, for traffic light scenarios with large circumscribed rectangles, the effective pixels are too few when the image is shrunk to the size of the input image for the segmentation algorithm, resulting in poor performance of the segmentation algorithm and inaccurate color restoration.

Method used

By acquiring the original input image of the target light group scene, cropping the image of each light group area, and applying it to the canvas using a preset set of texture parameters, the optimal set of texture parameters is determined to obtain the optimal input image, reducing image scaling time and improving the performance and robustness of the segmentation algorithm.

Benefits of technology

It improves the performance and accuracy of the segmentation algorithm, ensures accurate color recovery, and reduces the problem of insufficient effective pixels caused by scaling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122290077A_ABST
    Figure CN122290077A_ABST
Patent Text Reader

Abstract

This invention provides a method, apparatus, device, and storage medium for determining an input image, comprising: acquiring an original input image corresponding to a target lighting scene and pre-stored positions of each lighting group in the original input image; cropping the corresponding region of each lighting group from the original input image according to the pre-stored position of each lighting group to obtain a region image corresponding to each lighting group; acquiring a preset texture parameter set corresponding to the target lighting scene; the preset texture parameter set includes preset texture parameters corresponding to each lighting group, and the preset texture parameter set is determined in advance by traversing and calculating textures for multiple lighting groups in the target lighting scene using various different texture parameter sets; and applying the region image of each lighting group to a canvas according to the preset texture parameters corresponding to each lighting group in the preset texture parameter set to obtain the target input image. Using the technical solution of this invention can improve the segmentation performance of the segmentation algorithm and accurately achieve color recognition and color restoration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method, apparatus, device, and storage medium for determining an input image. Background Technology

[0002] Using electronic surveillance video to determine traffic violations has become the mainstream technical method. Taking running a red light as an example, to determine whether a user in the surveillance video has run a red light, it is generally necessary to identify the colors of the traffic lights (i.e., red and green lights) in the video and then use the identified image to determine whether a red light violation has occurred. However, due to shooting deviations in the original image, it is also necessary to restore the colors of the traffic lights identified in the original image after the determination. Furthermore, to ensure the effectiveness of violation capture, reduce the rate of rejected images, and decrease the workload of manual review, extremely high accuracy is required for traffic light color recognition. The restored traffic light colors must be free of deviation, missing corners, and overflow, which necessitates complete and precise pixel segmentation of the traffic lights in the image.

[0003] In related technologies, when segmenting and restoring the colors of traffic lights in an image, the general approach is to extract the largest bounding rectangle of all light groups. Then, a segmentation algorithm is used to segment the pixels within this bounding rectangle, and the percentages of red, yellow, and green pixels are statistically analyzed to determine the colors of the traffic lights displayed in the image. Finally, based on the color recognition results, the segmented light group regions are repainted.

[0004] However, since the input image size of the segmentation algorithm is fixed, when performing traffic light segmentation and color restoration using the above techniques, for scenarios such as intersections with multiple light groups at intervals, where the bounding rectangle of the traffic light area is large, the cropped image needs to be reduced to the size of the input image of the segmentation algorithm. The scaling factor is large, and the scaling operation takes longer, which will affect the performance of the algorithm. At the same time, the effective pixels of the traffic lights in the reduced image are too few, which will lead to a deterioration in the segmentation algorithm effect. Summary of the Invention

[0005] This invention provides a method, apparatus, device, and storage medium for determining an input image. It addresses the shortcomings of existing technologies where, in scenarios with large circumscribed rectangles, the number of effective pixels for traffic lights is too small when the cropped image is scaled down to the input image size for the segmentation algorithm, leading to poor algorithm performance and inaccurate color determination. Furthermore, color restoration requires reverting the scaled image to the original image, but the large scaling factor also hinders accurate color restoration. This invention achieves the optimal input image size for the algorithm by statistically analyzing the area of ​​sample light groups, reducing the time consumed by image scaling during algorithm input construction, improving the inference performance and segmentation effect of the segmentation algorithm. Simultaneously, by combining the images of each light group with the optimal input image size and using optimal mapping parameters, an input image with minimal performance consumption for the target algorithm is obtained, thereby improving the robustness and reducing performance overhead of the segmentation algorithm while accurately restoring color.

[0006] This invention provides a method for determining an input image, comprising: Obtain the original input image corresponding to the target light group scene; the original input image includes multiple light groups in the target light group scene; Obtain the pre-stored positions of each light group in the original input image, and based on the pre-stored positions of each light group, crop the corresponding area of ​​each light group in the original input image to obtain the area image corresponding to each light group; Obtain the preset texture parameter set corresponding to the target light group scene; the preset texture parameter set includes the preset texture parameters corresponding to each light group. The preset texture parameter set is determined in advance by traversing and calculating textures for multiple light groups in the target light group scene using various different texture parameter sets. Based on the preset texture parameters corresponding to each light group in the preset texture parameter set, the area image of each light group is textured onto the canvas to obtain the target input image.

[0007] According to a method for determining an input image provided by the present invention, the above-mentioned acquisition of a preset texture parameter set corresponding to a target light group scene includes: Acquire an initial image of the target light group scene, which includes multiple light groups, and crop the corresponding area of ​​each light group from the initial image to obtain the first image corresponding to each light group; each light group includes at least one signal light; Obtain the preset input image size corresponding to the target algorithm; the preset input image size is determined based on the area of ​​the sample light group in multiple sample images, and is less than or equal to the maximum input image size allowed by the target algorithm. The target algorithm is used to perform pixel-level segmentation processing on each light group in the image input to the target algorithm. Obtain different texture parameter sets, apply each first image to the same canvas according to the different texture parameter sets, and determine the canvas size corresponding to each texture parameter set; Based on the preset input image size and the canvas size of each texture parameter set, a performance evaluation quantization value is determined for each texture parameter set. Based on the performance evaluation quantization value of each texture parameter set, a preset texture parameter set is determined among different texture parameter sets. The aforementioned performance evaluation quantization value is used to characterize the performance consumption when converting the canvas size corresponding to the texture parameter set to the preset input image size.

[0008] According to the method for determining an input image provided by the present invention, the above-mentioned method for obtaining the preset input image size corresponding to the target algorithm includes: Acquire multiple sample images of different lighting scenarios; each sample image includes at least one sample lighting group; Based on the area of ​​each sample light group in each sample image, determine the total area corresponding to all sample light groups in each sample image; Count the total area and its frequency of occurrence in each total area, and determine the candidate total area corresponding to the maximum frequency of occurrence based on the frequency of occurrence of each total area; Obtain the maximum input image size allowed by the target algorithm, and determine the preset input image size corresponding to the target algorithm based on the maximum input image size and the total area of ​​the candidates.

[0009] According to a method for determining an input image provided by the present invention, the method for determining the preset input image size corresponding to the target algorithm based on the maximum input image size and the total area of ​​the candidates includes: If the total area of ​​the candidates is greater than the maximum input image size, then the maximum input image size will be set as the preset input image size. If the total area of ​​the candidates is not greater than the maximum input image size, then the size corresponding to the total area of ​​the candidates is determined as the preset input image size.

[0010] According to a method for determining an input image provided by the present invention, the different sets of texture parameters include combinations of different values ​​for rotation parameters and different values ​​for expansion direction parameters. The value of the rotation parameter is used to characterize whether the first image is rotated, and the value of the expansion direction parameter is used to characterize the texture direction and position of the first image when it is textured on the canvas. The above-mentioned method of obtaining different sets of texture parameters, textures each first image onto the same canvas according to the different sets of texture parameters, and determines the canvas size corresponding to each set of texture parameters includes: Based on different values ​​of rotation parameters and different values ​​of expansion direction parameters, different permutations and combinations are made to determine multiple sets of different texture parameters corresponding to each first image; In each first image, a set of texture parameters is selected from multiple sets of texture parameters as intermediate texture parameters to obtain a set of texture parameters. Perform the first texture calculation operation, which includes: applying each first image to the same canvas according to the corresponding intermediate texture parameters in a texture parameter set, to obtain the canvas size of a canvas; In at least one first image, another set of texture parameters is determined from multiple sets of texture parameters, and the intermediate texture parameters of the corresponding first image are updated using the other set of texture parameters to obtain a new set of texture parameters. Then, the process returns to iteratively execute the above first texture calculation operation until each set of texture parameters of each first image obtains a different set of texture parameters according to different permutations and combinations and the above first texture calculation operation is completed. After the iteration ends, the canvas sizes of multiple canvases are obtained.

[0011] According to a method for determining an input image provided by the present invention, the above-mentioned method of applying each first image to the same canvas according to the corresponding intermediate texture parameters in a texture parameter set to obtain the canvas size of a canvas includes: For each first image, perform a second texture calculation operation, and after performing a second texture calculation operation on each first image, obtain the canvas size of a canvas; The above-mentioned second texture calculation operation includes: Based on the value of the rotation parameter in the intermediate texture parameters corresponding to the first image in a texture parameter set, determine whether to rotate the first image, and determine the size of the light group corresponding to the first image based on the result of whether to rotate it; Determine whether the size of the mapped area in the canvas is smaller than the preset input image size; If it is not less than, then the expansion direction of the first image is determined according to the value of the expansion direction parameter in the intermediate texture parameters of the first image, and the first image is textured onto the canvas according to the expansion direction; If it is smaller, then the first image will be pasted onto the canvas according to the size of the light group corresponding to the first image.

[0012] According to a method for determining an input image provided by the present invention, the texture parameters include rotation parameter values, which are used to characterize whether a first image is rotated. The method involves determining a performance evaluation quantization value corresponding to each texture parameter set based on a preset input image size and the canvas size of each texture parameter set, and determining a preset texture parameter set among different texture parameter sets based on the performance evaluation quantization value of each texture parameter set. Based on the size relationship between the preset input image size and the canvas size of each texture parameter set, and the result of whether each first image is rotated during the texture mapping process for each texture parameter set, a performance evaluation function is constructed. The performance evaluation function is used to calculate the quantitative performance evaluation values ​​corresponding to various texture parameter sets. Based on the performance evaluation quantization values ​​of various texture parameter sets, the smallest performance evaluation quantization value is determined, and the texture parameter set corresponding to the smallest performance evaluation quantization value is determined as the preset texture parameter set; the magnitude of the above performance evaluation quantization value is positively correlated with the performance consumption of the target algorithm.

[0013] According to the method for determining an input image provided by the present invention, the preset input image size includes a first width and a first height, each canvas size includes a second width and a second height, and the method for calculating the performance evaluation quantization value corresponding to various texture parameter sets using a performance evaluation function includes: For each set of texture parameters, the total number of rotations of all first images during the texture mapping process is determined based on whether each first image is rotated during the texture mapping process according to the set of texture parameters. Based on the areas corresponding to the first width and the first height, and the areas corresponding to the second width and the second height, determine the blank area in the canvas obtained during the texturing process according to the texture parameter set; Based on the first width, first height, second width, and second height, determine the canvas size scaling factor obtained during the texturing process according to the texture parameter set; The total number of rotations, blank area, and size scaling factor corresponding to the texture parameter set are substituted into the performance evaluation function for calculation to determine the quantitative value of the performance evaluation corresponding to the texture parameter set.

[0014] The present invention also provides an input image determination module, comprising the following modules: The light group image acquisition module is used to acquire the original input image corresponding to the target light group scene; the original input image includes multiple light groups in the target light group scene. The region image cropping module is used to obtain the pre-stored positions of each light group in the original input image, and crop the corresponding region of each light group in the original input image according to the pre-stored position of each light group to obtain the region image corresponding to each light group. The texture parameter set acquisition module is used to acquire the preset texture parameter set corresponding to the target light group scene. The preset texture parameter set includes the preset texture parameters corresponding to each light group. The preset texture parameter set is determined in advance by traversing texture calculations using multiple different texture parameter sets for multiple light groups in the target light group scene. The input image determination module is used to apply the area image of each light group to the canvas according to the preset texture parameters corresponding to each light group in the preset texture parameter set, so as to obtain the target input image.

[0015] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the input image determination method as described above.

[0016] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the input image determination method as described above.

[0017] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the input image determination method as described above.

[0018] The method, apparatus, device, and storage medium for determining the input image provided by this invention acquires the original input image corresponding to multiple light groups in a target light group scene, and acquires the pre-stored positions of each light group in the original input image. Based on the pre-stored positions of each light group, the corresponding area of ​​each light group is cropped from the original input image to obtain the area image corresponding to each light group. Simultaneously, a preset texture parameter set corresponding to the target light group scene is acquired, and the area image of each light group is mapped onto the canvas according to the preset texture parameters corresponding to each light group in the preset texture parameter set, thus obtaining the target input image. The preset texture parameter set includes preset texture parameters corresponding to each light group, and the preset texture parameter set is determined in advance by traversing and calculating textures for multiple light groups in the target light group scene using various different texture parameter sets. In this method, since the optimal set of texture parameters can be determined by using multiple different sets of texture parameters to apply textures to the images of each light group to obtain the algorithm input image, the time consumed by image scaling required to construct an image that matches the algorithm input size can be reduced, thereby improving the algorithm's inference performance and segmentation effect, and further enhancing the algorithm's robustness. At the same time, since the set of texture parameters used to obtain the input image is the optimal set of texture parameters, that is, the original input image is scaled to the optimal ratio for texture application, the scaling ratio during color restoration is also optimal. Therefore, the problem of insufficient effective pixels due to excessive scaling is avoided, which makes accurate color restoration difficult, thus enabling accurate restoration of light group colors. Attached Figure Description

[0019] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0020] Figure 1These are schematic diagrams of two types of headlight groups, a large intersection, multiple headlight groups, and small pixel scenes.

[0021] Figure 2 This is one of the flowcharts illustrating the method for determining the input image provided in this embodiment of the invention.

[0022] Figure 3 This is a second schematic flowchart of the input image determination method provided in the embodiments of the present invention.

[0023] Figure 4 This is the third flowchart illustrating the method for determining the input image provided in this embodiment of the invention.

[0024] Figure 5 This is the fourth flowchart illustrating the method for determining the input image provided in this embodiment of the invention.

[0025] Figure 6 This is a schematic diagram illustrating the process of obtaining the canvas size of a canvas using a single set of texture parameters provided in an embodiment of the present invention.

[0026] Figure 7 This is the fifth flowchart illustrating the method for determining the input image provided in this embodiment of the invention.

[0027] Figure 8 This is a schematic diagram of the structure of the input image determination device provided in an embodiment of the present invention.

[0028] Figure 9 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation

[0029] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0030] Currently, electronic traffic enforcement cameras are typically installed at traffic light intersections. The style, number, size, and distribution of these traffic lights vary. Some scenarios are conventional, such as having only one set of traffic lights, while others are unconventional, potentially including large light clusters, major intersections, multiple light clusters, or small pixel displays. (See [reference needed]). Figure 1The diagrams shown depict two scenarios: a large traffic light cluster, a major intersection, multiple traffic light clusters, and a small pixel scene. The black arrows or lights represent the red arrows or lights displayed by actual traffic lights. These scenarios involve multiple traffic light clusters in large numbers. When segmenting and restoring the colors of these traffic light clusters in the images, one technique involves cropping the largest bounding rectangle of all traffic light clusters and then performing pixel segmentation, color statistics, and color restoration based on this bounding rectangle. However, for scenarios with large bounding rectangles, the cropped image, after being scaled down to the input image size for the segmentation algorithm, has too few effective pixels for the traffic lights, leading to poor performance and inaccurate color determination. Furthermore, color restoration requires reverting the scaled-down image to the original image, but the large scaling factor also hinders accurate color restoration. Another technique involves segmenting the image of each light group pixel by pixel. Specifically, this method uses image segmentation technology to perform segmentation algorithms on each light group image, statistically analyzes the red, yellow, and green pixels in the segmentation results, determines the color based on the statistical proportions, and finally restores and paints the segmented light area images based on the color recognition results. However, this technique requires a separate segmentation algorithm for each light group. For example, if there are six light groups in an image, each of the six light groups is cropped and the segmentation algorithm is performed six times. Furthermore, the input size for the segmentation algorithm is fixed, and each light group requires cropping and scaling algorithms, resulting in a performance consumption six times that of a single segmentation. Therefore, this method is unsuitable for multi-light group scenarios and has poor real-time performance. Based on this, embodiments of the present invention provide a method, apparatus, device, and storage medium for determining the input image, which can solve this technical problem.

[0031] The following is combined Figures 2-7 This invention describes a method for determining the input image according to an embodiment of the invention.

[0032] It should be noted that the execution subject in the embodiments of the present invention can be an input image determining device, an electronic device, or other devices or equipment. The following embodiments will use an electronic device as an example for illustration. The electronic device can be a terminal or a server.

[0033] Figure 2 This is one of the flowcharts illustrating the method for determining the input image provided in this embodiment of the invention, such as... Figure 2 As shown, the method includes the following steps: Step 202: Obtain the original input image corresponding to the target light group scene; the original input image includes multiple light groups in the target light group scene.

[0034] The target light group scene can be any light group scene, which can include multiple light groups. Each light group can include one or more traffic lights, i.e., traffic lights. The traffic lights can be represented by shapes such as circles, arrows, squares, numbers, etc., without specific limitations.

[0035] Specifically, cameras or other devices located at intersections or on roads within the target light cluster scene can be used to capture images of multiple light clusters within that scene, obtaining the original input images containing the images of the multiple light clusters.

[0036] Step 204: Obtain the pre-stored positions of each light group in the original input image, and extract the corresponding area of ​​each light group from the original input image according to the pre-stored positions of each light group to obtain the area image corresponding to each light group.

[0037] The original input image includes multiple light groups, each with a fixed position within the image. Specifically, during system initialization, an initial image of the target light group scene is acquired, and target detection is performed on each light group in the initial image to obtain its position information (e.g., the location of the detection box corresponding to the light group). This position information can then be saved, resulting in the pre-stored position of each light group. Here, the pre-stored position refers to the location of the light group within the image.

[0038] Specifically, after obtaining the original input image, the pre-stored position of each light group can be obtained through the pre-saved position information. Then, the image is cropped at the corresponding position in the original input image using the pre-stored position of each light group to obtain the image of the corresponding area of ​​each light group in the original input image, which is recorded as the area image corresponding to each light group.

[0039] Step 206: Obtain the preset texture parameter set corresponding to the target light group scene; the preset texture parameter set includes the preset texture parameters corresponding to each light group. The preset texture parameter set is determined in advance by traversing and calculating textures for multiple light groups in the target light group scene using a variety of different texture parameter sets.

[0040] In this step, after obtaining the region image corresponding to each light group in the original input image, in order to facilitate reducing the scaling time and performance loss when scaling the original input image to the input image size required by the algorithm, this embodiment proposes to select the optimal mapping parameters for each light group and map each light group onto the canvas to obtain the final input image. This way, the image of each light group can be mapped onto the canvas according to the optimal scaling factor to obtain the final input image, reducing the scaling time to improve algorithm performance. At the same time, it can ensure that there are more effective pixels in the final input image, thereby improving the light group segmentation effect.

[0041] In selecting the optimal texture parameters for each light group, each light group can correspond to a set of texture parameters. The texture parameters of all light groups can then be combined to obtain a texture parameter set. Each light group can be pre-arranged and combined according to different texture parameters to obtain multiple different texture parameter sets. Then, texture calculations are performed on the region image of each light group according to each texture parameter set. The scaling factor between the canvas size after texturing the region image of each light group and the algorithm input image size may differ for each different texture parameter set. That is, the performance loss and segmentation effect when converting the canvas after texturing to the algorithm input image size are different for each different texture parameter set. Finally, the texture parameter set with the optimal scaling factor and the optimal segmentation effect can be selected from various texture parameter sets. This selected texture parameter set can be denoted as the preset texture parameter set.

[0042] It should be noted that the process of selecting a preset texture parameter set from multiple texture parameter sets can be carried out during system initialization by iterating through the texture parameters of each light group in an initial image, selecting a preset texture parameter set from multiple texture parameter sets, and saving the preset texture parameter set.

[0043] In addition, for different lighting scene sets, the preset texture parameter set corresponding to the lighting scene can be obtained in advance in the above manner and saved. In this way, after obtaining the target lighting scene, the preset texture parameter set corresponding to the target lighting scene can be obtained from the preset preset texture parameter set.

[0044] Furthermore, the aforementioned set of preset texture parameters can include a set of preset texture parameters corresponding to each light group. This set of preset texture parameters for each light group can also be represented by a texture parameter matrix. This matrix can include values ​​for rotation parameters, expansion direction parameters, etc. For example, if there are two texture parameters, each of which can take the value 0 or 1, then the set of texture parameters for each light group can have four forms: [0,0], [0,1], [1,0], and [1,1]. By setting different values ​​for the texture parameters of each light group and then arranging and combining these different values ​​in different ways, various sets of texture parameters can be obtained.

[0045] Step 208: Based on the preset texture parameters corresponding to each light group in the preset texture parameter set, the area image of each light group is textured onto the canvas to obtain the target input image.

[0046] In this step, after obtaining the preset texture parameter set corresponding to the target light group scene, the area image of the light group can be mapped to the corresponding position on the canvas according to the set of texture parameters corresponding to each light group in the preset texture parameter set. After mapping the area images of all light groups, a complete canvas can be obtained, which is the final target input image of the algorithm.

[0047] It is understandable that the target input image is obtained by using a preset set of texture parameters to apply textures / stitch the images of each region. This results in the lowest performance consumption when the target input image is used as the input image for pixel-level segmentation of the algorithm. It also results in the lowest performance consumption when the target input image is scaled to the size of the algorithm's input image. In other words, the preset set of texture parameters here is the optimal set of texture parameters.

[0048] Furthermore, after obtaining the target input image, its size can be compared with the size of the input image required by the algorithm. If they are close, no scaling of the target input image is needed, and it can be directly used as the actual input image for the algorithm. If the size of the target input image is not close to the size required by the algorithm, the target input image is scaled to the required size. After finally determining the input image for the algorithm, it can be input into the algorithm for pixel-level light group segmentation. The values ​​of each pixel in each segmented light group are statistically analyzed to identify the color of each light group. Then, based on the identified light group colors, the corresponding colors are restored to the positions of the corresponding light groups in the original input image.

[0049] In this embodiment, the original input images corresponding to multiple light groups in the target light group scene are obtained, as well as the pre-stored positions of each light group in the original input images. Based on the pre-stored positions of each light group, the corresponding areas of each light group are cropped from the original input images to obtain the area images corresponding to each light group. At the same time, the preset texture parameter set corresponding to the target light group scene is obtained, and the area images of each light group are mapped onto the canvas according to the preset texture parameters corresponding to each light group in the preset texture parameter set to obtain the target input image. The preset texture parameter set includes the preset texture parameters corresponding to each light group. The preset texture parameter set is determined in advance by traversing and calculating textures for multiple light groups in the target light group scene using various different texture parameter sets. In this method, since the optimal set of texture parameters can be determined by using multiple different sets of texture parameters to apply textures to the images of each light group to obtain the algorithm input image, the time consumed by image scaling required to construct an image that matches the algorithm input size can be reduced, thereby improving the algorithm's inference performance and segmentation effect, and further enhancing the algorithm's robustness. At the same time, since the set of texture parameters used to obtain the input image is the optimal set of texture parameters, that is, the original input image is scaled to the optimal ratio for texture application, the scaling ratio during color restoration is also optimal. Therefore, the problem of insufficient effective pixels due to excessive scaling is avoided, which makes accurate color restoration difficult, thus enabling accurate restoration of light group colors.

[0050] In actual light group image segmentation, each time a light group image is acquired, a pre-calculated set of preset texture parameters corresponding to the light group scene is obtained, and textures are applied to obtain the optimal input image. The following embodiment explains how to obtain the set of preset texture parameters corresponding to the target light group scene.

[0051] Figure 3 This is a second schematic flowchart of the input image determination method provided in this embodiment of the invention, as shown below. Figure 3 As shown, step 206 above, "obtaining the set of preset texture parameters corresponding to the target light group scene," may include the following steps: Step 302: Obtain an initial image of the target light group scene that includes multiple light groups, and crop the image of the corresponding area of ​​each light group in the initial image to obtain the first image corresponding to each light group; each light group includes at least one signal light.

[0052] During system initialization, multiple light clusters in the target light cluster scene can be captured by cameras or other cameras located at intersections or on roads within the target light cluster scene. The captured images, including the multiple light clusters, are recorded as the initial images. Each light cluster can include one or more traffic lights, i.e., traffic lights (red and green lights). These traffic lights can be represented by shapes such as circles, arrows, squares, or numbers; no specific limitations are imposed here.

[0053] Then, target detection can be performed on each light group in the initial image to obtain the position information of each light group in the initial image (such as the position of the detection box corresponding to the light group). Afterwards, the image of the region where each light group is located can be cropped from the initial image using the position information of each light group. This way, the image of the region where each light group is located can be cropped, resulting in multiple cropped images. Each cropped image can be designated as the first image. It can be understood that each first image includes one light group; that is, each first image is a cropped image of one light group.

[0054] Furthermore, when performing target detection on the light groups, any target detection algorithms or models can be used, without specific limitations. It should be noted that after obtaining the positions of each light group in the initial image through target detection, these positions can be recorded as pre-stored locations and saved. Later, when cropping the light group image of the target light group scene, these pre-stored locations can be directly retrieved for cropping, thus not affecting the performance of the actual light group image segmentation process.

[0055] Step 304: Obtain the preset input image size corresponding to the target algorithm; the preset input image size is determined based on the area of ​​the sample light group in multiple sample images, and is less than or equal to the maximum input image size allowed by the target algorithm. The target algorithm is used to perform pixel-level segmentation processing on each light group in the image input to the target algorithm.

[0056] The target algorithm can be any algorithm or model that performs pixel-level segmentation of each light group in the image input to the target algorithm. For example, it can be a pixel-level segmentation algorithm / model, a pixel-level classification algorithm / model, a pixel-level detection algorithm / model, etc. There is no specific limitation on the specific type of algorithm / model.

[0057] Specifically, multiple sample images can be collected in advance. Each sample image may include one or more sample light groups. Then, by statistically analyzing the area of ​​these sample light groups and combining this with the maximum input image size allowed by the target algorithm, the optimal input image size suitable for the target algorithm can be determined. This optimal input image size can be denoted as the preset input image size. Furthermore, the maximum input image size allowed by the target algorithm can be determined after evaluating the workload of the target algorithm and the computing power of the chip platform. The chip platform can be one that supports the execution of the target algorithm.

[0058] The optimal input image size for the target algorithm is generally determined to be less than or equal to the maximum input image size. This reduces the time consumed by image scaling required for constructing the algorithm input, thereby improving the algorithm's inference performance and segmentation effect.

[0059] Step 306: Obtain different texture parameter sets, apply each first image to the same canvas according to the different texture parameter sets, and determine the canvas size corresponding to each texture parameter set.

[0060] In this step, in order to further improve the segmentation performance of the target algorithm and reduce its performance consumption, a scheme is designed to map / stitch the first image of each light group onto the canvas to obtain various canvas sizes, and then determine the optimal set of mapping parameters based on each canvas size.

[0061] Before stitching the first images of each light group onto the canvas, different texture parameters can be set for each first image. Here, texture parameters refer to a matrix composed of different values ​​of texture parameters. For example, if there are two texture parameters, each of which can take the value 0 or 1, then the texture parameters of each first image can have four forms, that is, each first image has four sets of texture parameters, namely [0,0], [0,1], [1,0], and [1,1]. Each set of texture parameters includes a rotation parameter value and an extension direction value.

[0062] After obtaining the different texture parameters for each first image, each first image can be combined with the different texture parameters of other first images to obtain multiple different sets of texture parameters. It can be understood that each set of texture parameters includes a set of texture parameters for each of the first images.

[0063] Next, according to the texture parameters corresponding to each first image in each texture parameter set, each first image can be mapped onto the same canvas, and then the canvas size can be obtained. It can be understood that each texture parameter set can yield a canvas and a corresponding canvas size. The canvas size can include parameters such as the canvas's width, height, and area.

[0064] For example, suppose there are two first images, each with the four different sets of texture parameters mentioned above. By combining the different sets of texture parameters for each first image, the resulting set of texture parameters can be A4 in size. 1 ×A4 1 =16.

[0065] Additionally, it should be noted that different texture parameter sets are used to apply textures to each first image. The performance consumption of the target algorithm and the final segmentation performance of the target algorithm are different when the canvas size obtained by each texture parameter set is converted to the preset input image size required by the target algorithm.

[0066] Step 308: Based on the preset input image size and the canvas size of each texture parameter set, determine the performance evaluation quantization value corresponding to each texture parameter set, and based on the performance evaluation quantization value of each texture parameter set, determine the preset texture parameter set among different texture parameter sets; the aforementioned performance evaluation quantization value is used to characterize the performance consumption when converting the canvas size corresponding to the texture parameter set to the preset input image size.

[0067] The preset input image size may include parameters such as preset input image area, preset input image width, and preset input image height.

[0068] In this step, after obtaining the canvas size after applying various texture parameter sets, the performance consumption data such as converting each canvas size to the preset input image size can be calculated by combining the preset input image size. The performance consumption data corresponding to each canvas size / texture parameter set can be represented by a performance evaluation quantification value. The larger the performance evaluation quantification value, the greater the performance consumption of the corresponding texture parameter set on the target algorithm.

[0069] After determining the performance evaluation quantization value corresponding to each set of texture parameters, the smallest performance evaluation quantization value can be selected. Then, the texture parameter set corresponding to the smallest performance evaluation quantization value is taken as the optimal preset texture parameter set for subsequent lamp image stitching / texturing. It can be understood that using the preset texture parameter set to stitch the first images and then using it as the input image for pixel-level segmentation of the target algorithm minimizes performance consumption. This also minimizes performance consumption when scaling the stitched image to the preset input image size. Therefore, this preset texture parameter set is the optimal texture parameter set.

[0070] Furthermore, the process of calculating the optimal texture parameter set can be performed once during system initialization. That is, when segmenting multiple light clusters at an intersection or road, an initial image of these light clusters is captured during initialization, and the calculations described above are performed to obtain the optimal texture parameter set for stitching the multiple light clusters at that intersection or road. Then, when continuously segmenting multiple light clusters at the same intersection or road, the first image of each light cluster can be extracted from the currently captured multi-light cluster image. These first images are then stitched onto a canvas according to the previously calculated optimal texture parameter set, resulting in an optimal canvas. The size of this optimal canvas can then be compared with the preset input image size of the target algorithm. If they are close, no scaling of the optimal canvas is needed; it can be directly used as the actual input image for the target algorithm. If the size of the optimal canvas is not close to the preset input image size, the optimal canvas size can be scaled to the preset input image size. After determining the actual input image, the actual input image can be fed into the target algorithm for pixel-level light group segmentation. The values ​​of each pixel in each segmented light group are statistically analyzed to identify the color of each light group. Then, based on the identified light group colors, the corresponding colors are restored to the corresponding light group positions in the current multi-light group image.

[0071] It should be noted that when the optimal texture parameter set obtained through the above method is used to stitch together the current first images, the size of the resulting optimal canvas is usually close to the size of the preset input image. This eliminates the need to scale the input image to the target algorithm, thereby improving the segmentation performance and robustness of the target algorithm. Similarly, no scaling is required during color restoration, thus improving the accuracy of color restoration. Furthermore, even when the optimal canvas size is not close to the preset input image size and scaling is necessary, the scaling ratio is still optimal. This further reduces the performance overhead on the target algorithm, improving both segmentation performance and, similarly, color restoration accuracy to some extent.

[0072] Furthermore, although this embodiment is described with reference to multiple light groups, in actual situations, the splicing / mapping of a single light group and the determination of the actual input image for the target algorithm can also be performed according to this scheme.

[0073] In this embodiment, an initial image including multiple light groups is acquired, and images of the corresponding areas of each light group are cropped from the initial image to obtain multiple first images. Simultaneously, the preset input image size corresponding to the target algorithm is acquired, and each first image is mapped onto the same canvas according to different mapping parameter sets. The canvas size corresponding to each mapping parameter set is determined. Then, each first image is mapped onto the same canvas according to the preset input image size and each mapping parameter set to determine different canvas sizes. Afterwards, based on the preset input image size and the canvas size of each mapping parameter set, a performance evaluation quantization value corresponding to each mapping parameter set is determined. Based on the performance evaluation quantization value of each mapping parameter set, a preset mapping parameter set is determined among the different mapping parameter sets. The aforementioned performance evaluation quantization value is used to characterize the performance consumption when converting the canvas size corresponding to the mapping parameter set to the preset input image size. Since the optimal input image size for the algorithm can be determined by statistically analyzing the area of ​​multiple sample light groups, the time consumed by image scaling when constructing the algorithm's input size and restoring the light group segmentation results to the initial image size can be reduced, thereby improving the algorithm's inference performance and segmentation effect. At the same time, by applying each light group image to different canvases using the optimal input image size and various different texture parameter sets, and determining the preset texture parameter set that minimizes the algorithm's performance consumption through the performance evaluation quantification value of different texture parameter sets, the optimal texture parameter set can be determined quickly and accurately, improving the speed and accuracy of subsequent texture mapping.

[0074] The following examples illustrate the process of determining the preset input image size for the target algorithm.

[0075] Figure 4 This is the third flowchart illustrating the method for determining the input image provided in this embodiment of the invention, as shown below. Figure 4 As shown, step 304 above, "obtaining the preset input image size corresponding to the target algorithm," may include the following steps: Step 402: Obtain multiple sample images of different light group scenes; each sample image includes at least one sample light group.

[0076] This involves pre-collecting images of intersections or roads with different lighting scenarios to obtain multiple sample images. These sample images can include sample lighting scenarios for these different lighting scenarios. Different lighting scenarios can include different numbers of lighting scenarios, different sizes of lighting scenarios, and different styles of lighting scenarios.

[0077] In addition, the number of sample images collected here can be set according to the actual situation. For example, 1,000 sample images can be collected, covering sample images under various lighting scenarios.

[0078] Step 404: Determine the total area corresponding to all sample light groups in each sample image based on the area of ​​each sample light group in each sample image.

[0079] In this step, after obtaining each sample image, the sample light groups in each sample image can also be detected to obtain the number of sample light groups in each sample image, the size information of the sample light groups, etc. Here, the size information of the sample light groups can include the width and height of the sample light groups.

[0080] For any given sample image, the area of ​​each sample light group can be calculated by multiplying its width and height. Then, the areas of all sample light groups are summed to obtain the total area of ​​all sample light groups in the image. This method can be used to calculate the total area of ​​each sample image.

[0081] For example, suppose a sample image contains n sample light groups (n is greater than or equal to 1), and the width of each sample light group can be denoted as W and the height can be denoted as H. Then the size information GropInfo of each sample light group can be represented as GropInfo={(GropW0, GropH0), (GropW1, GropH1), ..., (GropWn, GropHn)}, and the total area SumArea of ​​the sample image can be represented as SumArea=GropW0×GropH0+GropW1×GropH1+...+GropWn×GropHn.

[0082] Step 406: Count the total area and its occurrence frequency in each total area, and determine the candidate total area corresponding to the maximum occurrence frequency based on the occurrence frequency of each total area.

[0083] In this step, after obtaining the total area corresponding to each sample image, we can perform distribution statistics on these multiple vertical planes, that is, count the number of occurrences of each area from 0 to the maximum area m among these multiple total areas, and thus obtain the area distribution AreaDistribution, which can be represented as AreaDistribution={count0, count1, ..., countm}, where count1 represents the number of occurrences of area 1, and countm represents the number of occurrences of the maximum area m.

[0084] The above method can be used to obtain the frequency of occurrence of various total areas in multiple sample images. Then, the total area with the highest frequency of occurrence is selected, that is, the total area corresponding to the peak of the area distribution is selected, and the total area with the highest frequency of occurrence can be used as the candidate total area.

[0085] Step 408: Obtain the maximum input image size allowed by the target algorithm, and determine the preset input image size corresponding to the target algorithm based on the maximum input image size and the total area of ​​the candidates.

[0086] In this step, we can test the performance of the target algorithm in advance and test the maximum input image size allowed by the target algorithm, let's call it TheoryMaxSize. It should be noted that the maximum input image size here can be represented in terms of area, or in terms of the width and height of the input image, etc.

[0087] Taking the maximum input image size as an example, the total area of ​​the selected candidates can be compared with the maximum input image size. Optionally, if the total area of ​​the candidates is greater than the maximum input image size, the maximum input image size is set as the preset input image size; if the total area of ​​the candidates is not greater than the maximum input image size, the size corresponding to the total area of ​​the candidates is set as the preset input image size. In other words, when the total area of ​​the candidates is greater than the maximum input image size allowed by the target algorithm, it means that the size of the light groups in most sample images is large, exceeding the maximum input image size allowed by the target algorithm. To reduce performance consumption and feature loss caused by scaling when inputting into the target algorithm, the actual input size of the target algorithm can be set to the maximum input image size allowed above, so as to make full use of the performance of the target algorithm. When the total area of ​​the candidates is less than or equal to the maximum input image size allowed by the target algorithm, it means that the size of the light groups in most sample images is small and will not exceed the maximum input image size allowed by the target algorithm. At this time, the actual input size of the target algorithm can be set to the size of the total area of ​​the candidates calculated above, which can reduce the performance consumption of the target algorithm.

[0088] In summary, the actual input size of the target algorithm calculated above is the optimal input image size, which minimizes the performance consumption of the target algorithm and can be denoted as the preset input image size.

[0089] In addition, after determining the preset input image size, since the preset input image size is in the form of an area, the input of the target algorithm can be designed as a rectangle with a fixed aspect ratio. Then the width and height of the input image of the target algorithm can be calculated using the preset input image size and the fixed aspect ratio.

[0090] In this embodiment, the optimal input image size for the algorithm is determined by combining the total area of ​​the light groups and the frequency of occurrence of various total areas in multiple sample images with the maximum input image size allowed by the target algorithm. This fully utilizes the performance of the target algorithm, reduces its performance overhead, and thus improves the algorithm's segmentation performance. Furthermore, when the total area of ​​the most frequently occurring light group in the multiple sample images is small, this most frequently occurring total area can be selected as the actual input size for the algorithm; conversely, when the total area of ​​the most frequently occurring light group is large, the maximum input size allowed by the algorithm can be selected. This reduces the performance overhead and feature loss caused by image scaling, further ensuring the algorithm's segmentation performance.

[0091] The following examples illustrate the process of stitching each first image onto a canvas according to different texture parameters to obtain multiple canvases and their corresponding canvas sizes.

[0092] Figure 5 This is the fourth flowchart illustrating the method for determining the input image provided in this embodiment of the invention, as shown below. Figure 5 As shown, step 306 above, "obtaining different texture parameter sets, applying each first image to the same canvas according to the different texture parameter sets, and determining the canvas size corresponding to each texture parameter set," may include the following steps: Step 502: Based on different values ​​of rotation parameters and different values ​​of expansion direction parameters, different permutations and combinations are made to determine multiple sets of different texture parameters corresponding to each first image.

[0093] The texture parameters can include various different parameters, such as rotation parameters and expansion direction parameters. These different sets of texture parameters include combinations of different values ​​for the rotation parameter and the expansion direction parameter. The rotation parameter value indicates whether the first image rotates. For example, the rotation parameter can take the value 0 or 1, where a value of 0 indicates that the first image does not rotate, and a value of 1 indicates that the first image rotates. During rotation, the horizontal light group rotates 90 degrees counterclockwise, and the vertical light group rotates 90 degrees clockwise. The value of the expansion direction parameter is used to characterize the mapping direction and position of the first image when it is mapped onto the canvas. Specifically, it can be the mapping direction and position when the first image is mapped onto the canvas and exceeds the preset input image size. For example, when the first images are mapped / stitched onto the canvas, they are mapped or stitched in a bottom-up and left-to-right order and direction (of course, they can also be mapped or stitched in a top-down and left-to-right order and direction, but this is just an example). The expansion direction parameter can also take the value 0 or 1, where a value of 0 indicates that the expansion direction is to the right and a value of 1 indicates that the expansion direction is to the top.

[0094] Specifically, after determining the different values ​​of the rotation parameter and the different values ​​of the expansion direction, for each first image, the different values ​​of the rotation parameter and the different values ​​of the expansion direction parameter can be arranged and combined in different ways to obtain multiple sets of different texture parameters. That is, each first image can obtain multiple sets of different texture parameters. For example, each first image can obtain four different sets of texture parameters: [0,0], [0,1], [1,0], and [1,1]. In each set of texture parameters, the first value is the value of the rotation parameter, and the second value is the value of the expansion direction.

[0095] Step 504: Select one set of texture parameters from multiple sets of texture parameters corresponding to each first image as intermediate texture parameters to obtain a set of texture parameters.

[0096] In this step, after determining multiple / groups of texture parameters for each first image, one can be randomly selected as the intermediate texture parameter for the corresponding first image. Then, the selected intermediate texture parameters for each first image are combined to obtain one / a set of texture parameters. It is understood that when selecting an intermediate texture parameter for each first image, the selected intermediate texture parameter can be the same or different.

[0097] Step 506: Perform the first texture calculation operation, which includes: applying each first image to the same canvas according to the corresponding intermediate texture parameters in a texture parameter set, thereby obtaining the canvas size of a canvas.

[0098] In this step, after selecting an intermediate texture parameter for each first image, a first texture calculation operation can be performed. The first texture calculation operation includes: stitching / pasting each first image onto the same canvas according to the selected intermediate texture parameter and in combination with the preset input image size, to obtain the canvas size corresponding to the canvas.

[0099] For the process of applying textures to each first image according to a selected intermediate texture parameter to obtain the canvas size, optionally, see [link to documentation]. Figure 6 The flowchart shown in this embodiment of the invention illustrates the process of obtaining the canvas size of a canvas using a single set of texture parameters. This step may include: For each first image, perform a second texture calculation operation, and after performing a second texture calculation operation on each first image, obtain the canvas size of a canvas; The above-mentioned second texture calculation operation includes: Based on the value of the rotation parameter in the intermediate texture parameters corresponding to the first image in a texture parameter set, it is determined whether to rotate the first image, and the size of the light group corresponding to the first image is determined based on the rotation result; it is determined whether the size of the textured area in the canvas is smaller than the preset input image size; if it is not smaller, the expansion direction of the first image is determined based on the value of the expansion direction parameter in the intermediate texture parameters of the first image, and the first image is textured onto the canvas according to the expansion direction; if it is smaller, the first image is textured onto the canvas according to the size of the light group corresponding to the first image.

[0100] Specifically, for each first image, a second texture calculation operation can be performed. The second texture calculation operation includes: first, determining whether the index of the light group in the currently stitched first image is less than the total number of light groups, that is, determining whether the currently stitched first image is the last image among all first images. If it is less than the total number of light groups, then it can be determined whether the value of the rotation parameter in the intermediate texture parameters of the first image is 0; if the value of the rotation parameter is not 0, then it can be determined whether the value of the rotation parameter is 1. If it is not 1, then the stitching of the next light group / first image is performed. If it is 1, then the first image needs to be rotated. Then the first image is rotated, and after the rotation, the width and height of the rotated first image are calculated (that is, the size of the light group in the first image after rotation, including the width and height of the light group). Then it is determined whether the width and height of the currently textured area in the canvas are less than the preset input image size of the target algorithm (i.e., the preset input width and height); if the value of the above rotation parameter is 0, then it is directly determined whether the width and height of the currently textured area in the canvas are less than the preset input image size of the target algorithm.

[0101] If the width and height of the currently mapped area in the canvas are not less than the preset input image size of the target algorithm, then it can be determined whether the value of the expansion direction parameter in the middle mapping parameter of the first image is 1. If it is 1, it means that the expansion direction of the first image is upward, and mapping is performed upward from the leftmost side to the right in the canvas (i.e., stitching the first image); if it is not 1, it is determined whether it is 0. If it is 0, it is determined that the expansion direction of the first image is to the right, and mapping is performed from the bottom of the canvas to the right (i.e., stitching the first image).

[0102] If the width and height of the currently mapped area in the canvas are smaller than the preset input image size of the target algorithm, it can be determined whether the remaining width on the right side of the bottom row of the area to be mapped (i.e., the unmapped area) in the canvas is greater than the width of the light group in the first image (i.e., the width of the first image). If the remaining width on the right side of the bottom row of the area to be mapped in the canvas is greater than the width of the light group in the first image, the first image can be mapped on the right side of the bottom layer of the area to be mapped. If the remaining width on the right side of the bottom row of the area to be mapped in the canvas is not greater than the width of the light group in the first image, it is determined whether mapping in the row above the bottom row of the area to be mapped will exceed the upper height boundary of the preset input image size. If it exceeds, it returns to continue determining whether the width and height of the currently mapped area in the canvas are smaller than the preset input image size of the target algorithm. If it does not exceed, the first image is shifted upwards to the row above for mapping.

[0103] If, through the above process, the index of the light group in the currently stitched first image is not less than the total number of light groups, then all first images are mapped onto the same canvas, thus obtaining the canvas size of a mapped canvas. After obtaining the canvas size of each canvas, the performance evaluation quantification value corresponding to that canvas size (or that set of mapping parameters) can be calculated. The specific calculation process will be described in the following embodiments.

[0104] Step 508: Determine another set of texture parameters from multiple sets of texture parameters of at least one first image, and update the intermediate texture parameters of the corresponding first image using the other set of texture parameters to obtain a new set of texture parameters. Then return to iteratively execute the above first texture calculation operation until each set of texture parameters of each first image obtains a different set of texture parameters according to different permutations and combinations and the above first texture calculation operation is completed. After the iteration ends, obtain the canvas size of multiple canvases.

[0105] In this step, after obtaining the canvas size of one canvas as described above, for at least one first image, an unused texture parameter can be reselected from its corresponding multiple sets of texture parameters. This newly selected texture parameter is then used as the new intermediate texture parameter for the current iteration of that first image. The first and second texture calculation operations of step 506 are then iteratively executed to obtain a new canvas size. The intermediate texture parameters of at least one first image can then be updated in the same manner, and the first and second texture calculation operations of step 506 are iteratively executed to obtain a new canvas size. This process continues until all sets of texture parameters for each first image have undergone the first and second texture calculation operations of step 506 in different permutations and combinations. That is, all possible combinations of texture parameters for each first image are exhausted. Finally, the canvas sizes obtained from each iteration are combined to obtain the canvas sizes for multiple canvases, i.e., a canvas size corresponding to each set of texture parameters.

[0106] For example, if there are two first images, and each first image has four different sets of texture parameters: [0,0], [0,1], [1,0], [1,1], then exhaustively listing all possible combinations of texture parameters for the two first images will yield A4. 1 ×A4 1 =16 combinations, so by combining different groups of texture parameters, the number of texture parameter sets obtained can be 16.

[0107] In this embodiment, multiple canvas sizes are obtained by applying texture parameters of each first image in different arrangements and combinations. This exhaustive approach to the calculation of all texture parameters facilitates the search for the optimal set of texture parameters for texture processing, thereby maximizing the segmentation performance of the target algorithm. Furthermore, when obtaining each canvas size, the image can be rotated or not rotated using the rotation parameters of each first image, and then the expansion direction parameter can be used to determine the expansion direction of the image in the canvas for texture application. This allows for faster and more accurate image mapping onto the canvas, improving the efficiency and accuracy of obtaining the canvas size while also ensuring the segmentation performance of the target algorithm.

[0108] The following examples illustrate how to select the optimal preset texture parameter set after obtaining the canvas size corresponding to various texture parameter sets.

[0109] Figure 7 This is the fifth flowchart illustrating the method for determining the input image provided in this embodiment of the invention, as shown below. Figure 7As shown, step 308 above, "determining the performance evaluation quantization value corresponding to each texture parameter set based on the preset input image size and the canvas size of each texture parameter set, and determining the preset texture parameter set in different texture parameter sets based on the performance evaluation quantization value of each texture parameter set," may include the following steps: Step 602: Construct a performance evaluation function based on the size relationship between the preset input image size and the canvas size of each texture parameter set, and the result of whether each first image is rotated during the texture mapping process for each texture parameter set.

[0110] In this process, after obtaining the canvas size corresponding to a set of texture parameters each time, the intermediate texture parameters used by each first image in this texture mapping can also be obtained. The intermediate texture parameters (i.e. the texture parameters used by the first image) include the value of the rotation parameter. The value of the rotation parameter is used to characterize whether the first image is rotated. By obtaining the value of the rotation parameter, the result of whether the first image is rotated in the process of obtaining the canvas size in this texture mapping can be obtained, where 0 represents no rotation and 1 represents rotation.

[0111] Furthermore, after obtaining the canvas dimensions and the preset input image size for the target algorithm, parameters such as the scaling ratio between the canvas size and the preset input image size, and the difference between them, can be calculated. Then, combining this with the results of whether each first image is rotated during the texturing process corresponding to each texture parameter set, a performance evaluation function is constructed. This performance evaluation function primarily evaluates the performance consumption of the target algorithm. The smaller the value of the performance evaluation function, the lower the performance consumption of the target algorithm, and the better the texture parameter set corresponding to the canvas size.

[0112] As an optional embodiment, the performance evaluation function may include the following parameters: 1) Rotation count: refers to the total number of rotations of each first image in the canvas corresponding to each canvas size; if the light group needs to be rotated when applying the texture, and needs to be restored to its original form after segmentation, the performance consumption of two affine transformations (including rotating the light group) will affect the analysis performance of the algorithm. The larger the number of rotations, the worse the segmentation effect.

[0113] 2) Blank area: refers to the blank / white area in the canvas obtained by texture mapping; due to the different sizes or installation directions of each light group, there will be some blank areas after texture mapping. Blank areas will cause a waste of segmentation performance. Generally, the larger the blank area, the worse the segmentation effect.

[0114] 3) Canvas size scaling factor: including canvas width scaling factor, canvas height scaling factor, and canvas aspect ratio scaling factor; Canvas width scaling factor scalew: The optimal canvas width is less than or equal to w (the width corresponding to the preset input image size). The larger the canvas width, the more the scaling factor needs to be, which will increase the performance consumption of the target algorithm and result in a worse segmentation effect. Canvas height scaling factor scaleh: The optimal canvas height is less than or equal to h (the height corresponding to the preset input image size). The greater the canvas height, the more the scaling factor is required, which increases the performance consumption of the target algorithm and results in a worse segmentation effect. The aspect ratio scaling factor is: the optimal canvas aspect ratio is consistent with the aspect ratio of the target algorithm's preset input image size to ensure that the scaling operation is proportional and to reduce the impact of distortion. The larger the aspect ratio scaling factor, the worse the segmentation effect.

[0115] A performance evaluation function can be constructed using the above parameters. The constructed performance evaluation function f is shown in the following formula: f=turn_times*a1+space_area*a2+scaleh*a3+scalew*a4+ratio*a5.

[0116] Where a1, a2, a3, a4, and a5 are weighting coefficients, and their order of magnitude can be, for example, a3 = a4 > a5 > a1 > a2, and a1 + a2 + a3 + a4 + a5 = 1. For example, a1 = 0.15, a2 = 0.05, a3 = 0.3, a4 = 0.3, and a5 = 0.2.

[0117] Step 604: Calculate the performance evaluation quantification value corresponding to various texture parameter sets using the performance evaluation function.

[0118] In this step, after constructing the performance evaluation function as described above, optionally, assuming that the preset input image size includes a first width and a first height, and each canvas size includes a second width and a second height, for each canvas size corresponding to a certain set of texture parameters, the total number of rotations of all first images in the canvas obtained during the texture mapping process can be determined based on whether each first image of that set of texture parameters is rotated during the texture mapping process; that is, by adding up the number of rotations of all first images of each set of texture parameters during the texture mapping process, the total number of rotations corresponding to that set of texture parameters can be obtained. It should be noted that each first image is generally rotated only once or not at all in a canvas. Simultaneously, based on the areas corresponding to the first width and the first height, as well as the areas corresponding to the second width and the second height, the blank area in the canvas obtained during the mapping process according to the mapping parameter set can be determined; that is, the product of the first width and the first height can be calculated to obtain the area corresponding to the preset input image size, and the product of the second width and the second height can be calculated to obtain the area corresponding to each canvas size. Then, the area corresponding to the canvas size is subtracted from the area corresponding to the preset input image size to obtain the blank / white area in the canvas corresponding to each mapping parameter set.

[0119] Simultaneously, based on the first width, first height, second width, and second height, the canvas size scaling factor obtained during the texturing process according to the texture parameter set can be determined. The size scaling factor can specifically include a canvas width scaling factor, a canvas height scaling factor, and a canvas aspect ratio scaling factor. Specifically, this can be achieved by calculating the difference between the second width and the first width for each canvas size to obtain the canvas width scaling factor for each texture parameter set; calculating the difference between the second height and the first height for each canvas size to obtain the canvas height scaling factor; calculating the first ratio between the second width and the second height for each canvas size, and calculating the second ratio between the first width and the first height, then dividing the first ratio and the second ratio again, and finally subtracting this final ratio from 1 to obtain the canvas aspect ratio scaling factor for each texture parameter set.

[0120] Then, the total number of rotations, blank area, and size scaling factor corresponding to the texture parameter set can be substituted into the performance evaluation function for calculation to determine the quantitative performance evaluation value corresponding to the texture parameter set. That is, the total number of rotations, blank area, and size scaling factor (specifically, the canvas width scaling factor, canvas height scaling factor, and canvas width-to-height ratio scaling factor) corresponding to each texture parameter set can be substituted into the performance evaluation function for calculation to determine the quantitative performance evaluation value (i.e., performance evaluation score) corresponding to each texture parameter set.

[0121] The formula for calculating the performance evaluation quantification value for each texture parameter set is as follows: .

[0122] Where i represents the i-th first image in the canvas for each texture parameter set, j is the number of first images in the canvas for each texture parameter set, and x represents the value of the rotation parameter of each first image. Here, the total number of rotations for each texture parameter set can be obtained by adding the rotation parameter values ​​of each first image in the canvas for each texture parameter set; W and H represent the width and height of the canvas for each texture parameter set, respectively, and WH represents the area of ​​the canvas for each texture parameter set; w and h represent the width and height corresponding to the preset input image size, respectively, and wh represents the area corresponding to the preset input image size; ABS represents the absolute value operation; a1, a2, a3, a4, and a5 are weight coefficients.

[0123] Furthermore, when calculating the performance evaluation quantization value of the canvas width and height obtained by various texture parameter sets, if the area calculated by the canvas width and height of each texture parameter set is smaller than the area corresponding to the preset input image size, the width and height of the canvas obtained by that texture parameter set can be set / reset to the width and height corresponding to the preset input image size. This is because when the canvas size obtained by the texture parameter set is smaller than the preset input image size, no scaling operation is required during segmentation, which will not cause performance consumption to the target algorithm and there is no loss of pixel accuracy, that is, the segmentation effect will not be affected. Therefore, the width and height of the canvas obtained by that texture parameter set can be set / reset to the width and height corresponding to the preset input image size, avoiding the factor of increased performance consumption due to the difference between the two when calculating the performance evaluation quantization value of that texture parameter set, thereby fully ensuring the accuracy of the calculated performance evaluation quantization value.

[0124] Step 606: Based on the performance evaluation quantization values ​​of various texture parameter sets, determine the smallest performance evaluation quantization value among them, and determine the texture parameter set corresponding to the smallest performance evaluation quantization value as the preset texture parameter set; the magnitude of the above performance evaluation quantization value is positively correlated with the performance consumption of the target algorithm.

[0125] In this step, after obtaining the performance evaluation quantization value corresponding to each texture parameter set, the performance evaluation quantization values ​​can be sorted, for example, from smallest to largest. The first performance evaluation quantization value in the sorted result is then taken as the minimum performance evaluation quantization value. Subsequently, the texture parameter set corresponding to this minimum performance evaluation quantization value can be determined from each texture parameter set, and this texture parameter set is taken as the optimal preset texture parameter set.

[0126] In addition, the magnitude of the performance evaluation quantization value is positively correlated with the performance consumption of the target algorithm. That is, the smaller the performance evaluation quantization value, the less performance consumption of the target algorithm when using the texture parameter set corresponding to the performance evaluation quantization value for texture mapping. In other words, the more performance consumption of the target algorithm is saved, the better the segmentation performance of the target algorithm is.

[0127] In this embodiment, a performance evaluation function is constructed by considering the size relationship between the preset input image size and the canvas size corresponding to different texture parameter sets, as well as the result of whether each first image is rotated during the texturing process for various texture parameter sets. This function calculates the quantified performance evaluation values ​​of various texture parameter sets, and selects the optimal texture parameter set based on these quantified values. This comprehensive quantification of various parameters allows for a holistic assessment of the performance consumption of each texture parameter set on the target algorithm, enabling the accurate selection of texture parameter sets with superior performance consumption for subsequent image texturing / stitching. This ensures accurate performance optimization of the target algorithm and guarantees its segmentation performance. Furthermore, the performance evaluation values ​​of each texture parameter set are calculated using parameters such as the number of rotations of the light groups in the canvas for each texture parameter set, the white space area of ​​the canvas, and the scaling factor between the canvas and the optimal input size of the algorithm. This allows for a quick and accurate calculation of the performance consumption of each texture parameter set on the target algorithm, thereby improving the efficiency and accuracy of selecting the optimal texture parameter set.

[0128] As can be seen from the above embodiments, the technical solution of the present invention can calculate the optimal input image size of the target algorithm, so as to ensure the segmentation effect of the algorithm under limited performance conditions. At the same time, by exhaustively enumerating the set of texture parameters for light group mapping, the segmentation effect of the target algorithm under unconventional engineering surveys such as large light groups, multiple light groups, and light groups that are relatively dispersed (i.e., scattered distribution of light groups) can be guaranteed. Furthermore, the solution of the present invention has few scene limitations. In addition to single intersections, it can also support the segmentation and recognition of more light groups in a single frame. It can be applied to the unified analysis and recognition of traffic light information at multiple intersections in cities to achieve vehicle-road cooperation, traffic light intersection control, green wave traffic, etc.

[0129] The input image determination apparatus provided by the present invention will be described below. The input image determination apparatus described below can be referred to in correspondence with the input image determination method described above.

[0130] Figure 8 This is a schematic diagram of the structure of the input image determination device provided in an embodiment of the present invention. See also... Figure 8 As shown, the device may include: The light group image acquisition module 710 is used to acquire the original input image corresponding to the target light group scene; the original input image includes multiple light groups in the target light group scene. The region image cropping module 720 is used to obtain the pre-stored positions of each light group in the original input image, and crop the corresponding region of each light group in the original input image according to the pre-stored position of each light group to obtain the region image corresponding to each light group. The texture parameter set acquisition module 730 is used to acquire the preset texture parameter set corresponding to the target light group scene; the preset texture parameter set includes the preset texture parameters corresponding to each light group. The preset texture parameter set is determined in advance by traversing texture calculations using multiple different texture parameter sets for multiple light groups in the target light group scene. The input image determination module 740 is used to apply the area image of each light group to the canvas according to the preset texture parameters corresponding to each light group in the preset texture parameter set, so as to obtain the target input image.

[0131] In some embodiments, the texture parameter set acquisition module 730 is specifically used to acquire an initial image of a target light group scene including multiple light groups, and to crop the image of the corresponding area of ​​each light group in the initial image to obtain a first image corresponding to each light group; each light group includes at least one signal light; acquire a preset input image size corresponding to the target algorithm; the preset input image size is determined according to the area corresponding to the sample light group in multiple sample images, and is less than or equal to the maximum input image size allowed by the target algorithm, the target algorithm is used to perform pixel-level segmentation processing on each light group in the image input to the target algorithm; acquire different texture parameter sets, and apply each first image to the same canvas according to different texture parameter sets, and determine the canvas size corresponding to each texture parameter set; determine the performance evaluation quantization value corresponding to each texture parameter set according to the preset input image size and the canvas size of each texture parameter set, and determine the preset texture parameter set in different texture parameter sets according to the performance evaluation quantization value of each texture parameter set; the performance evaluation quantization value is used to characterize the performance consumption when converting the canvas size corresponding to the texture parameter set to the preset input image size.

[0132] In some embodiments, the texture parameter set acquisition module 730 is specifically used to acquire multiple sample images of different light group scenes; each sample image includes at least one sample light group; based on the area of ​​each sample light group in each sample image, the total area corresponding to all sample light groups in each sample image is determined; each total area and its occurrence frequency are counted, and based on the occurrence frequency of each total area, the candidate total area corresponding to the maximum occurrence frequency is determined; the maximum input image size allowed by the target algorithm is acquired, and based on the maximum input image size and the candidate total area, the preset input image size corresponding to the target algorithm is determined.

[0133] Optionally, the above-mentioned texture parameter set acquisition module 730 is specifically used to determine the maximum input image size as the preset input image size if the total candidate area is greater than the maximum input image size; and to determine the size corresponding to the total candidate area as the preset input image size if the total candidate area is not greater than the maximum input image size.

[0134] In some embodiments, the different texture parameter sets mentioned above include combinations of different values ​​for rotation parameters and different values ​​for expansion direction parameters. The rotation parameter value is used to characterize whether the first image is rotated, and the expansion direction parameter value is used to characterize the texture direction and position of the first image when it is textured on the canvas. The texture parameter set acquisition module 730 is specifically used to determine multiple different sets of texture parameters corresponding to each first image by performing different permutations and combinations based on the different values ​​of rotation parameters and expansion direction parameters; to select a set of texture parameters as intermediate texture parameters from the multiple sets of texture parameters corresponding to each first image to obtain a texture parameter set; and to perform the first texture calculation. The operation, the first texture calculation operation mentioned above, includes: applying each first image to the same canvas according to the intermediate texture parameters corresponding to each of the texture parameter sets, to obtain the canvas size of a canvas; determining another set of texture parameters from multiple sets of texture parameters of at least one first image, and updating the intermediate texture parameters of the corresponding first image using the other set of texture parameters, to obtain a new set of texture parameters, and then returning to iterate and execute the first texture calculation operation mentioned above until each set of texture parameters of each first image obtains different sets of texture parameters according to different permutations and combinations and the first texture calculation operation mentioned above is completed, and obtaining the canvas sizes of multiple canvases after the iteration ends.

[0135] Optionally, the above-mentioned texture parameter set acquisition module 730 is specifically used to perform a second texture calculation operation for each first image, and after each first image has completed one second texture calculation operation, obtain the canvas size of a canvas; the above-mentioned second texture calculation operation includes: determining whether to rotate the first image according to the value of the rotation parameter in the intermediate texture parameters corresponding to the first image in a texture parameter set, and determining the size of the light group corresponding to the first image according to the rotation result; determining whether the size of the textured area in the canvas is smaller than the preset input image size; if it is not smaller, determining the expansion direction of the first image when textured according to the value of the expansion direction parameter in the intermediate texture parameters of the first image, and textured the first image onto the canvas according to the expansion direction; if it is smaller, textured the first image onto the canvas according to the size of the light group corresponding to the first image.

[0136] In some embodiments, the texture parameters include rotation parameter values, which characterize whether the first image is rotated. The texture parameter set acquisition module 730 is specifically used to construct a performance evaluation function based on the size relationship between the preset input image size and the canvas size of each texture parameter set, and the result of whether each first image is rotated during the texture process for each texture parameter set; calculate the performance evaluation quantization value corresponding to each texture parameter set using the performance evaluation function; determine the smallest performance evaluation quantization value among the various texture parameter sets, and determine the texture parameter set corresponding to the smallest performance evaluation quantization value as the preset texture parameter set; the magnitude of the performance evaluation quantization value is positively correlated with the performance consumption of the target algorithm.

[0137] Optionally, the preset input image size includes a first width and a first height, and each canvas size includes a second width and a second height. The texture parameter set acquisition module 730 is specifically used for each texture parameter set to determine the total number of rotations of all first images during the texture mapping process according to the texture parameter set, based on whether each first image is rotated during the texture mapping process according to the texture parameter set; to determine the blank area in the canvas obtained during the texture mapping process according to the texture parameter set based on the area corresponding to the first width and the first height, and the area corresponding to the second width and the second height; to determine the size scaling factor corresponding to the canvas obtained during the texture mapping process according to the texture parameter set based on the first width, the first height, the second width, and the second height; and to substitute the total number of rotations, the blank area, and the size scaling factor corresponding to the texture parameter set into the performance evaluation function for calculation to determine the performance evaluation quantification value corresponding to the texture parameter set.

[0138] It should be noted that the apparatus provided in this embodiment of the invention can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.

[0139] Figure 9 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 9 As shown, the electronic device may include: a processor 810, a communications interface 820, a memory 830, and a communications bus 840, wherein the processor 810, the communications interface 820, and the memory 830 communicate with each other through the communications bus 840. The processor 810 can call logical instructions in the memory 830 to execute a method for determining the input image. This method includes: acquiring an original input image corresponding to the target lighting scene; the original input image includes multiple lighting groups in the target lighting scene; acquiring the pre-stored positions of each lighting group in the original input image, and cropping the corresponding area of ​​each lighting group from the original input image based on the pre-stored positions of each lighting group to obtain the area image corresponding to each lighting group; acquiring a preset texture parameter set corresponding to the target lighting scene; the preset texture parameter set includes preset texture parameters corresponding to each lighting group, and the preset texture parameter set is determined in advance by traversing and calculating textures for multiple lighting groups in the target lighting scene using various different texture parameter sets; and applying the area image of each lighting group to the canvas based on the preset texture parameters corresponding to each lighting group in the preset texture parameter set to obtain the target input image.

[0140] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0141] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the input image determination method provided by the above methods. The method includes: acquiring an original input image corresponding to a target lighting scene; the original input image includes multiple lighting groups in the target lighting scene; acquiring the pre-stored positions of each lighting group in the original input image, and cropping the image of the corresponding area of ​​each lighting group in the original input image according to the pre-stored positions of each lighting group to obtain the area image corresponding to each lighting group; acquiring a preset texture parameter set corresponding to the target lighting scene; the preset texture parameter set includes preset texture parameters corresponding to each lighting group, and the preset texture parameter set is determined in advance by traversing and calculating textures for multiple lighting groups in the target lighting scene using multiple different texture parameter sets; and applying the area image of each lighting group to the canvas according to the preset texture parameters corresponding to each lighting group in the preset texture parameter set to obtain the target input image.

[0142] In another aspect, the present invention also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a method for determining the input image provided by the methods described above. This method includes: acquiring an original input image corresponding to a target lighting scene; the original input image including multiple lighting groups in the target lighting scene; acquiring pre-stored positions of each lighting group in the original input image, and cropping images of corresponding regions of each lighting group from the original input image based on the pre-stored positions of each lighting group to obtain a region image corresponding to each lighting group; acquiring a preset texture parameter set corresponding to the target lighting scene; the preset texture parameter set including preset texture parameters corresponding to each lighting group, the preset texture parameter set being determined in advance by performing texture calculations on multiple lighting groups in the target lighting scene using various different texture parameter sets; and applying the region image of each lighting group to a canvas based on the preset texture parameters corresponding to each lighting group in the preset texture parameter set to obtain the target input image.

[0143] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0144] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0145] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for determining an input image, characterized in that, include: Obtain the original input image corresponding to the target light group scene; The original input image includes multiple light groups in the target light group scene; Obtain the pre-stored positions of each light group in the original input image, and extract the corresponding area of ​​each light group from the original input image according to the pre-stored positions of each light group to obtain the area image corresponding to each light group; Obtain the preset texture parameter set corresponding to the target light group scene; The preset texture parameter set includes preset texture parameters corresponding to each light group. The preset texture parameter set is determined in advance by traversing texture calculations using multiple different texture parameter sets for multiple light groups in the target light group scene. Based on the preset texture parameters corresponding to each light group in the preset texture parameter set, the area image of each light group is textured onto the canvas to obtain the target input image.

2. The method for determining the input image according to claim 1, characterized in that, The step of obtaining the preset texture parameter set corresponding to the target light group scene includes: An initial image of the target light group scene, including the multiple light groups, is obtained, and an image of the corresponding area of ​​each light group is cropped from the initial image to obtain a first image corresponding to each light group; each light group includes at least one signal light. Obtain the preset input image size corresponding to the target algorithm; the preset input image size is determined based on the area corresponding to the sample light group in multiple sample images, and is less than or equal to the maximum input image size allowed by the target algorithm; the target algorithm is used to perform pixel-level segmentation processing on each light group in the image input to the target algorithm. Obtain different texture parameter sets, and apply each of the first images to the same canvas according to the different texture parameter sets, and determine the canvas size corresponding to each texture parameter set; Based on the preset input image size and the canvas size of each texture parameter set, a performance evaluation quantization value corresponding to each texture parameter set is determined, and based on the performance evaluation quantization value of each texture parameter set, the preset texture parameter set is determined among the different texture parameter sets; the performance evaluation quantization value is used to characterize the performance consumption when converting the canvas size corresponding to the texture parameter set to the preset input image size.

3. The method for determining the input image according to claim 2, characterized in that, The process of obtaining the preset input image size corresponding to the target algorithm includes: Acquire multiple sample images of different lighting scenarios; each sample image includes at least one sample lighting group; Based on the area of ​​each sample light group in each sample image, determine the total area corresponding to all sample light groups in each sample image; Statistically analyze each type of total area and its frequency of occurrence, and determine the candidate total area corresponding to the maximum frequency of occurrence based on the frequency of occurrence of each type of total area; Obtain the maximum input image size allowed by the target algorithm, and determine the preset input image size corresponding to the target algorithm based on the maximum input image size and the total candidate area.

4. The method for determining the input image according to claim 2 or 3, characterized in that, The different texture parameter sets include combinations of different rotation parameter values ​​and different expansion direction parameter values. The rotation parameter value is used to characterize whether the first image is rotated, and the expansion direction parameter value is used to characterize the texture direction and position of the first image when it is textured on the canvas. The process of obtaining different texture parameter sets, textureding each first image onto the same canvas according to each different texture parameter set, and determining the canvas size corresponding to each texture parameter set includes: Based on different values ​​of the rotation parameter and the expansion direction parameter, different permutations and combinations are made to determine multiple sets of different texture parameters corresponding to each first image; In each of the multiple sets of texture parameters corresponding to the first image, a set of texture parameters is selected as an intermediate texture parameter to obtain a texture parameter set. Perform a first texture calculation operation, which includes: applying each of the first images to the same canvas according to the corresponding intermediate texture parameters in the set of texture parameters, to obtain the canvas size of a canvas; In at least one first image, another set of texture parameters is determined from multiple sets of texture parameters, and the intermediate texture parameters of the corresponding first image are updated using the other set of texture parameters to obtain a new set of texture parameters. Then, the first texture calculation operation is iteratively executed until each set of texture parameters of each first image is arranged in different combinations to obtain different sets of texture parameters and the first texture calculation operation is completed. After the iteration ends, the canvas sizes of multiple canvases are obtained.

5. The method for determining the input image according to claim 4, characterized in that, The step of applying each of the first images to the same canvas according to the corresponding intermediate texture parameters in the set of texture parameters to obtain the canvas size includes: For each of the first images, a second texture calculation operation is performed, and after each of the first images has undergone one second texture calculation operation, the canvas size of a canvas is obtained. The second texture calculation operation includes: Based on the value of the rotation parameter in the intermediate texture parameter corresponding to the first image in the texture parameter set, determine whether to rotate the first image, and determine the size of the light group corresponding to the first image based on the result of whether to rotate it; Determine whether the size of the mapped area in the canvas is smaller than the preset input image size; If it is not less than, then the expansion direction of the first image is determined according to the value of the expansion direction parameter in the intermediate texture parameter of the first image, and the first image is textured onto the canvas according to the expansion direction. If it is smaller, then the first image is pasted onto the canvas according to the size of the light group corresponding to the first image.

6. The method for determining the input image according to claim 2 or 3, characterized in that, The texture parameters include rotation parameter values, which characterize whether the first image is rotated. The step of determining a performance evaluation quantization value corresponding to each texture parameter set based on the preset input image size and the canvas size of each texture parameter set, and determining the preset texture parameter set from the different texture parameter sets based on the performance evaluation quantization value of each texture parameter set, includes: Based on the size relationship between the preset input image size and the canvas size of each texture parameter set, and the result of whether each first image is rotated during the texture mapping process for each texture parameter set, a performance evaluation function is constructed. The performance evaluation function is used to calculate the quantitative performance evaluation values ​​corresponding to various texture parameter sets. Based on the performance evaluation quantization values ​​of various texture parameter sets, the smallest performance evaluation quantization value is determined, and the texture parameter set corresponding to the smallest performance evaluation quantization value is determined as the preset texture parameter set; the magnitude of the performance evaluation quantization value is positively correlated with the performance consumption of the target algorithm.

7. The method for determining the input image according to claim 6, characterized in that, The preset input image size includes a first width and a first height, and each canvas size includes a second width and a second height. The calculation of performance evaluation quantification values ​​corresponding to various texture parameter sets using the performance evaluation function includes: For each set of texture parameters, the total number of rotations of all first images during the texture mapping process is determined based on whether each first image is rotated during the texture mapping process according to the set of texture parameters. Based on the area corresponding to the first width and the first height, and the area corresponding to the second width and the second height, determine the blank area in the canvas obtained during the texturing process according to the set of texturing parameters; Based on the first width, the first height, the second width, and the second height, determine the canvas size scaling factor obtained during the texturing process according to the set of texturing parameters; The total number of rotations, blank area, and size scaling factor corresponding to the texture parameter set are substituted into the performance evaluation function for calculation to determine the quantitative value of the performance evaluation corresponding to the texture parameter set.

8. An input image determining device, characterized in that, include: The light group image acquisition module is used to acquire the original input image corresponding to the target light group scene; the original input image includes multiple light groups in the target light group scene. The region image cropping module is used to obtain the pre-stored positions of each light group in the original input image, and crop the image of the corresponding region of each light group in the original input image according to the pre-stored position of each light group, so as to obtain the region image corresponding to each light group. The texture parameter set acquisition module is used to acquire the preset texture parameter set corresponding to the target light group scene; The preset texture parameter set includes preset texture parameters corresponding to each light group. The preset texture parameter set is determined in advance by traversing texture calculations using multiple different texture parameter sets for multiple light groups in the target light group scene. The input image determination module is used to apply the region image of each light group to the canvas according to the preset texture parameters corresponding to each light group in the preset texture parameter set, so as to obtain the target input image.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the method for determining the input image as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method for determining the input image as described in any one of claims 1 to 7.