Video de-interlacing processing method and device, electronic equipment and storage medium
By detecting the motion of the pixel points to be interpolated, different interpolation methods are used to process the stationary and moving pixel points, the image distortion, blur and jitter caused by video deinterlacing in the prior art is solved, and the interpolation accuracy is improved.
Patent Information
- Application Number
- CN202411038041.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-12-24
AI Technical Summary
The existing video deinterlacing processing technology causes distortion, blur and jitter in interlaced videos after interlacing.
By acquiring the current field image, the previous field image and the next field image, motion detection is performed on the pixel point to be interpolated. If it is a still pixel point, the data of the previous field and the next field image are interpolated. If it is a moving pixel point, the data of the previous field and the next field image are interpolated. Then the data of the current field image, the previous field and the next field are interpolated, and different interpolation processing methods are used.
Improve the interpolation accuracy, avoid distortion, blur and jitter in the image content after interpolation, and ensure the effect of video deinterlacing.
Smart Images

Figure CN119182874A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of video signal processing, and in particular to a video deinterlacing processing method, device, electronic equipment and storage medium. Background Art
[0002] In order to reduce transmission bandwidth and compress storage space, the traditional analog TV industry generally adopts interlaced sampling technology, that is, a complete video frame is divided into odd fields and even fields for transmission, thus producing interlaced video. However, this interlaced video cannot be directly displayed on the progressive display devices in the current digital TV industry, so it is necessary to convert the interlaced video into progressive video, which gives rise to video deinterlacing processing technology, that is, interpolating the data of the missing lines in the interlaced video.
[0003] In the related art, for an odd field in an interlaced video, interpolating the even lines in the odd field means copying the previous line of data of the even line to the even line. For an even field in an interlaced video, interpolating the odd lines in the even field means copying the next line of data of the odd line to the odd line.
[0004] However, this simple copy line processing method will cause the interlaced video after interpolation processing to have image content distortion, blur and jitter. Summary of the invention
[0005] Based on this, the object of the present invention is to provide a video deinterlacing processing method, device, electronic device and storage medium, which have the advantages of avoiding distortion, blurring and jittering of image content in interlaced video after interpolation processing.
[0006] According to a first aspect of an embodiment of the present application, a video deinterlacing processing method is provided, comprising the following steps:
[0007] Acquire a current field image, a field image before the current field image, and a field image after the current field image; wherein the current field image is an image obtained by performing interlaced sampling on a video image of a current frame, the field image before the current field image is an image obtained by performing interlaced sampling on a video image of a frame before the current frame, and the field image after the current field image is an image obtained by performing interlaced sampling on a video image of a frame after the current frame;
[0008] If the pixel to be interpolated of the current field image is a static pixel, the pixel to be interpolated is interpolated according to the field data of the previous field image and the field data of the next field image; wherein the pixel to be interpolated is the pixel to be filled with the pixel value;
[0009] If the pixel to be interpolated of the current field image is a moving pixel, the pixel to be interpolated is interpolated according to the field data of the previous field image, the field data of the next field image and the field data of the current field image;
[0010] Get the interpolated current field image.
[0011] According to a second aspect of an embodiment of the present application, a video deinterlacing processing device is provided, comprising:
[0012] A field image acquisition module is used to acquire a current field image, a field image before the current field image, and a field image after the current field image; wherein the current field image is an image obtained by performing interlaced sampling on a video image of a current frame, the field image before the current field image is an image obtained by performing interlaced sampling on a video image of a frame before the current frame, and the field image after the current field image is an image obtained by performing interlaced sampling on a video image of a frame after the current frame;
[0013] A stationary pixel interpolation module is used to interpolate the pixel to be interpolated according to the field data of the previous field image and the field data of the next field image if the pixel to be interpolated of the current field image is a stationary pixel; wherein the pixel to be interpolated is the pixel to be filled with the pixel value;
[0014] A motion pixel interpolation module, used for interpolating the pixel to be interpolated of the current field image according to the field data of the previous field image, the field data of the next field image and the field data of the current field image if the pixel to be interpolated of the current field image is a motion pixel;
[0015] The interpolated current field image obtaining module is used to obtain the interpolated current field image.
[0016] According to a third aspect of an embodiment of the present application, there is provided an electronic device, comprising: an odd-even field discriminator, a memory, and a data processor;
[0017] The odd and even field discriminator is connected to the memory, and the memory is connected to the data processor;
[0018] The odd-even field discriminator is used to receive the current field image, the previous field image of the current field image and the next field image of the current field image, and send the current field image, the previous field image of the current field image and the next field image of the current field image to the memory; wherein the current field image is an image obtained by performing interlaced sampling on the video image of the current frame, the previous field image of the current field image is an image obtained by performing interlaced sampling on the video image of the previous frame of the current frame, and the next field image of the current field image is an image obtained by performing interlaced sampling on the video image of the next frame of the current frame;
[0019] The memory is used to send the current field image, the previous field image of the current field image and the next field image of the current field image to the data processor;
[0020] The data processor is used to interpolate the pixels to be interpolated in the current field image according to the above-mentioned video deinterlacing processing method to obtain the interpolated current field image.
[0021] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the video deinterlacing processing method as described above is implemented.
[0022] The embodiment of the present application obtains a current field image, a previous field image of the current field image, and a subsequent field image of the current field image; wherein the current field image is an image obtained by interlaced sampling of a video image of the current frame, the previous field image of the current field image is an image obtained by interlaced sampling of a video image of the previous frame of the current frame, and the subsequent field image of the current field image is an image obtained by interlaced sampling of a video image of the subsequent frame of the current frame; if the pixel points to be interpolated of the current field image are stationary pixels, the pixel points to be interpolated are interpolated according to the field data of the previous field image and the field data of the subsequent field image; wherein the pixel points to be interpolated are the pixel points to be filled with pixel values; if the pixel points to be interpolated of the current field image are moving pixels, the pixel points to be interpolated are interpolated according to the field data of the previous field image, the field data of the subsequent field image, and the field data of the current field image; and the interpolated current field image is obtained. The present application performs motion detection on the pixel points to be interpolated in the current field image, determines whether the pixel points to be interpolated are stationary pixels or moving pixels, and when the pixel points to be interpolated are stationary pixels, interpolation processing is performed on the stationary pixels according to the adjacent field data of the current field image; when the pixel points to be interpolated are moving pixels, interpolation processing is performed on the moving pixels according to the adjacent field data of the current field image and the field data of the current field image. By adopting different interpolation processing methods for stationary pixels and moving pixels, the interpolation accuracy of the pixel points to be interpolated in the current field image is improved, and distortion, blurring and jittering of the image content of the interpolated current field image are avoided.
[0023] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application.
[0024] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 A schematic diagram of a flow chart of a video deinterlacing processing method provided by an embodiment of the present application;
[0026] Figure 2A structural block diagram of a video deinterlacing processing device provided by an embodiment of the present application;
[0027] Figure 3 A schematic block diagram of the structure of an electronic device provided for one embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0029] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0030] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the embodiments of the present application. The singular forms of "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0031] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims. In the description of the present application, it should be understood that the terms "first", "second", "third", etc. are only used to distinguish similar objects, and do not have to be used to describe a specific order or sequence, nor can they be understood as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood according to the specific circumstances.
[0032] In addition, in the description of this application, unless otherwise specified, "plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.
[0033] The video deinterlacing processing method provided in the embodiment of the present application can be applied to the scene of converting interlaced video to progressive video. In the related art, for the odd field in the interlaced video, the even lines in the odd field are interpolated, which is to copy the previous line data of the even line to the even line. For the even field in the interlaced video, the odd lines in the even field are interpolated, which is to copy the next line data of the odd line to the odd line.
[0034] The inventors discovered during the process of implementing the present invention that the duplicate line processing method in the related art would cause the interlaced video after interpolation processing to have problems such as image content distortion, blurring, and jitter.
[0035] To this end, the present application performs motion detection on the pixel points to be interpolated in the current field image to determine whether the pixel points to be interpolated are stationary pixels or moving pixels. When the pixel points to be interpolated are stationary pixels, interpolation processing is performed on the stationary pixels according to the adjacent field data of the current field image; when the pixel points to be interpolated are moving pixels, interpolation processing is performed on the moving pixels according to the adjacent field data of the current field image and the field data of the current field image. By adopting different interpolation processing methods for stationary pixels and moving pixels, the interpolation accuracy of the pixel points to be interpolated in the current field image is improved, and distortion, blurring and jittering of the image content of the interpolated current field image are avoided.
[0036] See also Figure 1 , which is a flow chart of a video deinterlacing processing method provided by an embodiment of the present application. The present application embodiment provides a video deinterlacing processing method, comprising the following steps:
[0037] S10: Acquire a current field image, a previous field image of the current field image, and a subsequent field image of the current field image; wherein the current field image is an image obtained by performing interlaced sampling on a video image of a current frame, the previous field image of the current field image is an image obtained by performing interlaced sampling on a video image of a frame previous to the current frame, and the subsequent field image of the current field image is an image obtained by performing interlaced sampling on a video image of a frame subsequent to the current frame;
[0038] S20: If the pixel to be interpolated of the current field image is a stationary pixel, interpolate the pixel to be interpolated according to the field data of the previous field image and the field data of the next field image; wherein the pixel to be interpolated is the pixel to be filled with the pixel value;
[0039] S30: if the pixel to be interpolated of the current field image is a moving pixel, interpolate the pixel to be interpolated according to the field data of the previous field image, the field data of the next field image and the field data of the current field image;
[0040] S40: Obtain the interpolated current field image.
[0041] The video deinterlacing processing method provided by the present application performs motion detection on the pixel points to be interpolated in the current field image to determine whether the pixel points to be interpolated are stationary pixels or moving pixels. When the pixel points to be interpolated are stationary pixels, interpolation processing is performed on the stationary pixels according to the adjacent field data of the current field image; when the pixel points to be interpolated are moving pixels, interpolation processing is performed on the moving pixels according to the adjacent field data of the current field image and the field data of the current field image. By adopting different interpolation processing methods for stationary pixels and moving pixels, the interpolation accuracy of the pixel points to be interpolated in the current field image is improved, and distortion, blurring and jittering of the image content of the current field image after interpolation are avoided.
[0042] The following embodiments of the present application use a computer as an execution subject to illustrate various steps of the video deinterlacing processing method.
[0043] For step S10, the current field image, the previous field image of the current field image and the subsequent field image of the current field image are obtained; wherein the current field image is an image obtained by interlaced sampling of the video image of the current frame, the previous field image of the current field image is an image obtained by interlaced sampling of the video image of the previous frame of the current frame, and the subsequent field image of the current field image is an image obtained by interlaced sampling of the video image of the next frame of the current frame.
[0044] Among them, the current field image, the previous field image of the current field image, and the next field image of the current field image are all interlaced video images. Specifically, if the current field image is an odd field image, the previous field image of the current field image is an even field image, and the next field image of the current field image is an even field image. If the current field image is an even field image, the previous field image of the current field image is an odd field image, and the next field image of the current field image is an odd field image.
[0045] The interlaced video image may be an RGB format image or a YUV format image. If the interlaced video image is an RGB format image, the RGB format image may be converted into a YUV format image.
[0046] In the embodiment of the present application, the current field image, the previous field image of the current field image, and the next field image of the current field image can be directly obtained. Alternatively, three consecutive video frames can be first obtained, and the three consecutive video frames are subjected to interlaced sampling processing to obtain the current field image, the previous field image of the current field image, and the next field image of the current field image.
[0047] In an optional embodiment, after step S10, the method further includes: determining the motion state of the pixel to be interpolated of the current field image; the step of determining the motion state of the pixel to be interpolated of the current field image includes:
[0048] S101: Obtain a first pixel value of a first pixel point corresponding to the pixel point to be interpolated in a previous field image, a second pixel value of a second pixel point corresponding to the pixel point to be interpolated in a next field image, a third pixel value of a third pixel point in a current field image, and a fourth pixel value of a fourth pixel point in the current field image; wherein the third pixel point is an adjacent pixel point above the pixel point to be interpolated in the current field image, and the fourth pixel point is an adjacent pixel point below the pixel point to be interpolated in the current field image;
[0049] S102: Calculate a first absolute value difference between the first pixel value and the second pixel value and a second average value;
[0050] S103: Calculate a second absolute value difference between the third pixel value and the fourth pixel value and a third average value;
[0051] S104: Calculating a third absolute value difference between the second average value and the third average value;
[0052] S105: Determine whether the first absolute value difference, the second absolute value difference and the third absolute value difference are all less than or equal to a first preset threshold; if so, determine that the pixel point to be interpolated of the current field image is a stationary pixel point; if not, determine that the pixel point to be interpolated of the current field image is a moving pixel point.
[0053] The position of the first pixel in the previous field image is the same as the position of the pixel to be interpolated in the current field image. For example, if the pixel to be interpolated is in the i-th row and j-th column in the current field image, then the first pixel is also in the i-th row and j-th column in the previous field image.
[0054] The position of the second pixel in the next field image is the same as the position of the pixel to be interpolated in the current field image. For example, if the pixel to be interpolated is in the i-th row and j-th column in the current field image, then the second pixel is also in the i-th row and j-th column in the next field image.
[0055] The first pixel value of the first pixel includes the YUV channel data of the first pixel, the second pixel value of the second pixel includes the YUV channel data of the second pixel, the third pixel value of the third pixel includes the YUV channel data of the third pixel, and the fourth pixel value of the fourth pixel includes the YUV channel data of the fourth pixel. The YUV channel data includes a brightness value (Y channel data) and a chromaticity value (UV channel data).
[0056] The first absolute value difference is obtained by taking the absolute value of the difference between the first pixel value and the second pixel value. The second average value is obtained by averaging the first pixel value and the second pixel value. The second absolute value difference is obtained by taking the absolute value of the difference between the third pixel value and the fourth pixel value. The third average value is obtained by averaging the third pixel value and the fourth pixel value. The third absolute value difference is obtained by taking the absolute value of the difference between the second average value and the third average value.
[0057] The first preset threshold value can be manually set according to actual needs. For example, the first preset threshold value is 5.
[0058] In the embodiment of the present application, if the first absolute value difference, the second absolute value difference, and the third absolute value difference are all less than or equal to the first preset threshold, the pixel to be interpolated is determined to be a stationary pixel. If the first absolute value difference is greater than the first preset threshold, or the second absolute value difference is greater than the first preset threshold, or the third absolute value difference is greater than the first preset threshold, the pixel to be interpolated is determined to be a moving pixel.
[0059] By comparing the pixel differences between adjacent field images of the current field image, the pixel differences between the upper and lower rows in the current field image, and the difference between the pixel averages of the adjacent field images of the current field image and the pixel averages of the upper and lower rows in the current field image, it is determined whether the pixel point to be interpolated in the current field image is in a motion state, thereby improving the accuracy and reliability of motion state detection.
[0060] For step S20, if the pixel to be interpolated of the current field image is a static pixel, the pixel to be interpolated is interpolated according to the field data of the previous field image and the field data of the next field image; wherein the pixel to be interpolated is the pixel to be filled with the pixel value.
[0061] The field data of the previous image refers to the pixel value of each pixel in the previous image, including the YUV channel data of each pixel in the previous image.
[0062] The field data of the next image field refers to the pixel value of each pixel point in the next image field, including the YUV channel data of each pixel point in the next image field.
[0063] The pixel points to be interpolated of the current field image refer to the pixel points in the current field image that are to be filled with pixel values. Specifically, if the current field image is an odd field image, the pixel points in all even rows of the odd field image are the pixel points to be interpolated. If the current field image is an even field image, the pixel points in all odd rows of the even field image are the pixel points to be interpolated.
[0064] In an embodiment of the present application, after determining that the pixel to be interpolated is a stationary pixel, the pixel to be interpolated is interpolated according to the field data of the previous image and the field data of the next image to obtain the pixel value of the pixel to be interpolated.
[0065] In an optional embodiment, step S20 includes steps S201 to S202, which are specifically as follows:
[0066] S201: If the pixel to be interpolated of the current field image is a stationary pixel, obtain a first pixel value of a first pixel corresponding to the pixel to be interpolated in the previous field image and a second pixel value of a second pixel corresponding to the pixel to be interpolated in the next field image;
[0067] S202: Calculate a first average value of the first pixel value and the second pixel value, and use the first average value as the pixel value of the pixel to be interpolated.
[0068] The first average value is obtained by averaging the first pixel value and the second pixel value.
[0069] In an embodiment of the present application, if the pixel to be interpolated is a stationary pixel, an average value of a first pixel value of a first pixel and a second pixel value of a second pixel is taken as the pixel value of the pixel to be interpolated.
[0070] When the pixel to be interpolated is a static pixel, since the position of the static pixel in different field images remains unchanged, the static pixel can be interpolated according to the pixel value of the corresponding pixel in the adjacent field image of the current field image, thereby avoiding blurring of the image content of the current field image after interpolation.
[0071] In an optional embodiment, the field data of the previous image includes the Y channel data of the previous image and the UV channel data of the previous image, and the field data of the next image includes the Y channel data of the next image and the UV channel data of the next image; step S20 includes steps S21 to S22, which are specifically as follows:
[0072] S21: if the pixel to be interpolated of the current field image is a stationary pixel, obtain YUV channel data of the pixel to be interpolated according to Y channel data of the previous field image, UV channel data of the previous field image, Y channel data of the next field image, and UV channel data of the next field image;
[0073] S22: Using the YUV channel data as the pixel value of the pixel to be interpolated.
[0074] Among them, the Y channel data is the brightness value, and the UV channel data is the chromaticity value.
[0075] The Y channel data of the previous image refers to the brightness value of each pixel in the previous image, and the UV channel data of the previous image refers to the chromaticity value of each pixel in the previous image.
[0076] The Y channel data of the next image refers to the brightness value of each pixel in the next image, and the UV channel data of the next image refers to the chromaticity value of each pixel in the next image.
[0077] In the embodiment of the present application, if the pixel to be interpolated of the current field image is a stationary pixel, step S21 can refer to steps S201 to S202 to obtain the Y channel data and UV channel data of the pixel to be interpolated, respectively, which will not be repeated here. The Y channel data and the UV channel data are spliced into YUV channel data, and the YUV channel data is used as the pixel value of the pixel to be interpolated.
[0078] If the pixel to be interpolated of the current field image is a static pixel, since the position of the static pixel remains unchanged in different field images, the pixel to be interpolated can be interpolated according to the Y channel data and UV channel data of the corresponding pixel in the adjacent field image of the current field image to obtain the Y channel data and UV channel data of the pixel to be interpolated, thereby avoiding blurring of the image content of the current field image after interpolation.
[0079] In step S30, if the pixel to be interpolated of the current field image is a moving pixel, the pixel to be interpolated is interpolated according to the field data of the previous field image, the field data of the next field image and the field data of the current field image.
[0080] The field data of the current field image refers to the pixel values of each pixel in the current field image except the pixel to be interpolated, including the YUV channel data of each pixel in the current field image except the pixel to be interpolated.
[0081] In an embodiment of the present application, after determining that the pixel to be interpolated is a moving pixel, the pixel to be interpolated is interpolated according to the field data of the previous field image, the field data of the current field image, and the field data of the next field image to obtain the pixel value of the pixel to be interpolated.
[0082] In an optional embodiment, step S30 includes steps S301 to S302, which are specifically as follows:
[0083] S301: If the pixel to be interpolated of the current field image is a moving pixel, obtain a first pixel value of a first pixel corresponding to the pixel to be interpolated in the previous field image, a second pixel value of a second pixel corresponding to the pixel to be interpolated in the next field image, a third pixel value of a third pixel in the current field image, a fourth pixel value of a fourth pixel in the current field image, a fifth pixel value of a fifth pixel in the previous field image, a sixth pixel value of a sixth pixel in the previous field image, a seventh pixel value of a seventh pixel in the next field image, and an eighth pixel value of an eighth pixel in the next field image; , the third pixel is an adjacent pixel above the pixel to be interpolated in the current field image, the fourth pixel is an adjacent pixel below the pixel to be interpolated in the current field image, the fifth pixel is an adjacent pixel above the pixel corresponding to the third pixel in the previous field image, the sixth pixel is an adjacent pixel below the pixel corresponding to the fourth pixel in the previous field image, the seventh pixel is an adjacent pixel above the pixel corresponding to the third pixel in the next field image, and the eighth pixel is an adjacent pixel below the pixel corresponding to the fourth pixel in the next field image;
[0084] S302: Perform weighted summation on the first pixel value, the second pixel value, the third pixel value, the fourth pixel value, the fifth pixel value, the sixth pixel value, the seventh pixel value and the eighth pixel value to obtain a first weighted summation result; and use the first weighted summation result as the pixel value of the pixel to be interpolated.
[0085] The position of the pixel corresponding to the third pixel in the previous image is the same as the position of the third pixel in the current image. For example, if the third pixel is in the i-1th row and jth column in the current image, then the pixel corresponding to the third pixel in the previous image is also in the i-1th row and jth column in the previous image.
[0086] The position of the pixel corresponding to the fourth pixel in the previous image is the same as the position of the fourth pixel in the current image. For example, if the fourth pixel is in the i+1th row and jth column in the current image, then the pixel corresponding to the fourth pixel in the previous image is also in the i+1th row and jth column in the previous image.
[0087] The position of the pixel corresponding to the third pixel in the next image is the same as the position of the third pixel in the current image. For example, if the third pixel is in the i-1th row and jth column in the current image, then the pixel corresponding to the third pixel in the next image is also in the i-1th row and jth column in the next image.
[0088] The position of the pixel corresponding to the fourth pixel in the next image is the same as the position of the fourth pixel in the current image. For example, if the fourth pixel is in the i+1th row and jth column in the current image, then the pixel corresponding to the fourth pixel in the next image is also in the i+1th row and jth column in the next image.
[0089] Among them, the fifth pixel value of the fifth pixel includes the YUV channel data of the fifth pixel, the sixth pixel value of the sixth pixel includes the YUV channel data of the sixth pixel, the seventh pixel value of the seventh pixel includes the YUV channel data of the seventh pixel, and the eighth pixel value of the eighth pixel includes the YUV channel data of the eighth pixel.
[0090] In an embodiment of the present application, a weight is set for each of the first pixel value, the second pixel value, the third pixel value, the fourth pixel value, the fifth pixel value, the sixth pixel value, the seventh pixel value, and the eighth pixel value, and a weighted sum is performed according to the corresponding weights, and the first weighted summation result is used as the pixel value of the pixel to be interpolated. Specifically, the weights corresponding to the first pixel value, the second pixel value, the third pixel value, the fourth pixel value, the fifth pixel value, the sixth pixel value, the seventh pixel value, and the eighth pixel value are 0.25, 0.25, 0.5, 0.5, -0.125, -0.125, -0.125, and -0.125, respectively.
[0091] When the pixel to be interpolated is a moving pixel, since the position of the moving pixel will change in different field images, the pixel to be interpolated can be weighted interpolated according to the pixel value of the corresponding pixel in the adjacent field image of the current field image, the pixel value of the surrounding pixels of the corresponding pixel, and the pixel value of the surrounding pixels of the pixel to be interpolated in the current field image to determine the pixel value of the pixel to be interpolated. This can ensure that the pixel value of the pixel to be interpolated is not abrupt, and avoid blurring and jittering of the image content of the current field image after interpolation.
[0092] In an optional embodiment, the field data of the previous image includes the Y channel data of the previous image and the UV channel data of the previous image, and the field data of the next image includes the Y channel data of the next image and the UV channel data of the next image. Step S30 includes steps S31 to S33, which are specifically as follows:
[0093] S31: if the pixel to be interpolated of the current field image is a moving pixel, obtain Y channel data of the pixel to be interpolated according to Y channel data of the previous field image, Y channel data of the next field image and Y channel data of the current field image;
[0094] S32: Obtaining UV channel data of the pixel to be interpolated according to the UV channel data of the previous image and the UV channel data of the next image;
[0095] S33: Obtain YUV channel data of the pixel to be interpolated according to the Y channel data and the UV channel data; and use the YUV channel data as the pixel value of the pixel to be interpolated.
[0096] Among them, the Y channel data of the current field image refers to the Y channel data of each pixel point in the current field image except the pixel point to be interpolated, and the UV channel data of the current field image refers to the UV channel data of each pixel point in the current field image except the pixel point to be interpolated.
[0097] In the embodiment of the present application, step S31 can refer to steps S301 to S302, which will not be described in detail here. Step S32 can refer to steps S201 to S202, which will not be described in detail here. The Y channel data of the pixel to be interpolated and the UV channel data of the pixel to be interpolated are channel-joined to obtain the YUV channel data of the pixel to be interpolated, and the YUV channel data is used as the pixel value of the pixel to be interpolated.
[0098] If the pixel to be interpolated of the current field image is a moving pixel, weighted interpolation processing is performed on the pixel to be interpolated according to the Y channel data of the corresponding pixel of the adjacent field image of the current field image, the Y channel data of the surrounding pixels of the corresponding pixel, and the Y channel data of the surrounding pixels of the pixel to be interpolated in the current field image to determine the Y channel data of the pixel to be interpolated; interpolation processing is performed on the pixel to be interpolated according to the UV channel data of the corresponding pixel of the adjacent field image of the current field image to determine the UV channel data of the pixel to be interpolated, which can ensure that the pixel value of the pixel to be interpolated is not abrupt, and avoid blurring and jittering of the image content of the current field image after interpolation.
[0099] In step S40, the interpolated current field image is obtained.
[0100] In the embodiment of the present application, after interpolation processing is performed on each pixel to be interpolated in the current field image, each pixel to be interpolated in the current field image has a pixel value, and the current field image is converted from an interlaced video image to a progressive video image.
[0101] In an optional embodiment, after interpolating the pixel points to be interpolated, the method further includes: filtering the pixel values of the pixel points to be interpolated; the step of filtering the pixel values of the pixel points to be interpolated includes:
[0102] S51: Obtaining the pixel value of the pixel to be interpolated, the pixel values of the adjacent pixel points above the pixel to be interpolated, and the pixel values of the adjacent pixel points below the pixel to be interpolated;
[0103] S52: Calculate a fourth absolute value difference and a fourth average value of pixel values of adjacent pixel points above the pixel point to be interpolated and pixel values of adjacent pixel points below the pixel point to be interpolated;
[0104] S53: Calculate a fifth absolute value difference between the fourth average value and the pixel value of the pixel to be interpolated;
[0105] S54: If the fourth absolute value difference is less than or equal to the second preset threshold, and the fifth absolute value difference is less than or equal to the second preset threshold, the pixel value of the pixel to be interpolated is replaced with the fourth average value.
[0106] The fourth absolute value difference is obtained by calculating the difference between the pixel values of the adjacent pixels above the pixel to be interpolated and the pixel values of the adjacent pixels below the pixel to be interpolated, and taking the absolute value of the difference. The fourth average value is the average value of the pixel values of the adjacent pixels above the pixel to be interpolated and the pixel values of the adjacent pixels below the pixel to be interpolated. The fifth absolute value difference is obtained by calculating the difference between the fourth average value and the pixel value of the current pixel, and taking the absolute value of the difference.
[0107] The second preset threshold can be set manually according to actual needs.
[0108] In the embodiment of the present application, if the fourth absolute value difference is less than or equal to the second preset threshold, and the fifth absolute value difference is less than or equal to the second preset threshold, the pixel value of the pixel to be interpolated is replaced with the fourth average value. If the fourth absolute value difference is greater than the second preset threshold, or the fifth absolute value difference is greater than the second preset threshold, the pixel value of the pixel to be interpolated does not need to be corrected.
[0109] By screening out the pixels to be interpolated whose pixel values are abrupt after interpolation processing and replacing the pixel values of the pixels to be interpolated with the fourth average value, it is possible to avoid color clutter in the image content and reduce image content distortion of the current field image after interpolation.
[0110] The following is an embodiment of the device of the present application, which can be used to execute the content of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the content of the method in the embodiment of the present application.
[0111] See also Figure 2 , which shows a schematic diagram of the structure of a video deinterlacing processing device provided in an embodiment of the present application. The video deinterlacing processing device 6 provided in an embodiment of the present application comprises:
[0112] The field image acquisition module 61 is used to acquire the current field image, the previous field image of the current field image, and the next field image of the current field image; wherein the current field image is an image obtained by performing interlaced sampling on the video image of the current frame, the previous field image of the current field image is an image obtained by performing interlaced sampling on the video image of the previous frame of the current frame, and the next field image of the current field image is an image obtained by performing interlaced sampling on the video image of the next frame of the current frame;
[0113] The stationary pixel interpolation module 62 is used to interpolate the pixel to be interpolated according to the field data of the previous field image and the field data of the next field image if the pixel to be interpolated of the current field image is a stationary pixel; wherein the pixel to be interpolated is the pixel to be filled with the pixel value;
[0114] A moving pixel interpolation module 63 is used to interpolate the pixel to be interpolated according to the field data of the previous field image, the field data of the next field image and the field data of the current field image if the pixel to be interpolated of the current field image is a moving pixel;
[0115] The interpolated current field image obtaining module 64 is used to obtain the interpolated current field image.
[0116] The embodiment of the present application is applied, by obtaining a current field image, a previous field image of the current field image, and a subsequent field image of the current field image; wherein the current field image is an image obtained by interlaced sampling of a video image of the current frame, the previous field image of the current field image is an image obtained by interlaced sampling of a video image of the previous frame of the current frame, and the subsequent field image of the current field image is an image obtained by interlaced sampling of a video image of the subsequent frame of the current frame; if the pixel points to be interpolated of the current field image are stationary pixels, the pixel points to be interpolated are interpolated according to the field data of the previous field image and the field data of the subsequent field image; wherein the pixel points to be interpolated are the pixel points to be filled with pixel values; if the pixel points to be interpolated of the current field image are moving pixels, the pixel points to be interpolated are interpolated according to the field data of the previous field image, the field data of the subsequent field image, and the field data of the current field image; and the interpolated current field image is obtained. The present application performs motion detection on the pixel points to be interpolated in the current field image, determines whether the pixel points to be interpolated are stationary pixels or moving pixels, and when the pixel points to be interpolated are stationary pixels, interpolation processing is performed on the stationary pixels according to the adjacent field data of the current field image; when the pixel points to be interpolated are moving pixels, interpolation processing is performed on the moving pixels according to the adjacent field data of the current field image and the field data of the current field image. By adopting different interpolation processing methods for stationary pixels and moving pixels, the interpolation accuracy of the pixel points to be interpolated in the current field image is improved, and distortion, blurring and jittering of the image content of the interpolated current field image are avoided.
[0117] The following is an embodiment of the device of the present application, which can be used to execute the content of the method in the embodiment of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the content of the method in the embodiment of the present application.
[0118] See also Figure 3 , the present application also provides an electronic device 300, including an odd-even field discriminator 301, a memory 302 and a data processor 303; the odd-even field discriminator is connected to the memory, and the memory is connected to the data processor;
[0119] The odd-even field discriminator 301 is used to receive the current field image, the previous field image of the current field image and the next field image of the current field image, and send the current field image, the previous field image of the current field image and the next field image of the current field image to the memory 302; wherein the current field image is an image obtained by performing interlaced sampling on the video image of the current frame, the previous field image of the current field image is an image obtained by performing interlaced sampling on the video image of the previous frame of the current frame, and the next field image of the current field image is an image obtained by performing interlaced sampling on the video image of the next frame of the current frame;
[0120] The memory 302 is used to send the current field image, the previous field image of the current field image and the next field image of the current field image to the data processor 303;
[0121] The data processor 303 is used to interpolate the pixels to be interpolated in the current field image according to the above-mentioned video deinterlacing processing method to obtain the interpolated current field image.
[0122] The electronic device may specifically be a computer, a mobile phone, a tablet computer, or a Field-Programmable Gate Array (FPGA) chip.
[0123] Among them, the odd-even field discriminator can determine whether the current field image, the previous field image of the current field image, and the next field image of the current field image are odd fields or even fields, and can also identify the resolution of the current field image, the previous field image of the current field image, and the next field image of the current field image.
[0124] Among them, the memory 302 may include a random access memory (RAM) or a read-only memory (Read-Only Memory). Optionally, the memory 302 includes a non-transitory computer-readable storage medium. The memory 302 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 302 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 302 may also be at least one storage device located away from the aforementioned data processor 303. The memory 302 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an operating application.
[0125] Among them, the digital processor 303 may include one or more processing cores. The digital processor 303 uses various interfaces and lines to connect various parts of the entire electronic device, and executes various functions of the electronic device and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory 302, and calling data stored in the memory 302. Optionally, the digital processor 303 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The digital processor 303 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed by the display layer; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor, but implemented separately through a chip.
[0126] The digital processor 303 can be used to call the application of the video deinterlacing processing method stored in the memory 302, and specifically execute the method steps of the above-mentioned embodiment. The specific execution process can refer to the specific description shown in the embodiment, which will not be repeated here.
[0127] The present application also provides a computer-readable storage medium on which a computer program is stored, and the instructions are suitable for being loaded by a processor and executing the method steps of the above-mentioned embodiment. The specific execution process can refer to the specific description shown in the embodiment, and will not be repeated here. The device where the storage medium is located can be a personal computer, a laptop computer, a smart phone, a tablet computer and other electronic devices.
[0128] For the device embodiments, since they basically correspond to the method embodiments, the relevant parts can refer to the partial description of the method embodiments. The device embodiments described above are merely schematic, wherein the components described as separate parts may or may not be physically separated, and the parts displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present application scheme. A person of ordinary skill in the art can understand and implement it without paying any creative work.
[0129] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0130] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data 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 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the function selected in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 function selected in a box or multiple boxes.
[0131] These computer program instructions can also be loaded onto a computer or other programmable data 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 implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 steps for the function selected in a box or multiple boxes.
[0132] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0133] The memory may include non-permanent memory 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.
[0134] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information 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, tape storage, disk storage or any other non-transmission medium that can be used to store information 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.
[0135] 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.
[0136] 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. A video deinterlacing processing method, characterized in that: The method comprises the following steps: Acquire a current field image, a field image before the current field image, and a field image after the current field image; wherein the current field image is an image obtained by performing interlaced sampling on a video image of a current frame, the field image before the current field image is an image obtained by performing interlaced sampling on a video image of a frame before the current frame, and the field image after the current field image is an image obtained by performing interlaced sampling on a video image of a frame after the current frame; If the pixel point to be interpolated of the current field image is a stationary pixel point, interpolate the pixel point to be interpolated according to the field data of the previous field image and the field data of the next field image; wherein the pixel point to be interpolated is a pixel point to be filled with a pixel value; If the pixel to be interpolated of the current field image is a moving pixel, interpolating the pixel to be interpolated according to the field data of the previous field image, the field data of the next field image and the field data of the current field image; The interpolated current field image is obtained.
2. The video deinterlacing processing method according to claim 1, characterized in that: If the pixel to be interpolated of the current field image is a stationary pixel, the step of interpolating the pixel to be interpolated according to the field data of the previous field image and the field data of the next field image comprises: If the pixel to be interpolated of the current field image is a stationary pixel, obtaining a first pixel value of a first pixel corresponding to the pixel to be interpolated in the previous field image and a second pixel value of a second pixel corresponding to the pixel to be interpolated in the next field image; A first average value of the first pixel value and the second pixel value is calculated, and the first average value is used as the pixel value of the pixel point to be interpolated.
3. The video deinterlacing processing method according to claim 1, characterized in that: If the pixel to be interpolated of the current field image is a moving pixel, the step of interpolating the pixel value of the pixel to be interpolated according to the field data of the previous field image, the field data of the next field image and the field data of the current field image comprises: If the pixel to be interpolated of the current field image is a moving pixel, obtain a first pixel value of a first pixel corresponding to the pixel to be interpolated in the previous field image, a second pixel value of a second pixel corresponding to the pixel to be interpolated in the next field image, a third pixel value of a third pixel in the current field image, a fourth pixel value of a fourth pixel in the current field image, a fifth pixel value of a fifth pixel in the previous field image, a sixth pixel value of a sixth pixel in the previous field image, a seventh pixel value of a seventh pixel in the next field image, and an eighth pixel value of an eighth pixel in the next field image; wherein, the third pixel is an adjacent pixel point located above the pixel point to be interpolated in the current field image, the fourth pixel point is an adjacent pixel point located below the pixel point to be interpolated in the current field image, the fifth pixel point is an adjacent pixel point above the pixel point corresponding to the third pixel point in the previous field image, the sixth pixel point is an adjacent pixel point below the pixel point corresponding to the fourth pixel point in the previous field image, the seventh pixel point is an adjacent pixel point above the pixel point corresponding to the third pixel point in the next field image, and the eighth pixel point is an adjacent pixel point below the pixel point corresponding to the fourth pixel point in the next field image; Perform weighted summation on the first pixel value, the second pixel value, the third pixel value, the fourth pixel value, the fifth pixel value, the sixth pixel value, the seventh pixel value and the eighth pixel value to obtain a first weighted summation result; and use the first weighted summation result as the pixel value of the pixel to be interpolated.
4. The video deinterlacing processing method according to any one of claims 1 to 3, characterized in that: After the step of acquiring the current field image, the previous field image of the current field image, and the next field image of the current field image, the method further includes: determining the motion state of the pixel points to be interpolated of the current field image; the step of determining the motion state of the pixel points to be interpolated of the current field image includes: Acquire a first pixel value of a first pixel point corresponding to the pixel point to be interpolated in the previous field image, a second pixel value of a second pixel point corresponding to the pixel point to be interpolated in the next field image, a third pixel value of a third pixel point in the current field image, and a fourth pixel value of a fourth pixel point in the current field image; wherein the third pixel point is an adjacent pixel point above the pixel point to be interpolated in the current field image, and the fourth pixel point is an adjacent pixel point below the pixel point to be interpolated in the current field image; Calculate a first absolute value difference between the first pixel value and the second pixel value and a second average value; Calculating a second absolute value difference between the third pixel value and the fourth pixel value and a third average value; Calculating a third absolute value difference between the second average value and the third average value; Determine whether the first absolute value difference, the second absolute value difference, and the third absolute value difference are all less than or equal to a first preset threshold; if so, determine that the pixel point to be interpolated of the current field image is a stationary pixel point; if not, determine that the pixel point to be interpolated of the current field image is a moving pixel point.
5. The video deinterlacing processing method according to any one of claims 1 to 3, characterized in that: After interpolating the pixel points to be interpolated, the method further includes: filtering the pixel values of the pixel points to be interpolated; the step of filtering the pixel values of the pixel points to be interpolated includes: Obtaining a pixel value of the pixel to be interpolated, a pixel value of an adjacent pixel above the pixel to be interpolated, and a pixel value of an adjacent pixel below the pixel to be interpolated; Calculating a fourth absolute value difference and a fourth average value of pixel values of adjacent pixel points above the pixel point to be interpolated and pixel values of adjacent pixel points below the pixel point to be interpolated; Calculate a fifth absolute value difference between the fourth average value and the pixel value of the pixel point to be interpolated; If the fourth absolute value difference is less than or equal to the second preset threshold, and the fifth absolute value difference is less than or equal to the second preset threshold, the pixel value of the pixel to be interpolated is replaced with the fourth average value.
6. The video deinterlacing processing method according to any one of claims 1 to 3, characterized in that: The field data of the previous image includes Y channel data of the previous image and UV channel data of the previous image, and the field data of the next image includes Y channel data of the next image and UV channel data of the next image; If the pixel to be interpolated of the current field image is a stationary pixel, the step of interpolating the pixel to be interpolated according to the field data of the previous field image and the field data of the next field image comprises: If the pixel to be interpolated of the current field image is a stationary pixel, obtaining YUV channel data of the pixel to be interpolated according to the Y channel data of the previous field image, the UV channel data of the previous field image, the Y channel data of the next field image, and the UV channel data of the next field image; The YUV channel data is used as the pixel value of the pixel to be interpolated.
7. The video deinterlacing processing method according to any one of claims 1 to 3, characterized in that: The field data of the previous image includes Y channel data of the previous image and UV channel data of the previous image, and the field data of the next image includes Y channel data of the next image and UV channel data of the next image; If the pixel to be interpolated of the current field image is a moving pixel, the step of interpolating the pixel to be interpolated according to the field data of the previous field image, the field data of the next field image and the field data of the current field image comprises: If the pixel to be interpolated of the current field image is a moving pixel, obtaining Y channel data of the pixel to be interpolated according to the Y channel data of the previous field image, the Y channel data of the next field image and the Y channel data of the current field image; Obtaining UV channel data of the pixel to be interpolated according to the UV channel data of the previous image and the UV channel data of the next image; According to the Y channel data and the UV channel data, the YUV channel data of the pixel to be interpolated is obtained; and the YUV channel data is used as the pixel value of the pixel to be interpolated.
8. A video deinterlacing processing device, characterized in that: include: A field image acquisition module, used to acquire a current field image, a field image before the current field image, and a field image after the current field image; wherein the current field image is an image obtained by performing interlaced sampling on a video image of a current frame, the field image before the current field image is an image obtained by performing interlaced sampling on a video image of a frame before the current frame, and the field image after the current field image is an image obtained by performing interlaced sampling on a video image of a frame after the current frame; A stationary pixel interpolation module, used for interpolating the to-be-interpolated pixel of the current field image according to the field data of the previous field image and the field data of the next field image if the to-be-interpolated pixel of the current field image is a stationary pixel; wherein the to-be-interpolated pixel is a pixel to be filled with a pixel value; A moving pixel interpolation module, configured to interpolate the pixel to be interpolated of the current field image according to the field data of the previous field image, the field data of the next field image and the field data of the current field image if the pixel to be interpolated of the current field image is a moving pixel; The interpolated current field image obtaining module is used to obtain the interpolated current field image.
9. An electronic device, characterized in that: It includes an odd-even field discriminator, a memory and a data processor; The odd-even field discriminator is connected to the memory, and the memory is connected to the data processor; The odd-even field discriminator is used to receive a current field image, a field image before the current field image, and a field image after the current field image, and send the current field image, the field image before the current field image, and the field image after the current field image to the memory; wherein the current field image is an image obtained by performing interlaced sampling on a video image of a current frame, the field image before the current field image is an image obtained by performing interlaced sampling on a video image of a frame before the current frame, and the field image after the current field image is an image obtained by performing interlaced sampling on a video image of a frame after the current frame; The memory is used to send the current field image, the previous field image of the current field image and the next field image of the current field image to the data processor; The data processor is used to interpolate the pixel points to be interpolated in the current field image according to the video deinterlacing processing method according to any one of claims 1 to 7, so as to obtain the interpolated current field image.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a data processor, the video deinterlacing processing method according to any one of claims 1 to 7 is implemented.
