Image optimization method, device, electronic device and storage medium

By performing color channel decomposition and lens refractive index correction on images collected by the camera, the dispersion problem in camera imaging is solved, the authenticity and controllability of the image are improved, and it is suitable for application scenarios such as autonomous driving simulation.

CN118368534BActive Publication Date: 2024-08-27BEIJING SAIMO TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410756465.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-08-27
Estimated Expiration
2044-06-13

AI Technical Summary

Technical Problem

In application scenarios such as autonomous driving simulations that require high real-time and authenticity of image output, the dispersion effect caused by the difference in the refractive index of the lens to different wavelengths during the camera imaging process affects the scene rendering effect, and the image needs to be optimized.

Method used

The image collected by the camera is decomposed into a pixel array of three color channels: R, G, and B. The coordinates and value of each pixel are corrected based on the refractive index of the lens. The preset and target pixel coordinates of each pixel are calculated. and values ​​to generate optimized images.

Benefits of technology

It effectively reduces the dispersion effect, improves the authenticity of the image, makes it closer to the actual scene, has good controllability and a wide range of applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118368534B
    Figure CN118368534B
Patent Text Reader

Abstract

The present application provides an image optimization method, device, electronic device and storage medium, and relates to the field of image processing technology. The method comprises decomposing a first image captured by a camera into first pixel arrays corresponding to three color channels R, G and B respectively; for each first pixel array, based on the refractive index of the camera lens for the color channel, correcting the pixel coordinates and sub-pixel values ​​of all sub-pixel points of the first pixel array to generate a corresponding second pixel array; combining the second pixel arrays corresponding to the three color channels R, G and B respectively to obtain an optimized second image, so as to optimize the dispersion effect of the image in the camera imaging process, so that the camera imaging is closer to the real scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image optimization method, device, electronic device and storage medium. Background Art

[0002] In the process of camera imaging, there are many parameters that affect the image quality. Among them, the difference in the refractive index of the lens for different wavelengths will cause the image to produce a dispersion effect. In some application scenarios that require high real-time and authenticity of image output, such as autonomous driving simulation, the dispersion image will affect the rendering effect in the scene simulation. Therefore, optimizing the dispersion image is a technical problem that needs to be solved urgently. Summary of the invention

[0003] The purpose of the embodiments of the present application is to provide an image optimization method, device, electronic device and storage medium, so as to optimize the dispersion effect of the image during the camera imaging process, so that the camera imaging is closer to the real scene.

[0004] In a first aspect, the present application provides an image optimization method, the method comprising decomposing a first image captured by a camera into first pixel arrays corresponding to three color channels R, G, and B; for each first pixel array, based on the refractive index of the camera lens for the color channel, correcting the pixel coordinates and sub-pixel values ​​of all sub-pixel points of the first pixel array to generate a corresponding second pixel array; and combining the second pixel arrays corresponding to the three color channels R, G, and B to obtain an optimized second image.

[0005] Preferably, for any first pixel array corresponding to the three color channels of R, G, and B, a corresponding second pixel array is generated in the following manner:

[0006] The method comprises the following steps: determining the preset pixel coordinates of each sub-pixel point in the first pixel array according to the original pixel coordinates and the corresponding color channel imaging ratio of the sub-pixel point; determining the sub-pixel value of the target pixel coordinates based on the preset pixel coordinates and the corresponding sub-pixel value of each sub-pixel point; and generating the second pixel array based on all the target pixel coordinates and the sub-pixel values ​​corresponding to the target pixel coordinates.

[0007] Preferably, for each sub-pixel point, the preset pixel coordinates of the sub-pixel value are determined in the following manner:

[0008] ;

[0009] in, is the original pixel coordinate of the sub-pixel point, is the preset pixel coordinate of the sub-pixel point, is the pixel coordinate of the center point of the first image, is the color channel imaging ratio corresponding to the first pixel array.

[0010] Preferably, the target pixel coordinates are determined by:

