Image processing method, device and electronic equipment
By using the color mapping table for color correction and updating in virtual shooting, the problem of color differences caused by factors such as background screens and lighting in virtual shooting is solved, improving the quality and efficiency of video shooting.
Patent Information
- Application Number
- CN202311435569.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-30
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2043-10-30
AI Technical Summary
During the virtual shooting process, factors such as color attenuation of the background screen, lighting effects, camera angle and position, lead to large color differences between the captured image and the image to be displayed, affecting the image quality.
By obtaining the image to be displayed, using the color map for color correction, updating the color map to adapt to color changes during the shooting process, ensuring that the color difference in the common area between the captured image and the image to be displayed is less than the preset threshold.
It effectively overcomes the color mismatch problem caused by color drift, improves the quality of virtual shooting videos, ensures color matching between the captured image and the image to be displayed, and improves shooting efficiency and image quality.
Smart Images

Figure CN117478802B
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to image processing methods, devices and electronic equipment. Background Art
[0002] Virtual shooting is to place the object to be shot in front of the background screen, display the background image on the background screen, and then shoot the object to be shot, making the object to be shot seem to be in the real scene. Compared with green screen shooting, the camera can directly shoot the final picture, which helps to improve the efficiency of shooting and production and save costs.
[0003] During the virtual shooting process, if the image to be displayed is directly displayed on the background screen for shooting, the shooting environment will affect the background of the captured image and the image to be displayed, resulting in obvious color difference. To solve this color difference problem, the relevant technology is to perform color correction on the image to be displayed before shooting, so as to achieve color alignment between the captured image and the image to be displayed.
[0004] However, in the actual virtual shooting process, many factors are changing, such as the color attenuation of the background screen, the influence of the lighting on the scene, the camera angle, position, etc. These factors will affect the color of the captured image. Even after color correction, it will cause a large color difference between the captured image and the image to be displayed, which will affect the quality of the image. Summary of the invention
[0005] Multiple aspects of the present application provide image processing methods, devices and electronic devices to improve the quality of captured images.
[0006] A first aspect of an embodiment of the present application provides an image processing method, including: acquiring a first image to be displayed; using a first color mapping table to perform color correction on the first image to be displayed to obtain a first corrected image, the first color mapping table being obtained by updating a second color mapping table based on a first color difference between a second image to be displayed and a captured image, the second image to be displayed being an image of a previous frame of the first image to be displayed, the second color mapping table being used to perform color correction on the second image to be displayed to obtain a second corrected image, the captured image being obtained by a camera shooting an object to be shot with the second corrected image as a background; controlling the first corrected image to be displayed on a background screen; controlling the camera to shoot the object to be shot with the first corrected image as a background to obtain a target image, the second color difference between the first image to be displayed and the target image in a common area being less than a preset threshold.
[0007] A second aspect of an embodiment of the present application provides an image processing device, including:
[0008] An acquisition module, used for acquiring a first image to be displayed;
[0009] a correction module, configured to perform color correction on a first image to be displayed using a first color mapping table to obtain a first corrected image, wherein the first color mapping table is obtained by updating a second color mapping table according to a first color difference between a second image to be displayed and a captured image, wherein the second image to be displayed is an image frame previous to the first image to be displayed, and the second color mapping table is used to perform color correction on the second image to be displayed to obtain a second corrected image, wherein the captured image is obtained by a camera capturing an object to be captured with the second corrected image as a background;
[0010] A first control module, used for controlling the display of a first corrected image on a background screen;
[0011] The second control module controls the camera to shoot the object to be shot with the first corrected image as the background to obtain a target image, and the second color difference between the first image to be displayed and the target image in the common area is less than a preset threshold.
[0012] A third aspect of an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the image processing method of the first aspect when executing the computer program.
[0013] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the image processing method of the first aspect.
[0014] The embodiment of the present application is applied in an image processing scenario, by acquiring a first image to be displayed; using a first color mapping table to perform color correction on the first image to be displayed to obtain a first corrected image, the first color mapping table is obtained by updating a second color mapping table according to a first color difference between the second image to be displayed and the captured image, the second image to be displayed is an image of the previous frame of the first image to be displayed, the second color mapping table is used to perform color correction on the second image to be displayed to obtain a second corrected image, the captured image is obtained by a camera shooting an object to be shot with the second corrected image as a background; controlling the first corrected image to be displayed on a background screen; controlling the camera to shoot the object to be shot with the first corrected image as a background to obtain a target image, the second color difference in a common area between the first image to be displayed and the target image is less than a preset threshold, and a high-quality captured image can be obtained. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0016] Figure 1 An application scenario diagram provided for an exemplary embodiment of the present application;
[0017] Figure 2 A flowchart of an image processing method provided for an exemplary embodiment of the present application;
[0018] Figure 3 A schematic diagram of a color mapping table update process provided for an exemplary embodiment of the present application;
[0019] Figure 4 A schematic diagram of a synthetic extended reality image provided for an exemplary embodiment of the present application;
[0020] Figure 5 A schematic diagram of determining a first area and a second area provided for an exemplary embodiment of the present application;
[0021] Figure 6 A schematic diagram of pixel clustering provided for an exemplary embodiment of the present application;
[0022] Figure 7 A structural block diagram of an image processing device provided for an exemplary embodiment of the present application;
[0023] Figure 8 A schematic structural diagram of an electronic device provided for an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0024] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0025] With the continuous advancement of display and control technology, virtual shooting is increasingly being used in video production, especially XR (extended reality) technology, which has achieved good shooting effects in many videos. However, using XR technology to shoot videos also faces a variety of technical and system difficulties, among which the color mismatch between the real shot part and the extended part is one of the difficulties.
[0026] Based on the above problems, the present application obtains a first image to be displayed, and uses a first color mapping table to perform color correction on the first image to be displayed to obtain a first corrected image. The first color mapping table is obtained by updating the second color mapping table according to the first color difference between the second image to be displayed and the captured image. The second image to be displayed is the previous frame image of the first image to be displayed. The second color mapping table is used to perform color correction on the second image to be displayed to obtain a second corrected image. The captured image is obtained by a camera shooting an object to be shot with the second corrected image as the background; the first corrected image is controlled to be displayed on the background screen; the camera is controlled to shoot the object to be shot with the first corrected image as the background to obtain a target image. The second color difference in the common area between the first image to be displayed and the target image is less than a preset threshold, which can overcome the color mismatch problem caused by color drift caused by various reasons during shooting and improve the video quality of virtual shooting.
[0027] In this embodiment, the execution device of the image processing method is not limited. Optionally, the image processing method is applied to a terminal, and the overall image processing method can also be implemented with the help of a cloud computing system. For example, the image processing method can be applied to a cloud server so as to run various models with the advantage of cloud resources; in addition to being applied to the cloud, the image processing method can also be applied to server-side devices such as conventional servers, cloud servers, or server arrays.
[0028] In addition, refer to Figure 1 , is an application scenario diagram of the present application. The application scenario diagram is a virtual shooting process, which uses XR technology, that is, setting a background screen, an object to be shot, and a camera in a virtual shooting scene. First, the extended image to be displayed is displayed on the background screen. The object to be shot stands in front of the background screen, and the content displayed on the background screen is used as the background. The camera shoots the object to be shot to obtain a target image, which is the real shot part. The background of the target image is the content displayed on the background screen. It can be seen that in Figure 1 If the image to be displayed is displayed directly on the background screen without being processed, there will be a color difference between the background of the target image captured by the camera and the content displayed on the background screen. Figure 1 There is a difference between the colors of the hexagonal star displayed on the background screen and the hexagonal star in the target image.
[0029] Figure 1 This is only an exemplary application scenario of the present application. The present application can also be applied in other related scenarios and is not limited here.
[0030] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.
[0031] Figure 2 The following is a flowchart of an image processing method provided by an exemplary embodiment of the present application. Figure 2 The image processing method shown specifically comprises the following steps:
[0032] S201: Acquire a first image to be displayed.
[0033] The first image to be displayed is preset, and the content in the first image to be displayed is the background content to be displayed in the captured image.
[0034] S202: Perform color correction on a first image to be displayed using a first color mapping table to obtain a first corrected image.
[0035] The first color mapping table may be a reverse color lookup table (LUT), through which the color of the first image to be displayed may be corrected to obtain a first corrected image. The first color mapping table may include a color change value corresponding to each color value in a plurality of color values in the image, and inputting a color value into the first color mapping table may output another color value, for example, the color value (R, G, B) is (5, 4, 6), and after the color value is corrected by the first color mapping table, the color value is corrected to (6, 5, 7). In addition, the first color mapping table may also be expressed in other forms, which are not limited here.
[0036] Among them, the first color mapping table is obtained by updating the second color mapping table according to the first color difference between the second image to be displayed and the captured image, the second image to be displayed is the previous frame image of the first image to be displayed, the second color mapping table is used to perform color correction on the second image to be displayed to obtain a second corrected image, and the captured image is obtained by a camera shooting the object to be photographed with the second corrected image as the background.
[0037] For example, refer to Figure 3 After correcting the second image to be displayed using the second color mapping table, a second corrected image is obtained. The second corrected image is taken as the background to obtain a captured image. The second color mapping table can be adjusted according to the first color difference between the captured image and the second image to be displayed to obtain the first color mapping table.
[0038] S203, controlling the display of the first corrected image on the background screen.
[0039] Reference Figure 1 and Figure 3 , display the first corrected image on the background screen
[0040] S204, controlling the camera to shoot the object to be shot with the first corrected image as the background to obtain a target image.
[0041] Among them, the second color difference between the first image to be displayed and the target image in the common area is less than a preset threshold. The preset threshold is pre-set. In the embodiment of the present application, the first color mapping table is updated based on the second color mapping table. The first image to be displayed is corrected by the first color mapping table and then displayed, so that the difference between the obtained target image and the first image to be displayed can be very small (that is, less than the preset threshold). The common area between the first image to be displayed and the target image may refer to the area where the two images coexist, and the content (including objects, background, etc.) displayed in the common area is the same, only the color is different. The common area between the first image to be displayed and the target image refers to Figure 4 , that is, the second color difference between the first area of the first image to be displayed and the second area of the target image is less than the preset threshold, which can ensure the quality of the obtained target image.
[0042] Furthermore, after controlling the camera to shoot the object to be shot with the first corrected image as the background and obtaining the target image, it also includes: determining a second color difference between the first image to be displayed and the target image; updating the first color mapping table according to the second color difference to obtain a third color mapping table, and determining the third color mapping table as the first color mapping table for color correction of the image to be displayed in the next frame of the first image to be displayed. For example, referring to Figure 3 The second color difference between the first image to be displayed and the target image can be used to adjust the first color mapping table to obtain a third color mapping table.
[0043] The embodiment of the present application is a process of iteratively adjusting the color mapping table. Specifically, other methods are used to determine the initial color mapping table. Then, during the shooting process, before each image is captured, the image to be displayed is color-corrected based on the current latest color mapping table and then captured as the background to obtain the image; after each image capture is completed, the current color mapping table is updated and adjusted according to the color difference between the captured image and the image to be displayed. That is, the current color mapping table is updated. For example, during the video shooting process, there are N images to be displayed, and the N images to be displayed need to be processed and displayed in sequence, wherein the initial color mapping table is used to correct the first image to be displayed to obtain the first corrected image, the first corrected image displayed on the background screen is captured to obtain the first captured image, and then the initial color mapping table is adjusted according to the first captured image and the first image to be displayed to obtain the second color mapping table. Subsequently, the i-th color mapping table is used to correct the i-th image to be displayed to obtain the i-th corrected image, the i-th corrected image displayed on the background screen is photographed to obtain the i-th captured image, and then the i-th color mapping table is adjusted according to the i-th captured image and the i-th image to be displayed to obtain the i+1-th color mapping table, where i is an integer from 2 to N in sequence, and this step is repeated to achieve iterative adjustment of the color mapping table.
[0044] In an embodiment of the present application, the color mapping table can be iteratively adjusted during the shooting process so that the color mapping table can correct the color differences caused by various changing factors such as color attenuation of the background screen, the influence of lighting on the scene, the camera angle, position, etc., thereby reducing the color difference between the final captured target image and the image to be displayed, and improving the quality of the captured target image.
[0045] Furthermore, after controlling the camera to shoot the object to be photographed with the first corrected image as the background and obtaining the target image, it also includes: obtaining a preset extended image, a partial area of the preset extended image being the first image to be displayed; and synthesizing the preset extended image and the target image to obtain an extended reality image.
[0046] For example, the entire image capturing process may be to first extract a first image to be displayed from a preset extended image, where the first image to be displayed may be a partial area of the preset extended image that may serve as the background of the object to be captured. Then, the first image to be displayed is processed in the above steps to obtain a target image, and then the preset extended image and the target image are synthesized to obtain an extended reality image. Specifically, referring to Figure 4 , synthesizing the preset extended image and the target image can be to splice the area of the preset extended image except the first image to be displayed with the target image to obtain an extended reality image. In an embodiment of the present application, the target image is actually shot, and the preset extended image can be some three-dimensional scenes fictionalized by computer technology, then the obtained extended reality image can achieve the visual effect of the object to be photographed in a real three-dimensional scene. Moreover, since only the first image to be displayed in the preset extended image is used for shooting in the process of shooting the target image, the speed of image color correction and the update speed of the color mapping table can be effectively guaranteed. At the same time, since the background of the object to be photographed is small, the hardware requirements for shooting can be reduced, thereby reducing the difficulty of shooting.
[0047] Before determining the second color difference between the first image to be displayed and the target image, the method may further include: obtaining a preset extended image, wherein a part of the preset extended image is the first image to be displayed; and extracting the first image to be displayed from the preset extended image. Figure 4 , the first image to be displayed can be directly extracted from the preset extended image by cutting.
[0048] Wherein, determining the second color difference between the first image to be displayed and the target image may include: obtaining a first area of the first image to be displayed and a second area of the target image, the first area and the second area being common areas of the first image to be displayed and the target image, and having the same object in the first area and the second area (the object may include different target objects displayed on the background of the image); determining the color difference value of the first area and the second area as the second color difference. Wherein, the area other than the area where the object to be photographed is located in the target image may be first determined as the second area, and then the corresponding area in the first image to be displayed may be determined as the first area according to the position and shape of the second area in the target image.
[0049] In an optional embodiment, the present application may also determine a first area in the preset extended image, and then determine the color difference value between the first area and the second area as the second color difference. The first area and the second area are common areas of the first image to be displayed and the target image.
[0050] For example, refer to Figure 5 The area in the first image to be displayed except the third area where the object to be photographed is located is the first area, and the area in the target image except the fourth area corresponding to the position and shape of the third area is the second area, and the first area and the second area contain the same object.
[0051] In the embodiment of the present application, the color difference value between the first area and the second area may be determined as the second color difference. It can be understood that the color difference value may be a set, including multiple pixel color difference values.
[0052] Determining the color difference value between the first area and the second area as the second color difference may include: clustering the pixels in the first area to obtain multiple categories of first pixels, where the color categories of first pixels of different categories are different; in the second area, clustering the pixels at the same position as the first pixel into one category to obtain multiple categories of second pixels, where the first pixels correspond one to one with the second pixels; for the first pixel, determining the pixel color difference value between the first pixel and the corresponding second pixel, and determining the second color difference according to the pixel color difference values corresponding to each category of the first pixels.
[0053] One clustering method is to cluster pixels according to their color categories, with different color categories having different color value ranges. For example, red pixels are clustered into one category, white pixels are clustered into one category, blue pixels are clustered into one category, and green pixels are clustered into one category, so that multiple categories of first pixels can be obtained. The average value of the colors of each pixel in each category of first pixels can be used as the first pixel color value of the first pixel in that category.
[0054] For example, refer to Figure 6, the first area can be clustered into three types of first pixels, namely A1, A2 and A3, and the corresponding second area can be clustered into three types of second pixels, namely B1, B2 and B3. Among them, A1 corresponds to B1, A2 corresponds to B2, and A3 corresponds to B3.
[0055] Table 1
[0056]
[0057] Among them, in Table 1, the first pixel color value of the first pixel is the first average value of the color values of each pixel in the corresponding cluster area, and the second pixel color value of the second pixel is the second average value of the color values of each pixel in the corresponding cluster area. The pixel color difference value corresponds to the difference between the second pixel color value and the first pixel color value in the same area. Taking Table 1 as an example, C1 represents the difference between the first average value of the color values of each pixel in the first pixel of class A1 and the second average value of the color values of each pixel in the second pixel of class B1, C2 represents the difference between the first average value of the color values of each pixel in the first pixel of class A2 and the second average value of the color values of each pixel in the second pixel of class B2, and C3 represents the difference between the first average value of the color values of each pixel in the first pixel of class A3 and the second average value of the color values of each pixel in the second pixel of class B3.
[0058] In the embodiment of the present application, other clustering methods may also be used to classify the pixels in the first area, which is not limited here.
[0059] Furthermore, the pixel color difference value is used to adjust the first color mapping table to obtain a third color mapping table. Exemplarily, the corrected color value obtained after the color value (5,6,7) is input into the first color mapping table is (4,5,7); after the first color mapping table is adjusted, the corrected color value obtained after the color value (5,6,7) is input into the first color mapping table becomes (4,5,6). Among them, the present application does not limit how the pixel color difference value is specifically adjusted to the first color mapping table, and the result after the adjustment is that after the input color value is corrected using the third color mapping table, the color of the color value displayed on the screen is closer to the input color value.
[0060] The above is only an exemplary method. The present application may also use other methods to adjust the first color mapping table to obtain the third color mapping table, and this is not limited to this.
[0061] In addition, updating the first color mapping table according to the second color difference to obtain the third color mapping table may include: acquiring an initial color mapping table; and updating the first color mapping table according to the second color difference with the initial color mapping table as a constraint to obtain the third color mapping table.
[0062] Among them, taking the initial color mapping table as a constraint, updating the first color mapping table according to the second color difference to obtain a third color mapping table, including: adjusting the color values in the first color mapping table according to the second color difference to obtain the third color mapping table, so that after the next frame of the first image to be displayed is color corrected based on the third color mapping table, the color difference in the common area between the next frame of the image to be displayed and the target image obtained based on the next frame of the image to be displayed is reduced, and the difference between the third color mapping table and the initial color mapping table meets a preset condition.
[0063] Specifically, after the first color mapping table is updated with the second color difference, an updated color mapping table is obtained. If the difference between the updated color mapping table and the initial color mapping table meets the preset condition, the updated color mapping table can be determined to be the third color mapping table. If the difference between the updated color mapping table and the initial color mapping table does not meet the preset condition, the second color difference can be reduced, and then the reduced second color difference can be used to update the first color mapping table until the difference between the obtained updated color mapping table and the initial color mapping table meets the preset condition. For example, the second color difference can be reduced to 0.9× the second color difference, and the first color mapping table is updated with 0.9× the second color difference. If the updated color mapping table meets the preset condition, the updated color mapping table is determined to be the third color mapping table. Otherwise, the second color difference is reduced to 0.8× the second color difference, and the above steps are continued until the updated color mapping table meets the preset condition.
[0064] The above is only an exemplary constraint method using the initial color mapping table. The present application may also use other methods to constrain and obtain the third color mapping table.
[0065] In the embodiment of the present application, the preset condition is pre-set, and the role of the preset condition is to make the color mapping table change around the initial color mapping table during iterative updates, and not differ too much from the initial color mapping table.
[0066] In an embodiment of the present application, the initial color mapping table is used as a constraint to improve the accuracy of the determined color mapping table. In addition, in the actual XR shooting process, various variable factors may cause color drift. The iterative update based on the color mapping table can allow the color-calibrated color mapping table to always follow and offset the color changes, so that each captured target image can achieve a good color matching effect, with robust performance and strong adaptability. Furthermore, a common first area and a second area are determined based on the target image and the first image to be displayed, and multiple categories of first pixels and second pixels are clustered. According to the pixel difference value between the pairs of first pixels and second pixels, the color mapping table is updated, so that the adjustment of the color mapping table is simple and efficient.
[0067] In an embodiment of the present application, an image processing method is also provided, including: acquiring a first image to be displayed; using a first color mapping table to perform color correction on the first image to be displayed to obtain a first corrected image, the first color mapping table being obtained by updating a second color mapping table based on a first color difference between a second image to be displayed and a captured image, the second image to be displayed being a previous frame image of the first image to be displayed, the second color mapping table being used to perform color correction on the second image to be displayed to obtain a second corrected image, the captured image being obtained by a camera shooting an object to be photographed with the second corrected image as a background; sending the first corrected image to a background screen so that the background screen displays the first corrected image.
[0068] The specific implementation process of the method refers to the above embodiment and is not limited thereto.
[0069] In the embodiment of the present application, in addition to providing an image processing method, an image processing device is also provided. Figure 7 As shown, the image processing device 70 includes:
[0070] An acquisition module 71, used for acquiring a first image to be displayed;
[0071] a correction module 72, configured to perform color correction on the first image to be displayed using a first color mapping table to obtain a first corrected image, wherein the first color mapping table is obtained by updating a second color mapping table according to a first color difference between the second image to be displayed and the captured image, wherein the second image to be displayed is a frame image previous to the first image to be displayed, and the second color mapping table is used to perform color correction on the second image to be displayed to obtain a second corrected image, wherein the captured image is obtained by a camera capturing an object to be captured with the second corrected image as a background;
[0072] A first control module 73, used for controlling the display of a first corrected image on a background screen;
[0073] The second control module 74 controls the camera to shoot the object to be shot with the first corrected image as the background to obtain a target image, and the second color difference between the first image to be displayed and the target image in the common area is less than a preset threshold.
[0074] In an optional embodiment, an update module (not shown) is used to control the camera to shoot the object to be photographed with the first corrected image as the background, and after obtaining the target image, determine the second color difference between the first image to be displayed and the target image; update the first color mapping table according to the second color difference to obtain a third color mapping table, and determine the third color mapping table as the first color mapping table for color correction of the image to be displayed in the next frame of the first image to be displayed.
[0075] In an optional embodiment, when determining the second color difference between the first image to be displayed and the target image, the update module is specifically used to: obtain a first area of the first image to be displayed and a second area of the target image, the first area and the second area representing the common area of the first image to be displayed and the target image; determine that the color difference value between the first area and the second area is the second color difference.
[0076] In an optional embodiment, when the update module determines that the color difference value between the first area and the second area is the second color difference, it is specifically used to: cluster the pixels in the first area to obtain multiple categories of first pixels, and the color categories of first pixels of different categories are different; in the second area, determine that the pixels with the same position as the first pixel are clustered into one category to obtain multiple categories of second pixels, and the first pixels correspond to the second pixels one by one; for the first pixel, determine the pixel color difference value between the first pixel and the corresponding second pixel, and determine it according to the pixel color difference values corresponding to each category of first pixels.
[0077] In an optional embodiment, when the update module updates the first color mapping table according to the second color difference to obtain the third color mapping table, it is specifically used to: obtain the initial color mapping table; use the initial color mapping table as a constraint, update the first color mapping table according to the second color difference, and obtain the third color mapping table.
[0078] In an optional embodiment, it also includes a determination module (not shown) for obtaining a preset extended image before determining the second color difference between the first image to be displayed and the target image, wherein a partial area of the preset extended image is the first image to be displayed; and extracting the first image to be displayed from the preset extended image.
[0079] In an optional embodiment, it also includes a synthesis module, which is used to control the camera to shoot the object to be photographed with the first corrected image as the background, and after obtaining the target image, obtain a preset extended image, and a partial area of the preset extended image is displayed as the first image to be displayed; synthesize the preset extended image and the target image to obtain an extended reality image; send the first corrected image to the background screen so that the background screen displays the first corrected image.
[0080] In an optional embodiment, when the update module updates the first color mapping table according to the second color difference with the initial color mapping table as a constraint to obtain a third color mapping table, the update module is specifically used to: adjust the color values in the first color mapping table according to the second color difference to obtain a third color mapping table, so that after color correction of the next frame of the first image to be displayed is performed based on the third color mapping table, the color difference in the common area between the next frame of the image to be displayed and the target image obtained based on the next frame of the image to be displayed is reduced, and the difference between the third color mapping table and the initial color mapping table meets a preset condition.
[0081] The specific implementation process refers to the above embodiment and will not be described again here.
[0082] In addition, in some of the processes described in the above embodiments and the accompanying drawings, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this article or executed in parallel, and are only used to distinguish between different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this article are used to distinguish different messages, devices, modules, etc., do not represent the order of precedence, and do not limit the "first" and "second" to different types.
[0083] Figure 8 Schematic diagram of the structure of an electronic device provided by an exemplary embodiment of the present application. The electronic device 80 is used to run the above-mentioned image processing method and image processing method. Figure 8 As shown, the electronic device includes: a memory 84 and a processor 85.
[0084] The memory 84 is used to store computer programs and can be configured to store various other data to support operations on the electronic device. The memory 84 can be an object storage service (OSS).
[0085] The memory 84 can be implemented by any type of volatile or nonvolatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0086] The processor 85 is coupled to the memory 84 and is used to execute the computer program in the memory 114, so as to: obtain a first image to be displayed; use a first color mapping table to perform color correction on the first image to be displayed to obtain a first corrected image, the first color mapping table is obtained by updating a second color mapping table according to a first color difference between a second image to be displayed and a captured image, the second image to be displayed is a previous frame image of the first image to be displayed, the second color mapping table is used to perform color correction on the second image to be displayed to obtain a second corrected image, and the captured image is obtained by a camera shooting an object to be shot with the second corrected image as a background; control the first corrected image to be displayed on a background screen; control the camera to shoot the object to be shot with the first corrected image as a background to obtain a target image, and the second color difference between the first image to be displayed and the target image in a common area is less than a preset threshold.
[0087] Further optionally, the processor 85 is used to control the camera to shoot the object to be photographed with the first corrected image as the background, and after obtaining the target image, determine the second color difference between the first image to be displayed and the target image; update the first color mapping table according to the second color difference to obtain a third color mapping table, and determine the third color mapping table as the first color mapping table for color correction of the image to be displayed of the next frame of the first image to be displayed.
[0088] Further optionally, when determining the second color difference between the first image to be displayed and the target image, the processor 85 is specifically used to: obtain a first area of the first image to be displayed and a second area of the target image, the first area and the second area representing a common area of the first image to be displayed and the target image; determine that the color difference value between the first area and the second area is the second color difference.
[0089] Further optionally, when determining that the color difference value between the first area and the second area is the second color difference, the processor 85 is specifically used to: cluster the pixels in the first area to obtain multiple categories of first pixels, and the color categories of first pixels of different categories are different; in the second area, determine that the pixels in the same position as the first pixel are clustered into one category to obtain multiple categories of second pixels, and the first pixels correspond to the second pixels one by one; for the first pixel, determine the pixel color difference value between the first pixel and the corresponding second pixel, and the second color difference includes the pixel color difference values corresponding to the multiple first pixels, which is determined according to the pixel color difference values corresponding to each category of the first pixels.
[0090] In an optional embodiment, when the processor 85 updates the first color mapping table according to the second color difference to obtain the third color mapping table, it is specifically used to: obtain the initial color mapping table; and update the first color mapping table according to the second color difference with the initial color mapping table as a constraint to obtain the third color mapping table.
[0091] In an optional embodiment, the processor 85 is further used to obtain a preset extended image before determining the second color difference between the first image to be displayed and the target image, wherein a partial area of the preset extended image is the first image to be displayed; and extract the first image to be displayed from the preset extended image.
[0092] In an optional embodiment, the processor 85 is also used to control the camera to shoot the object to be photographed with the first corrected image as the background, and after obtaining the target image, obtain a preset extended image, and a partial area of the preset extended image is the first image to be displayed; synthesize the preset extended image and the target image to obtain an extended reality image.
[0093] In an optional embodiment, when the processor 85 updates the first color mapping table according to the second color difference with the initial color mapping table as a constraint to obtain a third color mapping table, it is specifically used to: adjust the color values in the first color mapping table according to the second color difference to obtain a third color mapping table, so that after color correction of the next frame of the first image to be displayed is performed based on the third color mapping table, the color difference in the common area between the next frame of the image to be displayed and the target image obtained based on the next frame of the image to be displayed is reduced, and the difference between the third color mapping table and the initial color mapping table meets a preset condition.
[0094] Further, if Figure 8 As shown, the electronic device also includes: a firewall 81, a load balancer 82, a communication component 86, a power supply component 83 and other components. Figure 8 Only some components are shown schematically, which does not mean that the electronic device only includes Figure 8 Components shown.
[0095] Accordingly, an embodiment of the present application also provides a computer-readable storage medium storing a computer program, which, when the computer program / instructions are executed by a processor, causes the processor to implement the steps in the method shown above.
[0096] Accordingly, an embodiment of the present application also provides a computer program product, including a computer program / instruction. When the computer program / instruction is executed by a processor, the processor is caused to implement the steps in the method shown above.
[0097] Above Figure 8 The communication component in is configured to facilitate wired or wireless communication between the device where the communication component is located and other devices. The device where the communication component is located can access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G / LTE, 5G and other mobile communication networks, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related text from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0098] Above Figure 8 The power supply component in the device provides power to various components of the device where the power supply component is located. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device where the power supply component is located.
[0099] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0100] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable text processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable text processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0101] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable text processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0102] These computer program instructions may also be loaded onto a computer or other programmable text processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0103] In a typical configuration, a computing device includes one or more processors (CPU and / or GPU), input / output interfaces, network interfaces, and memory.
[0104] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0105] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store text. The text can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store text that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0106] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0107] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. An image processing method, characterized in that: include: Acquire a first image to be displayed; Using a first color mapping table to perform color correction on the first image to be displayed to obtain a first corrected image, the first color mapping table is obtained by updating a second color mapping table according to a first color difference between a second image to be displayed and a captured image, the second image to be displayed is an image frame previous to the first image to be displayed, the second color mapping table is used to perform color correction on the second image to be displayed to obtain a second corrected image, and the captured image is obtained by a camera shooting an object to be photographed with the second corrected image as a background; Controlling display of the first corrected image on a background screen; The camera is controlled to shoot the object to be shot with the first corrected image as the background to obtain a target image, wherein a second color difference between the first image to be displayed and the target image in a common area is less than a preset threshold.
2. The image processing method according to claim 1, characterized in that: After controlling the camera to shoot the object to be shot with the first calibrated image as the background and obtaining the target image, the method further includes: determining a second color difference between the first to-be-displayed image and the target image; The first color mapping table is updated according to the second color difference to obtain a third color mapping table, and the third color mapping table is determined as a first color mapping table for color correction of an image to be displayed in a next frame of the first image to be displayed.
3. The image processing method according to claim 2, characterized in that: The determining a second color difference between the first to-be-displayed image and the target image includes: Acquire a first area of the first image to be displayed and a second area of the target image, where the first area and the second area are common areas of the first image to be displayed and the target image; A color difference value between the first area and the second area is determined to be the second color difference.
4. The image processing method according to claim 3, characterized in that: The determining the color difference value between the first area and the second area as the second color difference includes: Clustering the pixels in the first area to obtain multiple categories of first pixels, where the first pixels of different categories have different color categories; In the second area, pixels at the same position as the first pixel are determined to be grouped into one category, so as to obtain a plurality of categories of second pixels, wherein the first pixels correspond to the second pixels one by one; For a first pixel, a pixel color difference value between the first pixel and a corresponding second pixel is determined, and the second color difference is determined according to the pixel color difference values corresponding to each type of first pixel.
5. The image processing method according to claim 4, characterized in that: The updating of the first color mapping table according to the second color difference to obtain a third color mapping table includes: Get the initial color map; Taking the initial color mapping table as a constraint, the first color mapping table is updated according to the second color difference to obtain a third color mapping table.
6. The image processing method according to any one of claims 2 to 5, characterized in that: Before determining the second color difference between the first to-be-displayed image and the target image, the method further includes: Acquire a preset extended image, wherein a partial area of the preset extended image is the first image to be displayed; The first image to be displayed is extracted from the preset extended image.
7. The image processing method according to any one of claims 1 to 5, characterized in that: After controlling the camera to shoot the object to be shot with the first calibrated image as the background and obtaining the target image, the method further includes: Acquire a preset extended image, wherein a partial area of the preset extended image is displayed as the first image to be displayed; Synthesizing the preset extended image and the target image to obtain an extended reality image; The first corrected image is sent to a background screen so that the background screen displays the first corrected image.
8. The image processing method according to claim 5, characterized in that: The method of taking the initial color mapping table as a constraint and updating the first color mapping table according to the second color difference to obtain a third color mapping table includes: The color values in the first color mapping table are adjusted according to the second color difference to obtain a third color mapping table, so that after the next frame of the first image to be displayed is color corrected based on the third color mapping table, the color difference in the common area between the next frame of the image to be displayed and the target image obtained based on the next frame of the image to be displayed is reduced, and the difference between the third color mapping table and the initial color mapping table meets a preset condition.
9. An image processing device, characterized in that: include: An acquisition module, used for acquiring a first image to be displayed; a correction module, configured to perform color correction on the first image to be displayed using a first color mapping table to obtain a first corrected image, wherein the first color mapping table is obtained by updating a second color mapping table according to a first color difference between a second image to be displayed and a captured image, wherein the second image to be displayed is an image frame previous to the first image to be displayed, and the second color mapping table is used to perform color correction on the second image to be displayed to obtain a second corrected image, wherein the captured image is obtained by a camera shooting an object to be photographed with the second corrected image as a background; A first control module, used for controlling the display of the first corrected image on the background screen; The second control module controls the camera to shoot the object to be shot with the first corrected image as the background to obtain a target image, and the second color difference between the first image to be displayed and the target image in the common area is less than a preset threshold.
10. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the image processing method according to any one of claims 1 to 8 when executing the computer program.
