Method and device for real-time detection of video image display area and electronic equipment

By comprehensively considering the bright spot threshold, time-domain motion changes and image edge differences, the method of detecting the video image display area solves the problems of inaccurate and unstable detection in the existing technology and improves the effect of video image processing.

CN114071209BActive Publication Date: 2024-09-17AMLOGIC (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010776132.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-05
Publication Date
2024-09-17
Estimated Expiration
2040-08-05

AI Technical Summary

Technical Problem

It is difficult for the existing technology to accurately and stably detect the display area of ​​the video image in video image processing, especially when there are black edge areas and uneven light and dark distribution, which affects the effect of the image processing algorithm.

Method used

By obtaining the pixel value, time-domain motion statistics and gradient information of the current frame image, comprehensively considering the bright spot threshold, motion changes and image edge differences, the boundary bright line of the display area is determined, and the linkage of multiple thresholds and warning lines is used to improve detection accuracy and stability.

Benefits of technology

It improves the accuracy and stability of video image display area detection, effectively copes with video streams with uneven light and dark distribution, and improves video image algorithms and final video image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114071209B
    Figure CN114071209B
Patent Text Reader

Abstract

The present invention discloses a method, device and electronic device for real-time detection of video image display area, the method comprising: obtaining the pixel value of each pixel in the current frame image, determining the bright spot threshold line for distinguishing the current frame image display area from the black edge area according to the pixel value of each pixel; obtaining the time domain motion statistics of the pixels corresponding to the current frame image and the previous frame image, determining the time domain warning line according to the time domain motion statistics of each row and column of pixels in the current frame image; determining the target optimal gradient line for distinguishing the current frame image display area from the black edge area according to the gradient information of each row and column of pixels; determining the boundary bright line between the current frame image display area and the black edge area according to the bright spot threshold line, the time domain warning line and the target gradient line, so as to determine the display area of ​​the current frame image. The method, device and electronic device of the present invention can select a more stable boundary bright line and improve the accuracy of the image processing algorithm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video processing technology, and in particular to a method for real-time detection of a video image display area, and a device and electronic equipment for real-time detection of a video image display area. Background Art

[0002] When playing a video, there will be black borders. For example, in old film, there are invalid black borders above and below. For video image processing, the data in the black border area is meaningless and will affect the effect of the image processing algorithm, especially in the motion compensation algorithm.

[0003] In the field of video editing, computer software is used to cut and manually set the cropping area. After separating the actual display content in the video, it is saved as a new video stream and then played. This will make the video ratio inconsistent with the ratio of the display panel, and it is impossible to use such a method in video image algorithm processing. Since the TV content played is updated in real time, the black border area between scenes is not necessarily the same. From the user's viewing perspective, it is not desirable to crop the black border area, which will lead to poor viewing experience.

[0004] When processing images, such as Figure 1 As shown, four bright lines, such as an upper bright line, a lower bright line, a left bright line and a right bright line, can be determined by a pixel brightness threshold method to separate the actual display area A and the invalid black border area B in the frame image.

[0005] However, since the invalid black-border area is not necessarily pure black, but has a certain brightness, using only the pixel brightness threshold method to determine the bright line that distinguishes the display area from the black-border area will make the result unstable or even produce errors. When the video image has an uneven distribution of light and dark, it will also affect the detection results of the black-border area. For example, the dark area is prone to misdetection. If the frame image boundary is not smooth enough, the bright line detection position will be unstable, affecting other video image algorithms and the final video image quality. Summary of the invention

[0006] The present invention aims to solve at least one of the technical problems existing in the prior art.

[0007] To this end, an object of the present invention is to provide a method for real-time detection of a video image display area, which method can improve the stability and accuracy of video image display area detection.

[0008] The second object of the present invention is to provide a device for real-time detection of a video image display area.

[0009] The third objective of the present invention is to provide an electronic device.

[0010] In order to achieve the above-mentioned purpose, the method for real-time detection of the display area of ​​a video image in an embodiment of the first aspect of the present invention includes: obtaining the pixel value of each pixel in the current frame image, and determining the bright spot threshold line that distinguishes the display area of ​​the current frame image from the black edge area according to the pixel value of each pixel; obtaining the time domain motion statistics of the pixels corresponding to the current frame image and the previous frame image, and determining the time domain warning line that distinguishes the display area of ​​the current frame image from the black edge area according to the time domain motion statistics of the pixels in each row and column of the current frame image; obtaining the gradient information of the pixels in each row and column of the current frame image, and determining the target gradient line that distinguishes the display area of ​​the current frame image from the black edge area according to the gradient information of the pixels in each row and column; determining the boundary bright line between the display area of ​​the current frame image and the black edge area according to the positions of the bright spot threshold line, the time domain warning line and the target gradient line; and determining the display area of ​​the current frame image according to the boundary bright line.

[0011] According to the method for real-time detection of the display area of ​​a video image according to an embodiment of the present invention, the bright spot threshold, the change of motion statistics and the image edge difference are comprehensively considered to select the boundary bright line of the display area of ​​the current frame image. Compared with determining the boundary bright line only by the bright spot threshold, the detection result is more accurate and stable. In the case where the boundary of the frame image is not smooth enough, the linkage of the three types of lines of feedback information can also make the detection result of the display area more stable. It can also effectively cope with the video code stream with uneven light and dark distribution, obtain a stable boundary bright line, and improve the video image algorithm and the final video image quality.

[0012] In some embodiments, obtaining the pixel value of each pixel in the current frame image, and determining the bright spot threshold line for distinguishing the current frame image display area from the black edge area according to the pixel value of each pixel, includes:

[0013] Read the pixel value of each pixel point in each row of the current frame image from top to bottom in sequence, and if the pixel value is greater than the bright spot threshold, determine that the corresponding pixel point is a bright spot, count the number of bright spots of each row of pixels, and determine that the behavior of the number of bright spots exceeding the first preset number threshold distinguishes the bright spot threshold line of the current frame image display area and the upper black border area;

[0014] Read the pixel value of each pixel in each row of the current frame image downward from the bright spot threshold line distinguishing the current frame image display area from the upper black border area, if the number of bright spots of the pixel in the current row exceeds a first preset number threshold and the number of bright spots between the current row and the bright spot threshold line distinguishing the current frame image display area from the upper black border area exceeds a first bright spot number threshold, then determine that the current row is the bright spot threshold line distinguishing the current frame image display area from the lower black border area;

[0015] Read the pixel value of each pixel point in each column of the current frame image from left to right in turn, and if the pixel value is greater than the bright spot threshold, determine that the corresponding pixel point is a bright spot, count the number of bright spots of the pixel points in each column, and determine that the column whose number of bright spots exceeds the second preset number threshold is the bright spot threshold line that distinguishes the current frame image display area from the left black border area;

[0016] The pixel value of each pixel in each column of the current frame image is read to the right from the bright spot threshold line that distinguishes the current frame image display area from the left black border area. If the number of bright spots of the pixels in the current column exceeds the second preset number threshold and the number of bright spots between the current column and the bright spot threshold line that distinguishes the current frame image display area from the left black border area exceeds the second bright spot number threshold, the current column is determined to be the bright spot threshold line that distinguishes the current frame image display area from the right black border area.

[0017] In some embodiments, the pixel value of each pixel point in each row of the current frame image is read from top to bottom in sequence, and the corresponding pixel point is determined to be a bright spot if the pixel value is greater than the bright spot threshold, and the number of bright spots in each row of pixels is counted, and the behavior of determining that the number of bright spots exceeds the first preset number threshold is used to distinguish the bright spot threshold line of the current frame image display area and the upper black border area, including: reading the pixel value of each pixel point in each row of the current frame image from top to bottom in sequence; the corresponding pixel point is determined to be a bright spot if the pixel value is greater than the first bright spot sub-threshold, and the number of bright spots in each row of pixels is counted, and the behavior of determining that the number of bright spots exceeds the first preset number threshold is used to distinguish the first bright spot threshold line of the current frame image display area and the upper black border area; the corresponding pixel point is determined to be a bright spot if the pixel value is greater than the second bright spot sub-threshold, and the number of bright spots in each row of pixels is counted, and the behavior of determining that the number of bright spots exceeds the second preset number threshold is used to distinguish the second bright spot threshold line of the current frame image display area and the upper black border area, wherein the first bright spot sub-threshold is greater than the second bright spot sub-threshold. By setting dual thresholds, the robustness and flexibility of the method can be further improved.

[0018] In some embodiments, the pixel value of each pixel in each row of the current frame image is read downward from the bright spot threshold line distinguishing the current frame image display area from the upper black border area, the number of bright spots of the current row of pixels exceeds a first preset number threshold and the number of bright spots between the current row and the bright spot threshold line distinguishing the current frame image display area from the upper black border area exceeds a first bright spot number threshold, then determining that the current row is the bright spot threshold line distinguishing the current frame image display area from the lower black border area includes:

[0019] Reading the pixel value of each pixel point in each row of the current frame image in sequence downward from the bright spot threshold line that distinguishes the current frame image display area from the upper black border area;

[0020] If the pixel value is greater than the first bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, the number of bright spots in each row of pixels is counted, and the first bright spot threshold line that distinguishes the current frame image display area from the lower black border area is determined when the number of bright spots exceeds the first preset number threshold;

[0021] If the pixel value is greater than the second bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, the number of bright spots in each row of pixels is counted, and the second bright spot threshold line that distinguishes the current frame image display area from the lower black border area when the number of bright spots exceeds the second preset number threshold is determined, wherein the first bright spot sub-threshold is greater than the second bright spot sub-threshold. By setting dual thresholds, the robustness and flexibility of the method can be further improved.

[0022] In some embodiments, the pixel value of each pixel in each column of the current frame image is obtained from left to right, and if the pixel value is greater than the bright spot threshold, the corresponding pixel is determined to be a bright spot, and the number of bright spots of each column of pixels is counted, and the column whose number of bright spots exceeds the first preset number threshold is determined as the bright spot threshold line that distinguishes the current frame image display area from the left black border area, including:

[0023] Obtain the pixel value of each pixel in each column of the current frame image from left to right;

[0024] If the pixel value is greater than the third bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, the number of bright spots in each column of pixels is counted, and the column whose number of bright spots exceeds the third preset number threshold is determined to be the first bright spot threshold line that distinguishes the current frame image display area from the left black border area;

[0025] If the pixel value is greater than the fourth bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, the number of bright spots in each column of pixels is counted, and the column whose number of bright spots exceeds the fourth preset number threshold is determined to be the second bright spot threshold line for distinguishing the current frame image display area from the left black border area, wherein the third bright spot sub-threshold is greater than the fourth bright spot sub-threshold. By setting dual thresholds, the robustness and flexibility of the method can be further improved.

[0026] In some embodiments, the pixel value of each pixel in each column of the current frame image is read to the right from the bright spot threshold line distinguishing the current frame image display area from the left black border area, the number of bright spots of the pixel in the current column exceeds the second preset number threshold and the number of bright spots between the current column and the bright spot threshold line distinguishing the current frame image display area from the left black border area exceeds the second bright spot number threshold, and the current column is determined to be the bright spot threshold line distinguishing the current frame image display area from the right black border area, including:

[0027] Read the pixel value of each pixel point in each column of the current frame image in sequence from the bright spot threshold line that distinguishes the current frame image display area from the left black border area to the right;

[0028] If the pixel value is greater than the third bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, the number of bright spots in each column of pixels is counted, and the column whose number of bright spots exceeds the third preset number threshold is determined to be the first bright spot threshold line that distinguishes the current frame image display area from the right black border area;

[0029] If the pixel value is greater than the fourth bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, the number of bright spots in each column of pixels is counted, and the column with the number of bright spots exceeding the fourth preset number threshold is determined as the second bright spot threshold line that distinguishes the current frame image display area from the right black border area, wherein the third bright spot sub-threshold is greater than the fourth bright spot sub-threshold.

[0030] In some embodiments, obtaining temporal motion statistics of corresponding pixels of a current frame image and a previous frame image includes:

[0031] Get the pixel value I' of the pixel at position (x, y) in the current frame image t (x, y), and get the pixel value I' of the pixel at the same position (x, y) in the previous frame image t-1 (x,y);

[0032] Calculate I' t (x,y) and I' t-1 The pixel difference of (x,y);

[0033] If the pixel difference is greater than the first pixel motion threshold, the temporal motion difference of the pixel point at the position (x, y) is the first temporal motion difference; if the pixel difference is less than or equal to the first pixel motion threshold and greater than the second pixel motion threshold, the temporal motion difference of the pixel point at the position (x, y) is the second temporal motion difference, wherein the first temporal motion difference is greater than the second temporal motion difference;

[0034] The sum of the temporal motion differences of the pixels in each row of the current frame image is calculated to obtain the temporal motion statistics of each row, and the sum of the temporal motion differences of the pixels in each column of the current frame image is calculated to obtain the temporal motion statistics of each column.

[0035] In some embodiments, determining a temporal warning line for distinguishing a current frame image display area from a black edge area according to temporal motion statistics of each row and column of pixels includes:

[0036] Accumulating the temporal motion statistics of each row of the current frame image from top to bottom, when the accumulated total value of the temporal motion statistics of the current row and the temporal motion statistics of all previous rows is greater than a first temporal motion accumulation threshold, determining a temporal warning line for distinguishing the current frame image display area from the upper black border area in the current behavior;

[0037] Accumulating the temporal motion statistics of each row of the current frame image from bottom to top, when the accumulated total value of the temporal motion statistics of the current row and the temporal motion statistics of all previous rows is greater than the first temporal motion accumulation threshold, determining a temporal warning line for distinguishing the current frame image display area from the lower black border area in the current behavior;

[0038] Accumulating the temporal motion statistics of each column of the current frame image from left to right, and the accumulated total value of the temporal motion statistics of the current column and the temporal motion statistics of all previous columns is greater than the second temporal motion accumulation threshold, and determining that the current column is the temporal warning line that distinguishes the current frame image display area from the left black edge area;

[0039] The time domain motion statistics of each column of the current frame image are accumulated from right to left. The accumulated total value of the time domain motion statistics of the current column and the time domain motion statistics of all previous columns is greater than the second time domain motion accumulation threshold, and the current column is determined to be the time domain warning line that distinguishes the current frame image display area from the right black border area.

[0040] By setting double thresholds, the robustness and flexibility of the method can be further improved.

[0041] In some embodiments, the temporal motion statistics of each row of the current frame image are accumulated from top to bottom, and the accumulated total value of the temporal motion statistics of the current row and the temporal motion statistics of all previous rows is greater than a first temporal motion accumulation threshold, and the temporal warning line for distinguishing the current frame image display area from the upper black border area is determined, including:

[0042] Accumulating the time domain motion vector accumulation value of each row of the current frame image from top to bottom;

[0043] If the accumulated total value of the temporal motion statistics of the current row and the temporal motion statistics of all previous rows is greater than the first temporal motion accumulation sub-threshold, the first temporal warning line for distinguishing the current frame image display area from the upper black border area is determined in the current row;

[0044] Alternatively, if the accumulated total value of the temporal motion statistics of the current row and the temporal motion statistics of all previous rows is greater than the second temporal motion accumulation sub-threshold, then the second temporal warning line for distinguishing the current frame image display area from the upper black border area is determined;

[0045] The first temporal motion accumulation sub-threshold is greater than the second temporal motion accumulation sub-threshold.

[0046] In some embodiments, the temporal motion statistics of each row of the current frame image are accumulated from bottom to top, and the sum of the temporal motion statistics of the current row and the temporal motion statistics of all previous rows is greater than the first temporal motion accumulation threshold, and the temporal warning line for distinguishing the current frame image display area from the lower black border area is determined, including:

[0047] Accumulating the temporal motion statistics of each row of the current frame image from bottom to top;

[0048] The accumulated total value of the temporal motion statistics of the current row and the temporal motion statistics of all previous rows is greater than the first temporal motion accumulation sub-threshold, and the first temporal warning line for distinguishing the current frame image display area from the lower black border area is determined;

[0049] Alternatively, the accumulated total value of the temporal motion statistics of the current row and the temporal motion statistics of all previous rows is greater than the second temporal motion accumulation sub-threshold, and the current row is determined to be a second temporal warning line that distinguishes the current frame image display area from the lower black border area;

[0050] The first temporal motion accumulation sub-threshold is greater than the second temporal motion accumulation sub-threshold.

[0051] In some embodiments, the temporal motion statistics of each column of the current frame image are accumulated from left to right, and the accumulated total value of the temporal motion statistics of the current column and the temporal motion statistics of all previous columns is greater than the second temporal motion accumulation threshold, and the current column is determined to be a temporal warning line that distinguishes the current frame image display area from the left black edge area, including:

[0052] Accumulate the total value of the temporal motion statistics of each pixel block from left to right, wherein each pixel block includes n columns of pixels, and n is an integer greater than 1;

[0053] The total value of the temporal motion statistics of the current pixel block is greater than the block motion threshold, and the temporal motion statistics of each column of pixels in the current pixel block are accumulated from left to right;

[0054] The accumulated total value of the temporal motion statistics of the current column of pixels and the temporal motion statistics of all previous columns in the current pixel block is greater than the third temporal motion accumulation sub-threshold, and the current column is determined to be the first temporal warning line distinguishing the current frame image display area from the left black edge area;

[0055] Alternatively, the accumulated total value of the temporal motion statistics of the current column of pixels and the temporal motion statistics of all previous columns in the current pixel block is greater than the fourth temporal motion accumulation sub-threshold, and the current column is determined to be the second temporal warning line that distinguishes the current frame image display area from the left black border area;

[0056] The fourth temporal motion accumulation sub-threshold is smaller than the third temporal motion accumulation sub-threshold. By setting a double threshold, the robustness and flexibility of the method can be further improved.

[0057] In some embodiments, the temporal motion statistics of each column of the current frame image are accumulated from right to left, and the accumulated total value of the temporal motion statistics of the current column and the temporal motion statistics of all previous columns is greater than the second temporal motion accumulation threshold, and the current column is determined to be a temporal warning line that distinguishes the current frame image display area from the right black edge area, including:

[0058] Accumulate the total value of the temporal motion statistics of each pixel block from right to left, wherein each pixel block includes n columns of pixels, and n is an integer greater than 1;

[0059] The total value of the temporal motion statistics of the current pixel block is greater than the block motion threshold, and the temporal motion statistics of each column of pixels in the current pixel block are accumulated from right to left;

[0060] The accumulated total value of the temporal motion statistics of the current column of pixels and the temporal motion statistics of all previous columns in the current pixel block is greater than the third temporal motion accumulation sub-threshold, and the current column is determined to be the first temporal warning line distinguishing the current frame image display area from the right black edge area;

[0061] Alternatively, the accumulated total value of the temporal motion statistics of the current column of pixels and the temporal motion statistics of all previous columns in the current pixel block is greater than the fourth temporal motion accumulation sub-threshold, and the current column is determined to be the second temporal warning line distinguishing the current frame image display area from the right black border area;

[0062] The fourth temporal motion accumulation sub-threshold is smaller than the third temporal motion accumulation sub-threshold. By setting a double threshold, the robustness and flexibility of the method can be further improved.

[0063] In some embodiments, the gradient information of each row and column of pixels in the current frame image is obtained, and the target gradient line for distinguishing the current frame image display area from the black border area is determined according to the gradient information of each row and column of pixels, including:

[0064] Obtaining the horizontal gradient value and the vertical gradient value of each pixel point in each row from top to bottom, if the horizontal gradient value of the pixel point is less than the first horizontal gradient threshold and the vertical gradient value of the pixel point is greater than the first vertical gradient threshold, determining that the pixel point is a bright pixel point, and counting the number of bright pixels included in the current row;

[0065] Obtaining the horizontal gradient value and the vertical gradient value of each pixel point in each row from bottom to top, the horizontal gradient value of the pixel point is less than the first horizontal gradient threshold and the vertical gradient value of the pixel point is greater than the first vertical gradient threshold, determining that the pixel point is a bright pixel point, and counting the number of bright pixels included in the current row;

[0066] Obtaining the horizontal gradient value and the vertical gradient value of each pixel point in each column from left to right, if the horizontal gradient value of the pixel point is greater than the second horizontal gradient threshold and the vertical gradient value of the current point is less than the second vertical gradient threshold, determining that the pixel point is a bright pixel point, and counting the number of bright pixels included in the current column;

[0067] The horizontal gradient value and the vertical gradient value of each pixel in each column are obtained from right to left. If the horizontal gradient value of the pixel is greater than the second horizontal gradient threshold and the vertical gradient value of the pixel is less than the second vertical gradient threshold, the pixel is determined to be a pixel bright spot, and the number of pixel bright spots included in the current column is counted.

[0068] In some embodiments, the step of obtaining gradient information of each row and column of pixels in the current frame image, and determining a target gradient line for distinguishing the current frame image display area from the black border area according to the gradient information of each row and column of pixels, further includes:

[0069] In the upper black border area, the gradient information of the current row and the gradient information of the two adjacent rows of the current row are filtered to obtain an average gradient, the average gradient is greater than a first edge threshold, and the current behavior is determined to be a first target gradient line for distinguishing the current frame image display area from the upper black border area, or the average gradient is greater than a second edge threshold, and the current behavior is determined to be a second target gradient line for distinguishing the current frame image display area from the upper black border area, wherein the first edge gradient value is greater than the second edge gradient value. By setting a double threshold, the robustness and flexibility of the method can be further improved;

[0070] In the lower black border area, filtering the gradient information of the current row and the gradient information of two adjacent rows of the current row to obtain an average gradient, the average gradient is greater than a first edge threshold, and the current row is determined to be a first target gradient line that distinguishes the current frame image display area from the lower black border area, or the average gradient is greater than a second edge threshold, and the current row is determined to be a second target gradient line that distinguishes the current frame image display area from the lower black border area;

[0071] In the left black border area, filtering the gradient information of the current column and the gradient information of two columns adjacent to the current column to obtain an average gradient, the average gradient is greater than a first width threshold, and the current behavior is determined to be a first target gradient line that distinguishes the current frame image display area from the left black border area, or the average gradient is greater than a second width threshold, and the current behavior is determined to be a second target gradient line that distinguishes the current frame image display area from the left black border area, wherein the first width gradient value is greater than the second width gradient value;

[0072] In the right black border area, the gradient information of the current column and the gradient information of the two adjacent columns of the current column are filtered to obtain an average gradient, and the average gradient is greater than a first width threshold, and the current behavior is determined to be a first target gradient line that distinguishes the current frame image display area from the right black border area, or the average gradient is greater than a second width threshold, and the current behavior is determined to be a second target gradient line that distinguishes the current frame image display area from the right black border area.

[0073] In some embodiments, the boundary bright line of the current frame image display area is determined according to the positions of the bright spot threshold line, the time domain warning line and the target gradient line, including: for the upper black border area or the lower black border area or the left black border area or the right black border area; if the first bright spot threshold line exists, the first bright spot threshold is determined to be the reference bright spot threshold line; if the first bright spot threshold line does not exist and the second bright spot threshold line exists, the second bright spot threshold line is determined to be the reference bright spot threshold line; if both the first bright spot threshold line and the second bright spot threshold line do not exist, the bright spot threshold line of the previous video frame is determined to be the reference bright spot threshold line.

[0074] In some embodiments, determining the boundary bright line between the current frame image display area and the black edge area according to the positions of the bright spot threshold line, the time domain warning line and the target gradient line includes:

[0075] For the upper black border area or the lower black border area or the left black border area or the right black border area, the first time domain warning line and the first target gradient line both exist; if the position of the first target gradient line is adjacent to the position of the first time domain warning line, the first target gradient line is determined to be the boundary bright line between the display area and the black border area of ​​the current frame image; if the position of the reference bright spot threshold line is adjacent to or the same as the position of the first target gradient line, the line where the reference bright spot threshold line and the first target gradient line are closer to the inside of the display area is determined to be the boundary bright line; if the position of the first target gradient line is located outside the reference bright spot threshold line, the boundary bright line between the display area and the black border area of ​​the current video frame is determined according to the first target gradient line and the first time domain warning line; if the position of the first target gradient line is located inside the reference bright spot threshold line, the boundary bright line of the current video frame is determined according to the boundary bright line information of the previous video frame of the current video frame and the boundary bright line information of the current video frame.

[0076] In some embodiments, determining a bright boundary line between a display area and a black border area of ​​the current video frame according to the first target gradient line and the first time-domain warning line includes:

[0077] If the first time-domain warning line is located inside the first target gradient line and the first target gradient line is not located at an image boundary, determining that the first target gradient line is a bright boundary line between a display area and a black border area of ​​the current video frame;

[0078] If the first time-domain warning line is located inside the first target gradient line and the first target gradient line is located at an image boundary, keeping the boundary bright line of the previous video frame as the boundary bright line of the current video frame;

[0079] If the first time-domain warning line is located inside the first target gradient line, the boundary bright line output is zero.

[0080] In some embodiments, if the position of the first target gradient line is located inside the reference bright spot threshold line, determining the boundary bright line of the current video frame according to boundary bright line information of a previous video frame of the current video frame and boundary bright line information of the current video frame includes:

[0081] The gradient line of the previous video frame is adjacent to the first target gradient line of the current video frame; if the first time-domain warning line of the current video frame is located inside the first target gradient line, the first target gradient line is determined to be the boundary bright line between the display area and the black-border area of ​​the current video frame; if the first time-domain warning line of the current video frame is located outside the first target gradient line, and the time-domain warning line of the previous video frame is located inside the first time-domain warning line of the current video frame, if the previous video frame has subtitles and the subtitles do not change or the previous video frame has no subtitles, then the first target gradient line is determined to be the boundary bright line between the display area and the black-border area of ​​the current video frame, or, if the previous video frame has subtitles and changes occur, then the reference bright spot threshold line is determined to be the boundary bright line between the display area and the black-border area of ​​the current video frame; if the first time-domain warning line of the current video frame is located outside the first target gradient line, and the time-domain warning line of the previous video frame is located outside the first time-domain warning line of the current video frame, then the reference bright spot threshold line is determined to be the boundary bright line between the display area and the black-border area of ​​the current video frame.

[0082] In some embodiments, if the position of the first target gradient line is located inside the reference bright spot threshold line, determining the boundary bright line of the current video frame according to the boundary bright line information of the previous video frame of the current video frame and the boundary bright line information of the current video frame further includes:

[0083] The gradient line of the previous video frame is not adjacent to the first target gradient line of the current video frame; if the first time-domain warning line is located inside the first target gradient line, the first target gradient line is determined to be the bright boundary line between the display area and the black-border area of ​​the current video frame; if the first time-domain warning line is located outside the first target gradient line, a second target gradient line is searched outside the first time-domain warning line, and if the second target gradient line is found, the second target gradient line is determined to be the bright boundary line between the display area and the black-border area of ​​the current video frame; if the first time-domain warning line is located outside the first target gradient line, the second target gradient line is searched outside the first time-domain warning line, and if the second target gradient line is found, the second target gradient line is determined to be the bright boundary line between the display area and the black-border area of ​​the current video frame; If the time domain warning line of the previous video frame is outside the second time domain warning line, and the second target gradient line is not found, if the time domain warning line of the previous video frame is outside the second time domain warning line, the reference bright spot threshold line and the line close to the outside of the display area in the time domain warning line of the previous video frame are determined as the boundary bright line; if the time domain warning line of the previous video frame is inside the second time domain warning line, the previous video frame has subtitles and the subtitles have not changed or have no subtitles, the first target gradient line is determined to be the boundary bright line, or, the previous video frame has subtitles and the subtitles have changed, the reference zero point threshold line is determined to be the boundary bright line.

[0084] In some embodiments, determining the boundary bright line of the current frame image display area according to the positions of the bright spot threshold line, the time domain warning line and the target gradient line includes:

[0085] For the upper black border area or the lower black border area or the left black border area or the right black border area, neither the first time domain warning line nor the first target gradient line exists; if both the first bright spot threshold line and the second bright spot threshold line exist, determine that the line between the first bright spot threshold line and the second bright spot threshold line that is closer to the outside of the display area is the boundary bright line; if the first bright spot threshold line does not exist and the second bright spot threshold line exists, determine that the second bright spot threshold line is the boundary bright line; if the first bright spot threshold line exists and the second bright spot threshold line does not exist, determine that the first bright spot threshold line is the boundary bright line; if neither the first bright spot threshold line nor the second bright spot threshold line exists, determine that the boundary bright line is to the edge of the image.

[0086] In some embodiments, determining the boundary bright line of the current frame image display area according to the positions of the bright spot threshold line, the time domain warning line and the target gradient line includes:

[0087] For the upper black border area or the lower black border area or the left black border area or the right black border area, the first time domain warning line does not exist and the first target gradient line exists;

[0088] If the reference bright spot threshold line is adjacent to the first target gradient line, determining a line between the reference bright spot threshold line and the first target gradient line that is close to the inner side of the display area as the boundary bright line;

[0089] If the reference bright spot threshold line is located outside the first target gradient line, determining the first target gradient line as the boundary bright line;

[0090] If the reference bright spot threshold line is located inside the first target gradient line, and there is a second target gradient line outside the first target gradient line, the boundary bright line is determined to be the image edge line; or, if there is no second target gradient line outside the first target gradient line, the first target gradient line is determined to be the boundary bright line.

[0091] In some embodiments, determining the boundary bright line of the current frame image display area according to the positions of the bright spot threshold line, the time domain warning line and the target gradient line includes:

[0092] For the upper black border area, the lower black border area, the left black border area, or the right black border area, the first time domain warning line exists and the first target gradient line does not exist; the second target gradient line is searched outward from the line position close to the inner side of the display area in the first time domain warning line and the reference bright spot threshold line;

[0093] The second target gradient line is found, and the second target gradient value is adjacent to the position of the first time-domain warning line. If the reference bright spot threshold line is adjacent to the second target gradient line, the line between the reference bright spot threshold line and the second target gradient line close to the inner side of the display area is determined to be the boundary bright line. Alternatively, if the first time-domain warning line is located inside the second gradient line and the second target gradient line is not at the image boundary, the second target gradient line is determined to be the boundary bright line. Alternatively, if the second target gradient line is at the boundary, the boundary bright line of the previous video frame is determined to be the boundary bright line of the current video frame. Alternatively, if the first time-domain warning line is located outside the second target gradient line, the boundary bright line is determined to be the image boundary line of the current video frame.

[0094] Alternatively, if the second target gradient line is not found, a second target gradient line is further searched outward from the line position away from the display area between the first time domain warning line and the reference bright spot threshold line; if the second target gradient line is found, the second target gradient line is determined to be the boundary bright line; or, if the second target gradient line is not found and the reference bright spot threshold line is located outside the first time domain warning line, the reference bright spot threshold line is determined to be the boundary bright line; or, if the second target gradient line is not found and the reference bright spot threshold line is located inside the first time domain warning line, the boundary bright line is determined to be the image boundary line of the current video frame.

[0095] In order to achieve the above object, the device for real-time detection of a video image display area according to a second aspect of the present invention is characterized by comprising:

[0096] A bright spot threshold line acquisition module is used to obtain the pixel value of each pixel in the current frame image, and determine the bright spot threshold line that distinguishes the current frame image display area from the black edge area according to the pixel value of each pixel;

[0097] A time domain warning line acquisition module is used to obtain the time domain motion statistics of the corresponding pixel points of the current frame image and the previous frame image, and determine the time domain warning line that distinguishes the current frame image display area and the black edge area according to the time domain motion statistics of each row and column of the current frame image;

[0098] A gradient line acquisition module is used to obtain the gradient information of each row and column of pixels in the current frame image, and determine the target gradient line that distinguishes the display area of ​​the current frame image from the black edge area according to the gradient information of each row and column of pixels;

[0099] The display area determination module is used to determine the boundary bright line between the current frame image display area and the black border area according to the positions of the bright spot threshold line, the time domain warning line and the target gradient line, and determine the display area of ​​the current frame image according to the boundary bright line.

[0100] According to the device for real-time detection of the display area of ​​a video image according to an embodiment of the present invention, based on a bright spot threshold line acquisition module, a time domain warning line acquisition module, and a gradient line acquisition module, the bright spot threshold, motion changes, and image edge differences are comprehensively considered to select the boundary bright line of the display area of ​​the current frame image. Compared with determining the boundary bright line only by the bright spot threshold, the detection result is more accurate and stable. In the case where the boundary of the frame image is not smooth enough, the linkage of the three types of lines of feedback information can also make the detection result of the display area more stable. It can also effectively cope with video code streams with uneven light and dark distribution, obtain stable boundary bright lines, and improve the video image algorithm and the final video image quality.

[0101] In order to achieve the above-mentioned purpose, the electronic device of the embodiment of the third aspect of the present invention includes: the device for real-time detection of the video image display area, used to determine the video image display area; an image processing device, used to process the video image display area; a display device, connected to the image processing device, for displaying the processed video image.

[0102] According to the electronic device of the embodiment of the present invention, by adopting the device for real-time detection of the video image display area of ​​the above embodiment, the boundary bright line of the current frame image display area is selected by comprehensively considering the bright spot threshold, motion change and image edge difference. Compared with determining the boundary bright line only by the bright spot threshold, the detection result is more accurate and stable. In the case where the frame image boundary is not smooth enough, the linkage of the three types of lines of feedback information can also make the detection result of the display area more stable, and can effectively cope with the video code stream with uneven light and dark distribution, obtain a stable boundary bright line, and improve the video image algorithm and the final video image quality.

[0103] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0104] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0105] Figure 1 It is a schematic diagram of determining the black border area and the bright line of the display area based on the bright spot threshold in the related art;