[0011] For each preset pixel coordinate , round the horizontal and vertical coordinates in the preset pixel coordinates to obtain the corresponding target pixel coordinates ; and determine the sub-pixel value of each target pixel coordinate by:

[0012] ;

[0013] in, is the sub-pixel value corresponding to the preset pixel coordinate.

[0014] Preferably, the color channel imaging ratios corresponding to the three color channels R, G, and B are determined in the following manner:

[0015] Obtain the focal length corresponding to the wavelength of the camera; based on the focal length corresponding to the wavelength and the preset calculation rules, calculate the imaging ratio values ​​corresponding to the three color channels of R, G, and B respectively.

[0016] Preferably, the imaging ratio values ​​corresponding to the three color channels R, G, and B are calculated in the following manner:

[0017] ;

[0018] ;

[0019] ;

[0020] ;

[0021] in, is the focal length corresponding to the wavelength, A is the intermediate imaging ratio value, is the imaging ratio value corresponding to the G color channel, is the imaging ratio value corresponding to the R color channel, It is the imaging ratio value corresponding to the B color channel.

[0022] Preferably, the size of the first image is larger than the size of the second image.

[0023] In a second aspect, the present application provides an image optimization device, the device comprising:

[0024] A decomposition module, used for decomposing a first image captured by a camera into first pixel arrays corresponding to three color channels, namely, R, G, and B;

[0025] A correction module, configured to correct, for each first pixel array, pixel coordinates and sub-pixel values ​​of all sub-pixel points of the first pixel array based on the refractive index of the camera lens for the color channel, so as to generate a corresponding second pixel array;

[0026] The synthesis module is used to combine the second pixel arrays corresponding to the three color channels of R, G and B respectively to obtain an optimized second image.

[0027] In a third aspect, the present application provides an electronic device comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate through the bus, and the processor executes the machine-readable instructions to perform the steps of the image optimization method as described above.

[0028] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the aforementioned image optimization method are executed.

[0029] The present application provides an image optimization method, device, electronic device and storage medium, wherein the method includes decomposing a first image captured by a camera into first pixel arrays corresponding to three color channels R, G, and B respectively; for each first pixel array, based on the refractive index of the camera lens for the color channel, the pixel coordinates and sub-pixel values ​​of all sub-pixel points of the first pixel array are corrected to generate a corresponding second pixel array; the second pixel arrays corresponding to the three color channels R, G, and B are combined to obtain an optimized second image. By processing the image using easily available camera parameters, the dispersion problem of camera imaging is optimized, and good controllability is achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0031] Figure 1 A flowchart of an image optimization method provided in an embodiment of the present application;

[0032] Figure 2 A flowchart of steps for correcting a pixel array provided in an embodiment of the present application;

[0033] Figure 3 A schematic diagram of the structure of an image optimization device provided in an embodiment of the present application;

[0034] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0035] First, the application scenario of the present application is described. The technical solution of the present application can be applied to optimize the dispersion problem after the image sensor captures the image.

[0036] Take a camera as an example. The focal length of the camera is fixed, but because the refractive index of the camera lens for light of different wavelengths is different, the fixed focal length of the camera actually corresponds to only one wavelength for optimal imaging. Therefore, during the camera imaging process, other wavelengths of light correspond to different refractive indices, which leads to dispersion in the image.

[0037] Therefore, the present application provides an image optimization method, device, electronic device and storage medium.

[0038] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0039] Figure 1 The following is a flow chart of an image optimization method provided in an embodiment of the present application. The image optimization method provided in an embodiment of the present application specifically includes:

[0040] S1. Decompose a first image captured by a camera into first pixel arrays corresponding to three color channels, R, G, and B.

[0041] Each first pixel array may include pixel coordinates of all pixel points and sub-pixel values ​​on corresponding color channels.

[0042] S2. For each first pixel array, based on the refractive index of the camera lens for the color channel, correct the pixel coordinates and sub-pixel values ​​of all sub-pixel points of the first pixel array to generate a corresponding second pixel array.

