Multi-camera color synchronization methods, electronic devices and storage media
By performing white balance processing and mapping optimization on multi-camera devices, the problem of color differences between cameras was solved, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HONOR DEVICE CO LTD
- Filing Date
- 2024-12-30
- Publication Date
- 2026-06-30
AI Technical Summary
Due to differences in sensors, physical characteristics, and tuning styles among different cameras, multi-camera devices exhibit variations in color performance, leading to a decline in user experience.
By performing white balance processing on the initial image of the first camera, a white balance image and white points are obtained. Based on the mapping relationship, these are mapped to the initial image of the second camera and white balance processing is performed to reduce the difference in white balance decision points between the cameras. The white balance decision points of the second camera are optimized by adjusting the white correction and color compensation coefficients.
It reduces color differences between different cameras, making them less noticeable to users and improving the user experience.
Smart Images

Figure CN122317439A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to a color synchronization method, electronic device and storage medium for multiple cameras. Background Technology
[0002] In order to achieve a wider field of view and capture details at greater distances, mobile phones and other electronic devices are usually equipped with multiple cameras, such as a main camera, a wide-angle camera, and a telephoto camera. By switching between cameras, different shooting scenarios can be achieved.
[0003] Due to differences in sensors, physical characteristics, and tuning styles among different cameras, images captured by different cameras will exhibit some differences in color reproduction. These color differences are easily perceived by users, reducing the user experience when using electronic devices. Summary of the Invention
[0004] In view of the above, embodiments of this application provide a color synchronization method, electronic device, and storage medium for multiple cameras to overcome the problems of the prior art.
[0005] In a first aspect, embodiments of this application provide a color synchronization method for multiple cameras, applied to an electronic device including a first camera and a second camera. The color synchronization method includes: performing white balance processing on a first initial image of the first camera to obtain a first white balance image and a first white point; obtaining a second white point based on the first white point, wherein the second white point is closer to true white than the first white point; mapping the first white point to a second initial image of the second camera based on a first mapping relationship to obtain a third white point, wherein the first mapping relationship is used to characterize the correspondence between the white balance coordinate points of the first camera and the second camera under a preset light source; obtaining a fourth white point based on the third white point, wherein the fourth white point is closer to true white than the third white point; mapping the first white point to the second initial image based on a second mapping relationship between the second white point and the fourth white point to obtain a fifth white point; and performing white balance processing on the second initial image based on the fifth white point to obtain a second white balance image.
[0006] The solution provided in this application, based on the mapping relationship between the first camera and the second camera, maps the white balance decision point of the first camera to the second camera during the white balance process, and performs white balance on the second camera according to the white balance decision point of the second camera. This reduces the difference between the white balance decision points of the first camera and the second camera, reduces the color difference between the first white balance image and the second white balance image, and makes the color difference between the first white balance image and the second white balance image less perceptible to the user, which helps to improve the user experience when using electronic devices.
[0007] When the camera's field of view does not include white, white correction is performed on the first white point after white balance, making the second white point closer to white. This helps improve the accuracy of the white balance decision point of the second camera, thereby further reducing the color difference between the first white balance image and the second white balance image.
[0008] In some optional embodiments, before mapping the first white point to the second initial image according to the second mapping relationship between the second white point and the fourth white point to obtain the fifth white point, the color synchronization method further includes: adjusting the color of the first white balance image based on the first preset color compensation coefficient to obtain the first adjusted image; determining the point in the first adjusted image corresponding to the pixel position of the first white point in the first white balance image as the sixth white point according to the pixel position of the first white point in the first white balance image; mapping the first white point to the second initial image according to the second mapping relationship between the second white point and the fourth white point to obtain the fifth white point, including: mapping the sixth white point to the second initial image according to the second mapping relationship to obtain the fifth white point.
[0009] The solution provided in this embodiment maps the white balance decision points of the first camera after color adjustment to the second camera, so that the white balance decision points of the second camera carry the same color information as the first adjusted image, thereby reducing the color difference between the second white balance image and the first adjusted image and improving the user experience when using electronic devices.
[0010] When the white balance image is color-adjusted according to user preferences, both the first and second white balance images with small color differences can satisfy the user's preferences, which helps to further improve the user experience when using electronic devices.
[0011] In some optional embodiments, the preset light source includes a first light source and a second light source, and the white balance coordinate points include a first white balance coordinate point, a second white balance coordinate point, a third white balance coordinate point, and a fourth white balance coordinate point. Before mapping the first white point to the second camera based on the first mapping relationship to obtain the third white point, the color synchronization method further includes: obtaining the first white balance coordinate point of the first camera under the first light source and the second white balance coordinate point of the first camera under the second light source; obtaining the third white balance coordinate point of the second camera under the first light source and the fourth white balance coordinate point of the second camera under the second light source; and determining the first mapping relationship based on the first white balance coordinate point, the second white balance coordinate point, the third white balance coordinate point, and the fourth white balance coordinate point.
[0012] The solution provided in this embodiment determines the first mapping relationship between the first camera and the second camera based on the white balance coordinates calibrated by different cameras under a preset light source, thereby improving the accuracy of the first mapping relationship.
[0013] In some optional embodiments, after mapping the sixth white point to the second initial image according to the second mapping relationship to obtain the fifth white point, the color synchronization method further includes: determining the correction coefficient of the fifth white point according to the first white balance coordinate point, the second white balance coordinate point, the third white balance coordinate point, and the fourth white balance coordinate point; correcting the fifth white point according to the correction coefficient to obtain the seventh white point; and performing white balance processing on the second initial image according to the seventh white point to obtain the third white balance image.
[0014] The solution provided in this embodiment corrects the white balance decision point of the second camera to obtain a seventh white point based on the white balance coordinates calibrated by the first and second cameras under a preset light source. This reduces the large difference between the white balance decision point of the second camera and the white balance decision point of the first camera caused by the differences between the first and second camera modules. By performing white balance processing on the second initial image based on the seventh white point, the color difference between the first adjusted image and the third white balance image is further reduced.
[0015] In some optional embodiments, determining the correction coefficient of the fifth white point based on the first white balance coordinate point, the second white balance coordinate point, the third white balance coordinate point, and the fourth white balance coordinate point includes: determining a first vector based on the first white balance coordinate point and the second white balance coordinate point; determining a second vector based on the third white balance coordinate point and the fourth white balance coordinate point; and calculating the ratio of the first vector length of the first vector to the second vector length of the second vector to obtain the correction coefficient.
[0016] The solution provided in this embodiment determines the correction coefficient of the white balance decision point of the second camera based on the white balance coordinates calibrated by different cameras under a preset light source, thereby improving the accuracy of the correction coefficient.
[0017] In some optional embodiments, the first preset color compensation coefficient corresponds to the first camera.
[0018] The solution provided in this embodiment is that the first preset color compensation coefficient is pre-associated with the first camera, and the first preset color compensation coefficient is determined based on the first camera, thereby improving the accuracy of the first preset color compensation coefficient.
[0019] In some optional embodiments, obtaining the second white point based on the first white point includes: selecting multiple first target color coordinate points associated with the first white point in a white balance coordinate system, each first target color coordinate point corresponding to a first color; assigning a first weight to each first target color coordinate point according to a first preset rule; and performing a weighted average calculation on the multiple first target color coordinate points based on each first target color coordinate point and its corresponding first weight to obtain the second white point.
[0020] The solution provided in this embodiment performs white correction on the first white point based on multiple first target color coordinate points associated with the first white point, so that the second white point after white correction is closer to true white than the first white point, thereby improving the correction accuracy of white correction on the first white point.
[0021] In some optional embodiments, selecting multiple first target color coordinate points associated with the first white point in the white balance coordinate system includes: selecting multiple color coordinate points within a first preset area as multiple first target color coordinate points, with the first white point as the center point, in the white balance coordinate system.
[0022] The solution provided in this embodiment selects multiple color coordinate points in the area near the first white point as multiple first target color coordinate points. The colors of the multiple first target color coordinate points are less different from the color of the first white point, which helps to improve the accuracy of white correction of the first white point based on the multiple first target color coordinate points.
[0023] In some optional embodiments, obtaining the fourth white point based on the third white point includes: selecting multiple second target color coordinate points associated with the third white point in a white balance coordinate system, each second target color coordinate point corresponding to a second color; assigning a second weight to each second target color coordinate point based on a third vector, the third vector being obtained based on the first white point and the second white point; and performing a weighted average calculation on the multiple second target color coordinate points based on each second target color coordinate point and its corresponding second weight to obtain the fourth white point.
[0024] The solution provided in this embodiment performs white correction on the third white point based on multiple second target color coordinate points associated with the third white point, so that the fourth white point after white correction is closer to true white than the third white point, thereby improving the accuracy of white correction of the third white point.
[0025] In some optional embodiments, assigning a second weight to each second target color coordinate point based on the third vector includes: when the length of the third vector is less than a length threshold, assigning a second weight to each second target color coordinate point according to a first preset rule.
[0026] The solution provided in this embodiment has a shorter third vector length, indicating that the white difference between the first white point and the real white is small. By assigning weights to the second target color coordinate points according to the first preset rule, it is beneficial to improve the accuracy of white correction for the third white point.
[0027] In some optional embodiments, the color synchronization method further includes: when the length of the third vector is greater than or equal to a length threshold, assigning a second weight to each second target color coordinate point according to a second preset rule.
[0028] The solution provided in this embodiment has a relatively long third vector, indicating that the white difference between the first white point and the real white is large. By assigning weights to the second target color coordinate points according to the second preset rule, the influence of the second target color coordinate points, which have a large difference from the real white, on the white correction of the third white point can be reduced, which is conducive to improving the accuracy of white correction of the third white point.
[0029] In some optional embodiments, the color synchronization method further includes: adjusting the color of a first white balance image based on a first preset color compensation coefficient to obtain a first adjusted image; and adjusting the color of a second white balance image based on a second preset color compensation coefficient to obtain a second adjusted image.
[0030] The solution provided in this embodiment adjusts the color of the first white balance image after white balance processing based on the first preset color compensation coefficient, and adjusts the color of the second white balance image after second white balance processing based on the second preset color compensation coefficient. This allows both the first and second adjusted images to meet user preferences, which is beneficial to further improving the user experience when using electronic devices.
[0031] In some optional embodiments, a first preset color compensation coefficient is pre-associated with a first camera, and a second preset color compensation coefficient is pre-associated with a second camera.
[0032] The solution provided in this embodiment determines a first preset color compensation coefficient based on a first camera and a second preset color compensation coefficient based on a second camera, thereby improving the accuracy of the first preset color compensation coefficient.
[0033] In some optional embodiments, white balance processing is performed on the first initial image of the first camera to obtain a first white balance image and a first white point, including: determining a target field of view region image of the first initial image, wherein the target field of view region image is a common field of view region image of the first initial image and the second initial image; and performing white balance processing on the target field of view region image to obtain the first white balance image and the first white point.
[0034] The solution provided in this embodiment performs white balance processing on the common field of view area of the first initial image and the second initial image, which can reduce the color difference between the first white balance image and the second white balance image.
[0035] In some optional embodiments, determining the target field-of-view region image of the first initial image includes: determining the center offset of the first initial image relative to the second initial image; correcting the initial center point of the first initial image according to the center offset to obtain the target center point; and cropping an image of the same size as the second initial image from the first initial image according to the target center point to obtain the target field-of-view region image.
[0036] The solution provided in this embodiment extracts the target field of view region image from the first initial image based on the center offset between the first initial image and the second initial image and the size of the second initial image, thereby improving the accuracy of the target field of view region image.
[0037] Secondly, embodiments of this application provide an electronic device, which includes: one or more processors and a memory; the memory is coupled to one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, and one or more processors call the computer instructions to cause the electronic device to execute the multi-camera color synchronization method provided in the first aspect above.
[0038] Thirdly, embodiments of this application provide a chip system applied to an electronic device. The chip system includes one or more processors, which are used to invoke computer instructions to cause the electronic device to execute the multi-camera color synchronization method provided in the first aspect above.
[0039] In some alternative embodiments, the chip system further includes a memory connected to one or more processors via circuits or wires.
[0040] In some alternative embodiments, the chip system also includes a communication interface.
[0041] Fourthly, embodiments of this application provide a computer-readable storage medium including instructions that, when executed on an electronic device, cause the electronic device to perform the multi-camera color synchronization method as described in the first aspect above.
[0042] Fifthly, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to execute the multi-camera color synchronization method provided in the first aspect above.
[0043] It is understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 A schematic diagram of a hardware structure of an electronic device provided in an embodiment of this application is shown.
[0046] Figure 2 This illustration shows a flowchart of a color synchronization method for multiple cameras provided in an embodiment of this application.
[0047] Figure 3 This illustration shows a scene diagram of the first initial image in the multi-camera color synchronization method provided in an embodiment of this application.
[0048] Figure 4 This illustration shows a scene diagram of the white balance coordinate system in the multi-camera color synchronization method provided in this application embodiment.
[0049] Figure 5 This illustration shows a scene diagram of the first white balance image in the multi-camera color synchronization method provided in an embodiment of this application.
[0050] Figure 6 This illustration shows another scenario diagram of the white balance coordinate system in the multi-camera color synchronization method provided in this application embodiment.
[0051] Figure 7 This illustration shows another scenario of the white balance coordinate system in the multi-camera color synchronization method provided in this application embodiment.
[0052] Figure 8 This illustration shows another scenario of the white balance coordinate system in the multi-camera color synchronization method provided in this application embodiment.
[0053] Figure 9 This illustration shows a scene diagram comparing images before and after color synchronization in the multi-camera color synchronization method provided in this application embodiment.
[0054] Figure 10 This paper illustrates another flowchart of the color synchronization method for multiple cameras provided in an embodiment of this application.
[0055] Figure 11 This illustration shows a scenario flow diagram of a multi-camera color synchronization method provided in an embodiment of this application.
[0056] Figure 12 This illustration shows another flowchart of the color synchronization method for multiple cameras provided in an embodiment of this application.
[0057] Figure 13 This illustration shows another flowchart of the color synchronization method for multiple cameras provided in an embodiment of this application.
[0058] Figure 14 A structural block diagram of a multi-camera color synchronization device provided in an embodiment of this application is shown.
[0059] Figure 15 A schematic diagram of the software system of an electronic device provided in an embodiment of this application is shown.
[0060] Figure 16 A functional block diagram of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0061] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0062] The following disclosure provides many different implementations or examples for carrying out different structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. Of course, these are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or reference letters may be repeated in different examples; such repetition is for simplification and clarity and does not in itself indicate a relationship between the various implementations and / or arrangements discussed.
[0063] In order to achieve a wider field of view and capture details at greater distances, mobile phones and other electronic devices are usually equipped with multiple cameras, such as a main camera, a wide-angle camera, and a telephoto camera. By switching between cameras, different shooting scenarios can be achieved.
[0064] Due to differences in sensors, physical characteristics, and tuning styles among different cameras, images captured by different cameras will exhibit some differences in color reproduction. These color differences are easily perceived by users, reducing the user experience when using electronic devices.
[0065] To address the aforementioned problems, this application provides a multi-camera color synchronization method, electronic device, and storage medium. The color synchronization method is applied to an electronic device including a first camera and a second camera. It involves performing white balance processing on a first initial image from the first camera to obtain a first white balance image and a first white point. A second white point is then obtained based on the first white point, which is closer to true white than the first white point. The first white point is then mapped to a second initial image from the second camera based on a first mapping relationship to obtain a third white point. The first mapping relationship characterizes the correspondence between the white balance coordinate points of the first and second cameras under a preset light source. A fourth white point is then obtained based on the third white point, which is closer to true white than the third white point. The method is further refined based on the second white point. The second mapping relationship between the first and second white points maps the first white point to the second initial image to obtain the fifth white point. Based on the fifth white point, white balance processing is performed on the second initial image to obtain the second white balance image. This achieves a mapping relationship between the first and second cameras, mapping the white balance decision points of the first camera to the second camera, and performing white balance on the second camera based on the white balance decision points of the second camera. This reduces the difference between the white balance decision points of the first and second cameras, and reduces the color difference between the first and second white balance images. This makes the color difference between the first and second white balance images less perceptible to the user, thus improving the user experience when using electronic devices.
[0066] When the camera's field of view does not include white, white correction is performed on the first white point after white balance, making the second white point closer to white. This helps improve the accuracy of the white balance decision point of the second camera, thereby further reducing the color difference between the first white balance image and the second white balance image.
[0067] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0068] The light source image processing method provided in this application can be applied to electronic devices. Electronic devices may include various terminal devices, which may also be called terminals, user equipment (UE), mobile stations (MS), mobile terminals (MT), etc.
[0069] Terminal devices can include mobile phones, robot vacuum cleaners, drones, smart TVs, wearable devices, personal digital assistants (PDAs), computers with wireless transceiver capabilities, virtual reality (VR) terminal devices, augmented reality (AR) terminal devices, wireless terminals in industrial control, wireless terminals in self-driving, wireless terminals in remote medical surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, and wireless terminals in smart homes. The type of terminal device is not limited here; it can be configured according to actual needs.
[0070] Please see Figure 1 This illustrates a schematic diagram of the hardware structure of an electronic device 100 provided in one embodiment of this application. Figure 1 As shown, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a Universal Serial Bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a Subscriber Identification Module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0071] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0072] For example, Figure 1 The processor 110 shown may include one or more processing units, such as an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). These different processing units may be independent devices or integrated into one or more processors.
[0073] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction opcode and timing signals to complete the control of fetching and executing instructions.
[0074] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0075] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an Inter-Integrated Circuit (I2C) interface, an Inter-Integrated Circuit Sound (I2S) interface, a Pulse Code Modulation (PCM) interface, a Universal Asynchronous Receiver / Transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI) interface, a General Purpose Input / Output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and / or a Universal Serial Bus (USB) interface, etc.
[0076] In some embodiments, the I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). The processor 110 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thus realizing the touch function of the electronic device 100.
[0077] In some embodiments, the MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a Camera Serial Interface (CSI) and a Display Serial Interface (DSI). The processor 110 and the camera 193 communicate via the CSI interface to enable the electronic device 100 to capture images. The processor 110 and the display screen 194 communicate via the DSI interface to enable the electronic device 100 to display images.
[0078] In some embodiments, the GPIO interface can be configured via software. The GPIO interface can be configured as a control signal or a data signal. The GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.
[0079] Electronic device 100 implements display functions through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.
[0080] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may be a Liquid Crystal Display (LCD), an Organic Light Emitting Diode (OLED) display, an Active Matrix Organic Light Emitting Diode (AMOLED) display, a Flexible Light Emitting Diode (FLED) display, a Mini Light Emitting Diode (MiniLed) display, a Micro Light Emitting Diode (Micro LED) display, a Micro Organic Light Emitting Diode (Micro OLED) display, a Quantum Dot Light Emitting Diode (QDLED) display, etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.
[0081] Electronic device 100 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.
[0082] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.
[0083] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, the electronic device 100 may include one or N cameras 193, where N is a positive integer greater than 1.
[0084] Digital signal processors (DSPs) are used to process digital signals. Besides digital image signals, they can also process other digital signals. For example, when electronic device 100 selects a frequency, the DSP can perform Fourier transforms on the frequency energy.
[0085] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. Thus, electronic device 100 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
[0086] NPU stands for Neural Network (NN) computing processor. By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in electronic devices, such as image recognition, facial recognition, speech recognition, and text understanding.
[0087] The external memory interface 120 can be used to connect an external memory card, such as a Secure Digital (SD) card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to perform data storage functions.
[0088] Internal memory 121 can be used to store computer executable program code, including instructions. Processor 110 executes various functional applications and data processing of electronic device 100 by running the instructions stored in internal memory 121. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as image capture, video recording, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as image data, video data, etc.). Furthermore, internal memory 121 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, Universal Flash Storage (UFS), etc.
[0089] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0090] This application does not specifically limit the structure of the execution subject of a multi-camera color synchronization method. As long as the code recording the multi-camera color synchronization method of this application is executed, communication can be performed according to the multi-camera color synchronization method provided in this application. For example, the execution subject of the multi-camera color synchronization method provided in this application can be a functional module in an electronic device capable of calling and executing programs, or a communication device applied in an electronic device, such as a chip.
[0091] Please see Figure 2 This document illustrates a flowchart of a multi-camera color synchronization method according to an embodiment of this application. In a specific embodiment, the multi-camera color synchronization method can be applied to an electronic device 100, which may include a first camera and a second camera. The following section uses the electronic device 100 as an example to illustrate... Figure 2 The process shown is described in detail. The color synchronization method for multiple cameras may include the following steps 101 to 106.
[0092] Step 101: Perform white balance processing on the first initial image from the first camera to obtain the first white balance image and the first white point.
[0093] In this embodiment of the application, when a user needs to take an image, he / she can send a shooting command to the electronic device. The electronic device receives and responds to the shooting command, performs white balance processing on the first initial image of the first camera, and obtains a first white balance image and a first white point.
[0094] The first initial image can be the initial preview stream image captured during the first camera's photo preview process, and the first white point is the white balance coordinate point in the white balance coordinate system obtained during the white balance processing of the first initial image. The first white point can be used to characterize the white balance coordinates of white points in the first white balance image.
[0095] The white balance coordinate system is a coordinate system constructed with the ratio of the red channel (R) to the green channel (G) of the three primary colors of light (red, green, and blue (RGB)) as the horizontal axis and the ratio of the blue channel (B) to G as the vertical axis.
[0096] The first camera can be any of the following: a main camera, a wide-angle camera, or a telephoto camera. Preferably, the first camera can be a main camera, but this is not limited here.
[0097] In one application scenario, the initial image captured by the first camera can be segmented to obtain multiple segmented regions, such as... Figure 3 As shown, the sum of each color channel of each pixel in each segmented region is calculated, and the R / G ratio and B / G ratio of each segmented region are calculated. Based on the R / G and B / G ratios of each segmented region, each segmented region is mapped to a white balance coordinate system to obtain a segmented white balance coordinate point. Under the white balance coordinate system, a target region is selected based on multiple standard light source white balance coordinate points, and a weighted average of all segmented white balance coordinate points within the target region is calculated to obtain the first white point, as shown. Figure 4 As shown.
[0098] The first initial image is then subjected to white balance processing based on the first white point to obtain the first white balance image, as shown below. Figure 5 As shown.
[0099] Among them, multiple standard light sources may include light sources with a color temperature of 7000K, 6500K (D65), 5000K (D50), 4500K, 3000K, and 2700K.
[0100] In some implementations, when a user needs to capture an image, a capture command can be sent to an electronic device. The electronic device receives and responds to the capture command, determines the target field-of-view region image of the first initial image, and performs white balance processing on the target field-of-view region image to obtain a first white balance image and a first white point. Performing white balance processing on the common field-of-view region image of the first initial image and the second initial image can reduce the color difference between the first white balance image and the second white balance image.
[0101] The target field of view region image can be the common field of view region image of the first initial image and the second initial image.
[0102] The electronic device can determine the center offset of the first initial image relative to the second initial image, correct the initial center point of the first initial image according to the center offset to obtain the target center point, and extract an image of the same size as the second initial image from the first initial image according to the target center point to obtain the target field of view region image. The target field of view region image is extracted from the first initial image according to the center offset between the first and second initial images and the size of the second initial image, thereby improving the accuracy of the target field of view region image.
[0103] The electronic device can calculate the center offset between the first initial image and the second initial image based on the image identifiers in the first initial image and the second initial image; it can also calculate the center offset between the first initial image and the second initial image based on the registered image obtained by image registration of the first initial image and the second initial image, etc., without limitation here.
[0104] In some implementations, the electronic device may be equipped with an input panel. When a user needs to take an image, they can input a shooting command on the input panel of the electronic device. For example, the user can input the shooting command by handwriting on the input panel of the electronic device or by pressing a button on the input panel of the electronic device. The electronic device receives the shooting command through the input panel.
[0105] In some implementations, the electronic device may be equipped with a voice recognition module. When a user needs to take an image, they can send voice information within the voice acquisition range of the voice recognition module. The voice recognition module collects the voice information sent by the user and performs voice recognition on the collected voice information to obtain a voice recognition result. When it is determined that the voice recognition result contains keywords used to instruct the electronic device to take an image, such as the keyword "take an image", or the keywords "take" and "image", it is determined that a shooting instruction has been received.
[0106] As an example, if the user sends the voice message "Take an image", and the voice recognition result contains the keyword "Take an image", then it is determined that the shooting instruction has been received.
[0107] In some implementations, when a user needs to take an image, they can send a shooting command to the client. The client receives and responds to the shooting command, and forwards the shooting command to the electronic device via the network. The electronic device then receives the shooting command forwarded by the client.
[0108] The client connects to the electronic device via a network and interacts with the electronic device through the network. The client can be any of the following: a mobile client (e.g., a mobile phone client, a PDA client, a Tablet PC client, a laptop client, a smartwatch client, a smart bracelet client, or a wearable client) or a fixed client (e.g., a desktop computer client, a smart panel client). The type of client is not limited here and can be configured according to actual needs.
[0109] The network can be any of the following: ZigBee network, Bluetooth (BT) network, Wireless Fidelity (Wi-Fi) network, Thread network, Long Range Radio (LoRa) network, Low-Power Wide-Area Network (LPWAN), infrared network, Narrow Band Internet of Things (NB-IoT), Controller Area Network (CAN), Digital Living Network Alliance (DLNA) network, Wide Area Network (WAN), Local Area Network (LAN), Metropolitan Area Network (MAN), or Wireless Personal Area Network (WPAN). The type of network is not limited here; it can be configured according to actual needs.
[0110] Step 102: Obtain the second white dot based on the first white dot.
[0111] In this embodiment of the application, the electronic device can select multiple first target color coordinate points associated with the first white point in a white balance coordinate system, assign a first weight to each first target color coordinate point according to a first preset rule, and perform a weighted average calculation on the multiple first target color coordinate points based on each first target color coordinate point and its corresponding first weight to obtain a second white point. Based on the multiple first target color coordinate points associated with the first white point, the first white point is white-corrected, so that the white-corrected second white point is closer to true white than the first white point, thereby improving the accuracy of white correction of the first white point.
[0112] Among them, the second white dot is closer to true white than the first white dot, and each first target color coordinate point can correspond to a first color.
[0113] In a white balance coordinate system, the electronic device can select multiple color coordinate points within a first preset area as multiple first target color coordinate points, with the first white point as the center point, and select multiple color coordinate points in the area near the first white point as multiple first target color coordinate points. The colors of the multiple first target color coordinate points are less different from the color of the first white point, which helps to improve the accuracy of white correction of the first white point based on the multiple first target color coordinate points.
[0114] The first preset area can be a shape area pre-defined by the user, or a shape area automatically generated by the electronic device based on the process of synchronizing the colors of multiple cameras multiple times, etc. There is no limitation here.
[0115] The first preset rule can be any one of the following: brightness rule, center point distance rule, gray area position rule, and standard light source point distance rule, etc., without limitation here.
[0116] The brightness rule assigns higher weights to color coordinate points whose brightness is within the brightness threshold range, and lower weights to color coordinate points whose brightness is outside the preset brightness threshold range.
[0117] The brightness threshold range can be a brightness range preset by the user, or a brightness range automatically generated by the electronic device based on the process of synchronizing the colors of multiple cameras multiple times, etc., and is not limited here.
[0118] The center point distance rule assigns higher weights to color coordinate points whose distance from the center point is less than the first distance threshold range, and lower weights to color coordinate points whose distance from the center point is greater than or equal to the first distance threshold range.
[0119] The first distance threshold range can be a distance range preset by the user, or a distance range automatically generated by the electronic device based on the process of synchronizing the colors of multiple cameras multiple times, etc., and is not limited here.
[0120] The gray area position rule is to assign higher weights to color coordinate points located within the preset area and lower weights to color coordinate points located outside the preset area.
[0121] The preset area can be a grayscale area pre-defined by the user, or a grayscale area automatically generated by the electronic device based on the process of synchronizing the colors of multiple cameras multiple times, etc. There is no limitation here.
[0122] The standard light source point distance rule assigns higher weights to color coordinate points whose distance from the standard light source point is less than the second distance threshold range, and lower weights to color coordinate points whose distance from the standard light source point is greater than or equal to the second distance threshold range.
[0123] The second distance threshold range can be a distance range preset by the user, or a distance range automatically generated by the electronic device based on the process of synchronizing the colors of multiple cameras multiple times, etc., and is not limited here.
[0124] In one application scenario, the first white point is (R1 / G1, B1 / G1), and multiple first target color coordinate points may include a first coordinate point (r1 / g1, b1 / g1), a second coordinate point (r2 / g2, b2 / g2), and a third coordinate point (r3 / g3, b3 / g3). The first preset rules may include brightness rules, center point distance rules, gray area position rules, and standard light source point distance rules.
[0125] The first weight may include a first sub-weight (W1, T1), a second sub-weight (W2, T2), and a third sub-weight (W3, T3). The first sub-weight (W1, T1) corresponds to the first coordinate point (r1 / g1, b1 / g1), the second sub-weight (W2, T2) corresponds to the second coordinate point (r2 / g2, b2 / g2), and the third sub-weight (W3, T3) corresponds to the third coordinate point (r3 / g3, b3 / g3).
[0126] According to the brightness rules, the first coordinate point (r1 / g1, b1 / g1) is assigned a weight (w1, t1), the second coordinate point (r2 / g2, b2 / g2) is assigned a weight (w2, t2), and the third coordinate point (r3 / g3, b3 / g3) is assigned a weight (w3, t3).
[0127] According to the center point distance rule, the first coordinate point (r1 / g1, b1 / g1) is assigned a weight (w'1, t'1), the second coordinate point (r2 / g2, b2 / g2) is assigned a weight (w'2, t'2), and the third coordinate point (r3 / g3, b3 / g3) is assigned a weight (w'3, t'3).
[0128] According to the gray area position rules, the first coordinate point (r1 / g1, b1 / g1) is assigned a weight (w”1, t”1), the second coordinate point (r2 / g2, b2 / g2) is assigned a weight (w”2, t”2), and the third coordinate point (r3 / g3, b3 / g3) is assigned a weight (w”3, t”3).
[0129] According to the center point distance rule, the first coordinate point (r1 / g1, b1 / g1) is assigned a weight (w”'1, t”'1), the second coordinate point (r2 / g2, b2 / g2) is assigned a weight (w”'2, t”'2), and the third coordinate point (r3 / g3, b3 / g3) is assigned a weight (w”'3, t”'3).
[0130] The first sub-weight (W1, T1) of the first coordinate point (r1 / g1, b1 / g1) can be calculated according to Formula 1.
[0131] Formula 1 is: W1=w1·w'1·w”1·w”'1;T1=t1·t'1·t”1·t”'1。
[0132] The second sub-weight (W2, T2) of the second coordinate point (r2 / g2, b2 / g2) can be calculated according to Formula 2.
[0133] Formula 2 is: W2 = w2·w'2·w”2·w”'2; T2 = t2·t'2·t”2·t”'2.
[0134] The third sub-weight (W3, T3) of the third coordinate point (r3 / g3, b3 / g3) can be calculated according to Formula 3.
[0135] Formula 3 is: W3 = w3·w'3·w”3·w”'3; T3 = t3·t'3·t”3·t”'3.
[0136] The second white point (R2 / G2, B2 / G2) can be calculated by weighting the first coordinate point (r1 / g1, b1 / g1), the second coordinate point (r2 / g2, b2 / g2), the third coordinate point (r3 / g3, b3 / g3), the first sub-weight (W1, T1), the second sub-weight (W2, T2), and the third sub-weight (W3, T3) according to Formula 4.
[0137] Formula four is:
[0138] R2 / G2=((r1 / g1)·W1+(r2 / g2)·W2+(r3 / g3)·W3) / (W1+W2+W3)
[0139] =((r1 / g1)·w1·w'1·w"1·w"'1+(r2 / g2)·w2·w'2·w"2·w"'2+(r3 / g3)·w3·w '3·w"3·w"'3) / (w1·w'1·w"1·w"'1+w2·w'2·w"2·w"'2+w3·w'3·w"3·w"'3);
[0140] B2 / G2=((b1 / g1)·T1+(b2 / g2)·T2+(b3 / g3)·T3) / (T1+T2+T3)
[0141] =((b1 / g1)·t1·t'1·t"1·t"'1+(b2 / g2)·t2·t'2·t"2·t"'2+(b3 / g3)·t3·t '3·t"3·t"'3) / (t1·t'1·t"1·t"'1+t2·t'2·t"2·t"'2+t3·t'3·t"3·t"'3).
[0142] Step 103: Based on the first mapping relationship, map the first white point to the second initial image of the second camera to obtain the third white point.
[0143] In this embodiment of the application, the electronic device can map the first white point to the second initial image of the second camera based on the first mapping relationship to obtain the third white point.
[0144] The first mapping relationship can be used to characterize the correspondence between the white balance coordinate points of the first camera and the second camera under a preset light source, and the second initial image can be the initial preview stream image captured during the second camera's photo preview process.
[0145] The second camera can be at least one of the main camera, wide-angle camera, or telephoto camera. Preferably, the second camera can be a telephoto camera or a wide-angle camera, but this is not limited here.
[0146] The preset light source may include a first light source and a second light source, and the white balance coordinate points may include a first white balance coordinate point, a second white balance coordinate point, a third white balance coordinate point, and a fourth white balance coordinate point.
[0147] The electronic device can acquire the first white balance coordinate point of the first camera under the first light source and the second white balance coordinate point of the first camera under the second light source, and acquire the third white balance coordinate point of the second camera under the first light source and the fourth white balance coordinate point of the second camera under the second light source. Based on the first white balance coordinate point, the second white balance coordinate point, the third white balance coordinate point and the fourth white balance coordinate point, the first mapping relationship is determined. Based on the white balance coordinates calibrated by different cameras under the preset light source, the first mapping relationship between the first camera and the second camera is determined, which improves the accuracy of the first mapping relationship.
[0148] In one application scenario, the first light source can be a D65, the second light source can be a D50, the first camera is the main camera, and the second camera is a telephoto camera.
[0149] like Figure 6 As shown, the first white balance coordinate point of the main camera under D65 is (R'0 / G'0, B'0 / G'0), the second white balance coordinate point of the main camera under D50 is (R”0 / G”0, B”0 / G”0), the third white balance coordinate point of the telephoto camera under D65 is (R”'0 / G”'0, B”'0 / G”'0), and the fourth white balance coordinate point of the telephoto camera under D50 is (R””'0 / G””'0, B””'0 / G””'0).
[0150] The first mapping relationship can be determined based on the first white balance coordinate point ((R'0 / G'0, B'0 / G'0), the second white balance coordinate point (R”0 / G”0, B”0 / G”0), the third white balance coordinate point (R”'0 / G”'0, B”'0 / G”'0), and the fourth white balance coordinate point (R””'0 / G””'0, B””'0 / G””'0).
[0151] The first white point (R1 / G1, B1 / G1) can be mapped to the second initial image based on the first mapping relationship to obtain the third white point (R3 / G3, B3 / G3).
[0152] Step 104: Obtain the fourth white dot based on the third white dot.
[0153] In this embodiment, the electronic device can select multiple second target color coordinate points associated with the third white point in a white balance coordinate system, assign a second weight to each second target color coordinate point according to a third vector, and perform a weighted average calculation on multiple second target color coordinate points based on each second target color coordinate point and its corresponding second weight to obtain a fourth white point. Based on the multiple second target color coordinate points associated with the third white point, white correction is performed on the third white point, so that the white-corrected fourth white point is closer to true white than the third white point, thereby improving the accuracy of white correction of the third white point.
[0154] Among them, the fourth white point is closer to true white than the third white point, each second target color coordinate point can correspond to a second color, and the third vector is calculated based on the first white point and the second white point.
[0155] In a white balance coordinate system, the electronic device can select multiple color coordinate points within a second preset area as multiple second target color coordinate points, with the third white point as the center point, and select multiple color coordinate points in the area near the third white point as multiple second target color coordinate points. The colors of the multiple second target color coordinate points are less different from the color of the third white point, which helps to improve the accuracy of white correction of the third white point based on multiple second target color coordinate points.
[0156] The second preset area can be a shape area preset by the user, or a shape area automatically generated by the electronic device based on the process of synchronizing the colors of multiple cameras multiple times, etc. There is no limitation here.
[0157] When the length of the third vector is less than the length threshold, a second weight can be assigned to each second target color coordinate point according to the first preset rule. The shorter length of the third vector indicates that the white difference between the first white point and the real white is small. Assigning weights to the second target color coordinate points according to the first preset rule is beneficial to improving the accuracy of white correction for the third white point.
[0158] When the length of the third vector is greater than or equal to the length threshold, a second weight can be assigned to each second target color coordinate point according to the second preset rule. The longer length of the third vector indicates that the white difference between the first white point and the real white is greater. Assigning weights to the second target color coordinate points according to the second preset rule can reduce the influence of the second target color coordinate points that are significantly different from the real white on the white correction of the third white point, which is conducive to improving the accuracy of the white correction of the third white point.
[0159] The length threshold can be used to characterize the minimum degree of white correction for the first white point. The length threshold can be a length preset by the user, or it can be a length automatically generated by the electronic device based on the process of synchronizing the colors of multiple cameras multiple times, etc. There is no limitation here.
[0160] The second preset rule can be any one of the following: brightness rule, center point distance rule, gray area position rule, standard light source point distance rule, and vector direction rule, etc., without limitation here.
[0161] The vector direction rule can assign higher weights to color coordinate points whose vector direction from the center point is the same as that of the third vector, and lower weights to color coordinate points whose vector direction from the center point is different from that of the third vector.
[0162] In one application scenario, the first light source can be a D65, the second light source can be a D50, the first camera is the main camera, and the second camera is a telephoto camera.
[0163] like Figure 7 As shown, multiple first target color coordinate points associated with the first white point (R1 / G1, B1 / G1) can be selected, and a first weight can be assigned to each second target color coordinate point according to a first preset rule. Based on each first target color coordinate point and its corresponding first weight, a weighted average calculation is performed on the multiple first target color coordinate points to obtain the second white point (R2 / G2, B2 / G2).
[0164] Multiple second target color coordinate points associated with the third white point (R3 / G3, B3 / G3) can be selected, and a second weight can be assigned to each second target color coordinate point according to the third vector. Based on each second target color coordinate point and its corresponding second weight, a weighted average calculation can be performed on the multiple second target color coordinate points to obtain the fourth white point (R4 / G4, B4 / G4).
[0165] Step 105: Based on the second mapping relationship between the second white point and the fourth white point, map the first white point to the second initial image to obtain the fifth white point.
[0166] In this embodiment of the application, the electronic device can determine the second mapping relationship between the second white point and the fourth white point based on the second white point and the fourth white point, and map the first white point to the second initial image according to the second mapping relationship to obtain the fifth white point. Based on the mapping relationship between the white balance decision points after white correction, the white balance decision points in the white balance process of the first camera are remapped to the second camera, thereby reducing the difference between the white balance decision points of the first camera and the second camera.
[0167] In one application scenario, the first light source can be a D65, the second light source can be a D50, the first camera is the main camera, and the second camera is a telephoto camera.
[0168] like Figure 8 As shown, the second mapping relationship can be determined based on the second white point (R2 / G2, B2 / G2) and the fourth white point (R4 / G4, B4 / G4). Based on the second mapping relationship, the first white point (R1 / G1, B1 / G1) is mapped to the second initial image to obtain the fifth white point (R5 / G5, B5 / G5).
[0169] Step 106: Perform white balance processing on the second initial image based on the fifth white point to obtain the second white balance image.
[0170] In this embodiment, the electronic device can perform white balance processing on the second initial image based on the fifth white point to obtain a second white balance image. This realizes the mapping relationship between the first camera and the second camera, mapping the white balance decision point in the white balance process of the first camera to the second camera, and performing white balance on the second camera based on the white balance decision point of the second camera. This reduces the difference between the white balance decision points of the first camera and the second camera, reduces the color difference between the first white balance image and the second white balance image, and makes the color difference between the first white balance image and the second white balance image less perceptible to the user, which is beneficial to improving the user experience when using the electronic device.
[0171] When the camera's field of view does not include white, white correction is performed on the first white point after white balance, making the second white point closer to white. This helps improve the accuracy of the white balance decision point of the second camera, thereby further reducing the color difference between the first white balance image and the second white balance image.
[0172] In one application scenario, the first camera is the main camera, and the second camera is a telephoto camera. The first initial image captured by the main camera is processed for white balance, resulting in a first white balance image as shown below. Figure 9 As shown in (a) above, the second initial image captured by the telephoto camera is as follows: Figure 9 As shown in (b) above, the second white balance image obtained after white balance processing of the second initial image is as follows: Figure 9 As shown in (c) in the figure.
[0173] The solution provided in this application involves performing white balance processing on a first initial image from a first camera to obtain a first white balance image and a first white point. A second white point, closer to true white than the first, is then obtained based on the first white point. The first white point is mapped to a second initial image from the second camera based on a first mapping relationship to obtain a third white point. This first mapping relationship characterizes the correspondence between the white balance coordinate points of the first and second cameras under a preset light source. A fourth white point, closer to true white than the third, is then obtained based on the third white point. Finally, the first white point is mapped to the second initial image based on a second mapping relationship between the second and fourth white points. The process involves obtaining a fifth white point and performing white balance processing on the second initial image based on the fifth white point to obtain a second white balance image. This achieves a mapping relationship between the first and second cameras, mapping the white balance decision points of the first camera to the second camera, and performing white balance on the second camera based on the white balance decision points of the second camera. This reduces the difference between the white balance decision points of the first and second cameras, and reduces the color difference between the first and second white balance images. As a result, the color difference between the first and second white balance images is less likely to be perceived by the user, which helps to improve the user experience when using electronic devices.
[0174] When the camera's field of view does not include white, white correction is performed on the first white point after white balance, making the second white point closer to white. This helps improve the accuracy of the white balance decision point of the second camera, thereby further reducing the color difference between the first white balance image and the second white balance image.
[0175] Please see Figure 10 This document illustrates a flowchart of a multi-camera color synchronization method according to another embodiment of this application. In a specific embodiment, the multi-camera color synchronization method can be applied to an electronic device 100, which may include a first camera and a second camera. The following uses the electronic device 100 as an example to illustrate... Figure 10 The process shown is described in detail. The color synchronization method for multiple cameras may include the following steps 201 to 208.
[0176] Step 201: Perform white balance processing on the first initial image from the first camera to obtain the first white balance image and the first white point.
[0177] Step 202: Obtain the second white dot based on the first white dot.
[0178] Step 203: Based on the first mapping relationship, map the first white point to the second initial image of the second camera to obtain the third white point.
[0179] Step 204: Obtain the fourth white dot based on the third white dot.
[0180] In this embodiment, steps 201, 202, 203 and 204 can be referred to the corresponding steps in the previous embodiments, and will not be repeated here.
[0181] Step 205: Adjust the color of the first white balance image based on the first preset color compensation coefficient to obtain the first adjusted image.
[0182] In this embodiment, the electronic device can determine a first preset color compensation coefficient based on the first camera, and adjust the color of the first white balance image based on the first preset color compensation coefficient to obtain a first adjusted image. The first preset color compensation coefficient is pre-associated with the first camera, and the accuracy of the first preset color compensation coefficient is improved by determining the first preset color compensation coefficient based on the first camera.
[0183] The first preset color compensation coefficient corresponds to the first camera, and the first preset color compensation coefficient can be a color compensation coefficient set by the user according to the user's preferred color.
[0184] In some implementations, the electronic device can look up a color compensation coefficient table based on the first camera identifier of the first camera to obtain a first preset color compensation coefficient, and adjust the color of the first white balance image based on the first preset color compensation coefficient to obtain a first adjusted image.
[0185] The color compensation coefficient table can be used to characterize the correspondence between camera markings and color compensation coefficients.
[0186] For example, camera identifiers may include camera A, camera B, and camera C, and color compensation coefficients may include color compensation coefficient 1, color compensation coefficient 2, and color compensation coefficient 3.
[0187] The correspondence between camera identifiers and color compensation coefficients can be shown in Table 1, i.e., the color compensation coefficient table. Based on this correspondence, the first preset color compensation coefficient corresponding to the first camera can be obtained.
[0188] Table 1
[0189] Camera logo Color compensation factor Camera A Color compensation factor 1 Camera B Color compensation factor 2 Camera C Color compensation factor 3
[0190] It should be noted that the correspondence between camera identification and color compensation coefficient is not limited to that shown in Table 1, and can be set according to actual needs.
[0191] In some implementations, the electronic device may generate a first prompt message and receive a first preset color compensation coefficient from a first camera uploaded by the user based on the first prompt message.
[0192] The first prompt information can be used to prompt the user to upload the first preset color compensation coefficient of the first camera to the electronic device. The first prompt information can be at least one of text prompt information, sound prompt information, or light prompt information, etc., without limitation here.
[0193] Step 206: Based on the pixel position of the first white point in the first white balance image, determine the point in the first adjustment image corresponding to the pixel position as the sixth white point.
[0194] In this embodiment, the electronic device can determine the pixel position of the first white point in the first white balance image based on the correspondence between white balance coordinate points and pixel points, and determine the point in the first adjustment image corresponding to the pixel position as the sixth white point.
[0195] The sixth white dot is the point obtained by adding a first preset color compensation coefficient to the first white dot.
[0196] Step 207: Map the sixth white point to the second initial image according to the second mapping relationship to obtain the fifth white point.
[0197] In this embodiment, the electronic device can map the sixth white point to the second initial image according to the second mapping relationship to obtain the fifth white point, and map the white balance decision point after the color adjustment of the first camera to the second camera, so that the white balance decision point of the second camera carries the same color information as the first adjusted image, thereby reducing the color difference between the second white balance image and the first adjusted image and improving the user experience when using the electronic device.
[0198] Step 208: Perform white balance processing on the second initial image based on the fifth white point to obtain the second white balance image.
[0199] In this embodiment, step 208 can be referred to the corresponding steps in the previous embodiments, and will not be repeated here.
[0200] In one application scenario, such as Figure 11 As shown, the color synchronization method for multiple cameras may include the following steps 301 to 313.
[0201] Step 301: Determine the target field of view region image of the first initial image.
[0202] Step 302: Perform white balance processing on the target field of view region image to obtain the first white balance image and the first white point.
[0203] Step 303: Assign a first weight to multiple first target color coordinate points according to the first preset rule.
[0204] Step 304: Based on each first target color coordinate point and its corresponding first weight, perform a weighted average calculation on multiple first target color coordinate points to obtain the second white point.
[0205] Step 305: Determine the third vector based on the first white point and the second white point.
[0206] Step 306: Based on the first mapping relationship, map the first white point to the second initial image of the second camera to obtain the third white point.
[0207] Step 307: Determine multiple second target color coordinate points.
[0208] Step 308: When the length of the third vector is less than the length threshold, a second weight can be assigned to each second target color coordinate point according to the first preset rule.
[0209] Step 309: When the length of the third vector is greater than or equal to the length threshold, a second weight can be assigned to each second target color coordinate point according to the second preset rule.
[0210] Step 310: Based on each second target color coordinate point and its corresponding second weight, perform a weighted average calculation on multiple second target color coordinate points to obtain the fourth white point.
[0211] Step 311: Adjust the color of the first white balance image based on the first preset color compensation coefficient to obtain the sixth white point of the first adjusted image.
[0212] Step 312: Map the sixth white point to the second initial image according to the second mapping relationship to obtain the fifth white point.
[0213] Step 313: Perform white balance processing on the second initial image based on the fifth white point to obtain the second white balance image.
[0214] The solution provided in this embodiment involves performing white balance processing on a first initial image from a first camera to obtain a first white balance image and a first white point. A second white point is then obtained based on the first white point. The first white point is mapped to a second initial image from the second camera based on a first mapping relationship to obtain a third white point. A fourth white point is obtained based on the third white point. The first white balance image is then color-adjusted based on a first preset color compensation coefficient to obtain a first adjusted image. Based on the pixel position of the first white point in the first white balance image, the point in the first adjusted image corresponding to that pixel position is determined as a sixth white point. This sixth white point is then mapped to the second initial image based on a second mapping relationship to obtain... The system retrieves the fifth white point and performs white balance processing on the second initial image based on the fifth white point to obtain the second white balance image. This achieves a mapping relationship between the first and second cameras, mapping the white balance decision points of the first camera to the second camera, and performing white balance on the second camera based on the white balance decision points of the second camera. This reduces the difference between the white balance decision points of the first and second cameras, reduces the color difference between the first and second white balance images, and makes the color difference between the first and second white balance images less perceptible to the user, thus improving the user experience when using electronic devices.
[0215] The white balance decision points adjusted by the first camera are mapped to the second camera, so that the white balance decision points of the second camera carry the same color information as the first adjusted image. This reduces the color difference between the second white balance image and the first adjusted image, which helps to improve the user experience when using electronic devices.
[0216] Please see Figure 12 This document illustrates a flowchart of a multi-camera color synchronization method provided in another embodiment of this application. In a specific embodiment, the multi-camera color synchronization method can be applied to an electronic device 100, which may include a first camera and a second camera. The following section uses the electronic device 100 as an example to illustrate... Figure 12 The process shown is described in detail. The color synchronization method for multiple cameras may include the following steps 401 to 411.
[0217] Step 401: Perform white balance processing on the first initial image from the first camera to obtain the first white balance image and the first white point.
[0218] Step 402: Obtain the second white dot based on the first white dot.
[0219] Step 403: Based on the first mapping relationship, map the first white point to the second initial image of the second camera to obtain the third white point.
[0220] Step 404: Obtain the fourth white dot based on the third white dot.
[0221] Step 405: Adjust the color of the first white balance image based on the first preset color compensation coefficient to obtain the first adjusted image.
[0222] Step 406: Determine the pixel position of the first white point in the first white balance image.
[0223] Step 407: Determine the point in the first adjusted image that corresponds to the pixel position as the sixth white point.
[0224] Step 408: Map the sixth white point to the second initial image according to the second mapping relationship to obtain the fifth white point.
[0225] In this embodiment, steps 401, 402, 403, 404, 405, 406, 407, and 408 can be found in the corresponding steps of the foregoing embodiments, and will not be repeated here.
[0226] Step 409: Determine the correction coefficient for the fifth white point based on the first white balance coordinate point, the second white balance coordinate point, the third white balance coordinate point, and the fourth white balance coordinate point.
[0227] In this embodiment, the electronic device can determine a first vector based on the first white balance coordinate point and the second white balance coordinate point, and determine a second vector based on the third white balance coordinate point and the fourth white balance coordinate point. The device can also calculate the first vector length of the first vector and the second vector length of the second vector, and calculate the ratio of the first vector length to the second vector length to obtain the correction coefficient. Based on the white balance coordinates calibrated by different cameras under a preset light source, the device can determine the correction coefficient of the white balance decision point of the second camera, thereby improving the accuracy of the correction coefficient.
[0228] Step 410: Correct the fifth white point according to the correction coefficient to obtain the seventh white point.
[0229] In this embodiment, the electronic device can correct the fifth white point according to the correction coefficient to obtain the seventh white point. Based on the white balance coordinates calibrated by the first camera and the second camera under a preset light source, the white balance decision point of the second camera can be corrected. This can reduce the large difference between the white balance decision point of the second camera and the white balance decision point of the first camera caused by the difference between the first camera and the second camera module, which is beneficial to reduce the color difference between the first adjusted image and the third white balance image.
[0230] The electronic device can construct a fourth vector starting from the fourth white point and ending at the fifth white point, calculate the quotient of the fourth vector length and the correction coefficient to obtain the fifth vector length, construct a fifth vector starting from the fourth white point and using the fifth vector length, and determine the end point of the fifth vector as the seventh white point.
[0231] Step 411: Perform white balance processing on the second initial image based on the seventh white point to obtain the third white balance image.
[0232] In this embodiment, the electronic device can perform white balance processing on the second initial image based on the seventh white point to obtain a third white balance image. Based on the white balance coordinates calibrated by the first and second cameras under a preset light source, the white balance decision point of the second camera is corrected to obtain the seventh white point. This can reduce the large difference between the white balance decision point of the second camera and the white balance decision point of the first camera caused by the differences between the first and second camera modules. Performing white balance processing on the second initial image based on the seventh white point further reduces the color difference between the first adjusted image and the third white balance image.
[0233] The solution provided in this embodiment involves performing white balance processing on a first initial image from a first camera to obtain a first white balance image and a first white point. A second white point is then obtained based on the first white point. The first white point is mapped to a second initial image from the second camera based on a first mapping relationship to obtain a third white point. A fourth white point is obtained based on the third white point. The first white balance image is then color-adjusted based on a first preset color compensation coefficient to obtain a first adjusted image. The pixel position of the first white point in the first white balance image is determined. The point corresponding to the pixel position in the first adjusted image is identified as a sixth white point. The sixth white point is mapped to the second initial image based on a second mapping relationship to obtain a fifth white point. Finally, based on the first white balance coordinate point, the second white balance coordinate point, the third white balance coordinate point, and the fourth white point, the solution is applied to the second initial image. The system uses four white balance coordinate points to determine the correction coefficient for the fifth white point. Based on this coefficient, the fifth white point is corrected to obtain the seventh white point. Then, the second initial image is white-balanced based on the seventh white point to obtain the third white-balanced image. This achieves a mapping relationship between the first and second cameras, mapping the white balance decision points from the first camera to the second camera. The second camera is then white-balanced based on these decision points, reducing the difference between the white balance decision points of the first and second cameras. This reduces the color difference between the first and second white-balanced images, making it less perceptible to the user and improving the user experience when using electronic devices.
[0234] Based on the white balance coordinates calibrated by the first and second cameras under a preset light source, the white balance decision point of the second camera is corrected to obtain the seventh white point. This can reduce the large difference between the white balance decision point of the second camera and the white balance decision point of the first camera caused by the differences between the first and second camera modules. The second initial image is then processed for white balance based on the seventh white point, which further reduces the color difference between the first adjusted image and the third white balance image.
[0235] Please see Figure 13 This document illustrates a flowchart of a multi-camera color synchronization method provided in another embodiment of this application. In a specific embodiment, the multi-camera color synchronization method can be applied to an electronic device 100, which may include a first camera and a second camera. The following section uses the electronic device 100 as an example to illustrate... Figure 13 The process shown is described in detail. The color synchronization method for multiple cameras may include the following steps 501 to 508.
[0236] Step 501: Perform white balance processing on the first initial image from the first camera to obtain the first white balance image and the first white point.
[0237] Step 502: Obtain the second white dot based on the first white dot.
[0238] Step 503: Based on the first mapping relationship, map the first white point to the second initial image of the second camera to obtain the third white point.
[0239] Step 504: Obtain the fourth white dot based on the third white dot.
[0240] Step 505: Based on the second mapping relationship between the second white point and the fourth white point, map the first white point to the second initial image to obtain the fifth white point.
[0241] Step 506: Perform white balance processing on the second initial image based on the fifth white point to obtain the second white balance image.
[0242] Step 507: Adjust the color of the first white balance image based on the first preset color compensation coefficient to obtain the first adjusted image.
[0243] In this embodiment, steps 501, 502, 503, 504, 505, 506, and 507 can be found in the corresponding steps in the foregoing embodiments, and will not be repeated here.
[0244] Step 508: Adjust the color of the second white balance image based on the second preset color compensation coefficient to obtain the second adjusted image.
[0245] In this embodiment, the electronic device can determine a second preset color compensation coefficient based on the second camera, and adjust the color of the second white balance image based on the second preset color compensation coefficient to obtain a second adjusted image. By adjusting the color of the first white balance image after white balance processing based on the first preset color compensation coefficient, and adjusting the color of the second white balance image after second white balance processing based on the second preset color compensation coefficient, both the first and second adjusted images can meet the user's preferences, which is beneficial to further improving the user experience when using the electronic device.
[0246] The second preset color compensation coefficient corresponds to the second camera. The second preset color compensation coefficient can be a color compensation coefficient set by the user according to the user's preferred color.
[0247] In some implementations, the electronic device can look up a color compensation coefficient table based on the second camera identifier of the second camera to obtain a second preset color compensation coefficient, and adjust the color of the second white balance image based on the second preset color compensation coefficient to obtain a second adjusted image.
[0248] In some implementations, the electronic device may generate a second prompt message and receive a second preset color compensation coefficient from the second camera uploaded by the user based on the second prompt message.
[0249] The second prompt message can be used to prompt the user to upload the second preset color compensation coefficient of the second camera to the electronic device. The second prompt message can be at least one of text prompt message, sound prompt message or light prompt message, etc., without limitation here.
[0250] The solution provided in this embodiment involves performing white balance processing on a first initial image from a first camera to obtain a first white balance image and a first white point. A second white point is then obtained based on the first white point. The first white point is mapped to a second initial image from the second camera based on a first mapping relationship to obtain a third white point. A fourth white point is obtained based on the third white point. The first white point is then mapped to the second initial image based on a second mapping relationship between the second and fourth white points to obtain a fifth white point. White balance processing is then performed on the second initial image based on the fifth white point to obtain a second white balance image. Finally, color adjustments are made to the first white balance image based on a first preset color compensation coefficient to obtain a first adjusted image. The method involves adjusting the color of a second white balance image based on a second preset color compensation coefficient to obtain a second adjusted image. This achieves a mapping relationship between the first and second cameras, mapping the white balance decision points of the first camera to the second camera, and performing white balance on the second camera based on the white balance decision points of the second camera. This reduces the difference between the white balance decision points of the first and second cameras, and reduces the color difference between the first and second white balance images. As a result, the color difference between the first and second white balance images is less likely to be perceived by the user, which helps to improve the user experience when using electronic devices.
[0251] Adjusting the color of the first white balance image after white balance processing based on the first preset color compensation coefficient, and adjusting the color of the second white balance image after white balance processing based on the second preset color compensation coefficient, can make both the first and second adjusted images meet user preferences, which is conducive to further improving the user experience when using electronic devices.
[0252] Please see Figure 14 This application illustrates a multi-camera color synchronization device 600 according to an embodiment of the present application. The multi-camera color synchronization device 600 can be applied to an electronic device 100, which may include a first camera and a second camera. The following uses the electronic device 100 as an example to illustrate... Figure 14 The multi-camera color synchronization device 600 shown will be described in detail. The multi-camera color synchronization device 600 may include a first processing module 610, a first correction module 620, a first mapping module 630, a second correction module 640, a second mapping module 650, and a second processing module 660.
[0253] The first processing module 610 can be used to perform white balance processing on the first initial image of the first camera to obtain a first white balance image and a first white point; the first correction module 620 can be used to obtain a second white point based on the first white point, the second white point being closer to true white than the first white point; the first mapping module 630 can be used to map the first white point to the second initial image of the second camera based on the first mapping relationship to obtain a third white point, the first mapping relationship being used to characterize the correspondence between the white balance coordinate points of the first camera and the second camera under a preset light source; the second correction module 640 can be used to obtain a fourth white point based on the third white point, the fourth white point being closer to true white than the third white point; the second mapping module 650 can be used to map the first white point to the second initial image based on the second mapping relationship between the second white point and the fourth white point to obtain a fifth white point; the second processing module 660 can be used to perform white balance processing on the second initial image based on the fifth white point to obtain a second white balance image.
[0254] In some implementations, the color synchronization device 600 for multiple cameras may further include a first adjustment module and a first determination module.
[0255] The first adjustment module can be used by the second mapping module 650 to map the first white point to the second initial image according to the second mapping relationship between the second white point and the fourth white point, and before obtaining the fifth white point, to adjust the color of the first white balance image based on the first preset color compensation coefficient to obtain the first adjusted image; the first determination module can be used to determine the point in the first adjusted image corresponding to the pixel position of the first white point in the first white balance image as the sixth white point.
[0256] In some implementations, the second mapping module 650 may include the first mapping unit.
[0257] The first mapping unit can be used to map the sixth white point to the second initial image according to the second mapping relationship, so as to obtain the fifth white point.
[0258] In some implementations, the preset light source may include a first light source and a second light source, and the white balance coordinate points may include a first white balance coordinate point, a second white balance coordinate point, a third white balance coordinate point, and a fourth white balance coordinate point. The color synchronization device 600 for multiple cameras may also include a first acquisition module, a second acquisition module, and a second determination module.
[0259] The first acquisition module can be used to adjust the color of the first white balance image based on the first preset color compensation coefficient. Before obtaining the first adjusted image, the first white balance coordinate point of the first camera under the first light source and the second white balance coordinate point of the first camera under the second light source can be acquired respectively. The second acquisition module can be used to acquire the third white balance coordinate point of the second camera under the first light source and the fourth white balance coordinate point of the second camera under the second light source respectively. The second determination module can be used to determine the first mapping relationship based on the first white balance coordinate point, the second white balance coordinate point, the third white balance coordinate point and the fourth white balance coordinate point.
[0260] In some embodiments, the multi-camera color synchronization device 600 may further include a third determination module, a third correction module, and a third processing module.
[0261] The third determining module can be used by the first mapping unit to map the sixth white point to the second initial image according to the second mapping relationship, and after obtaining the fifth white point, to determine the correction coefficient of the fifth white point according to the first white balance coordinate point, the second white balance coordinate point, the third white balance coordinate point and the fourth white balance coordinate point; the third correction module can be used to correct the fifth white point according to the correction coefficient to obtain the seventh white point; the third processing module can be used to perform white balance processing on the second initial image according to the seventh white point to obtain the third white balance image.
[0262] In some implementations, the third determining module may include a first determining unit, a second determining unit, and a first calculating unit.
[0263] The first determining unit can be used to determine the first vector based on the first white balance coordinate point and the second white balance coordinate point; the second determining unit can be used to determine the second vector based on the third white balance coordinate point and the fourth white balance coordinate point; the first calculating unit can be used to calculate the ratio of the first vector length of the first vector to the second vector length of the second vector to obtain the correction coefficient.
[0264] In some implementations, the multi-camera color synchronization device 600 may also include a fourth determining module.
[0265] The fourth determining module can be used to determine the first preset color compensation coefficient based on the first camera before the first adjustment module adjusts the color of the first white balance image based on the first preset color compensation coefficient to obtain the first adjusted image.
[0266] In some implementations, the first correction module 620 may include a first selection unit, a first assignment unit, and a second calculation unit.
[0267] The first selection unit can be used to select multiple first target color coordinate points associated with the first white point in a white balance coordinate system, and each first target color coordinate point can correspond to a first color; the first assignment unit can be used to assign a first weight to each first target color coordinate point according to a first preset rule; the second calculation unit can be used to perform a weighted average calculation on multiple first target color coordinate points based on each first target color coordinate point and its corresponding first weight to obtain the second white point.
[0268] In some implementations, the first selection unit may include a first selection subunit.
[0269] The first selection sub-unit can be used to select multiple color coordinate points within a first preset area as multiple first target color coordinate points, with the first white point as the center point, in a white balance coordinate system.
[0270] In some implementations, the second correction module 640 may include a second selection unit, a second assignment unit, and a third calculation unit.
[0271] The second selection unit can be used to select multiple second target color coordinate points associated with the third white point in the white balance coordinate system, and each second target color coordinate point can correspond to a second color; the second assignment unit can be used to assign a second weight to each second target color coordinate point according to the third vector, which can be obtained based on the first white point and the second white point; the third calculation unit can be used to perform a weighted average calculation on multiple second target color coordinate points based on each second target color coordinate point and the corresponding second weight to obtain the fourth white point.
[0272] In some implementations, the second assignment unit may include the first assignment subunit.
[0273] The first assignment subunit can be used to assign a second weight to each second target color coordinate point according to the first preset rule when the length of the third vector is less than the length threshold.
[0274] In some implementations, the second assignment unit may include a second assignment subunit.
[0275] The second assignment subunit can be used to assign a second weight to each second target color coordinate point according to the second preset rule when the length of the third vector is greater than or equal to the length threshold.
[0276] In some implementations, the multi-camera color synchronization device 600 may further include a second adjustment module and a third adjustment module.
[0277] The second adjustment module can be used to adjust the color of the first white balance image based on the first preset color compensation coefficient to obtain the first adjusted image; the third adjustment module can be used to adjust the color of the second white balance image based on the second preset color compensation coefficient to obtain the second adjusted image.
[0278] In some implementations, the first processing module 610 may include a third determining unit and a processing unit.
[0279] The third determining unit can be used to determine the target field of view region image of the first initial image. The target field of view region image can be the common field of view region image of the first initial image and the second initial image. The processing unit can be used to perform white balance processing on the target field of view region image to obtain a first white balance image and a first white point.
[0280] In some implementations, the third determining unit may be a determining subunit, a correction subunit, and a truncation subunit.
[0281] The determining subunit can be used to determine the center offset of the first initial image relative to the second initial image; the correcting subunit can be used to correct the initial center point of the first initial image according to the center offset to obtain the target center point; the cropping subunit can be used to crop an image of the same size as the second initial image from the first initial image according to the target center point to obtain the target field of view region image.
[0282] The solution provided in this embodiment involves performing white balance processing on a first initial image from a first camera to obtain a first white balance image and a first white point. A second white point, closer to true white, is then obtained based on the first white point. The first white point is mapped to a second initial image from the second camera based on a first mapping relationship to obtain a third white point. The first mapping relationship characterizes the correspondence between the white balance coordinate points of the first and second cameras under a preset light source. A fourth white point, closer to true white, is then obtained based on the third white point. Finally, the first white point is mapped to the second initial image based on a second mapping relationship between the second and fourth white points. The process involves obtaining a fifth white point and performing white balance processing on the second initial image based on the fifth white point to obtain a second white balance image. This achieves a mapping relationship between the first and second cameras, mapping the white balance decision points of the first camera to the second camera, and performing white balance on the second camera based on the white balance decision points of the second camera. This reduces the difference between the white balance decision points of the first and second cameras, and reduces the color difference between the first and second white balance images. As a result, the color difference between the first and second white balance images is less likely to be perceived by the user, which helps to improve the user experience when using electronic devices.
[0283] When the camera's field of view does not include white, white correction is performed on the first white point after white balance, making the second white point closer to white. This helps improve the accuracy of the white balance decision point of the second camera, thereby further reducing the color difference between the first white balance image and the second white balance image.
[0284] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For device embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to in the description of the method embodiments. Any processing method described in the method embodiments can be implemented in the device embodiments through corresponding processing modules, and will not be elaborated upon further in the device embodiments.
[0285] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0286] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses a layered Android system as an example to illustrate the software structure of electronic device 100.
[0287] Please see Figure 15 This diagram illustrates the structure of a software system of an electronic device 100 according to an embodiment of this application. The software system includes several layers, each with a clear role and division of labor, and the layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the system library layer, and the kernel layer.
[0288] The application layer can include a range of applications, such as camera applications, gallery applications, calling applications, wireless local area network (WLAN) applications, video applications, media provider applications, filesystem in userspace (FUSE) applications, etc.
[0289] The Media Provider is used to create or access multimedia files within FUSE. Applications in the application layer can create or access multimedia files within FUSE through the Media Provider.
[0290] FUSE is used to store multimedia files created by media providers. Of course, in other embodiments, FUSE can also be used to store other data.
[0291] The application framework layer provides an Application Programming Interface (API) and programming framework for applications in the application layer. The application framework layer includes predefined functions. For example, it may include a window manager, content provider, resource manager, and view system.
[0292] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.
[0293] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, and more.
[0294] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0295] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0296] System libraries may include Surface Manager, Media Libraries, Android Rruntime, etc.
[0297] The Android runtime consists of the core libraries and the virtual machine. The Android runtime is responsible for scheduling and managing the Android system. The core libraries comprise two parts: one part contains the functionalities that Java needs to call, and the other part consists of the Android core libraries. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0298] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0299] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0300] The kernel layer can include modules such as camera driver, display driver, Wi-Fi driver, Bluetooth driver, and audio driver.
[0301] Understandable, Figure 15 The layers in the illustrated software structure and the components contained in each layer do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer layers than illustrated, and each layer may include more or fewer components; this application does not impose any limitations.
[0302] Please see Figure 16 This illustrates a functional block diagram of an electronic device 700 according to an embodiment of this application. Figure 16 As shown, the electronic device 700 includes: one or more processors 710 ( Figure 16 Only one processor is shown in the diagram) and a memory 720, which is coupled to one or more processors 710. The memory 720 is used to store computer program code 730, which includes computer instructions. One or more processors 710 call the computer instructions to cause the electronic device 700 to perform the steps in any of the above methods.
[0303] Those skilled in the art will understand that Figure 16 This is merely an example of electronic device 700 and does not constitute a limitation on electronic device 700. In practice, electronic device 700 may include more or fewer components than shown, or combine certain components, or different components. For example, it may also include input / output devices, network access devices, etc. Electronic device 700 may also be the same device as electronic device 100 described in the above embodiments.
[0304] The processor 710 can be a Central Processing Unit (CPU), other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0305] In some embodiments, memory 720 may be an internal storage unit of electronic device 700, such as a hard disk or memory of electronic device 700. In other embodiments, memory 720 may be an external storage device of electronic device 700, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on electronic device 700. Optionally, memory 720 may include both internal and external storage units of electronic device 700. Memory 720 is used to store operating system, application programs, bootloaders, data, and other programs, such as program code of computer programs. Memory 720 may also be used to temporarily store data that has been output or will be output.
[0306] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0307] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the above device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0308] This application also provides a chip system applied to an electronic device. The chip system includes one or more processors, which are used to invoke computer instructions to cause the electronic device to implement the steps in any of the above methods.
[0309] In some implementations, the chip system also includes a memory connected to one or more processors via circuitry or wiring.
[0310] In some implementations, the chip system also includes a communication interface.
[0311] This application also provides a computer-readable medium including instructions that, when executed on an electronic device, cause the electronic device to perform the methods described in the above-described method embodiments.
[0312] This application also provides a computer program product that, when run on an electronic device, causes the electronic device to perform the aforementioned related steps to implement the methods described in the various method embodiments above.
[0313] If the integrated units described above are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable medium. Based on this understanding, all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographic device / electronic device, a recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0314] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0315] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0316] In the embodiments provided in this application, it should be understood that the disclosed apparatus / device and method can be implemented in other ways. For example, the apparatus / device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0317] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0318] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0319] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0320] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0321] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0322] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A multi-camera color synchronization method, characterized by, The color synchronization method, applied to an electronic device including a first camera and a second camera, includes: Perform white balance processing on the first initial image from the first camera to obtain a first white balance image and a first white point; A second white point is obtained based on the first white point, and the second white point is closer to true white than the first white point; Based on the first mapping relationship, the first white point is mapped to the second initial image of the second camera to obtain the third white point. The first mapping relationship is used to characterize the correspondence between the white balance coordinate points of the first camera and the second camera under a preset light source. A fourth white point is obtained based on the third white point, and the fourth white point is closer to true white than the third white point; Based on the second mapping relationship between the second white point and the fourth white point, the first white point is mapped to the second initial image to obtain the fifth white point; The second initial image is white-balanced based on the fifth white point to obtain the second white-balanced image.
2. The color synchronization method of claim 1, wherein, Before mapping the first white point to the second initial image based on the second mapping relationship between the second white point and the fourth white point to obtain the fifth white point, the color synchronization method further includes: The first white balance image is color-adjusted based on the first preset color compensation coefficient to obtain the first adjusted image; Based on the pixel position of the first white point in the first white balance image, the point in the first adjustment image corresponding to the pixel position is determined as the sixth white point; The step of mapping the first white point to the second initial image based on the second mapping relationship between the second white point and the fourth white point to obtain the fifth white point includes: The sixth white point is mapped to the second initial image according to the second mapping relationship to obtain the fifth white point.
3. The color synchronization method of claim 2, wherein, The preset light source includes a first light source and a second light source; the white balance coordinate points include a first white balance coordinate point, a second white balance coordinate point, a third white balance coordinate point, and a fourth white balance coordinate point; before mapping the first white point to the second camera based on the first mapping relationship to obtain the third white point, the color synchronization method further includes: The first white balance coordinate point of the first camera under the first light source and the second white balance coordinate point of the first camera under the second light source are obtained respectively. The third white balance coordinate point of the second camera under the first light source and the fourth white balance coordinate point of the second camera under the second light source are obtained respectively; The first mapping relationship is determined based on the first white balance coordinate point, the second white balance coordinate point, the third white balance coordinate point, and the fourth white balance coordinate point.
4. The color synchronization method of claim 3, wherein, After mapping the sixth white point to the second initial image according to the second mapping relationship to obtain the fifth white point, the color synchronization method further includes: The correction coefficient of the fifth white point is determined based on the first white balance coordinate point, the second white balance coordinate point, the third white balance coordinate point, and the fourth white balance coordinate point. The fifth white point is corrected according to the correction coefficient to obtain the seventh white point; The second initial image is white-balanced based on the seventh white point to obtain a third white-balanced image.
5. The color synchronization method of claim 4, wherein, The step of determining the correction coefficient for the fifth white point based on the first white balance coordinate point, the second white balance coordinate point, the third white balance coordinate point, and the fourth white balance coordinate point includes: Determine the first vector based on the first white balance coordinate point and the second white balance coordinate point; The second vector is determined based on the third white balance coordinate point and the fourth white balance coordinate point; The correction coefficient is obtained by calculating the ratio of the first vector length of the first vector to the second vector length of the second vector.
6. The color synchronization method according to any one of claims 2 to 5, wherein, The first preset color compensation coefficient corresponds to the first camera.
7. The color synchronization method according to any one of claims 1 to 6, wherein, The process of obtaining the second white point based on the first white point includes: In the white balance coordinate system, select multiple first target color coordinate points associated with the first white point, and each first target color coordinate point corresponds to a first color; Each first target color coordinate point is assigned a first weight according to a first preset rule; Based on each first target color coordinate point and its corresponding first weight, a weighted average is calculated on the plurality of first target color coordinate points to obtain the second white point.
8. The color synchronization method according to claim 7, characterized in that, The step of selecting multiple first target color coordinate points associated with the first white point in the white balance coordinate system includes: In the white balance coordinate system, with the first white point as the center point, multiple color coordinate points within the first preset area are selected as the multiple first target color coordinate points.
9. The color synchronization method according to any one of claims 1 to 8, characterized in that, The process of obtaining the fourth white point based on the third white point includes: In the white balance coordinate system, select multiple second target color coordinate points associated with the third white point, with each second target color coordinate point corresponding to a second color; A second weight is assigned to each of the second target color coordinate points according to a third vector, wherein the third vector is obtained based on the first white point and the second white point; Based on each second target color coordinate point and its corresponding second weight, a weighted average is calculated on the plurality of second target color coordinate points to obtain the fourth white point.
10. The color synchronization method according to claim 9, characterized in that, Assigning a second weight to each second target color coordinate point based on the third vector includes: When the length of the third vector is less than the length threshold, the second weight is assigned to each second target color coordinate point according to the first preset rule.
11. The color synchronization method according to claim 10, characterized in that, Also includes: When the length of the third vector is greater than or equal to the length threshold, the second weight is assigned to each second target color coordinate point according to the second preset rule.
12. The color synchronization method according to claim 1, characterized in that, Also includes: The first white balance image is color-adjusted based on the first preset color compensation coefficient to obtain the first adjusted image; The second white balance image is color-adjusted based on the second preset color compensation coefficient to obtain the second adjusted image.
13. The color synchronization method according to claim 12, characterized in that, The first preset color compensation coefficient corresponds to the first camera, and the second preset color compensation coefficient corresponds to the second camera.
14. The color synchronization method according to any one of claims 1 to 13, characterized in that, The step of performing white balance processing on the first initial image from the first camera to obtain a first white balance image and a first white point includes: Determine the target field of view region image of the first initial image, wherein the target field of view region image is the common field of view region image of the first initial image and the second initial image; The target field of view region image is subjected to white balance processing to obtain the first white balance image and the first white point.
15. The color synchronization method according to claim 14, characterized in that, Determining the target field of view region image of the first initial image includes: Determine the center offset of the first initial image relative to the second initial image; The initial center point of the first initial image is corrected according to the center offset to obtain the target center point; Based on the target center point, an image of the same size as the second initial image is extracted from the first initial image to obtain the target field of view region image.
16. An electronic device, characterized in that, The electronic device includes: one or more processors, and a memory; The memory is coupled to one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions, wherein the one or more processors call the computer instructions to cause the electronic device to perform the color synchronization method as described in any one of claims 1 to 15.
17. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on an electronic device, cause the electronic device to perform the color synchronization method as described in any one of claims 1 to 15.