Image processing method, device, computer readable storage medium and equipment
By cropping and normalizing high dynamic range images into sample images of low dynamic range images, the problem of shadowing at bright and dark edges in low dynamic range image processing is solved, improving the training effect and image quality of image processing models.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
- Filing Date
- 2023-02-23
- Publication Date
- 2026-05-08
AI Technical Summary
Low dynamic range images are prone to ghosting at bright and dark edges during processing, a problem that existing image processing models struggle to solve effectively.
By cropping high dynamic range (HDR) images into low dynamic range (LVR) images and normalizing them to their original color depth, sample images simulating low dynamic range are generated to simulate the characteristics of LVR images and are used to train image processing models.
It improves model training performance, avoids the problem of shadows at bright and dark edges, and generates sample images with consistent color depth with the original images, thus improving the quality of image processing models.
Smart Images

Figure CN116645277B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and more specifically, to an image processing method, apparatus, computer-readable storage medium, and device. Background Technology
[0002] Low Dynamic Range (LDR) images are images that are limited in their brightness and color gamut. High Dynamic Range (HDR) images, on the other hand, are images that can display a wider range of brightness and color gamut. HDR images can capture more brightness and color details than LDR images, thus reflecting details in real-world scenes more realistically.
[0003] To deliver better image quality to users, image processing models are typically incorporated into cameras to improve the quality of low dynamic range (LVR) images. Generally, these image processing models are trained using high dynamic range (HVR) images (as labels) and blurred versions of HVR images (as samples).
[0004] However, low dynamic range (LVR) images have limitations in color depth, and excessively bright or dark edges in the image are prone to truncation. For images with truncation issues, processing the image using the image processing model trained on the aforementioned samples may result in high dynamic range (HDR) images where excessively bright or dark edges exhibit motion blur.
[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute related technology known to those skilled in the art. Summary of the Invention
[0006] The purpose of this application is to provide an image processing method, apparatus, computer-readable storage medium, and electronic device that can crop a first image corresponding to a first color depth into a second image corresponding to a second color depth, and normalize the second image into a sample image of the first color depth to simulate low dynamic range images. Applying such sample images in model training can help the model learn the problem of low dynamic range images, thereby avoiding the problem of the model generating images with shadows at bright and dark edges.
[0007] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.
[0008] According to one aspect of this application, an image processing method is provided, the method comprising:
[0009] Obtain the first image corresponding to the first color depth;
[0010] Pixels in the first image that fall within a preset pixel value range are cropped to obtain a second image corresponding to the second color depth;
[0011] The second image is normalized to a sample image corresponding to the first color depth.
[0012] According to one aspect of this application, an image processing apparatus is provided, the apparatus comprising:
[0013] An image acquisition unit is used to acquire a first image corresponding to a first color depth;
[0014] The image cropping unit is used to crop pixels in the first image that belong to a preset pixel value range to obtain a second image corresponding to the second color depth;
[0015] The sample generation unit is used to normalize the second image into a sample image corresponding to the first color depth.
[0016] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various alternative implementations described above.
[0017] According to one aspect of this application, a computer-readable storage medium is provided, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the method of any one of the above.
[0018] According to one aspect of this application, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of any of the above by executing the executable instructions.
[0019] The exemplary embodiments of this application may have some or all of the following beneficial effects:
[0020] In an example embodiment of the image processing method provided in this application, a first image corresponding to a first color depth can be cropped into a second image corresponding to a second color depth, and the second image can be normalized to a sample image of the first color depth to simulate a low dynamic range image. Using such a sample image during model training can help the model learn the problem of low dynamic range images, thereby avoiding the generation of images with shadows at bright and dark edges. Furthermore, since the color depth of the image is dynamically adjusted, the generated final sample image corresponds to the same color depth as the first image. Compared to directly using the first image as a training sample, using the simulated low dynamic range image generated in this application as a sample image can improve the model training effect when subsequent sample images are applied to model training.
[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0022] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0023] Figure 1 A flowchart illustrating an image processing method according to an embodiment of this application is shown schematically;
[0024] Figure 2 This diagram illustrates an image processing scheme related to the technology.
[0025] Figure 3 A schematic diagram illustrating image artifacts is shown.
[0026] Figure 4 The diagram illustrates the pixel distribution of HDR and LDR.
[0027] Figure 5 This illustration schematically shows an image processing procedure according to an embodiment of the present application;
[0028] Figure 6 A flowchart illustrating another embodiment of an image processing method according to this application is shown schematically;
[0029] Figure 7 This illustration schematically shows a structural diagram of an image processing apparatus according to an embodiment of the present application;
[0030] Figure 8The schematic diagram illustrates the structure of a computer system suitable for implementing the electronic devices of the present application. Detailed Implementation
[0031] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of the embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this application.
[0032] Please see Figure 1 , Figure 1 A flowchart illustrating an image processing method according to an embodiment of this application is shown schematically. Figure 1 As shown, the method includes the following steps.
[0033] Step S110: Obtain the first image corresponding to the first color depth.
[0034] Step S120: Crop the pixels in the first image that belong to the preset pixel value range to obtain a second image corresponding to the second color depth.
[0035] Step S130: Normalize the second image into a sample image corresponding to the first color depth.
[0036] Implementation Figure 1 The method described herein can crop a first image corresponding to a first color depth into a second image corresponding to a second color depth, and normalize the second image to a sample image of the first color depth to simulate a low dynamic range image. Using such a sample image during model training can help the model learn the problem of low dynamic range images, thereby avoiding the generation of images with blurring at bright and dark edges. Furthermore, because the color depth of the image is dynamically adjusted, the generated final sample image corresponds to the same color depth as the first image. Compared to directly using the first image as a training sample, using the simulated low dynamic range image generated in this application as a sample image can improve the model training effect when subsequent sample images are applied to model training.
[0037] The steps described above in this example implementation will now be explained in more detail.
[0038] In step S110, a first image corresponding to the first color depth is obtained.
[0039] Specifically, to provide users with an image processing model that can improve the quality of LDR images, the model needs to be trained first. Training the model can involve selecting multiple HDR images. By preprocessing these HDR images, a first image can be obtained as input to the image processing model. The first color depth (e.g., 16-bit) of the first image can be used to characterize the value range of pixels in the first image (e.g., 0–2). 1+ That is, a maximum of 65,536 colors can be displayed in the first image. In addition, optionally, the first color depth can also be 24-bit, 32-bit, etc., which is not limited in the embodiments of this application.
[0040] As an optional embodiment, obtaining a first image corresponding to a first color depth includes: obtaining an original image corresponding to the first color depth; and performing convolution processing on the original image to obtain the first image corresponding to the first color depth. This allows for the acquisition of a first image suitable for model training through convolution of the original image, thereby helping to ensure the training effect of the image processing model.
[0041] Specifically, this application can obtain N original images corresponding to the first color depth, where N is a positive integer. The above processing method can be applied to any one of the N original images. Furthermore, the convolution processing performed on the original images is used to reduce the resolution of the original images, thereby improving the training efficiency of the model.
[0042] Optionally, after obtaining the original image corresponding to the first color depth, the original image can be filtered based on preset rules. These preset rules can be used to limit the image to: solid color images, out-of-focus images, etc., but are not limited in this embodiment. This helps improve the quality of the first image set, avoids processing all original images into the first image, and filters out original images that do not conform to the rules, thus ensuring the training effect of the model to a certain extent.
[0043] Alternatively, the original image can be convolved to obtain a first image corresponding to the first color depth by performing convolution processing on the original image using a function such as a sharpening function or an edge extraction function. The choice of which function to use for convolution depends on the model training objective; relevant personnel can select the necessary convolution function according to their needs.
[0044] As an optional embodiment, convolution processing is performed on the original image to obtain a first image corresponding to a first color depth, including: convolving a point spread function with the original image to obtain the first image corresponding to the first color depth. This can blur the original image, reduce its resolution, and improve training efficiency by using the obtained first image for model training.
[0045] Specifically, the point spread function (PSF) describes the response of an imaging system to a point light source or a point object. In image processing, PSF is often used to simulate the blurring effect during the imaging process and to restore a blurred image to a clear image.
[0046] In image convolution, the PSF (Power Filter) is typically used as a convolution kernel / filter. During image convolution, a series of weighted averages are calculated for each pixel in the original image. Each value in the convolution kernel represents the product of itself and the corresponding pixel value that should be included, and the sum of each weighted value is assigned to the center pixel. By using the PSF as the convolution kernel during the convolution process, each pixel value in the image can be multiplied by the PSF, and all results can be summed to generate a new pixel value.
[0047] In step S120, pixels in the first image that belong to a preset pixel value range are cropped to obtain a second image corresponding to the second color depth.
[0048] Generally, after acquiring the first image, the relevant technology uses the original image as the training label and the first image as the training sample. For details, please refer to [link / reference needed]. Figure 2 , Figure 2 A schematic diagram illustrating an image processing scheme of a related technology is shown. For example... Figure 2 As shown, after obtaining the HDR image 210 as the original image, related technologies usually convolve the HDR image 210 with the point spread function 220 to obtain the first image 230 as a training sample. Then, the first image 230 and the HDR image 210 can form a sample pair 240. By inputting the sample pair 240 into the image processing model, the image processing model can be trained.
[0049] However, for cameras with low dynamic range, the color depth is usually 8-bit precision. In actual imaging, the pixel values of the captured image are constrained to a small range (e.g., 0 to 255), which cannot truly reproduce the lighting environment, color changes and detailed textures of the real world. Figure 2 The proposed solution does not model the limited dynamic range, therefore it is difficult to simulate overly bright or dark areas that occur during actual shooting to compensate for the aforementioned limited dynamic range. Furthermore, based on... Figure 2The scheme shown generates samples to train an image processing model, which is then used to process images with low dynamic range. In the generated images, artifacts appear at excessively bright or dark edges (see diagram for an illustration of these artifacts). Figure 3 ).
[0050] To address the aforementioned issues, this application cropps pixels in the first image that fall within a preset pixel value range, thereby simulating a low dynamic range image, i.e., a second image corresponding to a second color depth (e.g., 8-bit).
[0051] As an optional embodiment, the preset pixel value range includes a maximum range and a minimum range. Pixels in the first image belonging to the preset pixel value range are cropped to obtain a second image corresponding to a second color depth. This includes cropping pixels in the first image that belong to the maximum and minimum ranges to obtain a second image corresponding to the second color depth. This allows the first image to be adjusted from a high dynamic range to a low dynamic range by cropping pixels from the maximum and minimum ranges, avoiding image truncation issues in subsequently generated samples.
[0052] Specifically, the highest and lowest ranges can be used to define a portion of the pixel value range for the first color depth; for example, the pixel value range for the first color depth is 0 to 2. 16 The minimum range is 0 to 2. 16 0 to 2 4 The highest range is 0 to 2. 16 2 in 12 ~2 16 Pixels belonging to the highest and lowest ranges in the first image are cropped to obtain a second image corresponding to the second color depth. In the second image, each pixel belongs to 2... 4 ~2 12 Within the range.
[0053] As an optional embodiment, pixels belonging to the highest and lowest ranges in the first image are cropped to obtain a second image corresponding to the second color depth. This includes: determining the minimum boundary value corresponding to the highest range and the maximum boundary value corresponding to the lowest range; cropping the pixels belonging to the highest range in the first image to the minimum boundary value, and cropping the pixels belonging to the lowest range in the first image to the maximum boundary value, to obtain the second image corresponding to the second color depth. This can simulate the truncation problem of low dynamic range images, allowing the model to better learn about this problem and avoid the motion blur problem in the subsequently generated image.
[0054] Specifically, the minimum boundary value (e.g., 4096) corresponding to the highest range and the maximum boundary value (e.g., 16) of the lowest range can be determined. Then, the pixels in the first image that belong to the highest range can be determined and the values of these pixels can be adjusted to the minimum boundary value. Also, the pixels in the first image that belong to the lowest range can be determined and the values of these pixels can be adjusted to the maximum boundary value.
[0055] In step S130, the second image is normalized to a sample image corresponding to the first color depth.
[0056] Specifically, the purpose of normalizing the second image is to dynamically adjust the image with the second color depth to the image with the first color depth. This allows for two adjustments to the image color depth: first from the first color depth to the second color depth, and then from the second color depth back to the first color depth, thus avoiding the image truncation problem.
[0057] Please see Figure 4 , Figure 4 The diagram illustrates the pixel distribution of HDR and LDR. Figure 4 As shown in the pixel distribution curves of HDR and LDR, it can be seen that the maximum pixel value of HDR can reach 1.0, while the maximum pixel value of LDR reaches 0.75. The maximum pixel value of HDR is greater than that of LDR. By adjusting the image from the first color depth to the second color depth, it is easier to simulate low dynamic range images.
[0058] As an optional embodiment, normalizing the second image into a sample image corresponding to the first color depth includes: normalizing each pixel in the second image using the maximum pixel value corresponding to the first color depth to obtain a sample image corresponding to the first color depth. This allows for dynamic adjustment of the color depth, ensuring that the sample image maintains a consistent color depth with the original image, facilitating feature learning by the image processing model.
[0059] Specifically, the maximum pixel value corresponding to the first color depth (e.g., 65535) can be determined, and each pixel in the second image can be divided by this maximum pixel value. The original pixel values are then reset based on the calculated new pixel values, thereby achieving normalization processing for each pixel in the second image. Alternatively, a second, third, or fourth maximum pixel value corresponding to the first color depth can also be determined to normalize each pixel in the second image; this embodiment does not limit the scope of the application.
[0060] Please see Figure 5 , Figure 5 The illustration shows a schematic diagram of an image processing procedure according to an embodiment of this application. Figure 5As shown, after obtaining the HDR image 510 as the original image, related technologies typically convolve the HDR image 510 with a point spread function 520 to obtain a first image 530 as a training sample. The difference between this application and related technologies is that this application can perform pixel cropping and pixel normalization on the first image 530 to achieve dynamic color depth adjustment of the first image 530, thereby obtaining a second image 540. Furthermore, the second image 540 and the HDR image 510 can form a sample pair 550. Inputting the sample pair 550 into an image processing model can train the image processing model. Figure 5 The image processing procedure shown can simulate training data that is consistent with the real imaging effect.
[0061] Optionally, during application, the image signal processing (ISP) flow of the imaging process can be modeled, and the technical solution of this application can be introduced to simulate the imaging problems caused by low dynamic range camera shooting in the raw domain, thereby obtaining input images that are more consistent with the actual shooting of the camera as sample images. This enables physical modeling of the shooting principle of low dynamic range cameras, thereby improving the generalization and robustness when facing different imaging elements.
[0062] As an optional embodiment, the method further includes: identifying the sample image and the original image as a sample pair; and training the image processing model using the sample pair. This allows the trained image processing model to reduce the dynamic range difference between the actual images captured by the low dynamic range camera and the neural network simulation training data, that is, to ensure that the simulation data is consistent with the actual scene shooting results, thereby avoiding artifact problems in the processed image.
[0063] Specifically, identifying the sample image and the original image as a sample pair allows the image processing model to learn the feature associations between the sample image and the original image, thereby enabling it to adjust a low dynamic range image into an artifact-free high dynamic range image when it receives one.
[0064] As an optional embodiment, training an image processing model using sample pairs includes: triggering the image processing model to perform image quality processing on the sample images to obtain a reference image; calculating a loss function between the reference image and the original image; and adjusting the model parameters of the image processing model using the loss function. This enables model training based on sample images, and the trained image processing model can generate artifact-free images, improving the accuracy of the model's image quality optimization.
[0065] Specifically, the image processing model can be triggered to process the sample image into a reference image with higher clarity and richer details in both light and dark areas. The loss function between the reference image and the original image can be L1 Loss, SSIM Loss, MS-SSIM Loss, etc., and this application embodiment is not limited to any particular type. L1 Loss essentially calculates the mean absolute error; SSIM Loss calculates the mean and variance of the image by convolving it with a Gaussian kernel; and MS-SSIM Loss continuously downsamples the generated image and the real image by a factor of 2. Furthermore, the calculated loss function can be used to adjust the model parameters of the image processing model, enabling it to learn the relationship between the sample image and the original image. In addition, the image processing model can be any model configured according to requirements, and its structure can be arbitrarily adjusted as needed.
[0066] Please see Figure 6 , Figure 6 A flowchart illustrating another embodiment of an image processing method according to this application is shown schematically. Figure 6 As shown, the image processing method includes steps S600 to S616.
[0067] Step S600: Obtain the original image corresponding to the first color depth.
[0068] Step S602: Convolve the point spread function with the original image to obtain the first image corresponding to the first color depth.
[0069] Step S604: Determine the minimum boundary value corresponding to the highest range and the maximum boundary value of the lowest range.
[0070] Step S606: Crop the pixels in the first image that belong to the highest range to the minimum boundary value, and crop the pixels in the first image that belong to the lowest range to the maximum boundary value, so as to obtain a second image corresponding to the second color depth.
[0071] Step S608: Normalize each pixel in the second image using the maximum pixel value corresponding to the first color depth to obtain a sample image corresponding to the first color depth.
[0072] Step S610: Determine the sample image and the original image as a sample pair.
[0073] Step S612: Trigger the image processing model to perform image quality processing on the sample image to obtain a reference image.
[0074] Step S614: Calculate the loss function between the reference image and the original image.
[0075] Step S616: Adjust the model parameters of the image processing model using the loss function.
[0076] It should be noted that steps S600 to S616 are the same as... Figure 1 For the specific implementation details of steps S600 to S616, please refer to the examples shown. Figure 1 The steps and their embodiments shown are not repeated here.
[0077] It is evident that implementation Figure 6 The method described herein can crop a first image corresponding to a first color depth into a second image corresponding to a second color depth, and normalize the second image to a sample image of the first color depth to simulate a low dynamic range image. Using such a sample image during model training can help the model learn the problem of low dynamic range images, thereby avoiding the generation of images with blurring at bright and dark edges. Furthermore, because the color depth of the image is dynamically adjusted, the generated final sample image corresponds to the same color depth as the first image. Compared to directly using the first image as a training sample, using the simulated low dynamic range image generated in this application as a sample image can improve the model training effect when subsequent sample images are applied to model training.
[0078] Please see Figure 7 , Figure 7 A schematic block diagram of an image processing apparatus according to one embodiment of this application is shown. Figure 7 As shown, the image processing apparatus 700 may include the following units.
[0079] Image acquisition unit 701 is used to acquire a first image corresponding to a first color depth;
[0080] The image cropping unit 702 is used to crop pixels in the first image that belong to a preset pixel value range to obtain a second image corresponding to the second color depth;
[0081] The sample generation unit 703 is used to normalize the second image into a sample image corresponding to the first color depth.
[0082] It is evident that implementation Figure 7The apparatus shown can crop a first image corresponding to a first color depth into a second image corresponding to a second color depth, and normalize the second image to a sample image of the first color depth to simulate a low dynamic range image. Using such a sample image during model training can help the model learn the problem of low dynamic range images, thereby avoiding the generation of images with ghosting at bright and dark edges. Furthermore, because the color depth of the image is dynamically adjusted, the generated final sample image corresponds to the same color depth as the first image. Compared to directly using the first image as a training sample, using the simulated low dynamic range image generated in this application as a sample image can improve the model training effect when subsequent sample images are applied to model training.
[0083] As an optional embodiment, the image acquisition unit 701 acquires a first image corresponding to a first color depth, including:
[0084] Obtain the original image corresponding to the first color depth;
[0085] The original image is convolved to obtain the first image corresponding to the first color depth.
[0086] As can be seen, by implementing this optional embodiment, a first image suitable for model training can be obtained by convolving the original image, which helps to ensure the training effect of the image processing model.
[0087] As an optional embodiment, the image acquisition unit 701 performs convolution processing on the original image to obtain a first image corresponding to a first color depth, including:
[0088] Convolve the point spread function with the original image to obtain the first image corresponding to the first color depth.
[0089] As can be seen, implementing this optional embodiment can blur the original image, reduce its resolution, and improve training efficiency by training the model based on the obtained first image.
[0090] As an optional embodiment, the preset pixel value range includes a maximum range and a minimum range. The image cropping unit 702 crops pixels in the first image that belong to the preset pixel value range to obtain a second image corresponding to the second color depth, including:
[0091] The pixels belonging to the highest and lowest ranges in the first image are cropped to obtain a second image corresponding to the second color depth.
[0092] As can be seen, by implementing this optional embodiment, the pixels in the first image can be cropped from the highest range to the lowest range, thereby adjusting the first image from the high dynamic range to the low dynamic range and avoiding image truncation problems in the subsequently generated sample pairs.
[0093] As an optional embodiment, the image cropping unit 702 crops pixels belonging to the highest and lowest ranges in the first image to obtain a second image corresponding to the second color depth, including:
[0094] Determine the minimum boundary value corresponding to the highest range and the maximum boundary value of the lowest range;
[0095] The pixels in the first image that belong to the highest range are cropped to the minimum boundary value, and the pixels in the first image that belong to the lowest range are cropped to the maximum boundary value, so as to obtain a second image corresponding to the second color depth.
[0096] As can be seen, implementing this optional embodiment can simulate the truncation problem of low dynamic range images, so that the model can learn the problem better and avoid the motion blur problem in the subsequently generated images.
[0097] As an optional embodiment, the sample generation unit 703 normalizes the second image into a sample image corresponding to the first color depth, including:
[0098] By using the maximum pixel value corresponding to the first color depth, the pixels in the second image are normalized to obtain a sample image corresponding to the first color depth.
[0099] As can be seen, implementing this optional embodiment can achieve dynamic adjustment of color depth so that the sample image and the original image maintain the same color depth, so that the image processing model can perform feature learning.
[0100] As an optional embodiment, it also includes:
[0101] The sample pair determination unit is used to determine the sample image and the original image as a sample pair;
[0102] The model training unit is used to train the image processing model using sample pairs.
[0103] As can be seen, implementing this optional embodiment can enable the trained image processing model to reduce the dynamic range difference between the actual images captured by the low dynamic range camera and the neural network simulation training data, that is, to make the simulation data consistent with the actual scene shooting results, so as to avoid the artifact problem in the processed image.
[0104] As an optional embodiment, the model training unit trains the image processing model using sample pairs, including:
[0105] The image processing model is triggered to perform image quality processing on the sample image to obtain a reference image;
[0106] Calculate the loss function between the reference image and the original image;
[0107] Adjust the model parameters of the image processing model using a loss function.
[0108] As can be seen, implementing this optional embodiment can enable model training based on sample images. The trained image processing model can generate artifact-free images, thereby improving the model's image quality optimization accuracy.
[0109] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0110] Since the functional modules of the image processing apparatus in the example embodiments of this application correspond to the steps of the example embodiments of the image processing apparatus described above, for details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the image processing apparatus described above.
[0111] Please see Figure 8 , Figure 8 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown.
[0112] It should be noted that, Figure 8 The computer system 800 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0113] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 802 or programs loaded from storage section 808 into random access memory (RAM) 803. The RAM 803 also stores various programs and data required for system operation. The CPU 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0114] The following components are connected to I / O interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to I / O interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 810 as needed so that computer programs read from it can be installed into storage section 808 as needed.
[0115] Specifically, according to embodiments of this application, the processes described below with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by central processing unit (CPU) 801, it performs the various functions defined in the methods and apparatus of this application.
[0116] In another aspect, this application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to implement the methods described in the above embodiments.
[0117] It should be noted that the computer-readable medium shown in this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0118] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0119] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.
[0120] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the claims.
Claims
1. An image processing method, characterized in that, include: Obtain the first image corresponding to the first color depth; Pixels in the first image that belong to a preset pixel value range are cropped to obtain a second image corresponding to a second color depth; wherein, the preset pixel value range includes a maximum range and a minimum range, and obtaining the second image corresponding to the second color depth includes: cropping pixels in the first image that belong to the maximum range and the minimum range to obtain the second image corresponding to the second color depth; Normalizing the second image into a sample image corresponding to the first color depth includes: normalizing each pixel in the second image using the maximum pixel value corresponding to the first color depth to obtain a sample image corresponding to the first color depth. The method further includes: determining a sample image and an original image corresponding to a first color depth as a sample pair; training an image processing model using the sample pair; and using the trained image processing model to reduce the dynamic range difference between the actual images captured by the low dynamic range camera and the neural network simulation training data.
2. The method according to claim 1, characterized in that, Obtain the first image corresponding to the first color depth, including: Obtain the original image corresponding to the first color depth; The original image is convolved to obtain a first image corresponding to the first color depth.
3. The method according to claim 2, characterized in that, Performing convolution processing on the original image to obtain a first image corresponding to the first color depth includes: The point spread function is convolved with the original image to obtain a first image corresponding to the first color depth.
4. The method according to claim 1, characterized in that, The image processing model is trained using the sample pairs, including: The image processing model is triggered to perform image quality processing on the sample image to obtain a reference image; Calculate the loss function between the reference image and the original image; The model parameters of the image processing model are adjusted using the loss function.
5. The method according to claim 1, characterized in that, Cropping pixels in the first image that belong to the highest and lowest ranges to obtain a second image corresponding to the second color depth includes: Determine the minimum boundary value corresponding to the highest range and the maximum boundary value of the lowest range; The pixels in the first image belonging to the highest range are cropped to the minimum boundary value, and the pixels in the first image belonging to the lowest range are cropped to the maximum boundary value, so as to obtain a second image corresponding to the second color depth.
6. An image processing apparatus, characterized in that, include: An image acquisition unit is used to acquire a first image corresponding to a first color depth; An image cropping unit is used to crop pixels in the first image that belong to a preset pixel value range to obtain a second image corresponding to a second color depth; wherein, the preset pixel value range includes a maximum range and a minimum range, and obtaining the second image corresponding to the second color depth includes: cropping pixels in the first image that belong to the maximum range and the minimum range to obtain the second image corresponding to the second color depth; The sample generation unit is used to normalize the second image into a sample image corresponding to the first color depth, including: normalizing each pixel in the second image by using the maximum pixel value corresponding to the first color depth to obtain a sample image corresponding to the first color depth. The sample pair determination unit is used to determine the sample image and the original image corresponding to the first color depth as a sample pair; The model training unit is used to train an image processing model using sample pairs; the trained image processing model is used to reduce the dynamic range difference between actual images captured by a low dynamic range camera and neural network simulation training data.
7. 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 described in any one of claims 1-5.
8. An electronic device, characterized in that, include: processor; as well as Memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1-5 by executing the executable instructions.
Citation Information
Patent Citations
Image conversion method and device, computer equipment and storage medium
CN111798381A
High dynamic range image generation method, apparatus and device, and readable storage medium
CN115103118A