[0106] Figure 2 is a flow chart of a method for real-time detection of a video image display area according to an embodiment of the present invention;

[0107] Figure 3 is a schematic diagram of determining upper and lower black border areas and bright lines of a display area based on a bright spot threshold according to an embodiment of the present invention;

[0108] Figure 4 is a schematic diagram of a process of selecting a final bright line based on three lines according to an embodiment of the present invention;

[0109] Figure 5 is a schematic diagram of gradient information of a pixel position of a current row according to an embodiment of the present invention;

[0110] Figure 6 is a schematic diagram of gradient information of a pixel position of a current column according to an embodiment of the present invention;

[0111] Figure 7 is a schematic diagram of a process of obtaining a target gradient line based on statistical gradient information according to an embodiment of the present invention;

[0112] Figure 8 is a block diagram of an apparatus for real-time detection of a video image display area according to an embodiment of the present invention;

[0113] Fig. 9 is a block diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0114] Embodiments of the present invention are described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. Embodiments of the present invention are described in detail below.

[0115] like Figure 1 As shown, the method for real-time detection of the display area of ​​a video image according to an embodiment of the present invention is used to distinguish the invalid static black border area B and the actual display area C in the video image, so that the image processing algorithm only processes the actual display area, thereby improving the robustness and accuracy of the algorithm.