[0043] Figure 2 A flowchart of the steps of correcting a pixel array provided in an embodiment of the present application. In step S2, for any first pixel array corresponding to the three color channels R, G, and B, a corresponding second pixel array is generated in the following manner:

[0044] S20 . Determine preset pixel coordinates of each sub-pixel point in the first pixel array according to the original pixel coordinates of the sub-pixel point and the corresponding color channel imaging ratio.

[0045] For each sub-pixel point, the preset pixel coordinates of the sub-pixel value are determined in the following manner:

[0046] ;

[0047] in, is the original pixel coordinate of the sub-pixel point, is the preset pixel coordinate of the sub-pixel point, is the pixel coordinate of the center point of the first image, is the color channel imaging ratio corresponding to the first pixel array.

[0048] And the color channel imaging ratios corresponding to the three color channels of R, G, and B are determined in the following way:

[0049] Obtain the focal length corresponding to the wavelength of the camera; based on the focal length corresponding to the wavelength and the preset calculation rules, calculate the imaging ratio values ​​corresponding to the three color channels of R, G, and B respectively.

[0050] The focal length corresponding to the wavelength here is set according to the focal length of the camera, which can be determined by the factory parameters of the camera.

[0051] According to optical principles, the focal length of the camera generally corresponds to a wavelength range of 380nm-740nm, with the middle value of 560nm being the wavelength corresponding to standard green, standard blue being 470nm, and standard red being 650nm. Based on the input focal length corresponding to wavelength λ and the wavelength corresponding to RGB color, the change of the original image RGB data is fitted by interpolation to calculate the pixel array corresponding to the new RGB three color channels.

[0052] Calculate the magnification or reduction ratio of the three color channel imaging. Taking the longest wavelength imaging ratio value as 0.9 and the shortest wavelength imaging ratio value as 1.1 as an example, the imaging ratio values ​​corresponding to the three color channels R, G, and B can be calculated by the following linear interpolation method:

[0053] ;

[0054] ;

[0055] ;

[0056] ;

[0057] in, is the focal length corresponding to the wavelength, A is the intermediate imaging ratio value, is the imaging ratio value corresponding to the G color channel, is the imaging ratio value corresponding to the R color channel, It is the imaging ratio value corresponding to the B color channel.

[0058] S22: Determine the sub-pixel value of the target pixel coordinate based on the preset pixel coordinates and the corresponding sub-pixel value of each sub-pixel point.

[0059] Since the pixel position is offset due to dispersion, the coordinates of each pixel point are recalculated in step S22. Assume that the center point corresponding to the lens is not offset, that is, the pixel coordinates of the center point in the image are the focus center. For each sub-pixel point, the preset pixel coordinates of the sub-pixel value are determined in the following manner:

[0060] ;

[0061] in, is the original pixel coordinate of the sub-pixel point, is the preset pixel coordinate of the sub-pixel point, is the pixel coordinate of the center point of the first image, is the color channel imaging ratio corresponding to the first pixel array.

[0062] S24: Generate a second pixel array based on all target pixel coordinates and sub-pixel values ​​corresponding to the target pixel coordinates.

[0063] Since the pixel coordinates of each pixel point in step S22 are not necessarily integer values, it is impossible to directly determine the sub-pixel value corresponding to the integer pixel point. Specifically, the target pixel coordinates can be determined in the following manner:

[0064] For each preset pixel coordinate , round the horizontal and vertical coordinates in the preset pixel coordinates to obtain the corresponding target pixel coordinates .

[0065] And the sub-pixel value of each target pixel coordinate is determined by the following interpolation method:

[0066] ;

[0067] in, is the sub-pixel value corresponding to the preset pixel coordinate.

[0068] It is understandable that if the coordinates of a pixel point fall outside the original image size, the pixel point may be deleted.

[0069] S3. Combine the second pixel arrays corresponding to the three color channels R, G, and B respectively to obtain an optimized second image.

[0070] Finally, the second pixel arrays corresponding to the three corrected color channels are combined to obtain a new second image.

