Video image processing method and device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202510173029.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-17
- Publication Date
- 2026-08-18
AI Technical Summary
[0002]随着计算机视觉技术的发展,拍摄场景也越来越多样性,相关技术中,可能会出现拍摄场景的光环境不佳等干扰,导致拍摄得到的视频中图像在呈现上效果不佳,例如视频中多帧图像出现色彩问题、图像模糊等问题,从而导致拍摄的视频质量欠佳
[0052]By separating the background and target objects from multiple frames in the target video, multiple target background images and multiple first target object images are obtained. The total number of pixels in the multiple first target object images and the number of times each first pixel appears in the multiple first target object images are counted. The first pixel is any pixel in the multiple first target object images. Based on the ratio of the total number of pixels to the number of times each first pixel appears, second pixels that do not meet the probability threshold range are selected from the first pixels in the multiple first target object images. The pixel information of the second pixel in the multiple first target object images is replaced with the pixel information corresponding to the pixel coordinates of the second pixel in a preset reference image, so as to obtain multiple second target object images corresponding to the updated multiple first target object images. The multiple second target object images are merged with the corresponding multiple target background images to obtain multiple target images corresponding to the multiple frames in the target video. This method separates the background and target objects in multiple frames of a target video, and adjusts the pixels of the target objects, which are the main content in the video frame images. This effectively reduces the pixel contrast of the target objects, improves the color performance of the target object images, avoids color distortion, and makes the target objects in multiple frames of the target video clearer, thereby improving video quality. Furthermore, this method of adjusting the pixels of the target objects, which are the main content in the video frame images after separation, can save processing resources and improve processing efficiency.
Smart Images

