Image Processing Method, Apparatus, Electronic Device, Storage Medium, and Program Product
By tone mapping and brightness enhancement of the source domain image and fusing the image, the problem of mismatch between the target object and the target domain image in the prior art is solved, and higher image processing accuracy is achieved.
Patent Information
- Application Number
- CN202510193856.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-21
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-02-21
AI Technical Summary
When the prior art improves the dynamic range of the image, it is unable to adapt to different lighting conditions and complex scenes, resulting in the luminance of the target object and the content in the target domain image, reducing the accuracy of image processing.
By acquiring the source domain image, tone mapping and brightness enhancement, identifying the target object and determining its weight, fusing the brightness enhancement image and the target domain image to adjust the brightness of the target object and improving the accuracy of image processing.
It effectively improves the brightness of the target object in the target domain image, improves the accuracy of image processing, and avoids the problems of tone mismatch and inconsistent brightness.
Smart Images

Figure CN119693251B_ABST
Abstract
Description
Technical Field
[0001] This application relates to artificial intelligence technology, and in particular, to an image processing method, apparatus, electronic device, storage medium, and program product. Background Art
[0002] High dynamic range technology is a hot topic in current video technology research and industrial applications, and is widely used in fields such as digital photography, film production, game development, virtual reality, etc., to improve the dynamic range and color richness of images, and bring vivid and realistic visual experiences to viewers. However, the method of improving the dynamic range of images through tone mapping technology cannot adapt to different lighting conditions and complex scenes, resulting in a mismatch in brightness between the target object and the content in the target domain image, and reducing the accuracy of generating the target domain image. Summary of the Invention
[0003] Embodiments of this application provide an image processing method, apparatus, electronic device, storage medium, and program product, which can specifically improve the brightness of the target object in the target domain image and further improve the accuracy of image processing.
[0004] The technical solution of the embodiments of this application is implemented as follows:
[0005] Embodiments of this application provide an image processing method, the method includes:
[0006] Obtain a source domain image, and perform tone mapping on the source domain image to obtain a target domain image;
[0007] Enhance the brightness of the source domain image to obtain a brightness-enhanced image;
[0008] Identify the target object in the source domain image, and determine the first weight of the target object in the source domain image;
[0009] Based on the first weight, determine the second weight of the target object in the brightness-enhanced image and the third weight of the target object in the target domain image;
[0010] Based on the second weight and the third weight, fuse the brightness-enhanced image and the target domain image to obtain a fused image.
[0011] Embodiments of this application provide an image processing apparatus, including:
[0012] A data acquisition module, configured to obtain a source domain image and perform tone mapping on the source domain image to obtain a target domain image;
[0013] A brightness enhancement module, configured to enhance the brightness of the source domain image to obtain a brightness-enhanced image;
[0014] An image fusion module, configured to identify a target object in the source domain image and determine a first weight of the target object in the source domain image; based on the first weight, determine a second weight of the target object in the brightness enhanced image and a third weight of the target object in the target domain image; based on the second weight and the third weight, fuse the brightness enhanced image and the target domain image to obtain a fused image.
[0015] An embodiment of the present application provides an electronic device, including:
[0016] A memory, configured to store computer executable instructions or computer programs;
[0017] A processor, configured to implement the image processing method provided by the embodiment of the present application when executing the computer executable instructions stored in the memory.
[0018] An embodiment of the present application provides a computer-readable storage medium, storing a computer program or computer executable instructions, configured to implement the image processing method provided by the embodiment of the present application when being executed by a processor.
[0019] An embodiment of the present application provides a computer program product, including a computer program or computer executable instructions, where when the computer program or computer executable instructions are executed by a processor, the image processing method provided by the embodiment of the present application is implemented.
[0020] The embodiment of the present application has the following beneficial effects:
[0021] Perform tone mapping on the source domain image to obtain a target domain image. In this way, the source domain image is migrated from the source domain to the target domain through tone mapping, so that the target domain image obtained after tone mapping is consistent with the target domain in terms of tone, avoiding the problem of tone mismatch; perform brightness enhancement on the source domain image to obtain a brightness enhanced image. In this way, by adjusting the brightness of the source domain image, overexposure or underexposure is avoided; identify the target object in the source domain image and determine the first weight of the target object in the source domain image. Based on the first weight, determine the second weight of the target object in the brightness enhanced image and the third weight of the target object in the target domain image. Based on the second weight and the third weight, fuse the brightness enhanced image and the target domain image to obtain a fused image. In this way, during the process of fusing the brightness enhanced image and the target domain image, the brightness of the target object in the fused image is adjusted specifically, improving the accuracy of the generated fused image and further enhancing the accuracy of image processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a schematic structural diagram of an image processing system provided by an embodiment of the present application;
[0023] Figure 2 is a schematic structural diagram of an electronic device provided by an embodiment of the present application;
[0024] Figure 3 is a first process schematic diagram of an image processing method provided by an embodiment of the present application;
[0025] Figure 4 is a schematic diagram of tone fusion provided by an embodiment of the present application;
[0026] Figure 5 is a second process schematic diagram of an image processing method provided by an embodiment of the present application;
[0027] Figure 6 is a schematic diagram of the principle of confirming target pixels provided by an embodiment of the present application;
[0028] Figure 7 is a schematic diagram of pixel splicing provided by an embodiment of the present application;
[0029] Figure 8 is a schematic structural diagram of a target recognition model provided by an embodiment of the present application;
[0030] Figure 9 is a third process schematic diagram of an image processing method provided by an embodiment of the present application;
[0031] Figure 10 is a first schematic diagram of regional position transformation provided by an embodiment of the present application;
[0032] Figure 11 is a second schematic diagram of regional position transformation provided by an embodiment of the present application;
[0033] Figure 12 is a fourth process schematic diagram of an image processing method provided by an embodiment of the present application;
[0034] Figure 13 is a schematic diagram of an image processing flow provided by an embodiment of the present application.
[0035] It should be noted that the above "first" and "second" are only used to distinguish different solutions, and do not represent the distinction of the advantages and disadvantages of the solutions or the priority in the implementation process. Detailed implementation manners
[0036] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations of the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of the present application.
[0037] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
[0038] In the following description, the terms "first / second / third" are only used to distinguish similar objects and do not represent a specific order for the objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence when permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0039] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of an overall module or unit that includes the function of the module or unit.
[0040] In the embodiments of the present application, when collecting and processing relevant data in practical applications, the informed consent or separate consent of the personal information subject should be obtained strictly in accordance with the requirements of relevant national laws and regulations, and subsequent data use and processing behaviors should be carried out within the scope authorized by laws and regulations and the personal information subject.
[0041] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meaning as commonly understood by those skilled in the art to which the present application belongs. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0042] In the related art, the human eye has prior knowledge of the target object and is very sensitive to slight color changes and light and dark contrast changes in the area where the target object is located. Due to the insufficient adaptive ability to perform tone mapping on the source domain image, the brightness of the target object does not match the content in the target domain image, reducing the accuracy of generating the target domain image. To address the above problems, the embodiments of the present application provide an image processing method, apparatus, electronic device, computer-readable storage medium, and computer program product to enhance the brightness of the target object in the fused image and further improve the accuracy of image processing.
[0043] The image processing method described in the embodiments of the present application can be applied to various fields, such as image enhancement, video generation, etc. That is, the image processing method in the embodiments of the present application is not limited to a certain field.
[0044] The exemplary applications of the electronic device provided in the embodiments of the present application will be described below. The electronic device provided in the embodiments of the present application can be implemented as a terminal or a server. Below, the exemplary applications when the electronic device is implemented as a server will be described.
[0045] Refer to Figure 1 , Figure 1 FIG. is a schematic architecture diagram of an image processing system 100 provided in the embodiments of the present application. To support an image processing application, a terminal (exemplarily shown as terminal 400) is connected to a server 200 through a network 300. The network 300 can be a wide area network, a local area network, or a combination of both.
[0046] The terminal 400 is configured to send a source domain image to the server 200 through the network 300. The server 200 is configured to perform tone mapping on the source domain image to obtain a target domain image; perform brightness enhancement on the source domain image to obtain a brightness enhanced image; identify a target object in the source domain image and determine a first weight of the target object in the source domain image; based on the first weight, determine a second weight of the target object in the brightness enhanced image and a third weight of the target object in the target domain image; based on the second weight and the third weight, fuse the brightness enhanced image and the target domain image to obtain a fused image, and return the fused image to the terminal 400. The terminal 400 displays the fused image through a graphical interface 410.
[0047] The following describes an example of image processing by the terminal 400.
[0048] In some embodiments, the terminal 400 can independently complete an image processing task. For example, the terminal 400 is configured to obtain a source domain image, perform tone mapping on the source domain image to obtain a target domain image; perform brightness enhancement on the source domain image to obtain a brightness enhanced image; identify a target object in the source domain image and determine a first weight of the target object in the source domain image; based on the first weight, determine a second weight of the target object in the brightness enhanced image and a third weight of the target object in the target domain image; based on the second weight and the third weight, fuse the brightness enhanced image and the target domain image to obtain a fused image, and display the fused image through the graphical interface 410.
[0049] In an implementation scenario, a server or a terminal can perform image enhancement on a low-dynamic-range image, obtain the low-dynamic-range image, perform tone mapping on the low-dynamic-range image to obtain a high-dynamic-range image; perform brightness enhancement on the low-dynamic-range image to obtain a brightness-enhanced image; identify a target object in the low-dynamic-range image and determine a first weight of the target object in the low-dynamic-range image; based on the first weight, determine a second weight of the target object in the brightness-enhanced image and a third weight of the target object in the high-dynamic-range image; based on the second weight and the third weight, fuse the brightness-enhanced image and the high-dynamic-range image to obtain a fused image.
[0050] In an implementation scenario, a server or a terminal can perform video generation and perform the following processing on video frames of a low-dynamic-range video. Perform tone mapping on the video frames to obtain high-dynamic-range video frames; perform brightness enhancement on the video frames to obtain brightness-enhanced video frames; identify a target object in the video frames and determine a first weight of the target object in the video frames; based on the first weight, determine a second weight of the target object in the brightness-enhanced video frames and a third weight of the target object in the high-dynamic-range video frames; based on the second weight and the third weight, fuse the brightness-enhanced video frames and the high-dynamic-range video frames to obtain fused video frames, and splice each fused video frame to obtain a new video.
[0051] In some embodiments, the server 200 may be an independent physical server, or a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (CDN), and big data and artificial intelligence platforms.
[0052] The terminal 400 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a smart voice interaction device, a smart home appliance, a vehicle terminal, an aircraft, etc., but is not limited thereto. The terminal and the server can be directly or indirectly connected through wired or wireless communication methods, which are not limited in the embodiments of the present application.
[0053] See Figure 2 , Figure 2 is a schematic structural diagram of an electronic device provided by an embodiment of the present application. Figure 2 The electronic device 500 shown may be Figure 1The terminal 400 or the server 200 among them, the electronic device 500 includes: at least one processor 510, a memory 550, and at least one network interface 520. Each component in the server 200 is coupled together through a bus system 540. It can be understood that the bus system 540 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 540 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 2 all kinds of buses are labeled as the bus system 540.
[0054] The processor 510 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0055] The user interface 530 includes one or more output devices 531 that enable the presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 530 also includes one or more input devices 532, including user interface components that facilitate user input, such as a keyboard, a mouse, a microphone, a touch screen display, a camera, other input buttons, and controls;
[0056] In some embodiments, when the embodiment independently completes the image processing task by the terminal 400, the server 200 provided by the embodiments of the present application does not include the user interface 530.
[0057] The memory 550 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disc drives, etc. The memory 550 optionally includes one or more storage devices that are physically located away from the processor 510.
[0058] The memory 550 includes volatile memory or non-volatile memory, and can also include both volatile and non-volatile memory. The non-volatile memory can be a read-only memory (ROM, Read Only Memory), and the volatile memory can be a random access memory (RAM, Random Access Memory). The memory 550 described in the embodiments of the present application is intended to include any suitable type of memory.
[0059] In some embodiments, the memory 550 is capable of storing data to support various operations. Examples of these data include programs, modules, and data structures, or subsets or supersets thereof, which are described below by way of example.
[0060] An operating system 551, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0061] A network communication module 552, for reaching other computing devices via one or more (wired or wireless) network interfaces 520. Exemplary network interfaces 520 include: Bluetooth, Wi-Fi (Wireless Fidelity), and USB (Universal Serial Bus), etc.;
[0062] A presentation module 553, for enabling the presentation of information (such as a user interface for operating peripheral devices and displaying content and information) via one or more output devices 531 associated with a user interface 530 (such as a display screen, a speaker, etc.);
[0063] In some embodiments, when the terminal 400 independently completes an image processing task, the server 200 provided by the embodiments of the present application may not include the presentation module 553.
[0064] An input processing module 554, for detecting and translating one or more user inputs or interactions from one of one or more input devices 532; in some embodiments, when the terminal 400 independently completes an image processing task, the server 200 provided by the embodiments of the present application may not include the presentation module 553.
[0065] In some embodiments, the device provided by the embodiments of the present application may be implemented in software. Figure 2 An image processing device 555 stored in the memory 550 is shown, which may be software in the form of programs and plugins, etc., including the following software modules: a data acquisition module 5551, a brightness enhancement module 5552, and an image fusion module 5553. These modules are logical, so they can be combined arbitrarily or further split according to the functions to be implemented. The functions of each module will be described below.
[0066] It should be noted that in the following examples of image processing, those skilled in the art can apply the image processing method provided by the embodiments of the present application to process low dynamic range images according to the understanding of the following text.
[0067] See Figure 3 , Figure 3 is the first process schematic diagram of the image processing method provided by the embodiments of the present application, which will be combined with Figure 3The steps shown will be described. The image processing method provided by the embodiments of the present application can be implemented independently by a server or a terminal, or jointly implemented by a server and a terminal. Below, an example of joint implementation by a server and a terminal will be used for description.
[0068] In step 101, a source domain image is obtained, and tone mapping is performed on the source domain image to obtain a target domain image.
[0069] Among them, the tone of the target domain image is different from that of the source domain image. Tone mapping is used to convert the tone of the source domain image into the tone of the target domain. When the source domain image is a low dynamic range image (i.e., an image with a tone less than the tone threshold), the target domain image is a high dynamic range image (i.e., an image with a tone greater than or equal to the tone threshold); when the source domain image is a high dynamic range image, the target domain image is a low dynamic range image. The embodiments of the present application do not limit low dynamic range images. For example, a low dynamic range image can be a photo taken in a low light environment, an image obtained by a specific imaging device, etc.; the embodiments of the present application also do not limit high dynamic range images. For example, a high dynamic range image can be a photo taken in a strong light environment. Among them, tone refers to the relative brightness and darkness of an image, which is manifested as color on a color image and is used to reflect the position of the color in the spectrum.
[0070] In some embodiments, performing tone mapping on the source domain image in step 101 to obtain a target domain image can be achieved in the following manner: obtaining multiple sample images belonging to the target domain, and extracting the sample tones of each sample image; fusing the multiple sample tones to obtain a target tone; replacing the tone of the source domain image with the target tone, and determining the source domain image with the replaced tone as the target domain image.
[0071] Here, the sample image is an image belonging to the target domain, which is used to determine the target color tone that the target domain image should possess. In the embodiments of the present application, there are no restrictions on the sample image. The sample image can be an image randomly selected from the target domain dataset, or an image screened from multiple images in the target domain according to the category of the image. The sample color tone refers to the color category possessed by each sample image. In the embodiments of the present application, there are no restrictions on the extraction method of the sample color tone. The sample color tone can be various color categories existing in nature and obtained through color mixing. For example, in the Hue-Saturation-Value (HSV) space, the sample color tone is represented by an angular value of 0-360° to represent different color ranges. In the HSV space, brightness is used to characterize the brightness of the color in the image. An image with high brightness is clear, while an image with low brightness is dim. Saturation is used to characterize the vividness of the color. A color with high saturation is vivid and intense, while a color with low saturation is dull and grayish. Saturation is represented by a value of 0-100%. Fusing multiple sample color tones is to fuse the sample color tones extracted from multiple sample images into a color tone used to characterize the overall color characteristics of the target domain. In the embodiments of the present application, there are no restrictions on the fusion method. Fusion can be performed in a weighted average manner. The target color tone is the result obtained by fusing multiple sample color tones and is used to characterize the color that the target domain image is expected to achieve.
[0072] In some embodiments, referring to Figure 4 , Figure 4 is a schematic diagram of color tone fusion provided by the embodiments of the present application. For the above "fusing multiple sample color tones to obtain the target color tone", as Figure 4 shown, weighted summation is performed on multiple sample color tones to obtain the target color tone.
[0073] For example, the sample color tone A is 6, and the sample color tone B is 4. When the sample color tone A and the sample color tone B have the same weight, such as the weights of both the sample color tone A and the sample color tone B are 0.5, the obtained target color tone is 5. When the sample color tone A and the sample color tone B have different weights, such as the weight of the sample color tone A is 0.6 and the weight of the sample color tone B is 0.4, the obtained target color tone is 5.2.
[0074] Continuing with the above example, given a source domain image with a warm color tone (such as a color tone of 120), multiple sample images belonging to the target domain are obtained, and the sample color tone of each sample image is extracted (such as the sample color tone of sample image A is 240, the sample color tone of sample image B is 241, and the sample color tone of sample image C is 239); multiple sample color tones are fused to obtain the target color tone (such as 240).
[0075] In the embodiments of the present application, the target tone is obtained by fusing the tones of multiple sample images, so that the source domain image after tone replacement is consistent with the target domain in terms of color, avoiding the problem of color mismatch. At the same time, by extracting and fusing the tones of the sample images, the sample images can be randomly selected from the target domain dataset or screened according to the image category, improving the flexibility of tone mapping. Through tone replacement, the brightness characteristics of the target tone are made consistent with the target domain image, avoiding the visual abruptness caused by brightness differences.
[0076] In step 102, the brightness of the source domain image is enhanced to obtain a brightness-enhanced image.
[0077] Here, brightness enhancement is used to improve the brightness of the image, and brightness enhancement can be achieved by adjusting the brightness of each pixel in the image. The embodiments of the present application do not limit the method of brightness enhancement, and brightness enhancement can adopt methods such as histogram equalization method and logarithmic transformation method.
[0078] In some embodiments, refer to Figure 5 , Figure 5 is the second process schematic diagram of the image processing method provided by the embodiments of the present application. For Figure 3 the step 102 shown, it can be implemented through Figure 5 steps 1021 to 1023, which will be specifically described below.
[0079] Steps 1021 to 1023 are executed for each pixel in the source domain image.
[0080] In step 1021, the target pixel corresponding to the pixel in the target domain image is determined.
[0081] Among them, the position of the target pixel in the target domain image is the same as the position of the pixel in the source domain image.
[0082] Here, a pixel is the smallest unit that makes up an image, and each pixel contains information such as color and brightness. A pixel is the basic unit of an image. The embodiments of the present application do not limit pixels. Pixels can be at any position in the image, and different pixels have different tones, saturations, and brightnesses. The target pixel is the pixel in the target domain image corresponding to the pixel in the source domain image, and the resolution of the target domain image is the same as that of the source domain image. The position of the target pixel in the target domain image is the same as the position of the pixel selected in the source domain image.
[0083] Exemplarily, refer to Figure 6 , Figure 6 is the schematic diagram of confirming the target pixel provided by the embodiments of the present application. As Figure 6As shown, the source domain image 601 is an image with a dimension of 2*2, and each pixel has a grayscale value. The target domain image 602 is another image with a dimension of 2*2. The position of pixel 603 in the source domain image 601 is (0, 0), and the position of pixel 604 in the target domain image 602 is (0, 0). The pixel 604 whose position in the target domain image 602 (such as (0, 0)) is the same as the position of pixel 603 in the source domain image 601 (such as (0, 0)) is determined as the target pixel.
[0084] Continue to refer to Figure 5 , in step 1022, based on the target pixel, enhance the brightness of the pixel to obtain the enhanced pixel.
[0085] Among them, the brightness of the target pixel is less than the brightness of the enhanced pixel.
[0086] In some embodiments, for the shown step 1022, it can be implemented through steps 10221 to 10223, which will be specifically described below.
[0087] In step 10221, based on the target pixel and the pixel, determine the brightness factor.
[0088] Here, the brightness factor can be the ratio of the brightness between the target pixel and the pixel. The embodiments of the present application do not limit the brightness factor, and the calculation method of the brightness factor can be the ratio between the brightness of the target pixel and the pixel.
[0089] In some embodiments, step 10221 can be implemented in the following way: determine the ratio of the brightness of the target pixel to the brightness of the pixel as the candidate brightness factor; perform filtering processing on the candidate brightness factor, and determine the filtered candidate brightness factor as the brightness factor.
[0090] Here, the candidate brightness factor can be obtained by calculating the ratio of the brightness of the target pixel to the brightness of the pixel, and is used to reflect the relative relationship between the target pixel and the pixel in terms of brightness. The filtering processing is used to remove possible noise or interference in the candidate brightness factor, making the candidate brightness factor smooth and stable. The brightness factor is obtained by filtering the candidate brightness factor through a filter. The embodiments of the present application do not limit the filter, and the filter can be a mean filter, a Gaussian filter, etc. By filtering the candidate brightness factor through the filter, the value of the candidate brightness factor is adjusted. The brightness factor is the candidate brightness factor after filtering processing.
[0091] In some embodiments, the above "perform filtering processing on the candidate brightness factor" can be implemented in the following way: determine the filtering parameter, and when the candidate brightness factor is greater than the filtering parameter, replace the candidate brightness factor with the filtering parameter to obtain the filtered candidate brightness factor.
[0092] Exemplarily, the ratio of the brightness of the target pixel (such as 12) to the brightness of the pixel (such as 6) is determined as the candidate brightness factor (such as 2); a filtering parameter (such as 1.5) is determined, and when the candidate brightness factor is greater than the filtering parameter, the candidate brightness factor is replaced with the filtering parameter to obtain the filtered candidate brightness factor (such as 1.5).
[0093] In the embodiments of the present application, noise or interference in the candidate brightness factor can be effectively removed through filtering. When the candidate brightness factor has outliers due to local brightness changes or measurement errors, the filter can smooth these outliers, making the brightness factor more stable, ensuring smooth transitions of the brightness factor in the image, and avoiding brightness discontinuities in the image caused by sudden changes in the brightness factor. At the same time, the filtered brightness factor can better reflect the relative relationship in brightness between the target pixel and the source domain image pixels, ensuring overall consistency in brightness of the image.
[0094] In step 10222, the product of the brightness of the pixel and the brightness factor is determined.
[0095] Exemplarily, the brightness of the pixel is 8 and the brightness factor is 1.5, and the product of the brightness of the pixel and the brightness factor (such as 12) is determined.
[0096] In step 10223, the brightness of the pixel is replaced with the product, and the pixel after replacing the brightness is determined as the enhanced pixel.
[0097] Exemplarily, the brightness of the pixel (such as 8) is replaced with the product (such as 12), and the pixel after replacing the brightness is determined as the enhanced pixel.
[0098] In the embodiments of the present application, by calculating the brightness factor and adjusting the pixel brightness, the overall brightness of the image can be significantly improved. For example, in a night scene photo, the enhanced image can clearly show details such as the outlines of buildings and street lights. At the same time, by adjusting the brightness factor, the contrast of the image is optimized, avoiding problems of overexposure or underexposure.
[0099] In step 1023, multiple enhanced pixels in the source domain image are combined to obtain a brightness-enhanced image.
[0100] It should be noted that the order of combining multiple enhanced pixels in the source domain image is the same as the order of performing steps 1021 to 1022 on each pixel.
[0101] In some embodiments, step 1023 can be implemented in the following manner: stitching multiple enhanced pixels in the source domain image to obtain a brightness-enhanced image.
[0102] Exemplarily, multiple enhanced pixels in the source domain image are spliced (such as the enhanced pixel A corresponding to the pixel at the (0, 0) position in the source domain image (the brightness of the enhanced pixel A is 5), the enhanced pixel B corresponding to the pixel at the (0, 1) position in the source domain image (the brightness of the enhanced pixel B is 2), the enhanced pixel C corresponding to the pixel at the (1, 0) position in the source domain image (the brightness of the enhanced pixel C is 4), and the enhanced pixel D corresponding to the pixel at the (1, 1) position in the source domain image (the brightness of the enhanced pixel D is 5)), to obtain a brightness-enhanced image (such as [[5, 2], [4, 5]]).
[0103] See Figure 7 , Figure 7 FIG. is a schematic diagram of pixel splicing provided by an embodiment of the present application. Each pixel in the source domain image 701 is enhanced respectively to obtain the enhanced pixel 7021 corresponding to the pixel 7011, the enhanced pixel 7022 corresponding to the pixel 7012, the enhanced pixel 7023 corresponding to the pixel 7013, and the enhanced pixel 7024 corresponding to the pixel 7014. Multiple enhanced pixels are spliced in the order of enhancing the brightness of each pixel in the source domain image 701 (that is, first enhancing the brightness of the pixel 7011, secondly, enhancing the brightness of the pixel 7012, then, enhancing the brightness of the pixel 7013, and finally, enhancing the brightness of the pixel 7014), to obtain a brightness-enhanced image 702.
[0104] In the embodiment of the present application, by calculating the brightness ratio between the target pixel and the source domain image pixel and replacing the brightness of the source domain image pixel with the enhanced brightness, it can be ensured that the source domain image is consistent with the target domain image in terms of brightness.
[0105] Continue to refer to Figure 3 , in step 103, the target object in the source domain image is identified, and the first weight of the target object in the source domain image is determined.
[0106] Here, the target object is a specific object or element that needs to be identified in the source domain image. The embodiment of the present application places no restrictions on the target object. The target object can be a person, an item, a feature region, etc. in the image. Identification is the process of determining the target object from the source domain image through specific algorithms and models. The embodiment of the present application places no restrictions on the identification method. The identification method can be a target detection method based on deep learning, a pattern recognition method, etc. The first weight is a numerical value determined for the region of the target object in the source domain image, used to characterize the importance of the target object in the source domain image. The embodiment of the present application places no restrictions on the determination method of the first weight. The method for determining the first weight can be rule-based calculation or obtained through machine learning model training.
[0107] In some embodiments, the above "identifying the target object in the source domain image" can be achieved in the following manner: encoding the source domain image to obtain the encoded features of the source domain image; decoding the encoded features of the source domain image to obtain the target object in the source domain image.
[0108] Continuing with the above embodiments, the above "encoding the source domain image to obtain the encoded features of the source domain image" can be achieved in the following manner: performing convolutional processing on the source domain image to obtain convolutional features, performing pooling processing on the convolutional features to obtain pooling features, and performing mapping processing on the pooling features to obtain the encoded features of the source domain image.
[0109] For example, performing convolutional processing on the source domain image (such as [[5, 2], [4, 5]]) to obtain convolutional features (such as [0.14, 0.13, -0.06, 0.15, 0.03, 0.06]), performing pooling processing on the convolutional features to obtain pooling features (such as [0.14, 0.13, -0.06]), and performing mapping processing on the pooling features to obtain the encoded features of the source domain image (such as [0.52, 0.13, -0.06, 0.15]).
[0110] Continuing with the above embodiments, the above "decoding the encoded features of the source domain image to obtain the target object in the source domain image" can be achieved in the following manner: performing mapping processing on the encoded features of the source domain image to obtain mapping features, performing upsampling processing on the mapping features to obtain upsampling features, and performing deconvolution processing on the upsampling features to obtain the target object in the source domain image.
[0111] For example, performing mapping processing on the encoded features of the source domain image (such as [0.52, 0.13, -0.06, 0.15]) to obtain mapping features (such as [0.14, 0.13, -0.06]), performing upsampling processing on the mapping features to obtain upsampling features (such as [0.14, 0.13, -0.06, 0.15, 0.03, 0.06]), and performing deconvolution processing on the upsampling features to obtain the target object in the source domain image (such as the item identified from the source domain image).
[0112] See Figure 8 , Figure 8 is a schematic diagram of the target recognition model structure provided by the embodiments of the present application, such as Figure 8As shown, the source domain image is input into the encoder of the target recognition model for encoding to obtain the encoded features of the source domain image. The encoded features of the source domain image are input into the decoder of the large language model for decoding to obtain the target object in the source domain image. Among them, the encoder includes a convolutional layer, a pooling layer, and a mapping layer. The convolutional layer is used to perform convolutional processing on the source domain image to obtain convolutional features. The pooling layer is used to perform pooling processing on the convolutional features to obtain pooling features. The mapping layer is used to perform mapping processing on the pooling features to obtain the encoded features of the source domain image. The decoder includes a mapping layer, an upsampling layer, and a transposed convolutional layer. The mapping layer is used to perform mapping processing on the encoded features of the source domain image to obtain mapping features. The upsampling layer is used to perform upsampling processing on the mapping features to obtain upsampling features. The transposed convolutional layer is used to perform transposed convolutional processing on the upsampling features to obtain the target object in the source domain image.
[0113] In some embodiments, referring to Figure 9 , Figure 9 is the third process schematic diagram of the image processing method provided by the embodiments of the present application. For Figure 3 shown in step 103, to determine the first weight of the target object in the source domain image, it can be implemented through Figure 9 steps 1031 to 1033, which will be specifically described below.
[0114] In step 1031, determine the target area of the target object in the source domain image and the center point of the target area.
[0115] Here, the target area is the area determined by the target object in the source domain image. This area includes the target object and some areas related to the target object. The embodiments of the present application do not limit the target area. The shape of the target area can be a regular shape such as a rectangle or a circle, or an irregular shape. The center point is the position point at the center of the target area, which is used to represent the center position of the target area. The embodiments of the present application do not limit the center point. For example, for a rectangular area, the center point is the intersection of the diagonals of the rectangular area; for a circular area, the center point is the center of the circular area. The coordinate value of the center point is the coordinate value of the position of the center point in the source domain image. The embodiments of the present application do not limit the method for determining the target area. The method for determining the target area can be to expand based on the contour of the target object, the area obtained by using image segmentation technology to segment the target object from the background, etc.
[0116] In some embodiments, the above "determine the target area of the target object in the source domain image" can be implemented in the following way: determine the pixels associated with the target object in the source domain image; combine multiple pixels to obtain the target area.
[0117] Exemplarily, taking the target area as a rectangular area as an example for illustration, given that the length of the rectangular area is L, the width of the rectangular area is W, and the coordinates of the lower left corner position of the rectangular area in the source domain image are ( ), where, is the abscissa of the lower left corner position of the rectangular area in the source domain image, is the ordinate of the lower left corner position of the rectangular area in the source domain image, and the center point is the pixel with subscripts ( +L / 2, +W / 2) in the source domain image.
[0118] In step 1032, the following processing is performed for each pixel in the target area. Based on the first position of the pixel in the source domain image and the second position of the center point in the source domain image, the fourth weight of the pixel is determined.
[0119] Here, the first position refers to the position coordinates of the pixel in the source domain image, which is used to identify the position of the pixel in the entire source domain image, so as to find the corresponding pixel on the two-dimensional plane of the source domain image. The embodiments of the present application do not limit the first position, and the representation method of the first position can be common row-column coordinates (such as (x, y)). The second position is the position coordinates of the center point in the source domain image, which is used to clarify the position of the center point on the two-dimensional plane of the source domain image. Both the first position and the second position are coordinate representations in the two-dimensional plane coordinate system of the source domain image. The embodiments of the present application do not limit the second position, and the representation form of the second position is the same as that of the first position, such as row-column coordinates (x, y), and matches the coordinate system definition of the source domain image. The fourth weight is a value calculated based on the first position of the pixel and the second position of the center point, and is used to measure the correlation of the pixel relative to the center point in the target area. The weight value is used to characterize the closeness of the relationship between the pixel and the center point. The embodiments of the present application do not limit the fourth weight, and the fourth weight can be calculated based on the distance between the pixel and the center point.
[0120] In some embodiments, for determining the fourth weight of the pixel based on the first position of the pixel in the source domain image and the second position of the center point in the source domain image in the shown step 1032, it can be implemented through steps 10321 to 10324, which will be specifically described below.
[0121] In step 10321, the size of the target area is obtained.
[0122] Here, the size is a measure of the size of the target area in the plane space. The embodiments of the present application do not limit the size of the target area. For a target area with a regular shape, such as the size of a rectangular area is the length and width of the rectangular area; such as the size of a circular area is the radius or diameter of the circular area.
[0123] In step 10322, the first position is transformed based on the size to obtain the transformed first position, and the second position is transformed based on the size to obtain the transformed second position.
[0124] Here, the transformation is a mathematical operation. Through specific rules, the original position information (i.e., the first position and the second position) is adjusted according to the size of the target region to obtain the new position information (i.e., the transformed first position and the transformed second position). The embodiments of the present application do not limit the transformation method. The transformation method can be scaling, translation, etc., which are used to reposition the position information in a specific scale or space. The transformed first position is the new position obtained by performing a transformation operation on the original first position of the pixel in the source domain image based on the size of the target region, reflecting the spatial coordinates of the pixel after adjustment.
[0125] In some embodiments, the above "transforming the first position based on the size to obtain the transformed first position" can be implemented in the following way: when the target region is a rectangular region, the length and height of the rectangular region are determined based on the size; the ratio of the abscissa in the first position to the length is determined as the transformed abscissa; the ratio of the ordinate in the first position to the height is determined as the transformed ordinate; the transformed abscissa and the transformed ordinate are combined to obtain the transformed first position.
[0126] See Figure 10 , Figure 10 is the first schematic diagram of the regional position transformation provided by the embodiments of the present application. As Figure 10 shown, the rectangular region 1001 on the source domain image contains the pixel corresponding to the center point 1002. The size of the rectangular region 1001 is W*H, the position of the center point 1002 is (W / 2, H / 2), and the size of the pixel corresponding to the center point 1002 is 1*1. Here, W is the width of the rectangular region 1001, H is the height of the rectangular region 1001. The width is the length of the rectangular region 1001 in the horizontal direction, and the height is the length of the rectangular region 1001 in the vertical direction. The ratio of the abscissa of the position of each pixel on the source domain image to the length is determined as the abscissa of the transformed pixel, and the ratio of the ordinate of the position of each pixel on the source domain image to the height is determined as the ordinate of the transformed pixel, obtaining a new rectangular region 1003. The size of the rectangular region 1003 is 1*1, and the coordinates of the center point 1004 included in the rectangular region 1003 are (1 / 2, 1 / 2), and the size of the pixel corresponding to the center point 1004 is 1 / W*1 / H.
[0127] Exemplarily, the ratio of the abscissa at the first position (such as (4, 6)) to the length (such as 20) is determined as the transformed abscissa (such as 0.2); the ratio of the ordinate at the first position to the height (such as 20) is determined as the transformed ordinate (such as 0.3); the transformed abscissa and the transformed ordinate are combined to obtain the transformed first position (such as (0.2, 0.3)).
[0128] Continuing with the above embodiments, the above "transforming the first position based on the size to obtain the transformed first position" can be implemented in the following manner: when the target area is a circular area, the diameter of the circular area is determined based on the size; the ratio of the abscissa at the first position to the diameter is determined as the transformed abscissa; the ratio of the ordinate at the first position to the diameter is determined as the transformed ordinate; the transformed abscissa and the transformed ordinate are combined to obtain the transformed first position.
[0129] See Figure 11 , Figure 11 is the second schematic diagram of the regional position transformation provided by the embodiments of the present application. As Figure 11 shown, the circular area 1101 on the source domain image contains the pixel corresponding to the center point 1102. The diameter of the circular area 1101 is D, the position of the center point 1102 is (R / 2, R / 2), and the size of the pixel corresponding to the center point 1102 is 1*1, where R is the radius of the circular area 1101 and R = D / 2. The ratio of the abscissa of the position of each pixel on the source domain image to the diameter is determined as the transformed abscissa of the pixel, and the ratio of the ordinate of the position of each pixel on the source domain image to the diameter is determined as the transformed ordinate of the pixel, obtaining a new circular area 1103. The diameter of the circular area 1103 is 1, and the coordinates of the center point 1104 included in the circular area 1103 are (1 / 2, 1 / 2), and the size of the pixel corresponding to the center point 1104 is 1 / D*1 / D.
[0130] Exemplarily, the ratio of the abscissa at the first position (such as (4, 6)) to the diameter (such as 20) is determined as the transformed abscissa (such as 0.2); the ratio of the ordinate at the first position to the diameter (such as 20) is determined as the transformed ordinate (such as 0.3); the transformed abscissa and the transformed ordinate are combined to obtain the transformed first position (such as (0.2, 0.3)).
[0131] Continuing with the above embodiments, the steps of the above "transforming the second position based on the size to obtain the transformed second position" are similar to the steps of the above "transforming the first position based on the size to obtain the transformed first position", and will not be elaborated here.
[0132] In step 10323, based on the transformed first position and the transformed second position, a weight coefficient is determined.
[0133] Here, the weight coefficient is a value calculated based on the transformed first position and the transformed second position, and is used to characterize the importance of pixels close to the center point. The embodiments of the present application do not limit the weight coefficient. For example, the weight coefficient can be the distance between the transformed first position and the transformed second position.
[0134] In some embodiments, step 10323 can be implemented in the following manner: determining the distance between the transformed first position and the transformed second position; based on the distance, performing an update process on a preset coefficient, and determining the updated preset coefficient as the weight coefficient.
[0135] Here, the distance is a spatial interval measure between the transformed first position and the transformed second position, and is used to reflect the spatial relationship between the pixel and the center point after position transformation. The embodiments of the present application do not limit the calculation method of the distance. The distance can be the Euclidean distance, Manhattan distance, etc. The preset coefficient is a preset value and serves as the starting value in the process of determining the weight coefficient. The weight coefficient is the value obtained after updating the preset coefficient and is used to represent the weight of the pixel brightness.
[0136] In some embodiments, the above "determining the distance between the transformed first position and the transformed second position" can be implemented in the following manner: determining a first difference between the abscissa of the transformed first position and the abscissa of the transformed second position; determining a second difference between the ordinate of the transformed first position and the ordinate of the transformed second position, adding the square of the first difference and the square of the second difference to obtain a sum of squares; and determining the square root of the sum of squares as the distance between the transformed first position and the transformed second position.
[0137] For example, determining a first difference (such as 0.5) between the abscissa of the transformed first position (such as (0.6, 0.6)) and the abscissa of the transformed second position (such as (0.2, 0.2)); determining a second difference (such as 0.5) between the ordinate of the transformed first position and the ordinate of the transformed second position, adding the square of the first difference and the square of the second difference to obtain a sum of squares (such as 0.5); and determining the square root of the sum of squares as the distance between the transformed first position and the transformed second position (such as 0.71).
[0138] In some embodiments, the above "performing an update process on a preset coefficient and determining the updated preset coefficient as the weight coefficient" can be implemented in the following manner: determining the difference (such as 0.29) between the preset coefficient (such as 1) and the distance (such as 0.71) as the weight coefficient.
[0139] In the embodiments of the present application, the weight coefficient is dynamically adjusted by calculating the distance between pixel positions, so that the weight of each pixel can be adjusted according to the relative position of the pixel to the center point, reflecting the spatial relationship between pixels and avoiding errors that may be caused by fixed weights.
[0140] In step 10324, the product of the preset weight and the weight coefficient is determined as the fourth weight of the pixel.
[0141] Here, the preset weight is a preset value used to represent a basic weight value assigned to a pixel before considering the weight coefficient calculated based on the positional relationship between the transformed first position and the transformed second position.
[0142] Exemplarily, the product (such as 0.29) of the preset weight (such as 1) and the weight coefficient (such as 0.29) is determined as the fourth weight of the pixel.
[0143] In the embodiments of the present application, the position is transformed based on the size of the target region to accurately adjust local details. At the same time, by combining the preset weight with the dynamically calculated weight coefficient, the accuracy of image processing is improved.
[0144] In step 1033, the fourth weights corresponding to multiple pixels in the target region are combined to obtain the first weight of the target object in the source domain image.
[0145] It should be noted that the order of combining the fourth weights corresponding to multiple pixels in the target region is the same as the order of calculating the fourth weight of each pixel.
[0146] Exemplarily, the fourth weights corresponding to multiple pixels are concatenated (for example, the fourth weight of pixel A at the position (0, 0) in the target region of the source domain image is 0.5, the fourth weight of pixel B at the position (0, 1) in the target region of the source domain image is 0.2, the fourth weight of pixel C at the position (1, 0) in the target region of the source domain image is 0.4, and the fourth weight of pixel D at the position (1, 1) in the target region of the source domain image is 0.5) to obtain the first weight of the target object in the source domain image (such as [[0.5, 0.2], [0.4, 0.5]]).
[0147] Through the embodiments of the present application, after determining the target region and the center point, the weights of the pixels in the target region are calculated one by one. At the same time, by combining the weights, the overall weight of the target object is obtained, avoiding complex calculations for the entire image and improving the calculation efficiency.
[0148] Continue to refer to Figure 3, in step 104, based on the first weight, determine the second weight of the target object in the brightness-enhanced image and the third weight of the target object in the target-domain image.
[0149] Here, the second weight is used to measure the importance of the target object in the brightness-enhanced image. The third weight is used to measure the importance of the target object in the target-domain image.
[0150] In some embodiments, step 104 can be implemented in the following manner: determine the first weight of the target object in the source-domain image as the second weight of the target object in the brightness-enhanced image, and determine the difference between the preset weight and the first weight of the target object in the source-domain image as the third weight of the target object in the target-domain image.
[0151] For example, determine the first weight of the target object in the source-domain image (such as 0.4) as the second weight of the target object in the brightness-enhanced image, and determine the difference between the preset weight (such as 1) and the first weight of the target object in the source-domain image (such as 0.6) as the third weight of the target object in the target-domain image.
[0152] In step 105, based on the second weight and the third weight, fuse the brightness-enhanced image and the target-domain image to obtain a fused image.
[0153] Here, fusion is the process of combining the brightness-enhanced image and the target-domain image into a new image according to certain rules. In this process, the second weight and the third weight are used to determine the fusion ratio of the target object parts in the two images.
[0154] In some embodiments, refer to Figure 12 , Figure 12 is the fourth process schematic diagram of the image processing method provided by the embodiments of the present application. Figure 3 shown in step 105, can be implemented through Figure 12 steps 1051 to 1053 below, which will be specifically described.
[0155] In step 1051, based on the second weight, perform an update process on the brightness-enhanced image to obtain an updated brightness-enhanced image.
[0156] Here, the update process is an adjustment operation performed on the brightness-enhanced image based on the second weight. The embodiments of the present application do not limit the manner of the update process. The update process adjusts the pixels in the region related to the target object in the brightness-enhanced image and updates the brightness of the pixel according to the second weight.
[0157] In some embodiments, step 1051 may be implemented as follows: In the brightness-enhanced image, determine the pixels to be updated included in the region where the target object is located; determine the product of the brightness of the pixel to be updated and the second weight corresponding to the pixel to be updated; replace the brightness of the pixel to be updated in the brightness-enhanced image with the product, and determine the brightness-enhanced image after replacement as the updated brightness-enhanced image.
[0158] Here, the region where the target object is located is a specific region that includes the target object in the brightness-enhanced image. The embodiments of the present application do not limit the region where the target object is located, and the shape of the region where the target object is located may be rectangular, circular, etc. The pixel to be updated is a pixel point located within the region where the target object is located. Each pixel to be updated corresponds to a brightness and a second weight. The second weight is used to measure the importance of the pixel to be updated in the region where the target object is located in the brightness-enhanced image.
[0159] For example, in the brightness-enhanced image (such as [[5, 2, 3], [4, 5, 6], [3, 5, 3]]), determine the pixels to be updated included in the region where the target object is located (such as [[5, 2], [4, 5]]) (that is, pixel A at the coordinate position (0, 0) in the brightness-enhanced image, the brightness of pixel A is 5, pixel B at the coordinate position (0, 1) in the brightness-enhanced image, the brightness of pixel B is 2, pixel C at the coordinate position (1, 0) in the brightness-enhanced image, the brightness of pixel C is 4, pixel D at the coordinate position (1, 1) in the brightness-enhanced image, the brightness of pixel C is 5); determine the product of the brightness of the pixel to be updated and the second weight corresponding to the pixel to be updated (such as the product of the brightness of pixel A (such as 5) and the corresponding second weight of pixel A (such as 0.8) is 4, the product of the brightness of pixel B (such as 2) and the corresponding second weight of pixel B (such as 0.5) is 1, the product of the brightness of pixel C (such as 4) and the corresponding second weight of pixel C (such as 0.5) is 2, the product of the brightness of pixel D (such as 5) and the corresponding second weight of pixel D (such as 0.4) is 2); replace the brightness of the pixel to be updated in the brightness-enhanced image with the product, and determine the brightness-enhanced image after replacement as the updated brightness-enhanced image (such as [[4, 1, 3], [2, 2, 6], [3, 5, 3]]).
[0160] In the embodiments of the present application, by determining the pixels to be updated in the region where the target object is located and calculating the product of the brightness of the pixel to be updated and the weight to update the brightness, the brightness of the target region can be enhanced more precisely, and at the same time, over-enhancement of the background or other non-target regions can be avoided. By only processing the pixels in the target region instead of making a global adjustment to the entire image, the amount of calculation is reduced, and the efficiency of image processing is improved.
[0161] In step 1052, based on the third weight, the target domain image is updated to obtain an updated target domain image.
[0162] In some embodiments, step 1052 is similar to step 1051 and will not be elaborated here.
[0163] In step 1053, the updated brightness-enhanced image and the updated target domain image are fused to obtain a fused image.
[0164] In some embodiments, step 1053 can be implemented in the following manner: in the updated brightness-enhanced image, a first image to be fused associated with the target object is extracted, and in the updated target domain image, a second image to be fused associated with the target object is extracted; the image in the updated target domain image except the second image to be fused is determined as a third image to be fused; the first image to be fused and the second image to be fused are subjected to pixel-by-pixel summation processing to obtain a fourth image to be fused, and the third image to be fused and the fourth image to be fused are spliced to obtain a fused image.
[0165] Here, the first image to be fused is the part associated with the target object extracted from the updated brightness-enhanced image. The second image to be fused is the part associated with the target object extracted from the updated target domain image. The third image to be fused is the part of the updated target domain image except the second image to be fused, that is, the remaining image content in the target domain image excluding the part associated with the target object. The pixel-by-pixel summation processing is to add the pixel values of each pair of corresponding pixels in the two images to obtain a new pixel value. The fourth image to be fused is the image obtained by performing pixel-by-pixel summation processing on the first image to be fused and the second image to be fused.
[0166] In some embodiments, the above “the first image to be fused and the second image to be fused are subjected to pixel-by-pixel summation processing to obtain a fourth image to be fused” can be implemented in the following manner: for each first pixel to be fused in the first image to be fused, a second pixel to be fused associated with the pixel in the second image to be fused is determined based on the first pixel to be fused, where the position of the second pixel to be fused in the second image to be fused is the same as the position of the first pixel to be fused in the first image to be fused; the first pixel to be fused and the second pixel to be fused are added to obtain a fourth pixel to be fused, and multiple fourth pixels to be fused are spliced to obtain a fourth image to be fused.
[0167] Exemplarily, given that the target object is a cat, in the updated brightness-enhanced image, the part associated with the cat is extracted as the first image to be fused. For example, the first image to be fused only contains the outline of the cat. In the updated target domain image, the part associated with the cat is extracted as the second image to be fused. We determine the part of the updated target domain image other than the second image to be fused as the third image to be fused. This part of the image includes the background other than the cat, as well as other objects, etc. Perform a pixel-by-pixel summation process on the first image to be fused and the second image to be fused. For the corresponding pixels in the two images, add the pixel values of the two corresponding pixels to obtain a new pixel value. Concatenate the multiple obtained new pixel values to obtain the fourth image to be fused. Concatenate the third image to be fused and the fourth image to be fused to obtain the fused image.
[0168] In the embodiments of the present application, by extracting the image regions associated with the target object (i.e., the first image to be fused and the second image to be fused), and performing a pixel-by-pixel summation process, the brightness and contrast of the target object are enhanced. By retaining the part of the updated target domain image other than the target object (i.e., the third image to be fused), and concatenating it with the processed target object region (i.e., the fourth image to be fused), the integrity of the background information is maintained, the loss of background information is avoided, and the target object is highlighted.
[0169] Next, an exemplary application of the image processing method provided in the embodiments of the present application in an actual application scenario will be described.
[0170] In the related art, the human eye is very sensitive to slight color changes and light and dark contrast changes in text such as subtitles and / or colors. Since the method of performing inverse mapping processing on low-dynamic-range images cannot adapt to different lighting conditions and complex scenes, the content of the transformed image is over-enhanced, especially in areas such as the face, subtitles, and slogans (i.e., the above-mentioned target objects) of low-dynamic-range images, resulting in a mismatch in brightness or color between the content of this area and the content in the high-dynamic-range image, reducing the accuracy of generating high-dynamic-range images.
[0171] To solve the above problems, the embodiments of the present application propose an image processing method. After performing inverse tone mapping on a low-dynamic-range image, the content such as the face and subtitles of the low-dynamic-range image is incorporated into the high-dynamic-range image, which not only solves the problem of brightness mismatch between the incorporated content and the content in the high-dynamic-range image, but also solves the problem of brightness flicker caused by missed detection of faces and text.
[0172] Taking image processing as an example, refer to Figure 13 , Figure 13 which is a schematic diagram of the image processing flow provided by the embodiments of the present application. The following explains the image processing flow provided by the embodiments of the present application.
[0173] In step 1301, perform inverse tone mapping (i.e., the above-mentioned tone mapping) on the low dynamic range image (i.e., the above-mentioned source domain image) to obtain a high dynamic range image (i.e., the above-mentioned target domain image).
[0174] Here, the inverse tone mapping method can be a method based on traditional image processing or a method based on deep learning. The high dynamic range image is in the BT.2020 color gamut. Using the Perceptual Quantizer (PQ) transfer curve, map the linear light luminance of the high dynamic range image to a non-linear coding value. Use the BT.2020 Non-Constant Luminance (NCL) matrix coefficients to convert the high dynamic range image in Red-Green-Blue (RGB) format to a high dynamic range image in Luminance-Chrominance Blue -Chrominance Red (YUV) format. Among them, the BT.2020 color gamut is a wide color gamut standard that can cover a wide range of color ranges.
[0175] In step 1302, perform color space conversion on the high dynamic range image to obtain a high dynamic range image after color space conversion.
[0176] Here, convert the high dynamic range image from YUV format to RGB format. Determine the standard corresponding to this color space according to the color space used by the high dynamic range image, and perform the conversion with reference to the method corresponding to this standard. For example, for a high dynamic range image, use the method corresponding to the International Telecommunication Union (ITU) BT.2020 standard to perform color space conversion on a high dynamic range image with a specific bit depth (such as 10 bits), as shown in Equation 1.
[0177]
[0178]
[0179] (1)
[0180] Among them, Y (Luminance) represents the brightness of the image, used to characterize the light and dark of the image, U (ChrominanceBlue) represents the blue chrominance component, which is the color information related to blue, V (Chrominance Red) represents the red chrominance component, which is the color information related to red, R represents the value of the red channel in the RGB format image, the range of R is from 0 to 1023, G represents the value of the green channel in the RGB format image, the range of G is from 0 to 1023, B represents the value of the blue channel in the RGB format image, and the range of B is from 0 to 1023.
[0181] In step 1303, the low-dynamic range image is subjected to color space conversion to obtain the low-dynamic range image after color space conversion.
[0182] Here, the low-dynamic range image is converted from the YUV format to the RGB format. The standard corresponding to this color space is determined according to the color space used by the low-dynamic range image, and the conversion is performed with reference to the method corresponding to this standard. For example, for the low-dynamic range image, the method corresponding to the ITU BT.709 standard is used to perform color space conversion on the low-dynamic range image, as shown in Formula 2.
[0183]
[0184]
[0185] (2)
[0186] In step 1304, the high-dynamic range image after color space conversion is subjected to optoelectronic transfer characteristic conversion.
[0187] Here, the non-linear brightness value of the high-dynamic range image after color space conversion is converted into a linearized brightness value, and the conversion is performed according to the method corresponding to the optoelectronic transfer characteristic standard used by the high-dynamic range image. For example, for the high-dynamic range image after color space conversion, the method corresponding to the PQ standard is used to perform optoelectronic transfer characteristic conversion on the high-dynamic range image after color space conversion, as shown in Formula 3.
[0188] (3)
[0189] Among them, Y represents the brightness of the image display, represents the non-linear value of the brightness of the image display, represents , represents , represents , represents , Indicate 。
[0190] In step 1305, perform photoelectric transfer characteristic conversion on the low dynamic range image after color space conversion.
[0191] Here, convert the non-linear brightness value of the low dynamic range image after color space conversion into a linearized brightness value, and perform the conversion according to the method corresponding to the photoelectric transfer characteristic standard used for the low dynamic range image. For example, for the low dynamic range image after color space conversion, use the method corresponding to the ITU BT.709 standard to perform photoelectric transfer characteristic conversion on the low dynamic range image after color space conversion, as shown in Equation 4.
[0192] (4)
[0193] Among them, Y represents the brightness of the image display, represents the non-linear value of the brightness of the image display.
[0194] In step 1306, perform gamut conversion on the low dynamic range image after photoelectric transfer characteristic conversion.
[0195] Here, convert the low dynamic range image after photoelectric transfer characteristic conversion from the current gamut to the gamut where the high dynamic range image is located. For the low dynamic range image after photoelectric transfer characteristic conversion, use the method corresponding to the ITU BT.2087 standard to convert the low dynamic range image after photoelectric transfer characteristic conversion from the current gamut to the gamut where the high dynamic range image is located, and obtain the low dynamic range image after gamut conversion. The method corresponding to the BT.2087 standard is shown in Equation 5.
[0196] (5)
[0197] Here, represents the brightness values of the low dynamic range image after photoelectric transfer characteristic conversion on the red, green, and blue channels, represents the brightness values of the low dynamic range image after gamut conversion on the red, green, and blue channels.
[0198] In step 1307, calculate the brightness of the high dynamic range image after photoelectric transfer characteristic conversion.
[0199] Here, use the coefficients specified by the BT.2020 standard to calculate the brightness of the high dynamic range image after photoelectric transfer characteristic conversion as shown in Equation 6.
[0200] (6)
[0201] Among them, Represents the luminance of the high-dynamic range image after the conversion of the optoelectronic transmission characteristics. Represents the luminance of the high-dynamic range image in the red channel after the conversion of the optoelectronic transmission characteristics. Represents the luminance of the high-dynamic range image in the green channel after the conversion of the optoelectronic transmission characteristics. Represents the luminance of the high-dynamic range image in the blue channel after the conversion of the optoelectronic transmission characteristics.
[0202] In step 1308, calculate the luminance of the low-dynamic range image after gamut conversion (i.e., the luminance of the above-mentioned pixel).
[0203] Here, use the coefficients specified by the BT.2020 standard to calculate the luminance of the low-dynamic range image after gamut conversion. .
[0204] In step 1309, calculate the luminance boosting factor (i.e., the above-mentioned candidate boosting factor).
[0205] Here, the luminance boosting factor is an image matrix, and the size of the luminance boosting factor is the same as the size of the low-dynamic range image after gamut conversion. Each pixel corresponds to the luminance boosting factor in the image matrix corresponding to that pixel as shown in Equation 7.
[0206] (7)
[0207] Here, Represents the luminance of the high-dynamic range image after the conversion of the optoelectronic transmission characteristics. Represents the luminance of the low-dynamic range image after gamut conversion, and r represents the luminance boosting factor.
[0208] In step 1310, perform filtering on the luminance boosting factor to obtain the filtered luminance boosting factor (i.e., the above-mentioned luminance factor).
[0209] Here, use guided filtering to perform edge-preserving smoothing filtering on the boosting factor, and the filtering radius is a preset radius (such as 11).
[0210] In step 1311, boost the low-dynamic range image after gamut conversion (i.e., the above-mentioned pixel).
[0211] Here, boosting the low-dynamic range image after gamut conversion is as shown in Equation 8.
[0212] (8)
[0213] Among them, r represents the luminance boosting factor. Represents the luminance of the low-dynamic range image after gamut conversion (i.e., the luminance of the above-mentioned pixel). Represents the luminance of the boosted low-dynamic range image.
[0214] In step 1312, perform region of interest detection on the low dynamic range image after color space conversion.
[0215] Here, detect content such as human faces, captions, slogans, etc. (i.e., the above-mentioned target objects) in the low dynamic range image after color space conversion, and output the position information Proi of the content of the detected region of interest (i.e., the above-mentioned target region). Proi can be in the form of a detection box (Bounding Box) or a mask (Mask), etc.
[0216] In step 1313, calculate the fusion weight of each pixel point in the low dynamic range image after color space conversion according to the position information of the content of the detected region of interest.
[0217] Here, the fusion weight is set to 1 at the center point position of the region of interest, the fusion weight is set to 0 at the four perimeter boundary positions of the region of interest, and the weights at other positions within the region of interest are linearly smoothed between the weights at the center point and the four perimeter boundary positions according to the spatial distance.
[0218] Taking the region of interest as a rectangular detection box as an example for illustration, the width and height of the detection box are w and h respectively (i.e., the above-mentioned dimensions), the center point coordinates are ( , ), the coordinates of the current position are (x, y), then the weight of the current position is as shown in formula 9.
[0219]
[0220] (9)
[0221] Among them, the max function is used to select the maximum value between the input parameters, w represents the width of the detection box, h represents the height of the detection box, ( , ) represents the center point coordinates (i.e., the above-mentioned second position), (x, y) represents the coordinates of the current position (i.e., the above-mentioned first position), ( , ) represents the current position after position transformation (i.e., the above-mentioned transformed first position), ( , ) represents the position of the center point after position transformation (i.e., the above-mentioned transformed second position).
[0222] In step 1314, fuse the brightened low dynamic range image and the high dynamic range image after optoelectronic transmission characteristic conversion.
[0223] Here, the fusion weight of each pixel in the low-dynamic-range image after color space conversion is determined as the fusion weight of the brightened low-dynamic-range image (i.e., the first weight above). The brightened low-dynamic-range image and the high-dynamic-range image after optoelectronic transfer characteristic conversion are fused as shown in Equation 10.
[0224] (10)
[0225] Among them, represents the brightened low-dynamic-range image, represents the high-dynamic-range image after optoelectronic transfer characteristic conversion, w represents the fusion weight of the brightened low-dynamic-range image (i.e., the second weight above), 1 - w represents the fusion weight of the high-dynamic-range image after optoelectronic transfer characteristic conversion (i.e., the third weight above), and I represents the fused image (i.e., the above-mentioned fused image).
[0226] In step 1315, the fused image is non-linearized.
[0227] Here, according to the requirements of the output image for optoelectronic transfer characteristics, the fused image is subjected to optoelectronic transfer characteristic conversion, and the linear image I is converted into a non-linear image I to obtain a non-linearized fused image. The fused image is non-linearized according to the method corresponding to the PQ standard as shown in Equation 11.
[0228] (11)
[0229] Among them, Y represents the brightness displayed by the fused image, represents the non-linear value of the brightness displayed by the fused image (i.e., to the power), , , , , .
[0230] In step 1316, the non-linearized fused image is subjected to color space conversion.
[0231] Here, the non-linearized fused image is subjected to color space conversion, and the non-linearized fused image is converted into YUV data corresponding to the corresponding color space according to the BT.2020 NCL conversion method specified by the BT.2020 standard.
[0232] In summary, in the embodiment of the present application, the content of a specific region of interest in a low-dynamic range image is incorporated into a high-dynamic range image obtained by inverse tone mapping of the low-dynamic range image, so as to maintain the optimized effect of the region of interest content or a specific artistic style. The content of the low-dynamic range image is brightened according to the brightness of the high-dynamic range image, so as to achieve the coordination and consistency of the incorporated low-dynamic range image content with the surrounding high-dynamic range image content in terms of brightness, and solve the problem of sudden brightness change of the region of interest in the front and back frames caused by missed detection of the region of interest detection algorithm in the case of not brightening.
[0233] Next, the exemplary structure of the software module implementation of the image processing device 555 provided in the embodiment of the present application will be further described. In some embodiments, as Figure 2 shown, the software module in the image processing device 555 stored in the memory 550 may include:
[0234] A data acquisition module 5551, configured to acquire a source domain image and perform tone mapping on the source domain image to obtain a target domain image.
[0235] A brightness enhancement module 5552, configured to perform brightness enhancement on the source domain image to obtain a brightness-enhanced image.
[0236] An image fusion module 5553, configured to identify a target object in the source domain image and determine a first weight of the target object in the source domain image; based on the first weight, determine a second weight of the target object in the brightness-enhanced image and a third weight of the target object in the target domain image; based on the second weight and the third weight, fuse the brightness-enhanced image and the target domain image to obtain a fused image.
[0237] In some embodiments, the image fusion module 5553 is further configured to perform update processing on the brightness-enhanced image based on the second weight to obtain an updated brightness-enhanced image; perform update processing on the target domain image based on the third weight to obtain an updated target domain image; fuse the updated brightness-enhanced image and the updated target domain image to obtain a fused image.
[0238] In some embodiments, the image fusion module 5553 is further configured to determine, in the brightness-enhanced image, the pixels to be updated included in the region where the target object is located; determine the product of the brightness of the pixels to be updated and the second weight corresponding to the pixels to be updated; replace the brightness of the pixels to be updated in the brightness-enhanced image with the product, and determine the replaced brightness-enhanced image as the updated brightness-enhanced image.
[0239] In some embodiments, the image fusion module 5553 is further configured to extract a first image to be fused associated with the target object from the updated brightness-enhanced image, and extract a second image to be fused associated with the target object from the updated target domain image; determine an image other than the second image to be fused in the updated target domain image as a third image to be fused; perform pixel-by-pixel summation processing on the first image to be fused and the second image to be fused to obtain a fourth image to be fused, and splice the third image to be fused and the fourth image to be fused to obtain a fused image.
[0240] In some embodiments, the image fusion module 5553 is further configured to determine the target area and the center point of the target area of the target object in the source domain image; perform the following processing on each pixel in the target area: determine the fourth weight of the pixel based on the first position of the pixel in the source domain image and the second position of the center point in the source domain image; combine the fourth weights corresponding to multiple pixels in the target area to obtain the first weight of the target object in the source domain image.
[0241] In some embodiments, the image fusion module 5553 is further configured to obtain the size of the target area; transform the first position based on the size to obtain the transformed first position, and transform the second position based on the size to obtain the transformed second position; determine the weight coefficient based on the transformed first position and the transformed second position; determine the product of the preset weight and the weight coefficient as the fourth weight of the pixel.
[0242] In some embodiments, the image fusion module 5553 is further configured to determine the distance between the transformed first position and the transformed second position; update the preset coefficient based on the distance, and determine the updated preset coefficient as the weight coefficient.
[0243] In some embodiments, the brightness enhancement module 5552 is further configured to perform the following processing on each pixel in the source domain image to determine the target pixel corresponding to the pixel in the target domain image, where the position of the target pixel in the target domain image is the same as the position of the pixel in the source domain image; enhance the brightness of the pixel based on the target pixel to obtain the enhanced pixel; combine multiple enhanced pixels in the source domain image to obtain a brightness-enhanced image.
[0244] In some embodiments, the brightness enhancement module 5552 is further configured to determine the brightness factor based on the target pixel and the pixel; determine the product of the brightness of the pixel and the brightness factor; replace the brightness of the pixel with the product, and determine the pixel after replacing the brightness as the enhanced pixel.
[0245] In some embodiments, the brightness enhancement module 5552 is further configured to determine the ratio of the brightness of the target pixel to the brightness of the pixel as a candidate brightness factor; perform filtering processing on the candidate brightness factor, and determine the filtered candidate brightness factor as the brightness factor.
[0246] In some embodiments, the data acquisition module 5551 is further configured to obtain a plurality of sample images belonging to the target domain, and extract the sample hues of each sample image; fuse the plurality of sample hues to obtain a target hue; replace the hue of the source domain image with the target hue, and determine the source domain image with the replaced hue as the target domain image.
[0247] An embodiment of the present application provides a computer program product, which includes computer-executable instructions or a computer program. The computer-executable instructions or the computer program are stored in a computer-readable storage medium. The processor of the electronic device reads the computer-executable instructions from the computer-readable storage medium, and the processor executes the computer-executable instructions, so that the electronic device executes the image processing method described above in the embodiments of the present application.
[0248] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions or a computer program are stored. When the computer-executable instructions or the computer program are executed by a processor, the processor will be caused to execute the image processing method provided in the embodiments of the present application. For example, Figure 3 the image processing method shown.
[0249] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disc, or CD-ROM; or it may be various devices including one or any combination of the above memories.
[0250] In some embodiments, the computer-executable instructions may be in the form of a program, software, software module, script, or code, and may be written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including being deployed as an independent program or being deployed as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0251] As an example, the computer-executable instructions may or may not correspond to files in the file system, and may be stored as part of a file that stores other programs or data. For example, they may be stored in one or more scripts in a Hyper Text Markup Language (HTML) document, stored in a single file dedicated to the program being discussed, or stored in multiple cooperating files (for example, files that store one or more modules, subroutines, or code portions).
[0252] As an example, computer executable instructions or computer programs may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.
[0253] In summary, tone mapping is performed on the source domain image to obtain the target domain image. In this way, the source domain image is migrated from the source domain to the target domain through tone mapping, so that the target domain image obtained after tone mapping is consistent with the target domain in tone, avoiding the problem of tone mismatch; the source domain image is brightness enhanced to obtain a brightness enhanced image. In this way, overexposure or underexposure is avoided by adjusting the brightness of the source domain image; the target object in the source domain image is identified, and the first weight of the target object in the source domain image is determined. Based on the first weight, the second weight of the target object in the brightness enhanced image and the third weight of the target object in the target domain image are determined. Based on the second weight and the third weight, the brightness enhanced image and the target domain image are fused to obtain a fused image. In this way, in the process of fusing the brightness enhanced image and the target domain image, the brightness of the target object in the fused image is adjusted in a targeted manner to improve the accuracy of the generated fused image, thereby further improving the accuracy of image processing.
[0254] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. An image processing method, characterized in that: The method comprises: Acquire a source domain image, and perform tone mapping on the source domain image to obtain a target domain image; Performing brightness enhancement on the source domain image to obtain a brightness enhanced image; Identifying a target object in the source domain image, and determining a target region of the target object in the source domain image and a center point of the target region; The following processing is performed for each pixel in the target area: obtaining the size of the target area; transforming the first position of the pixel in the source domain image based on the size to obtain the transformed first position, and transforming the second position of the center point in the source domain image based on the size to obtain the transformed second position; determining a weight coefficient based on the transformed first position and the transformed second position; and determining the product of a preset weight and the weight coefficient as a fourth weight of the pixel; Combining fourth weights respectively corresponding to a plurality of pixels in the target area to obtain a first weight of the target object in the source domain image; Based on the first weight, determining a second weight of the target object in the brightness enhanced image and a third weight of the target object in the target domain image; Based on the second weight and the third weight, the brightness enhanced image and the target domain image are fused to obtain a fused image.
2. The method according to claim 1, characterized in that The fusing the brightness enhanced image and the target domain image based on the second weight and the third weight to obtain a fused image includes: Based on the second weight, updating the brightness enhanced image to obtain the updated brightness enhanced image; Based on the third weight, updating the target domain image to obtain an updated target domain image; The updated brightness enhanced image and the updated target domain image are fused to obtain the fused image.
3. The method according to claim 2, characterized in that The updating process of the brightness enhanced image based on the second weight to obtain the updated brightness enhanced image includes: In the brightness enhanced image, determining pixels to be updated included in the area where the target object is located; Determine the product of the brightness of the pixel to be updated and the second weight corresponding to the pixel to be updated; The brightness of the pixel to be updated in the brightness enhanced image is replaced by the product, and the brightness enhanced image after the replacement is determined as the updated brightness enhanced image.
4. The method according to claim 2, characterized in that: The fusing the updated brightness enhanced image and the updated target domain image to obtain the fused image includes: Extracting a first image to be fused associated with the target object from the updated brightness enhanced image, and extracting a second image to be fused associated with the target object from the updated target domain image; Determining the images other than the second image to be fused in the updated target domain image as the third image to be fused; The first image to be fused and the second image to be fused are added pixel by pixel to obtain a fourth image to be fused, and the third image to be fused and the fourth image to be fused are spliced to obtain the fused image.
5. The method according to claim 1, characterized in that The determining a weight coefficient based on the transformed first position and the transformed second position includes: determining a distance between the transformed first position and the transformed second position; Based on the distance, the preset coefficient is updated, and the updated preset coefficient is determined as the weight coefficient.
6. The method according to claim 1, characterized in that The step of performing brightness enhancement on the source domain image to obtain a brightness enhanced image includes: The following processing is performed for each pixel in the source domain image: Determining a target pixel in the target domain image that corresponds to the pixel, wherein a position of the target pixel in the target domain image is the same as a position of the pixel in the source domain image; Based on the target pixel, enhancing the brightness of the pixel to obtain the enhanced pixel; The plurality of enhanced pixels in the source domain image are combined to obtain the brightness enhanced image.
7. The method according to claim 6, characterized in that Based on the target pixel, enhancing the brightness of the pixel to obtain the enhanced pixel, comprising: Determining a brightness factor based on the target pixel and the pixel; Determining the product of the brightness of the pixel and the brightness factor; The brightness of the pixel is replaced by the product, and the pixel after the brightness is replaced is determined as the enhanced pixel.
8. The method according to claim 7, characterized in that The step of determining a brightness factor based on the target pixel and the pixel comprises: Determine a ratio of the brightness of the target pixel to the brightness of the pixel as a candidate brightness factor; The candidate brightness factor is filtered and the filtered candidate brightness factor is determined as the brightness factor.
9. The method according to any one of claims 1 to 8, characterized in that: The step of performing tone mapping on the source domain image to obtain a target domain image includes: Acquire a plurality of sample images belonging to the target domain, and extract a sample hue of each of the sample images; Merging a plurality of the sample tones to obtain a target tones; The hue of the source domain image is replaced with the target hue, and the source domain image after the hue is replaced is determined as the target domain image.
10. An image processing device, characterized in that: The device comprises: A data acquisition module, used to acquire a source domain image and perform tone mapping on the source domain image to obtain a target domain image; A brightness enhancement module, used to perform brightness enhancement on the source domain image to obtain a brightness enhanced image; An image fusion module is used to identify a target object in the source domain image, and determine a target area of the target object in the source domain image and a center point of the target area; perform the following processing for each pixel in the target area: obtain the size of the target area; transform a first position of the pixel in the source domain image based on the size to obtain the transformed first position, and transform a second position of the center point in the source domain image based on the size to obtain the transformed second position; determine a weight coefficient based on the transformed first position and the transformed second position; determine the product of a preset weight and the weight coefficient as a fourth weight of the pixel; combine the fourth weights corresponding to a plurality of pixels in the target area to obtain a first weight of the target object in the source domain image; determine a second weight of the target object in the brightness enhanced image and a third weight of the target object in the target domain image based on the first weight; fuse the brightness enhanced image and the target domain image based on the second weight and the third weight to obtain a fused image.
11. The device according to claim 10, characterized in that The image fusion module is also used for: determining a distance between the transformed first position and the transformed second position; Based on the distance, the preset coefficient is updated, and the updated preset coefficient is determined as the weight coefficient.
12. The device according to claim 10, characterized in that The image fusion module is also used for: Based on the second weight, updating the brightness enhanced image to obtain the updated brightness enhanced image; Based on the third weight, updating the target domain image to obtain an updated target domain image; The updated brightness enhanced image and the updated target domain image are fused to obtain the fused image.
13. The device according to claim 12, characterized in that The image fusion module is also used for: In the brightness enhanced image, determining pixels to be updated included in the area where the target object is located; Determine the product of the brightness of the pixel to be updated and the second weight corresponding to the pixel to be updated; The brightness of the pixel to be updated in the brightness enhanced image is replaced by the product, and the brightness enhanced image after the replacement is determined as the updated brightness enhanced image.
14. The device according to claim 12, characterized in that The image fusion module is also used for: Extracting a first image to be fused associated with the target object from the updated brightness enhanced image, and extracting a second image to be fused associated with the target object from the updated target domain image; Determining the images other than the second image to be fused in the updated target domain image as the third image to be fused; The first image to be fused and the second image to be fused are added pixel by pixel to obtain a fourth image to be fused, and the third image to be fused and the fourth image to be fused are spliced to obtain the fused image.
15. An electronic device, characterized in that: The electronic device comprises: A memory for storing computer executable instructions or computer programs; The processor is used to implement the image processing method according to any one of claims 1 to 9 when executing the computer executable instructions or computer programs stored in the memory.
16. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that: When the computer executable instructions or computer program are executed by a processor, the image processing method according to any one of claims 1 to 9 is implemented.
17. A computer program product comprising computer executable instructions or a computer program, characterized in that When the computer executable instructions or computer program are executed by a processor, the image processing method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Image processing method and device, and electronic equipment
CN108174118A
Image processing method and device, product, equipment and medium
CN118918051A