[0116] It should be noted that in the embodiment, the black described in the black border area does not mean pure black, but is a relative concept. Assume that the value of a certain pixel is P y , when P y When it is less than or equal to the set bright spot threshold, the pixel can be judged as a "black spot", otherwise it is judged as a "bright spot".

[0117] Reference below Figure 2-Figure 7 A method for detecting a video image display area in real time according to an embodiment of the present invention is described.

[0118] Figure 2 is a flow chart of a method for real-time detection of a video image display area according to an embodiment of the present invention. Figure 2 As shown, the method for real-time detection of a video display area according to an embodiment of the present invention includes at least steps S1-S5, which are specifically as follows.

[0119] Step S1, obtaining the pixel value of each pixel in the current frame image, and determining the bright spot threshold line for distinguishing the current frame image display area and the black edge area according to the pixel value of each pixel.

[0120] For a certain frame of image, its pixels are scanned and read from top to bottom and from left to right in sequence, and the bright spot of each pixel is judged, for example, by the bright spot threshold black_th, as shown in the following formula:

[0121]

[0122] like Figure 3 The figure shows a schematic diagram of selecting bright spot threshold lines for the display area, the upper black border area, and the lower black border area according to an embodiment of the present invention. The result of selecting the bright spot threshold line is ultimately determined based on whether the number of bright spots in each row of pixels is greater than the threshold.

[0123] Step S2, obtaining the temporal motion statistics of the pixels corresponding to the current frame image and the previous frame image, and determining the temporal warning line that distinguishes the current frame image display area from the black edge area according to the temporal motion statistics of the pixels in each row and column of the current frame image.

[0124] Step S3, obtaining the gradient information of each row and column of pixels in the current frame image, and determining the target gradient line for distinguishing the current frame image display area and the black border area according to the gradient information of each row and column of pixels.

[0125] Step S4, determining the boundary bright line between the current frame image display area and the black edge area according to the positions of the bright spot threshold line, the time domain warning line and the target gradient line.

[0126] In an embodiment of the present invention, for the bright spot threshold line, since the judgment is made only by the bright spot threshold, it is considered that the credibility is low; for the gradient line, the edge difference between the determined wireless black border area and the actual display area is relatively large, so the credibility is considered to be high; and for the time domain warning line, in an embodiment of the present invention, as a reference-warning function, the final boundary bright line detection result cannot exceed this line, because there is not much inter-frame motion in the wireless black border area.

[0127] In an embodiment, the bright spot threshold line, time domain warning line and target gradient line obtained by different bright line search methods are comprehensively considered, and the most appropriate line position is selected as the boundary bright line of the current frame image according to the existence and accuracy of the three types of bright lines.

[0128] Step S5, determining the display area of ​​the current frame image according to the boundary bright lines, that is, the inner area of ​​the four upper, lower, left and right boundary bright lines of the current frame image is the display area of ​​the current frame image, and the areas outside the four boundary bright lines are the four black border areas.

[0129] In simple terms, Figure 4 As shown, the method for real-time detection of the video image display area according to the embodiment of the present invention is based on the pixel value I of the current frame image. t To obtain the bright spot threshold line and the target gradient line, i.e., the optimal gradient line, and the pixel value I based on the current frame image and the pixel value I of the previous frame image t-1 To obtain the time domain warning line, and then analyze and decide the final detection result of the current frame image display area based on the three types of lines.

[0130] According to the method for real-time detection of the display area of ​​a video image according to an embodiment of the present invention, the bright spot threshold, motion change and image edge difference are comprehensively considered to select the boundary bright line of the display area of ​​the current frame image. Compared with determining the boundary bright line only by the bright spot threshold, the detection result is more accurate and stable. In the case where the boundary of the frame image is not smooth enough, the linkage of the three types of lines of feedback information can also make the detection result of the display area more stable. It can also effectively cope with the video code stream with uneven light and dark distribution, obtain a stable boundary bright line, and improve the video image algorithm and the final video image quality.

[0131] The following is a further detailed description of the process of obtaining the bright spot threshold line, the time domain warning line and the target gradient line and determining the final boundary bright line based on these three types of lines in an embodiment of the present invention.

[0132] The process of obtaining the bright spot threshold line is first described below.

[0133] like Figure 3 As shown, for a certain frame image, its pixels are scanned and read from top to bottom and from left to right in sequence. Among them, for the bright spot threshold line of the current frame image display area and the upper black border area, the pixel value of each pixel point in each row of the current frame image is read from top to bottom in sequence. If the pixel value is greater than the bright spot threshold, the corresponding pixel point is determined to be a bright spot, and the number of bright spots of each row of pixels is counted. It is determined that the behavior of the number of bright spots exceeding the first preset number threshold distinguishes the bright spot threshold line Top_Line of the current frame image display area and the upper black border area.

[0134] Among them, for the bright spot threshold line of the current frame image display area and the lower black border area, the pixel value of each pixel in each row of the current frame image is read downward from the bright spot threshold line that distinguishes the current frame image display area and the upper black border area, the number of bright spots of the pixel points in the current row exceeds the first preset number threshold and the number of bright spots between the current row and the bright spot threshold line that distinguishes the current frame image display area and the upper black border area exceeds the first bright spot number threshold, for example Figure 3 If Bright_Num>TH, the current behavior is determined to be the bright spot threshold line Bottom_Line that distinguishes the current frame image display area from the lower black border area.