Figure CN122597455A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer vision technology, and in particular to a video image processing method, apparatus, electronic device and storage medium. Background Technology
[0002] With the development of computer vision technology, shooting scenarios are becoming increasingly diverse. However, some interference may occur due to poor lighting conditions in the shooting scene, resulting in poor image quality in the captured video. For example, multiple frames in the video may have color problems or be blurry, leading to poor video quality. Summary of the Invention
[0003] This application provides a video image processing method, apparatus, electronic device, and storage medium to at least solve the problem of how to avoid blurring in images in related technologies. The technical solution of this application is as follows:
[0004] According to a first aspect of the embodiments of this application, a video image processing method is provided, the method comprising:
[0005] The background and target objects are separated from multiple frames of images in the target video to obtain multiple target background images and multiple first target object images;
[0006] The total number of pixels in the plurality of first target object images and the number of times each first pixel appears in the plurality of first target object images are counted; the first pixel is any pixel in the plurality of first target object images;
[0007] Based on the ratio of the total number of pixels to the number of times each first pixel appears, second pixels that do not meet the probability threshold range are selected from each first pixel in the plurality of first target object images.
[0008] By using the pixel information corresponding to the pixel coordinates of the second pixel in a preset reference image, the pixel information of the second pixel in the plurality of first target object images is replaced, thereby obtaining a plurality of second target object images corresponding to the plurality of first target object images;
[0009] By merging the multiple second target object images with the corresponding multiple target background images, a multi-frame target image corresponding to the multiple frames in the target video is obtained.
[0010] According to a second aspect of the embodiments of this application, a video image processing apparatus is provided, the apparatus comprising:
[0011] The image separation module is used to separate the background and target objects from multiple frames of images in the target video, resulting in multiple target background images and multiple first target object images.
[0012] The pixel statistics module is used to count the total number of pixels in the plurality of first target object images and the number of times each first pixel appears in the plurality of first target object images; the first pixel is any pixel in the plurality of first target object images;
[0013] A pixel filtering module is used to filter out second pixels that do not meet the probability threshold range from each of the first pixels in the plurality of first target object images based on the ratio of the total number of pixels to the number of times each first pixel appears.
[0014] The pixel update module is used to replace the pixel information of the second pixel in the plurality of first target object images with the pixel information corresponding to the pixel coordinates of the second pixel in the preset reference image, so as to obtain a plurality of second target object images corresponding to the plurality of first target object images;
[0015] An image merging module is used to merge the plurality of second target object images with the corresponding plurality of target background images to obtain the plurality of target images corresponding to the plurality of frames in the target video.
[0016] In one possible implementation, the image separation module includes:
[0017] An image separation unit is used to separate and extract the background and target objects from multiple frames of images in the target video to obtain multiple initial background images and multiple initial target object images.
[0018] A pixel accumulation unit is used to obtain the first accumulated pixel value of background pixels in the plurality of initial background images and the second accumulated pixel value of target pixels in the plurality of initial target images;
[0019] A pixel difference determination unit is used to determine the pixel difference between the first accumulated pixel value and the second accumulated pixel value;
[0020] A pixel adjustment unit is used to adjust the pixel value of the background pixel and / or the pixel value of the target object pixel when the pixel difference does not match the preset pixel difference range, so that the pixel difference between the adjusted first cumulative pixel value and the adjusted second cumulative pixel value is within the preset pixel difference range, thereby obtaining the target background image and the first target object image.
[0021] Wherein, the target background image is the initial background image or the initial background image after adjusting the pixel values of the background pixels; the first target object image is the initial target object image or the initial target object image after adjusting the pixel values of the target object pixels.
[0022] In one possible implementation, the image separation unit includes:
[0023] An image separation subunit is used to separate and extract the background and target objects from multiple frames of images in the target video to obtain the initial background image and the region image in which the target object is located in the corresponding frame image; the region contour of the region image in the corresponding frame image is the contour of the target object.
[0024] The background image acquisition subunit is used to acquire a monochrome background image of the same size as the background in each frame image;
[0025] An initial target image construction subunit is used to overlay the region image from each frame image onto the monochrome background image to form the initial target image corresponding to each frame image.
[0026] In one possible implementation, the device further includes:
[0027] The target object image segmentation module is used to segment each second target object image to obtain multiple target object segmentation images corresponding to each second target object image;
[0028] The pixel mapping module is used to map the horizontal pixels in each target object segmentation image to a first saturation range and the vertical pixels in each target object segmentation image to a second saturation range, so as to obtain multiple third target object images corresponding to the multiple second target object images after pixel mapping.
[0029] The image merging module is further configured to merge the plurality of third target object images with the corresponding plurality of target background images to obtain the plurality of target images corresponding to the plurality of frames in the target video.
[0030] In one possible implementation, the pixel mapping module includes:
[0031] The first dynamic saturation determination unit is used to determine the first dynamic saturation information based on the maximum and minimum pixel values among the horizontal pixels.
[0032] The first saturation information determination unit is used to take the difference between the first dynamic saturation information and the preset saturation threshold as the first saturation information.
[0033] A horizontal pixel mapping unit is used to adjust the pixel value of the horizontal pixel according to the first saturation information when the first saturation information is within the first saturation range, so as to obtain the horizontally mapped pixel value of the horizontal pixel to the first saturation range.
[0034] Wherein, the pixel value of the horizontal pixel in the third target image is the horizontally mapped pixel value.
[0035] In one possible implementation, the lateral pixel mapping unit includes:
[0036] A horizontal pixel value acquisition subunit is used to superimpose the first saturation information onto the pixel value of the horizontal pixel to obtain the superimposed horizontal pixel value.
[0037] The first horizontal mapping pixel value determination subunit is used to take the superimposed horizontal pixel value as the horizontal mapping pixel value of the corresponding horizontal pixel point when the superimposed horizontal pixel value is within a preset pixel value range.
[0038] The second horizontal mapping pixel value determination subunit is used to take the upper limit of the pixel value as the horizontal mapping pixel value of the corresponding horizontal pixel point when the superimposed horizontal pixel value is not in the preset pixel value range and is greater than the upper limit of the pixel value of the preset pixel value range.
[0039] In one possible implementation, the pixel mapping module includes:
[0040] The second dynamic saturation determination unit is used to determine the second dynamic saturation information based on the maximum and minimum pixel values among the vertical pixels.
[0041] The second saturation information determination unit is used to take the difference between the second dynamic saturation information and the preset saturation threshold as the second saturation information;
[0042] A vertical pixel mapping unit is used to adjust the pixel value of the vertical pixel according to the second saturation information when the second saturation information is within the second saturation range, so as to obtain the vertically mapped pixel value of the vertical pixel to the corresponding vertically mapped pixel value of the second saturation range.
[0043] Wherein, the pixel value of the vertical pixel in the third target image is the vertically mapped pixel value.
[0044] In one possible implementation, the vertical pixel mapping unit includes:
[0045] The vertical pixel value acquisition subunit is used to superimpose the second saturation information onto the pixel value of the vertical pixel to obtain the superimposed vertical pixel value.
[0046] The first vertical mapping pixel value determination subunit is used to take the superimposed vertical pixel value as the vertical mapping pixel value of the corresponding vertical pixel point when the superimposed vertical pixel value is within a preset pixel value range.
[0047] The second vertical mapping pixel value determination subunit is used to take the upper limit of the pixel value as the vertical mapping pixel value of the corresponding vertical pixel point when the superimposed vertical pixel value is not in the preset pixel value range and is greater than the upper limit of the pixel value of the preset pixel value range.
[0048] According to a third aspect of the embodiments of this application, an electronic device is provided, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the method as described in any one of the first aspects above.
[0049] According to a fourth aspect of the present application, a computer-readable storage medium is provided, wherein when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to perform any of the methods described in the first aspect of the present application.
[0050] According to a fifth aspect of the embodiments of this application, a computer program product is provided, including computer instructions that, when executed by a processor, cause a computer to perform the method described in any one of the first aspects of the embodiments of this application.
[0051] The technical solutions provided by the embodiments of this application bring at least the following beneficial effects:
[0052] By separating the background and target objects from multiple frames in the target video, multiple target background images and multiple first target object images are obtained. The total number of pixels in the multiple first target object images and the number of times each first pixel appears in the multiple first target object images are counted. The first pixel is any pixel in the multiple first target object images. Based on the ratio of the total number of pixels to the number of times each first pixel appears, second pixels that do not meet the probability threshold range are selected from the first pixels in the multiple first target object images. The pixel information of the second pixel in the multiple first target object images is replaced with the pixel information corresponding to the pixel coordinates of the second pixel in a preset reference image, so as to obtain multiple second target object images corresponding to the updated multiple first target object images. The multiple second target object images are merged with the corresponding multiple target background images to obtain multiple target images corresponding to the multiple frames in the target video. This method separates the background and target objects in multiple frames of a target video, and adjusts the pixels of the target objects, which are the main content in the video frame images. This effectively reduces the pixel contrast of the target objects, improves the color performance of the target object images, avoids color distortion, and makes the target objects in multiple frames of the target video clearer, thereby improving video quality. Furthermore, this method of adjusting the pixels of the target objects, which are the main content in the video frame images after separation, can save processing resources and improve processing efficiency.
[0053] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0054] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application, and do not constitute an undue limitation of this application.
[0055] Figure 1 This is a schematic diagram illustrating an application environment according to an exemplary embodiment.
[0056] Figure 2 This is a flowchart illustrating a video image processing method according to an exemplary embodiment.
[0057] Figure 3 This is a schematic flowchart illustrating a method for separating the background and target objects from multiple frames of images in a target video, according to an exemplary embodiment, to obtain a target background image and a first target object image.
[0058] Figure 4 This is a schematic flowchart illustrating a video image processing method according to an exemplary embodiment.
[0059] Figure 5 This is a block diagram of a video image processing apparatus according to an exemplary embodiment.
[0060] Figure 6 This is a block diagram illustrating an electronic device for a video image processing method according to an exemplary embodiment.
[0061] Figure 7 This is a block diagram illustrating an electronic device for a video image processing method based on an exemplary embodiment. Detailed Implementation
[0062] Various exemplary embodiments, features, and aspects of this application will now be described in detail with reference to the accompanying drawings. The same reference numerals in the drawings denote elements that have the same or similar functions. Although various aspects of the embodiments are shown in the drawings, they are not necessarily drawn to scale unless specifically indicated otherwise.
[0063] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0064] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0065] Furthermore, to better illustrate this application, numerous specific details are provided in the following detailed embodiments. Those skilled in the art should understand that this application can be implemented without certain specific details. In some instances, methods, means, components, and circuits well-known to those skilled in the art have not been described in detail in order to highlight the main points of this application.
[0066] Please see Figure 1 , Figure 1 This diagram illustrates an application system according to an embodiment of this application. The application system can be used in the video image processing method of this application. Figure 1 As shown, the application system may include at least server 01 and terminal 02.
[0067] In this embodiment of the application, the server 01 can be used for video image processing. The server 01 may include an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0068] In this embodiment, the terminal 02 can be used to trigger the video image processing process or display the target video after processing, etc., and this application does not limit this. The terminal 02 may include physical devices such as smartphones, desktop computers, tablets, laptops, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, and smart wearable devices. Physical devices may also include software running on the physical device, such as applications. In this embodiment, the operating system running on the terminal 02 may include, but is not limited to, Android, iOS, Linux, Windows, etc.
[0069] In addition, it should be noted that, Figure 1 The example shown is merely one application environment of the video image processing method provided in this application.
[0070] In the embodiments described in this specification, the terminal 02 and the server 01 can be directly or indirectly connected through wired or wireless communication, and this application does not limit this connection.
[0071] It should be noted that in the specific implementation of this application, user-related data is involved. When the following embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0072] Before introducing the method embodiments provided in this application, a brief introduction will be given on the application scenarios, related terms or nouns that may be involved in the method embodiments of this application, so as to facilitate the understanding of those skilled in the art.
[0073] Contrast ratio: The measurement of different brightness levels between the brightest white and the darkest black in a bright and dark area of an image. The larger the difference range, the greater the contrast, and the smaller the difference range, the smaller the contrast. A good contrast ratio of 120:1 can display vivid and rich colors, and when the contrast ratio is as high as 300:1, it can support all levels of color.
[0074] Saturation: The vividness or purity of a color. In the Hue-Saturation-Value (HSV) color model, saturation is one of the three attributes of color; the other two are hue and value. In this model, hue ranges from 0° to 360°, while saturation and value range from 0 to 100%. In color theory, primary colors have the highest saturation. As saturation decreases, colors become duller until they become achromatic, that is, colors that have lost their hue.
[0075] Figure 2 This is a flowchart illustrating a video image processing method according to an exemplary embodiment. Figure 2 As shown, the video image processing method may include the following steps.
[0076] In step S201, the background and target objects are separated from each of the multiple frames in the target video to obtain multiple target background images and multiple first target object images.
[0077] In the embodiments of this specification, the target video can refer to any video that requires video image processing. Multiple frames in the target video can be all or a portion of the frame images in the target video. For example, the portion of the frame images can be frame images within a continuous time period in the video's progress; this application does not impose any limitations on these.
[0078] The background can refer to the background in each frame of the image, and the target object can refer to the object in the foreground of each frame of the image. For example, the target object can be a pre-set object, such as a pre-set object type, such as a plant object; or the target object can be an object in the foreground of the image that is dynamically extracted. This application does not limit this.
[0079] In one possible implementation, background and target object separation processing can be performed on multiple frames of images in the target video, that is, background and target object separation processing can be performed on each frame of the image to obtain multiple target background images and multiple first target object images. Each of the multiple target background images corresponds one-to-one with the multiple first target object images; that is, after background and target object separation processing, one frame of the image can obtain one target background image and one first target object image. It is understood that the first target object image here refers to the separated target object image; the "first" is to distinguish it from the subsequent second target object image. The first target object image may include the separated target object, or it may include the target object and a monochrome background; this application does not limit this.
[0080] For example, the above-mentioned separation processing methods may include, but are not limited to, methods for separating background and target objects based on image separation models, methods for separating background and target objects based on threshold segmentation, etc., and this application does not limit them. The image separation model may be obtained by pre-training a preset machine learning model based on a large number of sample images, and this application also does not limit it.
[0081] In one example, the background of the first target image can be a monochrome color and contain the isolated target object; for example, the monochrome color could be white. Based on this, accordingly, refer to... Figure 3 In one possible implementation, the step of separating the background and target objects from multiple frames of the target video to obtain the target background image and the first target object image may include:
[0082] In step S301, the background and target objects are separated and extracted from multiple frames of images in the target video to obtain multiple initial background images and multiple initial target object images.
[0083] In the embodiments of this specification, the separation and extraction processing methods described here can be found in the separation processing content described above, and will not be repeated here.
[0084] In one possible implementation, background and target objects can be separated and extracted from multiple frames of the target video to obtain an initial background image and a region image of the target object within the corresponding frame image; the contour of this region image within the corresponding frame image is the contour of the target object. For example, background and foreground segmentation can be performed on multiple frames of the target video to obtain an initial background image for each frame image, and the target object can be selected from the foreground to extract a region image containing the target object, i.e., an image of the region where the target object is located. Further, a monochrome background image of the same size as the background in each frame image, such as a white background image, can be obtained; the aforementioned region images from each frame image can then be superimposed onto this monochrome background image to form the initial target object image corresponding to each frame image, thus multiple frames correspond to multiple initial target object images.
[0085] In step S303, the first cumulative pixel value of the background pixels in the multiple initial background images and the second cumulative pixel value of the target pixels in the multiple initial target images are obtained.
[0086] In the embodiments of this specification, the pixel values of background pixels (background pixels) in multiple initial background images and the pixel values of target pixels (target pixels) in multiple initial target object images can be statistically analyzed to obtain a first cumulative pixel value of background pixels in multiple initial background images and a second cumulative pixel value of target pixels in multiple initial target object images. For example, the pixel values of all background pixels in multiple initial background images can be added together to obtain the first cumulative pixel value; and the pixel values of all target pixels in multiple initial target object images can be added together to obtain the second cumulative pixel value. Exemplarily, a target pixel can refer to a pixel in the region where the target object is located in an initial target object image. The pixel value here can include a grayscale value representing the brightness information corresponding to the pixel, and the pixel value can be from 0 to 255.
[0087] In step S305, the pixel difference between the first cumulative pixel value and the second cumulative pixel value is determined.
[0088] For example, the pixel difference can be obtained by subtracting the first cumulative pixel value from the second cumulative pixel value and taking the absolute value.
[0089] In step S307, if the pixel difference does not match the preset pixel difference range, the pixel values of the background pixels and / or the pixel values of the target pixels are adjusted so that the pixel difference between the adjusted first cumulative pixel value and the adjusted second cumulative pixel value is within the preset pixel difference range, thereby obtaining the target background image and the first target image.
[0090] In the embodiments of this specification, when the pixel difference does not match the preset pixel difference range, the pixel values of the background pixels and / or the pixel values of the target pixels are adjusted. Specifically, at least one of the pixel values of the background pixels and the target pixels is adjusted so that the pixel difference between the adjusted first cumulative pixel value and the adjusted second cumulative pixel value falls within the aforementioned preset pixel difference range, thus obtaining a target background image and a first target image. In other words, the target background image is the initial background image corresponding to the pixel difference between the first and second cumulative pixel values being within the aforementioned preset pixel difference range; the first target image is the initial target image corresponding to the pixel difference between the first and second cumulative pixel values being within the aforementioned preset pixel difference range.
[0091] Since at least one of the background pixel value and the target pixel value is adjusted, the target background image can be the initial background image (i.e., the background pixel value is not adjusted) or the initial background image after adjusting the background pixel value; the first target image can be the initial target image (i.e., the target pixel value is not adjusted) or the initial target image after adjusting the target pixel value.
[0092] Optionally, if the pixel difference matches the preset pixel difference range, it is not necessary to adjust the pixel values of the background pixels and the pixel values of the target pixels, so that the initial background image can be used as the target background image and the initial target image can be used as the first target image.
[0093] For example, a mismatch between the pixel difference and a preset pixel difference range can mean that the pixel difference is outside the preset pixel difference range, while a match between the pixel difference and a preset pixel difference range can mean that the pixel difference is within the preset pixel difference range (which may include the upper and lower boundary values of the preset pixel difference range). As an example, the preset pixel difference range can be 0 to the cumulative pixel value of the target pixel in the target image, that is, the ratio of the cumulative pixel value of the background pixel in the background image to the cumulative pixel value of the target pixel in the target image is within 2 times. This application does not limit this.
[0094] For example, the adjustments made to the pixel values of background pixels and / or target pixels may include, but are not limited to, increasing or decreasing. As an example, increasing may involve multiplying by a coefficient greater than 1, and decreasing may involve multiplying by a coefficient less than 1. For instance, if the first cumulative pixel value is more than twice the second cumulative pixel value, the pixel difference may be considered mismatched with a preset pixel difference range. In this case, at least one of the following can be performed: multiplying the pixel values of each background pixel in the multiple initial background images by a coefficient less than 1; multiplying the pixel values of each target pixel in the multiple initial target images by a pixel value greater than 1. For example, the coefficients here may be preset or dynamically determined. For preset coefficients, at least one multiplication process may be performed until the pixel difference between the adjusted first cumulative pixel value and the adjusted second cumulative pixel value falls within the preset pixel difference range. For dynamically determined coefficients, the coefficient corresponding to adjusting to the preset pixel difference range can be calculated based on the relationship between the pixel difference and the preset pixel difference range.
[0095] By adjusting at least one of the pixel values of the background image and the target object when the pixel difference is too large, so that the pixel difference is within a preset pixel difference range, the overall pixel contrast of the background and the target object is adjusted first. This can effectively reduce the distortion phenomenon of subsequent local adjustment of the contrast of the target object pixels (e.g., steps S203 to S207) when the pixel difference between the background and the target object is large.
[0096] In step S203, the total number of pixels in the multiple first target object images and the number of times each first pixel appears in the multiple first target object images are counted.
[0097] In the embodiments of this specification, the first pixel can be any pixel in a plurality of first target object images. For example, any pixel in a first target object image can refer to any pixel in the region where the target object is located within the first target object image. The total number of pixels in the plurality of first target object images can refer to the total number of all first pixels in the plurality of first target object images.
[0098] In practical applications, the same pixel often appears in consecutive frames of a target video, or even within the same frame. This allows us to count the frequency of the same first pixel appearing in multiple images of the target object. We can also count the total number of pixels in multiple images of the target object, i.e., the total number of first pixels. By counting the total number of first pixels and the frequency of each first pixel in multiple images of the target object, we can derive the probability distribution of each first pixel. This distribution can be compared with the probability distribution of the target object's pixels in a preset reference image, thereby identifying the first pixels in the target object image that require contrast improvement. The preset reference image can be a reference image whose contrast meets the contrast requirements of video image processing, used as a reference for improving the contrast of the target object in multiple frames.
[0099] For example, the same pixel here can refer to pixels with the same color information and grayscale value.
[0100] In step S205, based on the ratio of the total number of pixels to the number of times each first pixel appears, second pixels that do not meet the probability threshold range are selected from each first pixel in multiple first target object images.
[0101] In the embodiments of this specification, the ratio of the total number of pixels to the frequency of occurrence of each first pixel can be determined to obtain the probability distribution of each first pixel. Further, second pixels that do not meet the probability threshold range can be selected from the first pixels in multiple first target object images; that is, the second pixel can be a first pixel that does not meet the probability threshold range. For example, not meeting the probability threshold range can mean being outside the probability threshold range. The probability distribution of each first pixel can characterize the probability distribution of each first pixel in terms of color and grayscale. A first pixel that does not meet the probability threshold range can refer to a first pixel that does not conform to a preset color and preset grayscale distribution. After being selected, it can be subsequently replaced for adjustment, thereby achieving local contrast adjustment of the pixel.
[0102] For example, the probability threshold range can be set based on the probability distribution of each target pixel in a preset reference image. For instance, the probability distribution of each target pixel can be the pixel percentage of each target pixel in the preset reference image. A certain error is then added to this pixel percentage to obtain the probability threshold range, which includes the pixel percentage. For example, the boundary value of the probability threshold range can be obtained by adding or subtracting the certain error from the pixel percentage. For example, if the pixel percentage is 60% and the certain error is 1, the probability threshold range can be (59%, 61%), or (60%, 61%), or (59%, 60%). This application does not limit this to any particular range.
[0103] Optionally, the pixel coordinates and pixel information (such as color information and grayscale value) of the second pixel can be determined for use in the next step.
[0104] In step S207, the pixel information of the second pixel in multiple first target object images is replaced by the pixel information corresponding to the pixel coordinates of the second pixel in the preset reference image, so as to obtain multiple second target object images corresponding to the multiple first target object images.
[0105] In the embodiments of this specification, the preset reference image may be extracted from the target video or may be a pre-defined reference image. The preset reference image may refer to a reference image whose contrast can meet the contrast requirements of video image processing, and is used as a reference to improve the contrast of the target object in multiple frames of images. As an example, the size and resolution of the preset reference image may be the same as the size and resolution of the first target object image to facilitate the matching of corresponding pixel coordinates in the subsequent process.
[0106] For example, multiple frames can use a single preset reference image, or multiple preset reference images can be used. For instance, when multiple frames use multiple preset reference images, the target video can be segmented into video segments, such as dividing videos containing the same target object into a single video segment, and setting a preset reference image for each video segment, thereby allowing for more granular contrast adjustment. For example, a video frame with better contrast of the target object can be selected from the video segment as the preset reference image.
[0107] In one possible implementation, pixel information corresponding to the pixel coordinates of the second pixel can be determined in a preset reference image. This pixel information can then be used to replace the pixel information of the second pixel in the first target image, resulting in multiple second target images corresponding to multiple first target images. The multiple second target images correspond one-to-one with the multiple first target images, and the corresponding second target image is obtained by replacing the pixel information of the corresponding first target image.
[0108] For example, the target pixels in the preset reference image include reference pixel A (yellow 220, grayscale value 220) with a probability distribution of 30%, and reference pixel B (red 158, grayscale value 158) with a probability distribution of 70%. Based on this, with a certain error setting, the probability threshold range corresponding to yellow 220 can be configured as (29%, 31%), and the probability threshold range corresponding to red 158 as (69%, 71%); the probability threshold range for all other values besides yellow 220 and red 158 is 0. Assume that the statistical probability distribution of the first pixel A being yellow 220 is 25%, the probability distribution of the first pixel B being yellow 238 is 5%, and the probability distribution of the first pixel C being red 158 is 70%. By comparing these with the corresponding probability threshold ranges, the second pixel that does not meet the probability threshold range can be selected as the first pixel A and the first pixel B. Furthermore, the pixel information of the first pixel point A and the first pixel point B can be replaced with the pixel information of the corresponding pixel coordinates in the preset reference image, so that the color and grayscale value of yellow 220 in the replaced second target image, that is, the color contrast, can be consistent with the distribution in the preset reference image, thus obtaining the required contrast.
[0109] In step S209, multiple second target object images are merged with the corresponding multiple target background images to obtain multiple target images corresponding to multiple frames in the target video.
[0110] In the embodiments of this specification, multiple second target object images can be merged with corresponding multiple target background images. That is, the one-to-one corresponding second target object images and target background images can be superimposed to obtain multi-frame target images corresponding to multiple frames in the target video. In these images, the background is the target background image, and the foreground is the target object. This process processes the multiple frames in the target video, forming processed multi-frame target images. The target objects in these multiple target images become clearer, resulting in a better video playback effect.
[0111] By separating the background and target objects from multiple frames in the target video, multiple target background images and multiple first target object images are obtained. The total number of pixels in the multiple first target object images and the number of times each first pixel appears in the multiple first target object images are counted. The first pixel is any pixel in the multiple first target object images. Based on the ratio of the total number of pixels to the number of times each first pixel appears, second pixels that do not meet the probability threshold range are selected from the first pixels in the multiple first target object images. The pixel information of the second pixel in the multiple first target object images is replaced with the pixel information corresponding to the pixel coordinates of the second pixel in a preset reference image, so as to obtain multiple second target object images corresponding to the updated multiple first target object images. The multiple second target object images are merged with the corresponding multiple target background images to obtain multiple target images corresponding to the multiple frames in the target video. This method separates the background and target objects in multiple frames of a target video, and adjusts the pixels of the target objects, which are the main content in the video frame images. This effectively reduces the pixel contrast of the target objects, improves the color performance of the target object images, avoids color distortion, and makes the target objects in multiple frames of the target video clearer, thereby improving video quality. Furthermore, this method of adjusting the pixels of the target objects, which are the main content in the video frame images after separation, can save processing resources and improve processing efficiency.
[0112] Reference Figure 4 In one possible implementation, after obtaining the updated second target images corresponding to the updated first target images, the video image processing method may further include:
[0113] Each second target image is segmented to obtain multiple target image segments corresponding to each second target image. For example, each second target image can be segmented a preset number of times, such as dividing the second target image into a 9-grid; this application does not limit this. Based on this, multiple target image segments corresponding to each second target image can be obtained; for example, one second target image can yield nine corresponding target image segments.
[0114] Furthermore, the horizontal pixels in each target object segmentation image can be mapped to a first saturation range, and the vertical pixels in each target object segmentation image can be mapped to a second saturation range, resulting in multiple third target object images corresponding to multiple second target object images after pixel mapping. For example, this mapping process can be performed using a preset mapping algorithm, such as the tone-mapping algorithm, which is not limited in this application. The execution order of mapping horizontal pixels to the first saturation range and mapping vertical pixels to the second saturation range is not limited. Here, horizontal pixels can refer to any horizontal pixel in any row of each target object segmentation image, and vertical pixels can refer to any vertical pixel in any column of each target object segmentation image.
[0115] Accordingly, the above-mentioned merging of multiple second target object images with the corresponding multiple target background images to obtain multiple target images corresponding to the multiple frames in the target video may include: merging multiple third target object images with the corresponding multiple target background images to obtain multiple target images corresponding to the multiple frames in the target video.
[0116] By enhancing the pixel mapping of the target object in the second target object image, the visual quality of the target object can be improved, thereby enhancing the visual experience of multiple frames of target images in the target video.
[0117] In one example, mapping horizontal pixels in the segmented images of each target object to a first saturation range may include: determining first dynamic saturation information based on the maximum and minimum pixel values of the horizontal pixels; and using the difference between the first dynamic saturation information and a preset saturation threshold as the first saturation information. Further, when the first saturation information falls within the first saturation range, the pixel values of the horizontal pixels can be adjusted according to the first saturation information to obtain the horizontally mapped pixel values corresponding to the first saturation range. The pixel values of the horizontal pixels in the third target object image are these horizontally mapped pixel values.
[0118] For example, the above-mentioned adjustment of the pixel value of the horizontal pixel based on the first saturation information to obtain the horizontally mapped pixel value corresponding to the first saturation range may include: superimposing the first saturation information onto the pixel value of the horizontal pixel to obtain the superimposed horizontal pixel value; if the superimposed horizontal pixel value is within a preset pixel value range, using the superimposed horizontal pixel value as the horizontally mapped pixel value of the corresponding horizontal pixel; or, if the superimposed horizontal pixel value is not within the preset pixel value range but is greater than the upper limit of the preset pixel value range, using the upper limit of the pixel value as the horizontally mapped pixel value of the corresponding horizontal pixel.
[0119] For example, the mapping algorithm could be the Tone-Mapping algorithm. Assume multiple horizontal pixels, from largest to smallest, are [222, 220, 194, 191, 155, 132, 123, 119, 108], with a first saturation range of [0, 100]. The preset saturation threshold Pth = 50, and the preset pixel value range is (0, 255). Based on this, the first dynamic saturation information M = 222 - 108 = 114 can be determined from the multiple horizontal pixels. The first saturation information Gth = M - Pth = 114 - 50 = 64. 64 falls within the first saturation range, and this first saturation information can be superimposed onto the pixel values of the horizontal pixels, resulting in the superimposed horizontal pixel values [286, 284, 258, 255, 219, 196, 187, 183, 172]. Furthermore, for each horizontal pixel, the following two processing methods can be applied based on whether it falls within a preset pixel value range: if the superimposed horizontal pixel value falls within the preset pixel value range, the superimposed horizontal pixel value is used as the horizontally mapped pixel value for the corresponding horizontal pixel; and if the superimposed horizontal pixel value does not fall within the preset pixel value range but exceeds the upper limit of the preset pixel value range, the upper limit of the pixel value is used as the horizontally mapped pixel value for the corresponding horizontal pixel. Based on this, the values greater than 255 can be adjusted to 255, thereby obtaining the pixel values of the horizontal pixels in the third target image, i.e., the horizontally mapped pixel values can be [255, 255, 255, 255, 219, 196, 187, 183, 172]. Following this method, the horizontal pixels in each row are processed in this way, thus obtaining the horizontally mapped pixel values for all rows in the third target image. After obtaining the pixel values of the horizontal pixels in the segmented images of each target object within the first saturation range, the pixel values of the original multiple horizontal pixels can be replaced by the horizontally mapped pixel values to obtain the third target object image. This enhances the target object in the second target object image.
[0120] In another example, vertical pixel mapping can be implemented using the same horizontal pixel mapping method described above. Based on this, mapping vertical pixels in the segmented image of each target object to a second saturation range can include: determining second dynamic saturation information based on the maximum and minimum pixel values of the vertical pixels. The difference between this second dynamic saturation information and a preset saturation threshold can then be used as the second saturation information. Next, when the second saturation information falls within the second saturation range, the pixel values of the vertical pixels are adjusted according to the second saturation information to obtain the vertically mapped pixel values corresponding to the second saturation range. Here, the pixel values of the vertical pixels in the third target object image are the vertically mapped pixel values.
[0121] For example, the above-mentioned adjustment of the pixel value of the vertical pixel based on the second saturation information to obtain the vertically mapped pixel value corresponding to the second saturation range may include: superimposing the second saturation information onto the pixel value of the vertical pixel to obtain the superimposed vertical pixel value; if the superimposed vertical pixel value is within a preset pixel value range, using the superimposed vertical pixel value as the vertically mapped pixel value of the corresponding vertical pixel; or, if the superimposed vertical pixel value is not within the preset pixel value range but is greater than the upper limit of the preset pixel value range, using the upper limit of the pixel value as the vertically mapped pixel value of the corresponding vertical pixel. For a detailed explanation of the process, please refer to the example in the horizontal pixel mapping section above, which will not be repeated here.
[0122] This embodiment of the specification processes the contrast of the background and objects in the video image, balancing the background and objects in the image, avoiding blurry parts in the image, making the target objects in the video clearer and more harmonious with the background, avoiding a sense of conflict; in addition, it also combines image saturation to map the pixels of the objects in the image, enhancing the objects in the image, and further improving the visual experience.
[0123] Figure 5 This is a block diagram of a video image processing apparatus according to an exemplary embodiment. (Refer to...) Figure 5 The video image processing apparatus may include:
[0124] The image separation module 501 is used to separate the background and target objects from multiple frames of images in the target video to obtain multiple target background images and multiple first target object images. The background of the first target object image is white and contains the target object.
[0125] The pixel statistics module 503 is used to count the total number of pixels in the plurality of first target object images and the number of times each first pixel appears in the plurality of first target object images; the first pixel is any pixel in the plurality of first target object images;
[0126] The pixel filtering module 505 is used to filter out second pixels that do not meet the probability threshold range from each first pixel in the plurality of first target object images based on the ratio of the total number of pixels to the number of times each first pixel appears.
[0127] The pixel update module 507 is used to replace the pixel information of the second pixel in the plurality of first target object images with the pixel information corresponding to the pixel coordinates of the second pixel in the preset reference image, so as to obtain a plurality of second target object images corresponding to the updated plurality of first target object images;
[0128] The image merging module 509 is used to merge the plurality of second target object images with the corresponding plurality of target background images to obtain the multi-frame target images corresponding to the multi-frame images in the target video.
[0129] By separating the background and target objects from multiple frames in the target video, multiple target background images and multiple first target object images are obtained. The total number of pixels in the multiple first target object images and the number of times each first pixel appears in the multiple first target object images are counted. The first pixel is any pixel in the multiple first target object images. Based on the ratio of the total number of pixels to the number of times each first pixel appears, second pixels that do not meet the probability threshold range are selected from the first pixels in the multiple first target object images. The pixel information of the second pixel in the multiple first target object images is replaced with the pixel information corresponding to the pixel coordinates of the second pixel in a preset reference image, so as to obtain multiple second target object images corresponding to the updated multiple first target object images. The multiple second target object images are merged with the corresponding multiple target background images to obtain multiple target images corresponding to the multiple frames in the target video. This method separates the background and target objects in multiple frames of a target video, and adjusts the pixels of the target objects, which are the main content in the video frame images. This effectively reduces the pixel contrast of the target objects, improves the color performance of the target object images, avoids color distortion, and makes the target objects in multiple frames of the target video clearer, thereby improving video quality. Furthermore, this method of adjusting the pixels of the target objects, which are the main content in the video frame images after separation, can save processing resources and improve processing efficiency.
[0130] In one possible implementation, the image separation module 501 may include:
[0131] An image separation unit is used to separate and extract the background and target objects from multiple frames of images in the target video to obtain multiple initial background images and multiple initial target object images.
[0132] A pixel accumulation unit is used to obtain the first accumulated pixel value of background pixels in the plurality of initial background images and the second accumulated pixel value of target pixels in the plurality of initial target images;
[0133] A pixel difference determination unit is used to determine the pixel difference between the first accumulated pixel value and the second accumulated pixel value;
[0134] A pixel adjustment unit is used to adjust the pixel value of the background pixel and / or the pixel value of the target object pixel when the pixel difference does not match the preset pixel difference range, so that the pixel difference between the adjusted first cumulative pixel value and the adjusted second cumulative pixel value is within the preset pixel difference range, thereby obtaining the target background image and the first target object image.
[0135] Wherein, the target background image is the initial background image or the initial background image after adjusting the pixel values of the background pixels; the first target object image is the initial target object image or the initial target object image after adjusting the pixel values of the target object pixels.
[0136] In one possible implementation, the image separation unit may include:
[0137] An image separation subunit is used to separate and extract the background and target objects from multiple frames of images in the target video to obtain the initial background image and the region image in which the target object is located in the corresponding frame image; the region contour of the region image in the corresponding frame image is the contour of the target object.
[0138] The background image acquisition subunit is used to acquire a monochrome background image of the same size as the background in each frame image;
[0139] An initial target image construction subunit is used to overlay the region image from each frame image onto the monochrome background image to form the initial target image corresponding to each frame image.
[0140] In one possible implementation, the device may further include:
[0141] The target object image segmentation module is used to segment each second target object image to obtain multiple target object segmentation images corresponding to each second target object image;
[0142] The pixel mapping module is used to map the horizontal pixels in each target object segmentation image to a first saturation range and the vertical pixels in each target object segmentation image to a second saturation range, so as to obtain multiple third target object images corresponding to the multiple second target object images after pixel mapping.
[0143] The image merging module 509 is further configured to merge the plurality of third target object images with the corresponding plurality of target background images to obtain the plurality of target images corresponding to the plurality of frames in the target video.
[0144] In one possible implementation, the pixel mapping module may include:
[0145] The first dynamic saturation determination unit is used to determine the first dynamic saturation information based on the maximum and minimum pixel values among the horizontal pixels.
[0146] The first saturation information determination unit is used to take the difference between the first dynamic saturation information and the preset saturation threshold as the first saturation information.
[0147] A horizontal pixel mapping unit is used to adjust the pixel value of the horizontal pixel according to the first saturation information when the first saturation information is within the first saturation range, so as to obtain the horizontally mapped pixel value of the horizontal pixel to the first saturation range.
[0148] Wherein, the pixel value of the horizontal pixel in the third target image is the horizontally mapped pixel value.
[0149] In one possible implementation, the lateral pixel mapping unit may include:
[0150] A horizontal pixel value acquisition subunit is used to superimpose the first saturation information onto the pixel value of the horizontal pixel to obtain the superimposed horizontal pixel value.
[0151] The first horizontal mapping pixel value determination subunit is used to take the superimposed horizontal pixel value as the horizontal mapping pixel value of the corresponding horizontal pixel point when the superimposed horizontal pixel value is within a preset pixel value range.
[0152] The second horizontal mapping pixel value determination subunit is used to take the upper limit of the pixel value as the horizontal mapping pixel value of the corresponding horizontal pixel point when the superimposed horizontal pixel value is not in the preset pixel value range and is greater than the upper limit of the pixel value of the preset pixel value range.
[0153] In one possible implementation, the pixel mapping module may include:
[0154] The second dynamic saturation determination unit is used to determine the second dynamic saturation information based on the maximum and minimum pixel values among the vertical pixels.
[0155] The second saturation information determination unit is used to take the difference between the second dynamic saturation information and the preset saturation threshold as the second saturation information;
[0156] A vertical pixel mapping unit is used to adjust the pixel value of the vertical pixel according to the second saturation information when the second saturation information is within the second saturation range, so as to obtain the vertically mapped pixel value of the vertical pixel to the corresponding vertically mapped pixel value of the second saturation range.
[0157] Wherein, the pixel value of the vertical pixel in the third target image is the vertically mapped pixel value.
[0158] In one possible implementation, the vertical pixel mapping unit may include:
[0159] The vertical pixel value acquisition subunit is used to superimpose the second saturation information onto the pixel value of the vertical pixel to obtain the superimposed vertical pixel value.
[0160] The first vertical mapping pixel value determination subunit is used to take the superimposed vertical pixel value as the vertical mapping pixel value of the corresponding vertical pixel point when the superimposed vertical pixel value is within a preset pixel value range.
[0161] The second vertical mapping pixel value determination subunit is used to take the upper limit of the pixel value as the vertical mapping pixel value of the corresponding vertical pixel point when the superimposed vertical pixel value is not in the preset pixel value range and is greater than the upper limit of the pixel value of the preset pixel value range.
[0162] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0163] Figure 6 This is a block diagram illustrating an electronic device for a video image processing method according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 6 As shown, the electronic device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a video image processing method. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.
[0164] Those skilled in the art will understand that Figure 6The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0165] Figure 7 This is a block diagram of an electronic device for a video image processing method based on an exemplary embodiment. The electronic device may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, the electronic device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a video image processing method.
[0166] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0167] In an exemplary embodiment, an electronic device is also provided, including: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the video image processing method as described in the embodiments of this application.
[0168] In an exemplary embodiment, a computer-readable storage medium is also provided, which, when executed by a processor of an electronic device, enables the electronic device to perform the video image processing method described in this application. The computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, or optical data storage device, etc.
[0169] In an exemplary embodiment, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to perform the video image processing method of the embodiments of this application.
[0170] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0171] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0172] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A video image processing method, characterized in that, include: The background and target objects are separated from multiple frames of images in the target video to obtain multiple target background images and multiple first target object images; The total number of pixels in the plurality of first target object images and the number of times each first pixel appears in the plurality of first target object images are counted; The first pixel is any pixel in the plurality of first target object images; Based on the ratio of the total number of pixels to the number of times each first pixel appears, second pixels that do not meet the probability threshold range are selected from each first pixel in the plurality of first target object images. By using the pixel information corresponding to the pixel coordinates of the second pixel in a preset reference image, the pixel information of the second pixel in the plurality of first target object images is replaced, thereby obtaining a plurality of second target object images corresponding to the plurality of first target object images; By merging the multiple second target object images with the corresponding multiple target background images, a multi-frame target image corresponding to the multiple frames in the target video is obtained.
2. The method according to claim 1, characterized in that, The step of separating the background and target objects from multiple frames of images in the target video to obtain a target background image and a first target object image includes: The background and target objects are separated and extracted from multiple frames of images in the target video to obtain multiple initial background images and multiple initial target object images. Obtain the first cumulative pixel value of the background pixels in the plurality of initial background images, and the second cumulative pixel value of the target object pixels in the plurality of initial target object images; Determine the pixel difference between the first cumulative pixel value and the second cumulative pixel value; If the pixel difference does not match the preset pixel difference range, adjust the pixel value of the background pixel and / or the pixel value of the target object pixel so that the pixel difference between the adjusted first cumulative pixel value and the adjusted second cumulative pixel value is within the preset pixel difference range, thereby obtaining the target background image and the first target object image; Wherein, the target background image is the initial background image or the initial background image after adjusting the pixel values of the background pixels; the first target object image is the initial target object image or the initial target object image after adjusting the pixel values of the target object pixels.
3. The method according to claim 2, characterized in that, The step of separating and extracting background and target objects from multiple frames of images in the target video to obtain multiple initial background images and multiple initial target object images includes: The background and target object are separated and extracted from multiple frames of the target video to obtain the initial background image and the region image of the target object in the corresponding frame image; the region contour of the region image in the corresponding frame image is the contour of the target object. Obtain a monochrome background image with the same size as the background in each frame; The region images from each frame are superimposed onto the monochrome background image to form the initial target image corresponding to each frame.
4. The method according to any one of claims 1-3, characterized in that, After the step of obtaining the updated second target images corresponding to the multiple first target images, the method further includes: Each second target object image is segmented to obtain multiple target object segmentation images corresponding to each second target object image; The horizontal pixels in each target object segmentation image are mapped to a first saturation range, and the vertical pixels in each target object segmentation image are mapped to a second saturation range, thereby obtaining multiple third target object images corresponding to the multiple second target object images after pixel mapping; The step of merging the plurality of second target object images with the corresponding plurality of target background images to obtain the plurality of target images corresponding to the plurality of frames in the target video includes: By merging the multiple third target object images with the corresponding multiple target background images, a multi-frame target image corresponding to the multiple frames in the target video is obtained.
5. The method according to claim 4, characterized in that, The step of mapping the horizontal pixels in each target object segmentation image to a first saturation range includes: The first dynamic saturation information is determined based on the maximum and minimum pixel values among the horizontal pixels. The difference between the first dynamic saturation information and the preset saturation threshold is used as the first saturation information; When the first saturation information is within the first saturation range, the pixel value of the horizontal pixel is adjusted according to the first saturation information to obtain the horizontally mapped pixel value corresponding to the first saturation range. Wherein, the pixel value of the horizontal pixel in the third target image is the horizontally mapped pixel value.
6. The method according to claim 5, characterized in that, The step of adjusting the pixel value of the horizontal pixel according to the first saturation information to obtain the horizontal mapped pixel value corresponding to the first saturation range includes: The first saturation information is superimposed onto the pixel value of the horizontal pixel to obtain the superimposed horizontal pixel value; If the superimposed horizontal pixel value is within a preset pixel value range, the superimposed horizontal pixel value is used as the horizontal mapped pixel value of the corresponding horizontal pixel point; If the superimposed horizontal pixel value is not within the preset pixel value range but is greater than the upper limit of the preset pixel value range, the upper limit of the pixel value is used as the horizontal mapped pixel value of the corresponding horizontal pixel.
7. The method according to claim 4, characterized in that, The step of mapping the vertical pixels in each target object segmentation image to the second saturation range includes: The second dynamic saturation information is determined based on the maximum and minimum pixel values among the vertical pixels. The difference between the second dynamic saturation information and the preset saturation threshold is used as the second saturation information; When the second saturation information is within the second saturation range, the pixel value of the vertical pixel is adjusted according to the second saturation information to obtain the vertical mapped pixel value corresponding to the second saturation range; Wherein, the pixel value of the vertical pixel in the third target image is the vertically mapped pixel value.
8. The method according to claim 7, characterized in that, The step of adjusting the pixel value of the vertical pixel according to the second saturation information to obtain the vertical mapped pixel value corresponding to the second saturation range includes: The second saturation information is superimposed onto the pixel value of the vertical pixel to obtain the superimposed vertical pixel value; If the superimposed vertical pixel value is within a preset pixel value range, the superimposed vertical pixel value is used as the vertical mapped pixel value of the corresponding vertical pixel point; If the superimposed vertical pixel value is not within the preset pixel value range but is greater than the upper limit of the preset pixel value range, the upper limit of the pixel value is used as the vertical mapped pixel value of the corresponding vertical pixel.
9. A video image processing apparatus, characterized in that, include: The image separation module is used to separate the background and target objects from multiple frames of images in the target video, resulting in multiple target background images and multiple first target object images. The pixel statistics module is used to count the total number of pixels in the plurality of first target object images and the number of times each first pixel appears in the plurality of first target object images; The first pixel is any pixel in the plurality of first target object images; A pixel filtering module is used to filter out second pixels that do not meet the probability threshold range from each of the first pixels in the plurality of first target object images based on the ratio of the total number of pixels to the number of times each first pixel appears. The pixel update module is used to replace the pixel information of the second pixel in the plurality of first target object images with the pixel information corresponding to the pixel coordinates of the second pixel in the preset reference image, so as to obtain a plurality of second target object images corresponding to the plurality of first target object images; An image merging module is used to merge the plurality of second target object images with the corresponding plurality of target background images to obtain the plurality of target images corresponding to the plurality of frames in the target video.
10. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the video image processing method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the electronic device, the electronic device is enabled to perform the video image processing method as described in any one of claims 1 to 8.
12. A computer program product, characterized in that, It includes computer instructions, which, when executed by a processor, cause the computer to perform the video image processing method as described in any one of claims 1 to 8.