[0071] In the embodiments of the present application, the dispersion problem of camera imaging is optimized by processing the image using easily available camera parameters, and the invention has good controllability and only requires adjusting the parameters in the calculation model, and has a wide range of applications.

[0072] In one embodiment of the present application, since the positions of the pixels in the image are offset, the edge pixels of the original image may be lost. Therefore, in order to ensure the integrity of the output image, the size of the first image is larger than the size of the second image. That is, a camera with an imaging size larger than the size of the second image to be used can be selected to capture the second image.

[0073] In a specific embodiment of the present application, the aforementioned image optimization method can be applied to the vehicle's autonomous driving technology. That is, the camera in step S1 can be a vehicle-mounted camera. The optimized second image is used for rendering the scene in the autonomous driving simulation.

[0074] Figure 3 The schematic diagram of the structure of an image optimization device provided in an embodiment of the present application. Based on the same inventive concept, an image optimization device 300 is also provided in an embodiment of the present application, and the device includes:

[0075] A decomposition module 310 is used to decompose the first image captured by the camera into first pixel arrays corresponding to the three color channels of R, G and B respectively;

[0076] A correction module 320, configured to correct, for each first pixel array, pixel coordinates and sub-pixel values ​​of all sub-pixel points of the first pixel array based on the refractive index of the camera lens for the color channel, so as to generate a corresponding second pixel array;

[0077] The synthesis module 330 is used to combine the second pixel arrays corresponding to the three color channels R, G, and B respectively to obtain an optimized second image.

[0078] In a preferred embodiment, for any first pixel array corresponding to the three color channels of R, G, and B, the correction module 320 generates a corresponding second pixel array in the following manner:

[0079] The method comprises the following steps: determining the preset pixel coordinates of each sub-pixel point in the first pixel array according to the original pixel coordinates and the corresponding color channel imaging ratio of the sub-pixel point; determining the sub-pixel value of the target pixel coordinates based on the preset pixel coordinates and the corresponding sub-pixel value of each sub-pixel point; and generating the second pixel array based on all the target pixel coordinates and the sub-pixel values ​​corresponding to the target pixel coordinates.

[0080] In a preferred embodiment, for each sub-pixel point, the correction module 320 determines the preset pixel coordinates of the sub-pixel value in the following manner:

[0081] ;

[0082] in, is the original pixel coordinate of the sub-pixel point, is the preset pixel coordinate of the sub-pixel point, is the pixel coordinate of the center point of the first image, is the color channel imaging ratio corresponding to the first pixel array.

[0083] In a preferred embodiment, the correction module 320 determines the target pixel coordinates by:

[0084] For each preset pixel coordinate , round the horizontal and vertical coordinates in the preset pixel coordinates to obtain the corresponding target pixel coordinates ; and determine the sub-pixel value of each target pixel coordinate by:

[0085] ;

[0086] in, is the sub-pixel value corresponding to the preset pixel coordinate.

[0087] In a preferred embodiment, the correction module 320 is further configured to:

[0088] Get the focal length corresponding to the wavelength of the camera, and calculate the imaging ratio values ​​corresponding to the three color channels of R, G, and B based on the focal length corresponding to the wavelength and the preset calculation rules.

[0089] In a preferred embodiment, the correction module 320 calculates the imaging ratio values ​​corresponding to the three color channels R, G, and B respectively in the following manner:

[0090] ;

[0091] ;

[0092] ;

[0093] ;

[0094] in, is the focal length corresponding to the wavelength, A is the intermediate imaging ratio value, is the imaging ratio value corresponding to the G color channel, is the imaging ratio value corresponding to the R color channel, It is the imaging ratio value corresponding to the B color channel.

[0095] In a preferred embodiment, the size of the first image is larger than the size of the second image.

[0096] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown in , the electronic device 400 includes a processor 410 , a memory 420 and a bus 430 .

[0097] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, the above-mentioned Figure 1 The steps of an image optimization method in the method embodiment shown are specifically implemented in accordance with the method embodiment, and will not be described in detail here.