[0135] Among them, for the bright spot threshold line of the current frame image display area and the left black border area, the pixel value of each pixel in each column of the current frame image is read from left to right in turn. If the pixel value is greater than the bright spot threshold, the corresponding pixel is determined to be a bright spot. The number of bright spots in each column of pixels is counted, and the column whose number of bright spots exceeds the second preset number threshold is determined as the bright spot threshold line that distinguishes the current frame image display area and the left black border area.

[0136] Among them, for the bright spot threshold line between the current frame image display area and the right black side area, the pixel value of each pixel in each column of the current frame image is read to the right from the bright spot threshold line that distinguishes the current frame image display area and the left black side area, the number of bright spots of the pixel points in the current column exceeds the second preset number threshold and the number of bright spots between the current column and the bright spot threshold line that distinguishes the current frame image display area and the left black side area exceeds the second bright spot number threshold, and the current column is determined to be the bright spot threshold line that distinguishes the current frame image display area and the right black side area.

[0137] Furthermore, in order to improve the robustness and flexibility of the method, in some embodiments, the bright spot threshold is set to a double threshold to facilitate optimization and selection by comprehensive analysis of the method.

[0138] For example, for the bright spot threshold line of the current frame image display area and the upper black border area, the pixel value of each pixel in each row of the current frame image is read from top to bottom in turn; if the pixel value is greater than the first bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, the number of bright spots in each row of pixels is counted, and the behavior of determining that the number of bright spots exceeds the first preset number threshold is used to distinguish the first bright spot threshold line of the current frame image display area and the upper black border area; if the pixel value is greater than the second bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, the number of bright spots in each row of pixels is counted, and the behavior of determining that the number of bright spots exceeds the second preset number threshold is used to distinguish the second bright spot threshold line of the current frame image display area and the upper black border area. Among them, the first bright spot sub-threshold is greater than the second bright spot sub-threshold, that is, the first bright spot sub-threshold is set more strictly, and the second bright spot sub-threshold is set more open, so that more abundant bright spot threshold line information can be obtained.

[0139] For example, for the bright spot threshold line of the current frame image display area and the lower black border area, the pixel value of each pixel in each row of the current frame image is read downward in sequence from the bright spot threshold line that distinguishes the current frame image display area and the upper black border area; if the pixel value is greater than the first bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, and the number of bright spots of each row of pixels is counted, and the behavior of determining that the number of bright spots exceeds the first preset number threshold is used to distinguish the first bright spot threshold line of the current frame image display area and the lower black border area; if the pixel value is greater than the second bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, and the number of bright spots of each row of pixels is counted, and the behavior of determining that the number of bright spots exceeds the second preset number threshold is used to distinguish the second bright spot threshold line of the current frame image display area and the lower black border area, wherein the first bright spot sub-threshold is greater than the second bright spot sub-threshold, that is, the first bright spot sub-threshold is set more strictly, and the second bright spot sub-threshold is set more open, so that richer bright spot threshold line information can be obtained.

[0140] For example, for the bright spot threshold line of the current frame image display area and the left black side area, the pixel value of each pixel in each column of the current frame image is obtained from left to right in turn; if the pixel value is greater than the third bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, and the number of bright spots of each column of pixels is counted, and the column with the number of bright spots exceeding the third preset number threshold is determined to be the first bright spot threshold line that distinguishes the current frame image display area and the left black side area; if the pixel value is greater than the fourth bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, and the number of bright spots of each column of pixels is counted, and the column with the number of bright spots exceeding the fourth preset number threshold is determined to be the second bright spot threshold line that distinguishes the current frame image display area and the left black side area, wherein the third bright spot sub-threshold is greater than the fourth bright spot sub-threshold, that is, the third bright spot sub-threshold is set more strictly, and the fourth bright spot sub-threshold is set more open, so that richer bright spot threshold line information can be obtained.

[0141] For example, for the bright spot threshold line of the current frame image display area and the right black side area, the pixel value of each pixel in each column of the current frame image is read from the bright spot threshold line that distinguishes the current frame image display area and the left black side area to the right; if the pixel value is greater than the third bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, and the number of bright spots of each column of pixels is counted, and the column with the number of bright spots exceeding the third preset number threshold is determined to be the first bright spot threshold line that distinguishes the current frame image display area and the right black side area; if the pixel value is greater than the fourth bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, and the number of bright spots of each column of pixels is counted, and the column with the number of bright spots exceeding the fourth preset number threshold is determined to be the second bright spot threshold line that distinguishes the current frame image display area and the right black side area, wherein the third bright spot sub-threshold is greater than the fourth bright spot sub-threshold, that is, the third bright spot sub-threshold is set more strictly, and the fourth bright spot sub-threshold is set more open, so that richer bright spot threshold line information can be obtained.

[0142] The process of obtaining the time domain warning line is described below.

[0143] In an embodiment, the time domain warning line is determined based on the motion change between the current frame image and the previous frame image. Obtain the pixel value I' of the pixel point at position (x, y) in the current frame image t (x, y), and get the pixel value I' of the pixel at the same position (x, y) in the previous frame image t-1 (x,y); calculate I' t (x,y) and I' t-1 The pixel difference of position (x, y) is calculated; if the pixel difference is greater than the first pixel motion threshold, the temporal motion difference of the pixel point at position (x, y) is the first temporal motion difference; if the pixel difference is less than or equal to the first pixel motion threshold and greater than the second pixel motion threshold, the temporal motion difference of the pixel point at position (x, y) is the second temporal motion difference, wherein the first temporal motion difference is greater than the second temporal motion difference; the sum of the temporal motion differences of the pixel points in each row of the current frame image is calculated to obtain the temporal motion statistics of each row, and the sum of the temporal motion differences of the pixel points in each column of the current frame image is calculated to obtain the temporal motion statistics of each column.

[0144] For example, taking a 1080 video frame image I as an example, the temporal motion change information of each row and column of I is counted, that is, the temporal motion difference. The calculation method of the temporal motion change of a pixel point (motion) is: let the pixel value at position (x, y) in the current frame position image be I' t (x, y), the pixel value at the same position (x, y) in the previous frame image is I' t-1 (x, y), then the difference d = |I' t (x,y)-I' t-1 (x, y)|, if d is greater than the first pixel motion threshold, such as pix_motion_th1, the motion accumulation value is a; if d is less than or equal to pix_motion_th1 and greater than the second pixel motion threshold, such as pix_motion_th2, the motion accumulation value is b, where a>b. Finally, the motion difference of each row and column of pixels is used to calculate the sum of motion information to obtain the pixel temporal motion statistics, which is used to detect the temporal warning line later.

[0145] Specifically, the time domain motion statistics of each row of the current frame image are accumulated from top to bottom, and the cumulative total of the time domain motion statistics of the current row and the time domain motion statistics of all previous rows is greater than the first time domain motion accumulation threshold, and the time domain warning line that the current behavior distinguishes between the display area of ​​the current frame image and the upper black border area is determined; the time domain motion statistics of each row of the current frame image are accumulated from bottom to top, and the cumulative total of the time domain motion statistics of the current row and the time domain motion statistics of all previous rows is greater than the first time domain motion accumulation threshold, and the time domain warning line that the current behavior distinguishes between the display area of ​​the current frame image and the lower black border area is determined.

[0146] Also, the time-domain motion statistics of each column of the current frame image are accumulated from left to right, and the accumulated total value of the time-domain motion statistics of the current column and the time-domain motion statistics of all previous columns is greater than the second time-domain motion accumulation threshold, and the current column is determined to be the time-domain warning line that distinguishes the current frame image display area from the left black edge area; the time-domain motion statistics of each column of the current frame image are accumulated from right to left, and the accumulated total value of the time-domain motion statistics of the current column and the time-domain motion statistics of all previous columns is greater than the second time-domain motion accumulation threshold, and the current column is determined to be the time-domain warning line that distinguishes the current frame image display area from the right black edge area.

[0147] Furthermore, in order to increase the robustness and flexibility of the method, in an embodiment, each temporal motion accumulation threshold is set as a double threshold.

[0148] Among them, for the temporal warning line that distinguishes the current frame image display area from the upper black border area, the temporal motion statistics of each row of the current frame image are accumulated from top to bottom; if the cumulative total value of the temporal motion statistics of the current row and the temporal motion statistics of all previous rows is greater than the first temporal motion accumulation sub-threshold, then the first temporal warning line that distinguishes the current frame image display area from the upper black border area is determined to be the current behavior; or, if the cumulative total value of the temporal motion statistics of the current row and the temporal motion statistics of all previous rows is greater than the second temporal motion accumulation sub-threshold, then the second temporal warning line that distinguishes the current frame image display area from the upper black border area is determined to be the current behavior. Among them, the first temporal motion accumulation sub-threshold is greater than the second temporal motion accumulation sub-threshold, that is, the first temporal motion accumulation sub-threshold is set more strictly, and the second temporal motion accumulation sub-threshold is set more loosely, so that more abundant temporal motion warning line information of the upper black border area can be obtained.

[0149] For example, after obtaining the time domain motion statistics value, that is, the total motion information, of each row of the current frame image, the accumulated time domain motion statistics value, that is, the total motion information value, is accumulated from top to bottom. When the total motion information value is greater than the first time domain motion accumulation sub-threshold value, such as row_motion_th2, the row serves as the first time domain warning line, such as top_motion_line2. When the total motion information value is greater than the second time domain motion accumulation sub-threshold value, such as row_motion_th1, the row serves as the second time domain warning line, such as top_motion_line1, where row_motion_th1 is less than row_motion_th2, so top_motion_line1 is less than or equal to top_motion_line2.

[0150] Among them, for the time domain warning line that distinguishes the current frame image display area from the lower black border area, the time domain motion statistics of each row of the current frame image are accumulated from bottom to top; the cumulative total value of the time domain motion statistics of the current row and the time domain motion statistics of all previous rows is greater than the first time domain motion accumulation sub-threshold, and the first time domain warning line that distinguishes the current behavior from the current frame image display area and the lower black border area is determined; or, the cumulative total value of the time domain motion statistics of the current row and the time domain motion statistics of all previous rows is greater than the second time domain motion accumulation sub-threshold, and the second time domain warning line that distinguishes the current behavior from the current frame image display area and the lower black border area is determined; wherein the first time domain motion accumulation sub-threshold is greater than the second time domain motion accumulation sub-threshold, that is, the first time domain motion accumulation sub-threshold is set more strictly, and the second time domain motion accumulation sub-threshold is set more loosely, so that richer time domain motion warning line information of the lower black border area can be obtained.

[0151] For example, after obtaining the time domain motion statistics value, that is, the total motion information, of each row of the current frame image, the accumulated total value of the time domain motion statistics, that is, the total motion information value, is accumulated from bottom to top. When the total motion information value is greater than the first time domain motion accumulation sub-threshold, for example, set to row_motion_th2, the row serves as the first time domain warning line, for example, bot_motion_line2. When the total motion information value is greater than the second time domain motion accumulation sub-threshold, for example, row_motion_th1, the row serves as the second time domain warning line bot_motion_line1, wherein row_motion_th1 is less than row_motion_th2, so bot_motion_line1 is greater than or equal to top_motion_line2.

[0152] Among them, the temporal warning line for distinguishing the current frame image display area from the left black border area is divided into a coarse search and a fine search. Specifically, the total value of the temporal motion statistics of each pixel block is accumulated from left to right, wherein each pixel block includes n columns of pixels, and n is an integer greater than 1; the total value of the temporal motion statistics of the current pixel block is greater than the block motion threshold, and the temporal motion statistics of each column of pixels in the current pixel block are accumulated from left to right; the cumulative total value of the temporal motion statistics of the current column of pixels and the temporal motion statistics of all previous columns in the current pixel block is greater than the third temporal motion accumulation sub-threshold, and the current column is determined to be the first column that distinguishes the current frame image display area from the left black border area. time domain warning line; or, the cumulative total of the time domain motion statistics of the current column pixels and the time domain motion statistics of all previous columns in the current pixel block is greater than the fourth time domain motion accumulation sub-threshold, determining that the current column is the second time domain warning line that distinguishes the current frame image display area from the left black side area; wherein the fourth time domain motion accumulation sub-threshold is less than the third time domain motion accumulation sub-threshold, that is, the third time domain motion accumulation sub-threshold is set more strictly, and the fourth time domain motion accumulation sub-threshold is set more loosely, so that richer time domain motion warning line information of the left black side area can be obtained.

[0153] Similarly, for the temporal warning line distinguishing the current frame image display area from the right black side area, it is also divided into a rough search and a fine search. Specifically, the total value of the temporal motion statistics of each pixel block is accumulated from right to left, wherein each pixel block includes n columns of pixels, and n is an integer greater than 1; the total value of the temporal motion statistics of the current pixel block is greater than the block motion threshold, and the temporal motion statistics of each column of pixels in the current pixel block are accumulated from right to left; the cumulative total value of the temporal motion statistics of the current column of pixels and the temporal motion statistics of all previous columns in the current pixel block is greater than the third temporal motion accumulation sub-threshold, and the current column is determined to be the first temporal warning line distinguishing the current frame image display area from the right black side area; or, the cumulative total value of the temporal motion statistics of the current column of pixels and the temporal motion statistics of all previous columns in the current pixel block is greater than the fourth temporal motion accumulation sub-threshold, and the current column is determined to be the second temporal warning line distinguishing the current frame image display area from the right black side area; wherein the fourth temporal motion accumulation sub-threshold is less than the third temporal motion accumulation sub-threshold.

[0154] For example, for the search of the time domain warning line in the left black border area and the right black border area, when performing a rough search, the cumulative total value of the time domain motion vector accumulation value on each n columns, such as the total value of motion information, is counted and stored in rough_lft_blk[n] and rough_rit_blk[n]. For rough_lft_blk[n], the total value of motion information of the block is accumulated from left to right. When the accumulated total value of motion information, rough_lft_cnt, is greater than the third time domain motion accumulation sub-threshold, such as col_motion_th2, the sequence number of the block is saved for fine search, and the threshold for fine search is updated at the same time. When performing a fine search, the n columns in the block number obtained by the rough search are processed in detail, and the total value of the motion information of each column is stored in finer_lft_blk2[n]. The total value of the motion information of the block is still accumulated from left to right. When the accumulated motion value is greater than the third temporal motion accumulation sub-threshold, such as finer_lft_motion_th2, the column is used as the first temporal warning line, such as lft_motion_line2, to distinguish the current frame image display area from the left black border area. Similarly, through the fourth temporal motion accumulation sub-threshold, such as col_motion_th1, the second temporal warning line, such as lft_motion_line1, to distinguish the current frame image display area from the left black border area can also be obtained.

[0155] The following describes the process of obtaining the target gradient lines of the current frame image display area and the black border area.

[0156] Specifically, the horizontal gradient value and vertical gradient value of each pixel point in each row are obtained from top to bottom, and the horizontal gradient value of the pixel point is less than the first horizontal gradient threshold and the vertical gradient value of the pixel point is greater than the first vertical gradient threshold, and the pixel point is determined to be a pixel bright spot, and the number of pixel bright spots included in the current row is counted; the horizontal gradient value and vertical gradient value of each pixel point in each row are obtained from bottom to top, and the horizontal gradient value of the pixel point is less than the first horizontal gradient threshold and the vertical gradient value of the pixel point is greater than the first vertical gradient threshold, and the pixel point is determined to be a pixel bright spot, and the number of pixel bright spots included in the current row is counted; the horizontal gradient value and vertical gradient value of each pixel point in each column are obtained from left to right, and the horizontal gradient value of the pixel point is greater than the second horizontal gradient threshold and the vertical gradient value of the current point is less than the second vertical gradient threshold, and the pixel point is determined to be a pixel bright spot, and the number of pixel bright spots included in the current column is counted; the horizontal gradient value and vertical gradient value of each pixel point in each column are obtained from right to left, and the horizontal gradient value of the pixel point is greater than the second horizontal gradient threshold and the vertical gradient value of the pixel point is less than the second vertical gradient threshold, and the pixel point is determined to be a pixel bright spot, and the number of pixel bright spots included in the current column is counted.

[0157] For example, Figure 5 As shown, the gradient information of each pixel in the image is counted, and 7 edge gradients, namely edge_diff, are calculated, where C is the position of the current pixel. Taking the black edge area as an example, diff_1, diff_2, diff_3, and diff_4 are horizontal gradient values, namely, the smoothness information in the horizontal direction, for example, set to flat_val, and diff_5, diff_6, and diff_7 are vertical gradient values, namely, the gradient information in the vertical direction, for example, set to edge_val. For the black edge area, if the current line Current_line is a potential bright line, then the pixels on this line should satisfy that diff_5, diff_6, and diff_7 are all greater than the first vertical gradient threshold, for example, set to edge_diff_th, that is, there is a jump between the current line and the previous line, and diff_1 and diff_2 are both less than the first horizontal gradient threshold, for example, set to flat_th, that is, the line in the previous line of the current line should be smooth, and the number of pixels that meet the above conditions in each line is counted.

[0158] For the left black border area and the right black border area, the amount of judgment required is reduced, such as Figure 6 As shown, position C is the current pixel position, diff_1 and diff_3 are horizontal gradient information, i.e., edge information edge_val in the horizontal direction, and diff_5 and diff_6 are vertical gradient values, i.e., smoothing information in the vertical direction, for example, set to flat_val. Taking the left black border area as an example, if the current column Current_line is a potential bright line, then the pixels on this line should satisfy that both diff_1 and diff_3 are greater than the second horizontal gradient threshold, for example, set to edge_diff_th, that is, there is a jump between the two lines of the current column and the previous column, and diff_5 is less than the second vertical gradient value, for example, set to flat_th, and the number of pixels that meet the above conditions in each column is counted.

[0159] Further, in an embodiment, in the upper black border area, the gradient information of the current row and the gradient information of the two adjacent rows of the current row are filtered to obtain an average gradient, and the average gradient is greater than a first edge threshold, and the current behavior is determined to be a first target gradient line that distinguishes the current frame image display area from the upper black border area, or the average gradient is greater than a second edge threshold, and the current behavior is determined to be a second target gradient line that distinguishes the current frame image display area from the upper black border area, wherein the first edge gradient value is greater than the second edge gradient value, that is, the setting of the first edge gradient value is more stringent, and the setting of the second edge gradient information is looser, and setting double thresholds can obtain richer gradient line information in the upper black border area, thereby improving the robustness and flexibility of the method.

[0160] Similarly, in the lower black border area, the gradient information of the current row and the gradient information of the two adjacent rows of the current row are filtered to obtain an average gradient. If the average gradient is greater than the first edge threshold, the current row is determined to be a first target gradient line that distinguishes the current frame image display area from the lower black border area. Alternatively, if the average gradient is greater than the second edge threshold, the current row is determined to be a second target gradient line that distinguishes the current frame image display area from the lower black border area.

[0161] Similarly, in the left black border area, the gradient information of the current column and the gradient information of the two adjacent columns of the current column are filtered to obtain an average gradient. If the average gradient is greater than the first width threshold, the current behavior is determined to be the first target gradient line that distinguishes the current frame image display area from the left black border area. Alternatively, if the average gradient is greater than the second width threshold, the current behavior is determined to be the second target gradient line that distinguishes the current frame image display area from the left black border area. Among them, the first width gradient value is greater than the second width gradient value, that is, the first width gradient value is set more strictly, and the second width gradient value is set more loosely, so that the gradient information of the left black border area can be obtained. Setting dual thresholds can improve the robustness and flexibility of the method.

[0162] Similarly, in the right black border area, the gradient information of the current column and the gradient information of the two adjacent columns of the current column are filtered to obtain an average gradient. If the average gradient is greater than the first width threshold, the current behavior is determined to be the first target gradient line that distinguishes the current frame image display area from the right black border area. Alternatively, if the average gradient is greater than the second width threshold, the current behavior is determined to be the second target gradient line that distinguishes the current frame image display area from the right black border area. Setting dual thresholds can improve the robustness and flexibility of the method.

[0163] By filtering the gradient information of the current row / column and the rows and columns adjacent to the current row / column to obtain new gradient information, that is, comparing the new gradient information with the threshold, the optimal gradient of the upper, lower, left and right black border areas can be obtained.

[0164] Taking the black border area as an example, each time the gradient information of the current row and the gradient information of the two adjacent rows are filtered to obtain new gradient information, such as Figure 7As shown, from top to bottom, three lines, namely the previous line, the current line and the next line, are selected for processing each time, and the average gradient avg_diff is obtained by low-pass filtering, and the current line when the average gradient avg_diff is greater than the first edge threshold, such as width / edge_th_div2, is used as the first target gradient line between the display area and the upper black border area, such as ro_bb_top_edge_posi2; the current line when the average gradient avg_diff is greater than the second edge threshold, such as width / edge_th_div1, is used as the second target gradient line between the display area and the upper black border area, such as ro_bb_top_edge_posi1. That is, if it is greater than the edge threshold, such as avg_diff_Max, it is determined that the gradient line line is obtained. If the threshold cannot be met, the cumulative statistics are continued.

[0165] The bright spot threshold lines, time domain warning lines and gradient lines of the display area and the black-edge area of ​​the current frame image are obtained above, and three types of lines are obtained with double thresholds, that is, there are two bright spot threshold lines, time domain warning lines and target gradient lines for the four black-edge areas of the top, bottom, left and right. Then, the software selects the final boundary bright lines of each black-edge area and the display area based on the feedback information obtained.

[0166] The following is a detailed description of the process of determining the boundary bright line of the current frame image display area according to the positions of the bright spot threshold line, the time domain warning line and the target gradient line, wherein Cur in the corresponding figure in the following embodiment represents the final selection result.

[0167] First, preliminary selection is performed based on the existence information of the bright spot threshold line, that is, the valid information of the bright spot threshold line output by the image scanning device. Specifically, in the embodiment, for the upper black border area or the lower black border area or the left black border area or the right black border area; if the first bright spot threshold line exists, the first bright spot threshold is determined to be the reference bright spot threshold line; if the first bright spot threshold line does not exist and the second bright spot threshold line exists, the second bright spot threshold line is determined to be the reference bright spot threshold line; if both the first bright spot threshold line and the second bright spot threshold line do not exist, the bright spot threshold line of the previous video frame is determined to be the reference bright spot threshold line.

[0168] Among them, it should be noted that in the set threshold, the threshold condition corresponding to the first bright spot threshold line is stricter and more conservative than the threshold condition corresponding to the second bright spot threshold line. That is to say, the value when the first bright spot threshold line has information such as valid2 is set to hold is preferred. If valid2 is not true and the second bright spot threshold line has information valid1, the value corresponding to valid1 is selected. If both valids are not satisfied, the result of the previous frame is used. For the bright spot threshold lines of the upper, lower, left and right black border areas, four candidate boundary bright lines are obtained, for example, set to: tmp_final_top_posi line corresponding to the upper black border area, tmp_final_bot_posi line corresponding to the lower black border area, tmp_final_lft_posi line corresponding to the left black border area, and tmp_final_rit_posi line corresponding to the right black border area.

[0169] In the embodiment, there are the three types of lines mentioned above between each black border area and the display area, namely the bright spot threshold line, the time domain warning line and the target gradient line. The following will further explain how to select the final bright line through the existing information. In the following embodiment, the black border area is taken as an example, LB represents the bright spot threshold line, Edge represents the gradient line, and Motion represents the time domain warning line.

[0170] In some embodiments, for the upper black border area or the lower black border area or the left black border area or the right black border area, when both the first time domain warning line and the first target gradient line exist, if the position of the first target gradient line is adjacent to the position of the first time domain warning line, the first target gradient line is determined to be the boundary bright line between the current frame image display area and the black border area. For example, the Edge line and the Motion line are not much different because the Edge line is more reliable than the Motion line. The Motion line is updated to the position of the Edge line, that is, the Edge line is used as the selected boundary bright line.

[0171] In the embodiment, when both the first time domain warning line and the first target gradient line exist, if the position of the reference bright spot threshold line is adjacent to or the same as the position of the first target gradient line, the line whose position is closer to the inside of the display area than the reference bright spot threshold line and the first target gradient line is determined as the boundary bright line. For example, if the Lb line and the Edge line are not much different, both of them become the lines closest to the inside of the image, that is, the selection result Cur is the line IN (Lb, Edge) closer to the inside of the image between the Lb line and the Edge line. If the positions of the Lb line and the Edge line are the same, the position of the Edge line is selected as the selection result.

[0172] In the embodiment, when both the first time domain warning line and the first target gradient line exist, if the first gradient line is located outside the reference bright spot threshold line, that is, the first target gradient line is located further away from the inside of the image, the boundary bright line between the display area and the black edge area of ​​the current video frame is determined according to the first target gradient line and the first time domain warning line. For example, when the Edge line is outside the Lb line, the Lb line is likely to be wrong and is not desirable, so the Motion line needs to be added for judgment.

[0173] Among them, in some embodiments, if the position of the first time domain warning line is located on the inner side of the first target gradient line and the first target gradient line is not located at the image boundary, that is, the zero position, the first target gradient line, that is, the Edge line, is more reliable, and the first target gradient line is determined to be the boundary bright line between the display area and the black edge area of ​​the current video frame, that is, the Edge line position is selected as the selection result; if the position of the first time domain warning line is located on the inner side of the first target gradient line and the first target gradient line is located at the image boundary, the Edge line is unreliable, then the result value of the previous frame is maintained, that is, the boundary bright line of the previous video frame is maintained as the boundary bright line of the current video frame; if the position of the first time domain warning line is located on the inner side of the first target gradient line, that is, the first time domain warning line is closer to the inside of the image, in other words, at this time there is a motion vector change in the first target gradient line, and it is considered that all three types of lines are unreliable, then the boundary bright line output is zero, that is, the final selection result is 0.

[0174] In an embodiment, for the case where both the first time domain warning line and the first target gradient line exist, if the position of the first target gradient line is located inside the reference bright spot threshold line, the boundary bright line of the current video frame is determined based on the boundary bright line information of the previous video frame of the current video frame and the boundary bright line information of the current video frame.

[0175] Specifically, in some embodiments, the gradient line of the previous video frame is adjacent to the first target gradient line of the current video frame. If the first time domain warning line of the current video frame is located inside the first target gradient line, the first target gradient line is determined to be the bright boundary line between the display area and the black border area of ​​the current video frame. For example, the Motion line is located inside the Edge line, indicating that the current frame image has subtitles but the subtitles have not changed. In this case, the Edge line is selected as the final result.