[0098] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The steps of an image optimization method in the method embodiment shown are specifically implemented in accordance with the method embodiment, and will not be described in detail here.

[0099] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0100] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0101] In addition, the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0102] Furthermore, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0103] It should be noted that if the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.

[0104] In this document, relational terms such as first and second, etc. are used merely to distinguish one entity or operation from another entity or operation, but do not necessarily require or imply any such actual relationship or order between these entities or operations.

[0105] The above description is only an embodiment of the present application and is not intended to limit the protection scope of the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. An image optimization method, characterized in that: The method comprises: Decomposing the first image captured by the camera into first pixel arrays corresponding to the three color channels R, G, and B; For each first pixel array, based on the refractive index of the camera lens for the color channel, pixel coordinates and sub-pixel values ​​of all sub-pixel points of the first pixel array are corrected to generate a corresponding second pixel array; Combine the second pixel arrays corresponding to the three color channels R, G, and B to obtain an optimized second image; For any first pixel array corresponding to the three color channels R, G, and B, the corresponding second pixel array is generated in the following manner: Determine the preset pixel coordinates of each sub-pixel point in the first pixel array according to the original pixel coordinates of the sub-pixel point and the corresponding color channel imaging ratio; Determine the sub-pixel value of the target pixel coordinate based on the preset pixel coordinates and the corresponding sub-pixel value of each sub-pixel point; generating a second pixel array based on all target pixel coordinates and sub-pixel values ​​corresponding to the target pixel coordinates; For each sub-pixel point, the preset pixel coordinates of the sub-pixel value are determined in the following manner: ; in, is the original pixel coordinate of the sub-pixel point, is the preset pixel coordinate of the sub-pixel point, is the pixel coordinate of the center point of the first image, is the color channel imaging ratio corresponding to the first pixel array; The target pixel coordinates are determined in the following way: For each preset pixel coordinate , round the horizontal and vertical coordinates in the preset pixel coordinates to obtain the corresponding target pixel coordinates ;as well as The sub-pixel value of each target pixel coordinate is determined in the following way: ; in, is the sub-pixel value corresponding to the preset pixel coordinate.

2. The method according to claim 1, characterized in that Also includes: Get the focal length of the camera corresponding to the wavelength; Based on the focal length corresponding to the wavelength and the preset calculation rules, the imaging ratio values ​​corresponding to the three color channels of R, G, and B are calculated respectively.

3. The method according to claim 2, characterized in that The imaging ratio values ​​corresponding to the three color channels R, G, and B are calculated in the following way: ; ; ; ; in, is the focal length corresponding to the wavelength, A is the intermediate imaging ratio value, is the imaging ratio value corresponding to the G color channel, is the imaging ratio value corresponding to the R color channel, It is the imaging ratio value corresponding to the B color channel.

4. The method according to claim 1, characterized in that: The size of the first image is larger than that of the second image.

5. An image optimization device, characterized in that: Using the image optimization method as claimed in claim 1, the device comprises: A decomposition module, used for decomposing a first image captured by a camera into first pixel arrays corresponding to three color channels, namely, R, G, and B; A correction module, configured to correct, for each first pixel array, pixel coordinates and sub-pixel values ​​of all sub-pixel points of the first pixel array based on the refractive index of the camera lens for the color channel, so as to generate a corresponding second pixel array; The synthesis module is used to combine the second pixel arrays corresponding to the three color channels of R, G and B respectively to obtain an optimized second image.

6. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and the processor executes the machine-readable instructions to perform the steps of the image optimization method as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the image optimization method according to any one of claims 1 to 4 are executed.

Citation Information

Patent Citations

  • Image array format conversion method and device, electronic equipment and storage medium

    CN113971635A

  • Image sensor including planar nano-photon microlens array and electronic device including same

    CN114695408A

  • Image generation method and device, electronic equipment and storage medium

    CN115103168A

  • Image processing apparatus and method, electronic device, and medium

    CN116582759A

  • Image processing method and electronic equipment

    CN117425091A