[0176] In some embodiments, the target gradient line of the previous video frame is adjacent to the first target gradient line of the current video frame. If the first temporal warning line of the current video frame is located outside the first target gradient line, and the temporal warning line of the previous video frame is located inside the first temporal warning line of the current video frame, if the previous video frame has subtitles and the subtitles do not change or the previous video frame has no subtitles, then the first target gradient line is determined to be the boundary bright line between the display area and the black border area of ​​the current video frame, or, if the previous video frame has subtitles and changes, then the reference bright spot threshold line is determined to be the boundary bright line between the display area and the black border area of ​​the current video frame. For example, when the Motion line is located outside the Edge line, the position of the temporal warning line of the previous frame, such as the Pre_Motion line, and the first temporal warning line of the current video frame, such as the Motion line, is determined. If the Pre_Motion line is located inside the Motion line, if the previous frame has subtitles but does not change or the previous frame has no subtitles, the Edge line is selected as the boundary bright line; if the previous frame has subtitles and changes, the Lb line is selected as the boundary bright line.

[0177] In some embodiments, the gradient line of the previous video frame is adjacent to the first target gradient line of the current video frame. If the first temporal warning line of the current video frame is located outside the first target gradient line, and the temporal warning line of the previous video frame is located outside the first temporal warning line of the current video frame, the reference bright spot threshold line is determined to be the boundary bright line between the display area and the black edge area of ​​the current video frame. For example, if the Pre_Motion line is located outside the Motion line, both the Edge line and the Motion line are unreliable, and the Lb line is selected as the boundary bright line.

[0178] In other embodiments, the gradient line of the previous video frame is not adjacent to the first target gradient line of the current video frame, and Pre_Line is not close to the Edge line. If the first time-domain warning line is located inside the first target gradient line, the first target gradient line is determined to be the bright boundary line between the display area and the black border area of ​​the current video frame. For example, when the Motion line is located inside the Edge line, the Edge line is selected, and it is considered that there are subtitles in the current frame image, but the subtitles are static. If the first time-domain warning line is located outside the first target gradient line, the second target gradient line is searched outside the first time-domain warning line. If the second target gradient line is found, the second target gradient line is determined to be the bright boundary line between the display area and the black border area of ​​the current video frame. For example, when Motion is located outside the Edge line, a new gradient line New_Edge, i.e., the second target gradient line Edge_Line1, is searched outside the Motion line. If found, the second target gradient line Edge_Line1 is selected as the final detection result.

[0179] In some embodiments, if the first time domain warning line is located outside the first target gradient line and the second target gradient line is not found, if the time domain warning line of the previous video frame is located outside the second time domain warning line, the reference bright spot threshold line and the line close to the outside of the display area in the time domain warning line of the previous video frame are determined as the boundary bright line; if the time domain warning line of the previous video frame is located inside the second time domain warning line, the previous video frame has subtitles and the subtitles have not changed or have no subtitles, the first target gradient line is determined to be the boundary bright line; alternatively, the previous video frame has subtitles and the subtitles have changed, the reference zero point threshold line is determined to be the boundary bright line. For example, if the second target gradient line is not found, the positional relationship between Pre_Motion and Motion lines is compared. If Pre_Motion is outside Motion, the line outside the Lb line and the Pre_Motion line is selected as the final detection result. If Pre_motion is inside Motion, there are two situations. One is that there are subtitles in the previous frame and there is no change or no subtitles, then the Edge line is selected as the final selected boundary bright line; the other is that there are subtitles in the previous frame image and the subtitles have changed, then the Lb line is selected as the final boundary bright line.

[0180] In other embodiments, for the upper black border area or the lower black border area or the left black border area or the right black border area, the first time domain warning line and the first target gradient line do not exist, and only the bright spot threshold line is used as a reference, wherein, if both the first bright spot threshold line and the second bright spot threshold line exist, the line of the first bright spot threshold line and the second bright spot threshold line that is close to the outside of the display area is determined to be the boundary bright line; if the first bright spot threshold line does not exist and the second bright spot threshold line exists, the second bright spot threshold line is determined to be the boundary bright line; if the first bright spot threshold line exists and the second bright spot threshold line does not exist, the first bright spot threshold line is determined to be the boundary bright line; if both the first bright spot threshold line and the second bright spot threshold line do not exist, the boundary bright line is determined to be the edge of the image, that is, the image boundary is not processed to avoid errors.

[0181] For example, if both Lb1 and Lb2 exist, the line closer to the outside of the image is selected as the final selected boundary bright line; if only Lb1 exists, Lb1 is selected as the final selected boundary bright line; if only Lb2 exists, Lb2 is selected as the final selected boundary bright line; if both Lb1 and Lb2 do not exist, the selection is bounced to the edge of the image, that is, the edge of the image is used as the selection result to avoid errors.

[0182] In some embodiments, for the upper black border area or the lower black border area or the left black border area or the right black border area, the first time domain warning line does not exist and the first target gradient line exists, if the reference bright spot threshold line is adjacent to the first target gradient line, the line between the reference bright spot threshold line and the first target gradient line close to the inner side of the display area is determined to be the boundary bright line. If the reference bright spot threshold line is located outside the first target gradient line, the first target gradient line is determined to be the boundary bright line; if the reference bright spot threshold line is located inside the first target gradient line, and there is a second target gradient line outside the first target gradient line, the boundary bright line is determined to be the image edge line, or if there is no second target gradient line outside the first target gradient line, the first target gradient line is determined to be the boundary bright line.

[0183] For example, if the top_motion_posi2 line does not exist, but the top_edge_posi2 line does exist, the Lb line and the Edge line can be used as references. If the Lb line is close to the Edge line, the innermost line is selected as the selected result Cur; if the Lb line is outside the Edge line, the Edge line is selected as the selected result Cur; if the Lb line is inside the Edge line, it is also necessary to determine whether there is a new time domain warning line New_Motion outside the Edge line, that is, the second time domain warning line such as motion_posi1. If it exists, the second time domain warning line motion_posi1 is used as the current result Cur, or, for the sake of conservatism, it is bounced to the edge of the image, that is, the edge of the image is used as the final boundary bright line. If it does not exist, the Edge line is selected as the final result Cur.

[0184] In other embodiments, for the upper black border area or the lower black border area or the left black border area or the right black border area, the first time domain warning line exists and the first target gradient line does not exist; a new gradient line, namely, the second target gradient line, is searched outward from the line position close to the inner side of the display area among the first time domain warning line and the reference bright spot threshold line. In other words, the judgment conditions are lowered, and the following two situations exist.

[0185] One situation is that a new gradient line, i.e., a second target gradient line, is found outward from the position of the line close to the inner side of the display area in the first time domain warning line and the reference bright spot threshold line, and the second target gradient value is close to the position of the first time domain warning line. If the reference bright spot threshold line is close to the second target gradient line, the line close to the inner side of the display area in the reference bright spot threshold line and the second target gradient line is determined to be the boundary bright line. Alternatively, if the first time domain warning line is located on the inner side of the second target gradient line and the second target gradient line is not at the image boundary, the second target gradient line is determined to be the boundary bright line. Alternatively, if the second target gradient line is at the boundary, the boundary bright line of the previous video frame is determined to be the boundary bright line of the current video frame. Alternatively, if the first time domain warning line is located on the outer side of the second target gradient line, the boundary bright line is determined to be the image boundary line of the current video frame.

[0186] For example, when the first time domain warning line top_motion_posi2 exists and the first gradient line top_edge_posi2 does not exist, the Lb line and the Motion line can be used for reference. First, check whether there is a new gradient line New_Edge, i.e., the second target gradient line, which is set to top_edge_posi1, inside the Motion and Lb lines. If the second target gradient line top_edge_posi1 is found, preprocessing is performed. If the New_Edge line is close to the Motion line, the Motion line becomes the New_Edge line; if the Lb line is close to the New_Edge line, the innermost one of the two is selected as the current result Cur. If the Motion line is inside the New_Edge line and the New_Edge line is not at the image boundary, the New_Edge line is selected as the current result Cur; if the New_Edge line is at the boundary, the previous result is selected as the current result Cur. If the Motion line is outside the New_Edge line, it means that all three types of lines are unreliable and bounce directly to the image boundary.

[0187] Alternatively, another situation is that no new gradient line, that is, no second target gradient line, is found outward from the line position close to the inner side of the display area in the first time domain warning line and the reference bright spot threshold line, and further outward from the line position far from the display area in the first time domain warning line and the reference bright spot threshold line is searched for the second target gradient line. If the second target gradient line is found, the second target gradient line is determined to be the boundary bright line. Alternatively, if the second target gradient line is not found and the reference bright spot threshold line is located outside the first time domain warning line, the reference bright spot threshold line is determined to be the boundary bright line. Alternatively, if the second target gradient line is not found and the reference bright spot threshold line is located inside the first time domain warning line, the boundary bright line is determined to be the image boundary line of the current video frame.

[0188] For example, if no new gradient line New_Edge is found outward from the line position close to the inner side of the display area in the first time domain warning line and the reference bright spot threshold line, determine whether there is a new gradient line New_Edge, i.e., the second target gradient line top_edge_posi1, further outward between the Motion line and the Lb line. If found, the New_Edge line is selected as the selected result Cur; if not found, there are two situations. In one situation, if the Lb line is outside the Motion line, the Lb line is selected as the current result Cur; if the Lb line is inside the Motion line, it is directly bounced to the image boundary to avoid errors.

[0189] In summary, the method for real-time detection of the display area of ​​a video image in an embodiment of the present invention obtains the bright spot threshold lines, time domain warning lines and target gradient lines of the upper, lower, left and right black edge areas respectively, and then selects the final detection result through a decision-making method. Compared with the method of only using the bright spot threshold to determine the boundary bright line, the method of the embodiment of the present invention comprehensively considers the information of the three types of boundary lines, and does not only rely on the bright spot threshold. The detection result is more accurate and stable through the gradient and motion information; and for the case where the image boundary is not smooth enough, the detection result is made more stable through the linkage of feedback information; and by setting dual thresholds, in which one threshold is set more strictly and the other threshold is more open, richer information can be obtained, further improving the robustness and flexibility of the method.

[0190] The following describes a device for real-time detection of a video image display area according to a second embodiment of the present invention with reference to the accompanying drawings.

[0191] Figure 8 is a block diagram of a device for real-time detection of a video image display area according to an embodiment of the present invention. Figure 8 As shown, the device 10 of the embodiment of the present invention includes a bright spot threshold line obtaining module 11 , a time domain warning line obtaining module 12 , a gradient line obtaining module 13 and a display area determining module 14 .

[0192] Among them, the bright spot threshold line acquisition module 11 is used to obtain the pixel value of each pixel in the current frame image, and determine the bright spot threshold line that distinguishes the current frame image display area and the black edge area according to the pixel value of each pixel; the time domain warning line acquisition module 12 is used to obtain the time domain motion statistics of the corresponding pixels of the current frame image and the previous frame image, and determine the time domain warning line that distinguishes the current frame image display area and the black edge area according to the time domain motion statistics of the pixels in each row and column of the current frame image; the gradient line acquisition module 13 is used to obtain the gradient information of the pixels in each row and column of the current frame image, and determine the target gradient line that distinguishes the current frame image display area and the black edge area according to the gradient information of the pixels in each row and column; the display area determination module 14 is used to determine the boundary bright line between the current frame image display area and the black edge area according to the positions of the bright spot threshold line, the time domain warning line and the target gradient line, and determine the display area of ​​the current frame image according to the boundary bright line.

[0193] For the process of obtaining the bright spot threshold lines, time domain warning lines and target gradient lines in the upper, lower, left and right black edge areas, and the process of making decisions based on the three types of lines to obtain the final boundary bright line position, reference may be made to the description of the above embodiments.

[0194] According to the device 10 for real-time detection of the display area of ​​a video image according to an embodiment of the present invention, based on the bright spot threshold line acquisition module 11, the time domain warning line acquisition module 12, and the gradient line acquisition module 13, the boundary bright line of the display area of ​​the current frame image is selected by comprehensively considering the bright spot threshold, the time domain motion change, and the image edge difference. Compared with determining the boundary bright line only by the bright spot threshold, the detection result is more accurate and stable. In the case where the boundary of the frame image is not smooth enough, the linkage of the three types of lines of feedback information can also make the detection result of the display area more stable. It can also effectively cope with the video code stream with uneven light and dark distribution, obtain a stable boundary bright line, and improve the video image algorithm and the final video image quality.

[0195] like Fig. 9 As shown, the electronic device 100 of the embodiment of the present invention includes the device 10 for real-time detection of the video image display area, the image processing device 20 and the display device 30 of the above embodiment. The device 10 for real-time detection of the video image display area is used to determine the video image display area, and the specific implementation process can refer to the description of the above embodiment; the image processing device 20 is used to process the video image display area, such as performing motion estimation, etc.; the display device 30 is connected to the image processing device 20, and is used to display the processed video image.

[0196] In an embodiment, the electronic device 100 may include a television, a projector, a computer, or other devices that include image processing and image display.

[0197] According to the electronic device 100 of the embodiment of the present invention, by adopting the device 10 for real-time detection of the video image display area of ​​the above embodiment, the boundary bright line of the current frame image display area is selected by comprehensively considering the bright spot threshold, the motion vector change and the image edge difference. Compared with determining the boundary bright line only by the bright spot threshold, the detection result is more accurate and stable. In the case where the frame image boundary is not smooth enough, the linkage of the three types of lines of feedback information can also make the detection result of the display area more stable, and can effectively deal with the video code stream with uneven light and dark distribution, obtain a stable boundary bright line, and improve the video image algorithm and the final video image quality.

[0198] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example.

[0199] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.

Claims

1. A method for real-time detection of a video image display area, characterized in that: include: Obtain the pixel value of each pixel in the current frame image, and determine the bright spot threshold line that distinguishes the current frame image display area from the black edge area according to the pixel value of each pixel; Obtaining the temporal motion statistics of the pixels corresponding to the current frame image and the previous frame image, and determining the temporal warning line that distinguishes the current frame image display area from the black edge area according to the temporal motion statistics of the pixels in each row and column of the current frame image; Obtaining gradient information of each row and column of pixels in the current frame image, and determining a target gradient line that distinguishes the display area of ​​the current frame image from the black border area according to the gradient information of each row and column of pixels; Determine the boundary bright line between the current frame image display area and the black edge area according to the existence of the bright spot threshold line, the time domain warning line and the target gradient line and the relative positions among the bright spot threshold line, the time domain warning line and the target gradient line; The display area of ​​the current frame image is determined according to the boundary bright line.

2. The method for real-time detection of video image display area according to claim 1, characterized in that: Obtain the pixel value of each pixel in the current frame image, and determine the bright spot threshold line that distinguishes the current frame image display area from the black edge area according to the pixel value of each pixel, including: Read the pixel value of each pixel point in each row of the current frame image from top to bottom in sequence, and if the pixel value is greater than the bright spot threshold, determine that the corresponding pixel point is a bright spot, count the number of bright spots of each row of pixels, and determine that the behavior of the number of bright spots exceeding the first preset number threshold distinguishes the bright spot threshold line of the current frame image display area and the upper black border area; Read the pixel value of each pixel in each row of the current frame image downward from the bright spot threshold line distinguishing the current frame image display area from the upper black border area, if the number of bright spots of the pixel in the current row exceeds a first preset number threshold and the number of bright spots between the current row and the bright spot threshold line distinguishing the current frame image display area from the upper black border area exceeds a first bright spot number threshold, then determine that the current row is the bright spot threshold line distinguishing the current frame image display area from the lower black border area; Read the pixel value of each pixel point in each column of the current frame image from left to right in turn, and if the pixel value is greater than the bright spot threshold, determine that the corresponding pixel point is a bright spot, count the number of bright spots of the pixel points in each column, and determine that the column whose number of bright spots exceeds the second preset number threshold is the bright spot threshold line that distinguishes the current frame image display area from the left black border area; The pixel value of each pixel in each column of the current frame image is read to the right from the bright spot threshold line that distinguishes the current frame image display area from the left black border area. If the number of bright spots of the pixels in the current column exceeds the second preset number threshold and the number of bright spots between the current column and the bright spot threshold line that distinguishes the current frame image display area from the left black border area exceeds the second bright spot number threshold, the current column is determined to be the bright spot threshold line that distinguishes the current frame image display area from the right black border area.

3. The method for real-time detection of video image display area according to claim 2, characterized in that: The pixel value of each pixel point in each row of the current frame image is read from top to bottom in sequence. If the pixel value is greater than the bright spot threshold, the corresponding pixel point is determined to be a bright spot. The number of bright spots of each row of pixels is counted, and the behavior of determining that the number of bright spots exceeds the first preset number threshold distinguishes the bright spot threshold line of the current frame image display area and the upper black border area, including: Read the pixel value of each pixel in each row of the current frame image from top to bottom; If the pixel value is greater than the first bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, the number of bright spots in each row of pixels is counted, and the first bright spot threshold line that distinguishes the current frame image display area from the upper black border area is determined when the number of bright spots exceeds the first preset number threshold; If the pixel value is greater than the second bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, the number of bright spots in each row of pixels is counted, and the behavior of determining that the number of bright spots exceeds the second preset number threshold distinguishes the second bright spot threshold line between the current frame image display area and the upper black border area, wherein the first bright spot sub-threshold is greater than the second bright spot sub-threshold.

4. The method for real-time detection of video image display area according to claim 2, characterized in that: The pixel value of each pixel in each row of the current frame image is read downward from the bright spot threshold line distinguishing the current frame image display area from the upper black border area, and the number of bright spots of the pixel in the current row exceeds the first preset number threshold and the number of bright spots between the current row and the bright spot threshold line distinguishing the current frame image display area from the upper black border area exceeds the first bright spot number threshold, then determining that the current row is the bright spot threshold line distinguishing the current frame image display area from the lower black border area, including: Reading the pixel value of each pixel point in each row of the current frame image in sequence downward from the bright spot threshold line that distinguishes the current frame image display area from the upper black border area; If the pixel value is greater than the first bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, the number of bright spots in each row of pixels is counted, and the first bright spot threshold line that distinguishes the current frame image display area from the lower black border area is determined when the number of bright spots exceeds the first preset number threshold; If the pixel value is greater than the second bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, the number of bright spots in each row of pixels is counted, and the behavior of determining that the number of bright spots exceeds the second preset number threshold distinguishes the second bright spot threshold line between the current frame image display area and the lower black border area, wherein the first bright spot sub-threshold is greater than the second bright spot sub-threshold.

5. The method for real-time detection of video image display area according to claim 2, characterized in that: Obtaining the pixel value of each pixel point in each column of the current frame image from left to right, if the pixel value is greater than the bright spot threshold, the corresponding pixel point is determined to be a bright spot, counting the number of bright spots of each column of pixels, and determining the column whose number of bright spots exceeds the first preset number threshold as the bright spot threshold line distinguishing the current frame image display area from the left black border area, including: Obtain the pixel value of each pixel in each column of the current frame image from left to right; If the pixel value is greater than the third bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, the number of bright spots in each column of pixels is counted, and the column whose number of bright spots exceeds the third preset number threshold is determined to be the first bright spot threshold line that distinguishes the current frame image display area from the left black border area; If the pixel value is greater than the fourth bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, the number of bright spots in each column of pixels is counted, and the column with the number of bright spots exceeding the fourth preset number threshold is determined as the second bright spot threshold line that distinguishes the current frame image display area from the left black border area, wherein the third bright spot sub-threshold is greater than the fourth bright spot sub-threshold.

6. The method for real-time detection of video image display area according to claim 2, characterized in that: The pixel value of each pixel in each column of the current frame image is read rightward from the bright spot threshold line distinguishing the current frame image display area from the left black border area, the number of bright spots of the pixel in the current column exceeds the second preset number threshold and the number of bright spots between the current column and the bright spot threshold line distinguishing the current frame image display area from the left black border area exceeds the second bright spot number threshold, and the current column is determined to be the bright spot threshold line distinguishing the current frame image display area from the right black border area, including: Read the pixel value of each pixel point in each column of the current frame image in sequence from the bright spot threshold line that distinguishes the current frame image display area from the left black border area to the right; If the pixel value is greater than the third bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, the number of bright spots in each column of pixels is counted, and the column whose number of bright spots exceeds the third preset number threshold is determined to be the first bright spot threshold line that distinguishes the current frame image display area from the right black border area; If the pixel value is greater than the fourth bright spot sub-threshold, the corresponding pixel is determined to be a bright spot, the number of bright spots in each column of pixels is counted, and the column with the number of bright spots exceeding the fourth preset number threshold is determined as the second bright spot threshold line that distinguishes the current frame image display area from the right black border area, wherein the third bright spot sub-threshold is greater than the fourth bright spot sub-threshold.

7. The method for real-time detection of video image display area according to claim 1 or 6, characterized in that: Get the temporal motion statistics of the corresponding pixels of the current frame image and the previous frame image, including: Get the pixel value I' of the pixel at position (x, y) in the current frame image t (x, y), and get the pixel value I' of the pixel at the same position (x, y) in the previous frame image t-1 (x,y); Calculate I' t (x,y) and I' t-1 The pixel difference of (x,y); If the pixel difference is greater than the first pixel motion threshold, the temporal motion difference of the pixel point at the position (x, y) is the first temporal motion difference; if the pixel difference is less than or equal to the first pixel motion threshold and greater than the second pixel motion threshold, the temporal motion difference of the pixel point at the position (x, y) is the second temporal motion difference, wherein the first temporal motion difference is greater than the second temporal motion difference; The sum of the temporal motion differences of the pixels in each row of the current frame image is calculated to obtain the temporal motion statistics of each row, and the sum of the temporal motion differences of the pixels in each column of the current frame image is calculated to obtain the temporal motion statistics of each column.

8. The method for real-time detection of video image display area according to claim 7, characterized in that: Determining a temporal warning line that distinguishes a display area of ​​the current frame image from a black edge area according to temporal motion statistics of pixels in each row and column of the current frame image includes: Accumulating the temporal motion statistics of each row of the current frame image from top to bottom, when the accumulated total value of the temporal motion statistics of the current row and the temporal motion statistics of all previous rows is greater than a first temporal motion accumulation threshold, determining a temporal warning line for distinguishing the current frame image display area from the upper black border area in the current behavior; Accumulating the temporal motion statistics of each row of the current frame image from bottom to top, when the accumulated total value of the temporal motion statistics of the current row and the temporal motion statistics of all previous rows is greater than the first temporal motion statistics threshold, determining a temporal warning line for distinguishing the current frame image display area from the lower black border area in the current behavior; Accumulating the temporal motion statistics of each column of the current frame image from left to right, and the accumulated total value of the temporal motion statistics of the current column and the temporal motion statistics of all previous columns is greater than the second temporal motion accumulation threshold, and determining that the current column is the temporal warning line that distinguishes the current frame image display area from the left black edge area; The time domain motion statistics of each column of the current frame image are accumulated from right to left. The accumulated total value of the time domain motion statistics of the current column and the time domain motion statistics of all previous columns is greater than the second time domain motion accumulation threshold, and the current column is determined to be the time domain warning line that distinguishes the current frame image display area from the right black border area.

9. The method for real-time detection of video image display area according to claim 8, characterized in that: The temporal motion vector statistics of each row of the current frame image are accumulated from top to bottom, and the accumulated total value of the temporal motion statistics of the current row and the temporal motion statistics of all previous rows is greater than the first temporal motion accumulation threshold, and the temporal warning line of the current behavior distinguishing the current frame image display area from the upper black border area is determined, including: Accumulating the temporal motion statistics of each row of the current frame image from top to bottom; If the accumulated total value of the temporal motion statistics of the current row and the temporal motion statistics of all previous rows is greater than the first temporal motion accumulation sub-threshold, the first temporal warning line for distinguishing the current frame image display area from the upper black border area is determined in the current row; Alternatively, if the accumulated total value of the temporal motion statistics of the current row and the temporal motion statistics of all previous rows is greater than the second temporal motion accumulation sub-threshold, then the second temporal warning line for distinguishing the current frame image display area from the upper black border area is determined; The first temporal motion accumulation sub-threshold is greater than the second temporal motion accumulation sub-threshold.

10. The method for real-time detection of video image display area according to claim 8, characterized in that: The temporal motion statistics of each row of the current frame image are accumulated from bottom to top, and the accumulated total value of the temporal motion statistics of the current row and the temporal motion statistics of all previous rows is greater than the first temporal motion accumulation threshold, and the temporal warning line for distinguishing the current frame image display area from the lower black border area is determined, including: Accumulating the temporal motion statistics of each row of the current frame image from bottom to top; The accumulated total value of the temporal motion statistics of the current row and the temporal motion vector statistics of all previous rows is greater than the first temporal motion accumulation sub-threshold, and the first temporal warning line for distinguishing the current frame image display area from the lower black border area is determined; Alternatively, the accumulated total value of the temporal motion statistics of the current row and the temporal motion statistics of all previous rows is greater than the second temporal motion accumulation sub-threshold, and the current row is determined to be a second temporal warning line that distinguishes the current frame image display area from the lower black border area; The first temporal motion accumulation sub-threshold is greater than the second temporal motion accumulation sub-threshold.

11. The method for real-time detection of video image display area according to claim 8, characterized in that: The temporal motion statistics of each column of the current frame image are accumulated from left to right, and the accumulated total value of the temporal motion statistics of the current column and the temporal motion statistics of all previous columns is greater than the second temporal motion accumulation threshold, and the current column is determined to be a temporal warning line that distinguishes the current frame image display area from the left black edge area, including: Accumulate the total value of the temporal motion statistics of each pixel block from left to right, wherein each pixel block includes n columns of pixels, and n is an integer greater than 1; The total value of the temporal motion statistics of the current pixel block is greater than the block motion threshold, and the temporal motion statistics of each column of pixels in the current pixel block are accumulated from left to right; The accumulated total value of the temporal motion statistics of the current column of pixels and the temporal motion statistics of all previous columns in the current pixel block is greater than the third temporal motion accumulation sub-threshold, and the current column is determined to be the first temporal warning line distinguishing the current frame image display area from the left black edge area; Alternatively, the accumulated total value of the temporal motion statistics of the current column of pixels and the temporal motion statistics of all previous columns in the current pixel block is greater than the fourth temporal motion accumulation sub-threshold, and the current column is determined to be the second temporal warning line distinguishing the current frame image display area from the left black border area; The fourth time-domain motion accumulation sub-threshold is smaller than the third time-domain motion accumulation sub-threshold.

12. The method for real-time detection of video image display area according to claim 8, characterized in that: The temporal motion statistics of each column of the current frame image are accumulated from right to left, and the accumulated total value of the temporal motion statistics of the current column and the temporal motion statistics of all previous columns is greater than the second temporal motion accumulation threshold, and the current column is determined to be a temporal warning line that distinguishes the current frame image display area from the right black edge area, including: Accumulate the total value of the temporal motion statistics of each pixel block from right to left, wherein each pixel block includes n columns of pixels, and n is an integer greater than 1; The total value of the temporal motion statistics of the current pixel block is greater than the block motion threshold, and the temporal motion statistics of each column of pixels in the current pixel block are accumulated from right to left; The accumulated total value of the temporal motion statistics of the current column of pixels and the temporal motion statistics of all previous columns in the current pixel block is greater than the third temporal motion accumulation sub-threshold, and the current column is determined to be the first temporal warning line distinguishing the current frame image display area from the right black edge area; Alternatively, the accumulated total value of the temporal motion statistics of the current column of pixels and the temporal motion statistics of all previous columns in the current pixel block is greater than the fourth temporal motion accumulation sub-threshold, and the current column is determined to be the second temporal warning line distinguishing the current frame image display area from the right black border area; The fourth time-domain motion accumulation sub-threshold is smaller than the third time-domain motion accumulation sub-threshold.

13. The method for real-time detection of video image display area according to claim 12, characterized in that: Obtain the gradient information of each row and column of pixels in the current frame image, and determine the target gradient line that distinguishes the display area of ​​the current frame image from the black edge area according to the gradient information of each row and column of pixels, including: Obtaining the horizontal gradient value and the vertical gradient value of each pixel point in each row from top to bottom, if the horizontal gradient value of the pixel point is less than the first horizontal gradient threshold and the vertical gradient value of the pixel point is greater than the first vertical gradient threshold, determining that the pixel point is a bright pixel point, and counting the number of bright pixels included in the current row; Obtaining the horizontal gradient value and the vertical gradient value of each pixel point in each row from bottom to top, the horizontal gradient value of the pixel point is less than the first horizontal gradient threshold and the vertical gradient value of the pixel point is greater than the first vertical gradient threshold, determining that the pixel point is a bright pixel point, and counting the number of bright pixels included in the current row; Obtaining the horizontal gradient value and the vertical gradient value of each pixel point in each column from left to right, if the horizontal gradient value of the pixel point is greater than the second horizontal gradient threshold and the vertical gradient value of the pixel point is less than the second vertical gradient threshold, determining that the pixel point is a bright pixel point, and counting the number of bright pixels included in the current column; The horizontal gradient value and the vertical gradient value of each pixel in each column are obtained from right to left. If the horizontal gradient value of the pixel is greater than the second horizontal gradient threshold and the vertical gradient value of the pixel is less than the second vertical gradient threshold, the pixel is determined to be a pixel bright spot, and the number of pixel bright spots included in the current column is counted.

14. The method for real-time detection of video image display area according to claim 13, characterized in that: Obtaining the gradient information of each row and column of pixels in the current frame image, and determining the target gradient line that distinguishes the display area of ​​the current frame image from the black border area according to the gradient information of each row and column of pixels, further comprising: In the upper black border area, filtering the gradient information of the current row and the gradient information of two adjacent rows of the current row to obtain an average gradient, the average gradient is greater than a first edge threshold, and the current behavior is determined to be a first target gradient line that distinguishes the current frame image display area from the upper black border area, or the average gradient is greater than a second edge threshold, and the current behavior is determined to be a second target gradient line that distinguishes the current frame image display area from the upper black border area, wherein the first edge threshold is greater than the second edge threshold; In the lower black border area, filtering the gradient information of the current row and the gradient information of two adjacent rows of the current row to obtain an average gradient, the average gradient is greater than a first edge threshold, and the current row is determined to be a first target gradient line that distinguishes the current frame image display area from the lower black border area, or the average gradient is greater than a second edge threshold, and the current row is determined to be a second target gradient line that distinguishes the current frame image display area from the lower black border area; In the left black border area, filtering the gradient information of the current column and the gradient information of two adjacent columns of the current column to obtain an average gradient, the average gradient is greater than a first width threshold, and the current behavior is determined to be a first target gradient line that distinguishes the current frame image display area from the left black border area, or the average gradient is greater than a second width threshold, and the current behavior is determined to be a second target gradient line that distinguishes the current frame image display area from the left black border area, wherein the first width threshold is greater than the second width threshold; In the right black border area, the gradient information of the current column and the gradient information of the two adjacent columns of the current column are filtered to obtain an average gradient, and the average gradient is greater than a first width threshold, and the current behavior is determined to be a first target gradient line that distinguishes the current frame image display area from the right black border area, or the average gradient is greater than a second width threshold, and the current behavior is determined to be a second target gradient line that distinguishes the current frame image display area from the right black border area.

15. The method for real-time detection of video image display area according to claim 14, characterized in that: Determining the boundary bright line of the current frame image display area according to the positions of the bright spot threshold line, the time domain warning line and the target gradient line includes: For the upper black border area or the lower black border area or the left black border area or the right black border area; The first bright spot threshold line exists, and the first bright spot threshold is determined to be a reference bright spot threshold line; The first bright spot threshold line does not exist and the second bright spot threshold line exists, determining the second bright spot threshold line as a reference bright spot threshold line; The first bright spot threshold line and the second bright spot threshold line do not exist, and the bright spot threshold line of the previous video frame is determined as the reference bright spot threshold line.

16. The method for real-time detection of video image display area according to claim 15, characterized in that: Determining the boundary bright line between the current frame image display area and the black edge area according to the positions of the bright spot threshold line, the time domain warning line and the target gradient line includes: For the upper black border area, the lower black border area, the left black border area, or the right black border area, the first time domain warning line and the first gradient line both exist; If the position of the first target gradient line is adjacent to the position of the first time-domain warning line, determining that the first target gradient line is a bright boundary line between the current frame image display area and the black border area; If the position of the reference bright spot threshold line is adjacent to or identical to the position of the first target gradient line, determine that the line where the positions of the reference bright spot threshold line and the first target gradient line are closer to the inside of the display area is the boundary bright line; If the first target gradient line is located outside the reference bright spot threshold line, a boundary bright line between the display area and the black border area of ​​the current video frame is determined according to the first target gradient line and the first time domain warning line; If the position of the first target gradient line is located inside the reference bright spot threshold line, the boundary bright line of the current video frame is determined according to the boundary bright line information of the previous video frame of the current video frame and the boundary bright line information of the current video frame.

17. The method for real-time detection of video image display area according to claim 16, characterized in that: Determining a boundary bright line between a display area and a black edge area of ​​a current video frame according to the first target gradient line and the first time domain warning line includes: If the first time-domain warning line is located inside the first target gradient line and the first target gradient line is not located at an image boundary, determining that the first target gradient line is a bright boundary line between a display area and a black border area of ​​the current video frame; If the first time-domain warning line is located inside the first target gradient line and the first target gradient line is located at an image boundary, keeping the boundary bright line of the previous video frame as the boundary bright line of the current video frame; If the first time-domain warning line is located inside the first target gradient line, the boundary bright line output is zero.

18. The method for real-time detection of video image display area according to claim 16, characterized in that: If the position of the first target gradient line is located inside the reference bright spot threshold line, determining the boundary bright line of the current video frame according to boundary bright line information of a previous video frame of the current video frame and boundary bright line information of the current video frame, including: The target gradient line of the previous video frame is adjacent to the first target gradient line of the current video frame; If the first time-domain warning line of the current video frame is located inside the first target gradient line, determining the first target gradient line as a bright boundary line between a display area and a black border area of ​​the current video frame; If the first time-domain warning line of the current video frame is located outside the first target gradient line, and the time-domain warning line of the previous video frame is located inside the first time-domain warning line of the current video frame, if the previous video frame has subtitles and the subtitles do not change or the previous video frame has no subtitles, then the first target gradient line is determined to be a bright line at the boundary between the display area and the black-border area of ​​the current video frame; or, if the previous video frame has subtitles and changes occur, then the reference bright spot threshold line is determined to be a bright line at the boundary between the display area and the black-border area of ​​the current video frame; If the first time domain warning line of the current video frame is located outside the first target gradient line, and the time domain warning line of the previous video frame is located outside the first time domain warning line of the current video frame, the reference bright spot threshold line is determined to be the boundary bright line between the display area and the black border area of ​​the current video frame.

19. The method for real-time detection of video image display area according to claim 18, characterized in that: If the position of the first target gradient line is located inside the reference bright spot threshold line, determining the bright boundary line of the current video frame according to the bright boundary line information of the previous video frame of the current video frame and the bright boundary line information of the current video frame, further comprising: The gradient line of the previous video frame is not adjacent to the first target gradient line of the current video frame; If the first time-domain warning line is located inside the first target gradient line, determining that the first target gradient line is a bright boundary line between the display area and the black border area of ​​the current video frame; If the first time domain warning line is located outside the first target gradient line, searching for a second target gradient line outside the first time domain warning line, and if the second target gradient line is found, determining that the second target gradient line is a bright boundary line between a display area and a black border area of ​​the current video frame; If the first time domain warning line is located outside the first target gradient line and the second target gradient line is not found, if the time domain warning line of the previous video frame is located outside the second time domain warning line, determine the reference bright spot threshold line and the line close to the outside of the display area in the time domain warning line of the previous video frame as the boundary bright line; if the time domain warning line of the previous video frame is located inside the second time domain warning line, the previous video frame has subtitles and the subtitles have not changed or have no subtitles, determine the first target gradient line as the boundary bright line, or, the previous video frame has subtitles and the subtitles have changed, determine the reference zero point threshold line as the boundary bright line.

20. The method for real-time detection of video image display area according to claim 15, characterized in that: Determining the boundary bright line of the current frame image display area according to the positions of the bright spot threshold line, the time domain warning line and the target gradient line includes: For the upper black border area, the lower black border area, the left black border area, or the right black border area, the first time domain warning line and the first target gradient line do not exist; If both the first bright spot threshold line and the second bright spot threshold line exist, determining the line of the first bright spot threshold line and the second bright spot threshold line that is closer to the outside of the display area as the boundary bright line; If the first bright spot threshold does not exist and the second bright spot threshold line exists, determining the second bright spot threshold line as the boundary bright line; If the first bright spot threshold line exists and the second bright spot threshold line does not exist, determining the first bright spot threshold line as the boundary bright line; If neither the first bright spot threshold line nor the second bright spot threshold line exists, the boundary bright line is determined to be at the edge of the image.

21. The method for real-time detection of video image display area according to claim 15, characterized in that: Determining the boundary bright line of the current frame image display area according to the positions of the bright spot threshold line, the time domain warning line and the target gradient line includes: For the upper black border area or the lower black border area or the left black border area or the right black border area, the first time domain warning line does not exist and the first target gradient line exists; If the reference bright spot threshold line is adjacent to the first target gradient line, determining a line between the reference bright spot threshold line and the first target gradient line that is close to the inner side of the display area as the boundary bright line; If the reference bright spot threshold line is located outside the first target gradient line, determining the first target gradient line as the boundary bright line; If the reference bright spot threshold line is located inside the first target gradient line, and there is a second target gradient line outside the first target gradient line, the boundary bright line is determined to be the image edge line; or, if there is no second target gradient line outside the first target gradient line, the first target gradient line is determined to be the boundary bright line.

22. The method for real-time detection of video image display area according to claim 15, characterized in that: Determining the boundary bright line of the current frame image display area according to the positions of the bright spot threshold line, the time domain warning line and the target gradient line includes: For the upper black border area or the lower black border area or the left black border area or the right black border area, the first time domain warning line exists and the first target gradient line does not exist; Searching for a second target gradient line outward from a line position close to the inner side of the display area between the first time domain warning line and the reference bright spot threshold line; The second target gradient line is found, and the second target gradient line is adjacent to the first time-domain warning line. If the reference bright spot threshold line is adjacent to the second target gradient line, a line between the reference bright spot threshold line and the second target gradient line that is close to the inner side of the display area is determined to be the boundary bright line. Alternatively, if the first time-domain warning line is located inside the second target gradient line and the second target gradient line is not at the image boundary, the second target gradient line is determined to be the boundary bright line. Alternatively, if the second target gradient line is at the boundary, the boundary bright line of the previous video frame is determined to be the boundary bright line of the current video frame. Alternatively, if the first time-domain warning line is located outside the second target gradient line, the boundary bright line is determined to be the image boundary line of the current video frame. Alternatively, if the second target gradient line is not found, the second target gradient line is further searched outward from the line position away from the display area between the first time domain warning line and the reference bright spot threshold line; if the second target gradient line is found, the second target gradient line is determined to be the boundary bright line; or, if the second target gradient line is not found and the reference bright spot threshold line is located outside the first time domain warning line, the reference bright spot threshold line is determined to be the boundary bright line; or, if the second target gradient line is not found and the reference bright spot threshold line is located inside the first time domain warning line, the boundary bright line is determined to be the image boundary line of the current video frame.

23. A device for real-time detection of a video image display area, characterized in that: include: A bright spot threshold line acquisition module is used to obtain the pixel value of each pixel in the current frame image, and determine the bright spot threshold line that distinguishes the current frame image display area from the black edge area according to the pixel value of each pixel; A time domain warning line acquisition module is used to obtain the time domain motion statistics of the corresponding pixel points of the current frame image and the previous frame image, and determine the time domain warning line that distinguishes the current frame image display area and the black edge area according to the time domain motion statistics of each row and column of the current frame image; A gradient line acquisition module is used to obtain the gradient information of each row and column of pixels in the current frame image, and determine the target gradient line that distinguishes the display area of ​​the current frame image from the black edge area according to the gradient information of each row and column of pixels; A display area determination module is used to determine the boundary bright line between the current frame image display area and the black border area according to the existence of the bright spot threshold line, the time domain warning line and the target gradient line and the relative positions among the bright spot threshold line, the time domain warning line and the target gradient line, and determine the display area of ​​the current frame image according to the boundary bright line.

24. An electronic device, characterized in that: include: The device for real-time detection of a video image display area according to claim 23 is used to determine a video image display area; An image processing device, used for processing the video image display area; A display device is connected to the image processing device and is used to display the processed video image.