Dynamic adaptive video black edge real-time detection method based on multistage scanning
By combining multi-level scanning and sparse sampling with multi-mode color determination, the position of the black border is updated in real time, which solves the problems of low efficiency, poor adaptability and insufficient format compatibility in existing technologies for video black border detection, and achieves efficient and accurate real-time video black border detection.
Patent Information
- Application Number
- CN202511573189.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-30
- Publication Date
- 2026-01-30
AI Technical Summary
Existing methods for detecting black borders in videos are inefficient, have poor dynamic adaptability, and limited format compatibility, making it difficult to meet the processing needs of real-time video streams.
A dynamic adaptive video black border detection method using multi-level scanning is adopted. By selecting 28 detection areas within the video frame, sparse sampling is performed on each area, and a multi-mode color determination method is used to determine the black area. The number of consecutive changes is counted, and the position of the black border is updated in real time.
It achieves efficient and accurate black border detection, reduces the amount of computation by 80%, has a detection latency of less than 10ms, supports resolution switching and landscape/portrait screen changes, has a low false detection rate, and is compatible with mainstream video formats.
Smart Images

Figure CN121438176A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a dynamic adaptive video black edge real-time detection method based on multi-level scanning. BACKGROUND
[0002] In the video processing process, the existence of black edges (i.e. black borders around the picture) will cause the effective picture area to shrink, affecting the user experience. The existing black edge detection method usually has the following problems: 1. Inefficient: Traditional methods use pixel-by-pixel scanning, which is computationally intensive and difficult to meet the processing needs of real-time video streams.
[0003] 2. Poor dynamic adaptability: Existing algorithms are mostly designed based on static pictures and cannot effectively handle dynamic changes in black edges caused by resolution switching, horizontal and vertical screen switching, and content changes in video streams.
[0004] 3. Limited format compatibility: Differences in pixel arrangement and color space between different video formats (such as RGB, YUV, etc.) lead to complex detection logic and insufficient universality. Current mainstream solutions (such as the OpenCV black edge detection module) support multiple formats, but are time-consuming (more than 16ms), lack dynamic refresh mechanisms, and are difficult to balance real-time performance and accuracy.
[0005] Therefore, a dynamic adaptive video black edge real-time detection method based on multi-level scanning is proposed to solve the above problems. SUMMARY
[0006] The present application aims to provide a dynamic adaptive video black edge real-time detection method based on multi-level scanning to solve the technical problems raised in the background.
[0007] To achieve the above purpose, the present application provides the following technical solutions: A dynamic adaptive video black edge real-time detection method based on multi-level scanning, the specific steps are as follows: Step 1: Input 1 frame of video, select 28 detection regions in the video frame by four corner region positioning, edge center region center positioning and cross region positioning requirements; Step 2: Perform sparse sampling on the 28 detection regions one by one, and determine whether it is a black region through the sampling result. If it is determined to be, execute step 3, if it is determined to be not, output the detection region; Step 3: Preliminarily determine the direction of the video frame black edge, as well as the starting and ending positions of the black edge in the four directions of the video frame; Step four: judging whether the current video frame black edge orientation and the video frame four edge starting and ending positions have changed compared with the previous video frame black edge orientation and the video frame each direction black edge starting and ending positions, if yes, executing step five, if no, executing step six; Step five: determining the complete pixel-level black edge boundary through the current video frame black edge orientation and the video frame each direction black edge starting and ending positions, repeating steps one-four every 30 frames; Step six: counting the continuous unchanged times, judging whether the continuous unchanged times are greater than or equal to 5 times, if yes, pausing step five, repeating steps one-four every 30 frames, if no, executing step five.
[0008] Further, the detection area size is 16x16 pixels.
[0009] Further, step 1 is specifically operated as follows: Step 11: calculating the center coordinates of the video frame; Step 12: setting four corner detection areas at the four corners of the standard area according to the four-corner area positioning requirement; Step 13: selecting four edge center detection areas at the four edge centers of the video frame according to the edge center area center positioning requirement; Step 14: forming ten groups of vertical direction detection areas between the upper edge center detection area and the lower edge center detection area, and forming ten groups of horizontal direction detection areas between the left edge center detection area and the right edge center detection area according to the cross area positioning requirement.
[0010] Further, the sparse sampling step is set to 4 pixels.
[0011] Further, step two is specifically operated as follows: Step 21: starting from the upper left corner of the video frame, jumping sampling in the horizontal and vertical directions with an interval of 4 pixels in the 28 detection areas, and counting the total number of sampling points in each detection area; Step 22: comprehensively judging whether the sampling points in the detection area are black pixels through the multi-mode color judgment method, and counting the number of black pixels in the detection area; Step 23: judging whether the number of black pixels in the detection area divided by the total number of sampling points in the corresponding detection area exceeds the set threshold A, if yes, marking the detection area as a black area, executing step three, if no, outputting the detection area.
[0012] Further, the multi-mode color judgment method includes a brightness judgment method, a color distance judgment method, and a mean threshold judgment method.
[0013] Further, the step three is specifically operated as follows: Step 31: counting the detection area marked as black area, and judging whether the four edges of the video frame exist black edge by marking the black area as standard through all the detection areas on the edge; Step 32: placing the detection area on the left side of the vertical center and on the horizontal center as left side area, placing the detection area on the right side of the vertical center and on the horizontal center as right side area, placing the detection area on the upper side of the horizontal center and on the vertical center as upper side area, and placing the detection area on the lower side of the horizontal center and on the vertical center as lower side area; Step 33: patrolling all the detection areas in the left side area whether being marked as black area, positioning the range of the black edge of the left side area, and the first start position and the first end position; Step 34: patrolling all the detection areas in the right side area whether being marked as black area, positioning the range of the black edge of the right side area, and the second start position and the second end position; Step 35: patrolling all the detection areas in the upper side area whether being marked as black area, positioning the range of the black edge of the upper side area, and the third start position and the third end position; Step 36: patrolling all the detection areas in the lower side area whether being marked as black area, positioning the range of the black edge of the lower side area, and the fourth start position and the fourth end position.
[0014] Further, the step five is specifically operated as follows: Step 51: calculating the pixel level boundary in horizontal direction through the range of the black edge of the left side area, the first start position and the first end position, the range of the black edge of the right side area, the second start position and the second end position; Step 52: calculating the pixel level boundary in vertical direction through the range of the black edge of the upper side area, the third start position and the third end position, the range of the black edge of the lower side area, the fourth start position and the fourth end position; Step 53: combining the pixel level boundary in horizontal direction and the pixel level boundary in vertical direction to form the complete pixel level boundary.
[0015] Further, the step 51 is specifically operated as follows: Step 511: calculating the start point in horizontal direction through the range of the black edge of the left side area, the first start position and the first end position, the range of the black edge of the right side area, the second start position and the second end position; Step 512: Calculate two opposite starting positions of bidirectional progressive scanning; Step 513: From two different starting positions, simultaneously perform bidirectional progressive scanning from inside to outside to determine the positioning black border boundary; Step 514: The black border boundary is further scanned by the boundary scanning function, and the black border boundary range is narrowed; Step 515: The narrowed black border boundary is scanned at the pixel level to obtain the pixel-level boundary in the horizontal direction.
[0016] Further, steps 51 and 52 have the same running logic, and the corresponding orientation can be adjusted.
[0017] Beneficial effects
[0018] The present application improves efficiency: by sparse sampling each of the 28 detection areas, by sampling results to determine whether it is a black area, and by preliminarily determining the video frame black border orientation, the video frame black border starting and ending positions in the four directions, the calculation amount can be reduced by 80%, and the 1080P picture detection delay is less than 10ms. The number of consecutive no changes is counted, and it is judged whether the number of consecutive no changes is greater than or equal to 5 times. If the judgment is yes, step five is suspended, and steps one to four are repeated every 30 frames. If the judgment is no, step five is executed, the black border position is updated in real time, the resolution switching, the horizontal and vertical screen changes and the picture cropping are adapted, the efficient and accurate black border detection is realized, and the detection result is updated in real time. At the same time, the present application supports mainstream video formats (RGB / YUV), and has lower false detection rate. BRIEF DESCRIPTION OF DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiment or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0020] Fig. 1 A flow chart of a dynamic adaptive video black border real-time detection method based on multi-level scanning of the present application; Fig. 2 A layout diagram for 28 detection areas. DETAILED DESCRIPTION
[0021] The technical solutions in the embodiments of the present application will be described clearly and completely below. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0022] The application will be further described in connection with the following examples.
[0023] Example 1, please refer to Figs. 1-2 A dynamic adaptive video black edge real-time detection method based on multi-level scanning, the specific steps are as follows: Step one: input 1 frame of video frame, through four corner region positioning, edge center region center positioning and cross region positioning, select 28 detection regions in the video frame; Step two: sparse sampling is performed on the 28 detection regions one by one, and it is judged whether it is a black region through the sampling result, if it is judged, step three is executed, if it is judged, the detection region is output; Step three: preliminarily determine the black edge direction of the video frame, and the starting and ending positions of the black edge in the four directions of the video frame; Step four: judge whether the black edge direction of the current video frame and the starting and ending positions of the black edge in the four directions of the video frame have changed compared with the black edge direction of the previous video frame and the starting and ending positions of the black edge in each direction of the video frame, if it is judged, step five is executed, if it is judged, step six is executed; Step five: determine the complete pixel-level black edge boundary through the current video frame black edge direction and the starting and ending positions of the black edge in each direction of the video frame, repeat steps one-four every 30 frames; Step six: count the number of continuous no change, judge whether the number of continuous no change is greater than or equal to 5 times, if it is judged, suspend step five, repeat steps one-four every 30 frames, if it is judged, execute step five.
[0024] The size of the detection region is 16x16 pixels.
[0025] Step 1 specific operation as follows: Step 11: calculate the center coordinates of the video frame; The center coordinates are the half of the image width as the horizontal center, and the half of the image height as the vertical center Step 12: set 4 corner detection regions at the four corners of the standard region according to the four corner region positioning requirement; The detection region of the upper left corner is located at the top of the left edge, the detection region of the lower left corner is located at the bottom of the left edge, the detection region of the upper right corner is located at the top of the right edge, and the detection region of the lower right corner is located at the lower right corner of the standard region.
[0026] The detection region of each corner considers the offset of the region size, which ensures that the region is completely located in the image range; Step 13: select 4 edge center detection regions at the four groups of edge centers of the video frame according to the edge center region center positioning requirement; A detection region for the left edge center is located at the vertical center of the left boundary, a detection region for the right edge center is located at the vertical center of the right boundary, a detection region for the top edge center is located at the horizontal center of the top boundary, and a detection region for the bottom edge center is located at the horizontal center of the bottom boundary.
[0027] Step 14: According to the cross region positioning requirement, ten groups of vertical direction detection regions are formed between the detection region for the top edge center and the detection region for the bottom edge center, and ten groups of horizontal direction detection regions are formed between the detection region for the left edge center and the detection region for the right edge center.
[0028] The arrangement of the ten groups of horizontal direction detection regions is as follows: The ten groups of horizontal direction detection regions are arranged on the horizontal center line, and the left five points are arranged from the detection region for the left edge center to the center coordinate, and the horizontal position of each detection region is arranged in increments of ten equal parts. The right five points are arranged from the detection region for the edge center to the center coordinate, and the horizontal position of each detection region is arranged in increments of ten equal parts.
[0029] The arrangement of the ten groups of vertical direction detection regions is as follows: Ten detection points are uniformly arranged on the vertical center line of the image. The upper five points are arranged from the detection region for the top edge center to the center coordinate, and the vertical position of each detection region is arranged in increments of ten equal parts. The lower five points are arranged from the detection region for the bottom edge center to the center coordinate, and the vertical position of each detection region is arranged in increments of ten equal parts.
[0030] The sparse sampling step is set to 4 pixels.
[0031] The specific operation of step two is as follows: Step 21: Starting from the upper left corner of the video frame, jump sampling is performed in the horizontal and vertical directions at an interval of 4 pixels in the 28 detection regions, and the total number of sampling points in each detection region is counted. Step 22: Whether the sampling points in the detection region are black pixels is comprehensively judged by a multi-mode color judgment method, and the number of black pixels in the detection region is counted. Step 23: When the number of black pixels in the detection region divided by the total number of sampling points in the corresponding detection region exceeds a set threshold A, if the judgment is yes, the detection region is marked as a black region, and step three is executed, if the judgment is no, the detection region is output.
[0032] Threshold A: The proportion of black pixels in the region is 95%. The multi-mode color judgment method includes a brightness judgment method, a color distance judgment method, and a mean threshold judgment method.
[0033] The brightness judgment method is calculated as follows: Y = 0.299R + 0.587G + 0.114B Y is a luminance value, R is a red component weight, G is a green component weight, and B is a blue component weight; The color distance determination method calculates the Euclidean distance between the current pixel color and pure black.
[0034] The average threshold determination method calculates the average value of the red, green, and blue color components.
[0035] Through the comprehensive evaluation of the three methods, black pixels can be more accurately identified; The judgment standard is that the results of the luminance determination method, the color distance determination method, and the average threshold determination method all do not exceed the corresponding set value, and the black pixels are identified Step three is specifically operated as follows: Step 31: Count the detection regions marked as black regions, and determine whether the four edges of the standard determination video frame exist black edges by marking all the detection regions on the edges as black regions; The existence of the left black edge requires that the left edge top, left edge center, and left edge bottom three detection regions all detect black; the right black edge requires that the right edge top, right edge center, and right edge bottom three detection regions all detect black; the upper black edge requires that the left edge top, upper edge center, and right edge top three detection regions all detect black; and the lower black edge requires that the left edge bottom, lower edge center, and right edge bottom three detection regions all detect black. Only when all three detection regions in one direction detect black, it is considered that the black edge exists in that direction; Step 32: The detection region located on the left side of the vertical center and on the horizontal center of the video frame is placed as the left side region, the detection region located on the right side of the vertical center and on the horizontal center of the video frame is placed as the right side region, the detection region located on the upper side of the horizontal center and on the vertical center of the video frame is placed as the upper side region, and the detection region located on the lower side of the horizontal center and on the vertical center of the video frame is placed as the lower side region; There are six detection regions in the left side region, the right side region, the upper side region, and the lower side region; Step 33: Patrol all the detection regions in the left side region whether they are marked as black region detection regions, locate the range of the black edge of the left side region, and the first start position and the first end position; Traverse all detection areas within the left region and count the number of black areas. When a black area is found, update the starting position of the left boundary to the maximum value of the right edge position of the left region to determine the right boundary of the black edge. When a non-black area is found and a starting position has been recorded but an ending position has not yet been recorded, record the left edge position of the current non-black area detection area as the first ending position of the left region, locate the range of the black edge of the left region, and determine the first starting position and the first ending position.
[0036] Step 34: Traverse all detection areas within the right-hand region to determine if they are marked as black areas, locate the range of the black border in the right-hand region, and determine the second start position and the second end position; Traverse all detection areas within the right-side region and count the number of black areas. When a black area is detected, if it is the first time it has been detected, directly set the right boundary end position; otherwise, take the minimum value between the current position and the already recorded position to determine the left boundary of the black edge of the right-side region. When a non-black area is encountered and an end position has been recorded but a start position has not yet been found, record the current position of the non-black area detection region as the second start position of the right-side region, locate the range of the black edge of the right-side region, and determine the second start position and the second end position. Step 35: Traverse all detection areas in the upper region to determine if they are marked as black areas, locate the range of the black border in the upper region, and the third start and third end positions; Traverse all detection areas within the upper region and count the number of black areas. When a black area is found, update the starting position of the upper boundary to the maximum value of the lower edge position of the upper region to determine the lower boundary of the black border. When a non-black area is found and a starting position has been recorded but an ending position has not yet been determined, record the upper edge position of the current non-black area as the third ending position of the upper region to locate the range of the black border in the upper region, as well as the third starting position and the third ending position.
[0037] Step 36: Traverse all detection areas in the lower region to determine if they are marked as black areas, locate the range of the black border in the lower region, and determine the fourth start position and the fourth end position.
[0038] Traverse all detection areas within the lower region and count the number of black areas. When a black area is found, if it is the first time it has been detected, directly set the fourth end position of the lower region; otherwise, take the minimum value between the current position and the already recorded position to determine the upper boundary of the black edge of the lower region. When a non-black region is encountered and an end position has been recorded but a start position has not yet been found, record the current position of the non-black region detection area as the start position of the lower boundary, locate the range of the black edge of the lower region, and determine the fourth start position and the fourth end position.
[0039] Step five involves the following steps: Step 51: Calculate the pixel-level boundary in horizontal direction by the range of black border of left region, and the first start position and the first end position, the range of black border of right region, and the second start position and the second end position; Step 52: Calculate the pixel-level boundary in vertical direction by the range of black border of upper region, and the third start position and the third end position, the range of black border of lower region, and the fourth start position and the fourth end position; Step 53: Combine the pixel-level boundary in horizontal direction and the pixel-level boundary in vertical direction to form the complete pixel-level boundary; Step 51 is specifically operated as follows: Step 511: Calculate the start position in horizontal direction by the range of black border of left region, and the first start position and the first end position, the range of black border of right region, and the second start position and the second end position; Step 512: Calculate two opposite start positions of bidirectional progressive scanning; Step 513: Perform bidirectional progressive scanning from the two different start positions at the same time from inside to outside to determine the positioning of black border boundary; Step 514: The boundary scanning function black border boundary further scans to narrow the range of black border boundary; Step 515: The narrowed black border boundary is subjected to pixel-level scanning to obtain the pixel-level boundary in horizontal direction; Step 51 and Step 52 have the same running logic, and the corresponding orientation can be adjusted.
[0040] The specific operation is as follows: Calculate the start position in horizontal direction: first check the detection result of the left region, if the start and end positions of the left region are both valid and the end position is greater than the start position, then calculate the difference between the start and end positions of the left region as the horizontal scanning width and set the left scanning start position of the horizontal scanning as the first start position of the left region. Then check the detection result of the right region, if the right region data is valid, take the maximum value of the difference between the start and end positions of the left and right regions as the final horizontal scanning region width, and set the right scanning start position of the horizontal scanning as the second end position of the right region. If the calculated horizontal scanning region width is invalid or exceeds the reasonable range, use the default value, that is, 40% of the image width, and reset the scanning start position.
[0041] Compute two opposite start positions for bi-directional progressive scan: the first scan position (left scan start) is determined based on whether there is a valid start point. If there is, it is offset inward by the size of the scan region based on the start point. Otherwise, it starts directly from the scan region boundary. The second scan position (right scan start) is calculated in a similar way, but in the opposite direction. If there is a valid start point, it is offset outward. Otherwise, it starts from the other end of the image minus the size of the scan region. The scan direction is selected based on whether it is a vertical or horizontal scan, using the height or width of the image.
[0042] Bi-directional progressive scan: Scan from two different start positions simultaneously from inside to outside, with a step size determined by the scan direction. The first scan position moves from the start position to the edge, and the second scan position moves outward from the other side start position. For each scan position, calculate the proportion of black pixels on the scan line. If the proportion of black pixels on the first scan line reaches the set threshold B, mark it as finding the black edge and record the maximum value of the position, while increasing the discovery count. If the second scan line reaches the threshold, record the minimum value of the position. When both directions have found at least twice, terminate the scan early to improve efficiency, quickly and accurately locating the black edge boundary.
[0043] Boundary scan function scan: Call the boundary scan [direction focus] function, passing in image data, size, format, threshold C, etc. parameters, as well as the black edge boundary width and start position, the scan step size is set to 8 pixels, further narrowing the range of the black edge position, preparing for the final high-precision scan.
[0044] Pixel-level scan: The scan region size is set to 3 times the step size, with a horizontal step size of 1 pixel to achieve pixel-level accuracy, and the vertical step size remains at the default value.
[0045] For formats such as RGB565, YUV, etc., adapt pixel parsing and color calculation (e.g. 5-6-5 bit split for RGB565).
[0046] Pixel position calculation: Calculate the position of a pixel in memory based on the image format. The memory address of a pixel is equal to the base address plus the offset. The offset is calculated differently for different formats: YUV format occupies 1 byte per pixel, offset is row coordinate multiplied by image width plus column coordinate; RGB565 format occupies 2 bytes per pixel, offset needs to be multiplied by 2 on the basis of the calculation result; RGBA or ARGB format occupies 4 bytes per pixel, offset needs to be multiplied by 4.
[0047] The above calculation method ensures correct memory access for different image formats, supports mainstream video formats (RGB / YUV), and has lower false detection rate.
[0048] The preferred embodiments of the application disclosed above are only to facilitate the elucidation of the application. The preferred embodiments do not describe all the details of the application and limit the application to the specific embodiments. Obviously, many modifications and variations can be made in light of the teachings above. The description is chosen and described in order to provide the best illustration of the application and its practical application to those skilled in the art and to enable those skilled in the art to best utilize the application. The application is limited only by the claims and their full scope and equivalents.
Claims
1. A dynamic adaptive video black edge real-time detection method based on multi-stage scanning, characterized in that: The specific steps are as follows: Step one: input 1 frame of video frame, through the four corner region positioning, edge center region center positioning and cross region positioning requirements in the video frame to select 28 detection regions; Step two: sparse sampling is performed on the 28 detection regions one by one, and it is judged whether it is a black region through the sampling result, if it is judged to be, step three is executed, if it is judged to be not, the detection region is output; Step three: the black edge direction of the video frame is preliminarily determined, as well as the starting and ending positions of the black edge in the four directions of the video frame; Step four: it is judged whether the black edge direction of the current video frame, as well as the starting and ending positions of the black edge in each direction of the video frame have changed compared with the black edge direction of the previous video frame, as well as the starting and ending positions of the black edge in each direction of the video frame, if it is judged to be, step five is executed, if it is judged to be not, step six is executed; Step five: the complete pixel-level black edge boundary is determined through the black edge direction of the current video frame, as well as the starting and ending positions of the black edge in each direction of the video frame, steps one-four are repeated every 30 frames; Step six: the number of continuous no changes is counted, and it is judged whether the number of continuous no changes is greater than or equal to 5 times, if it is judged to be, step five is suspended, steps one-four are repeated every 30 frames, if it is judged to be not, step five is executed.
2. The detection method of claim 1, wherein: The size of the detection region is 16x16 pixels.
3. The method of claim 2, wherein: Step 1 specific operation as follows: Step 11: calculate the center coordinates of the video frame; Step 12: set 4 corner detection regions at the four corners of the standard region according to the four corner region positioning requirements; Step 13: select 4 edge center detection regions at the four groups of edge centers of the video frame according to the edge center region center positioning requirements; Step 14: form ten groups of vertical direction detection regions between the upper edge center detection region and the lower edge center detection region, and form ten groups of horizontal direction detection regions between the left edge center detection region and the right edge center detection region according to the cross region positioning requirements.
4. The method of claim 3, wherein: The sparse sampling step is set to 4 pixels.
5. The method of claim 4, wherein: Step two specific operation as follows: Step 21: start from the upper left corner of the video frame, jump sampling in the horizontal and vertical directions with an interval of 4 pixels in the 28 detection regions, and count the total number of sampling points in each detection region; Step 22: judge whether the sampling points in the detection region are black pixels by a multi-mode color judgment method, and count the number of black pixels in the detection region; Step 23: if the value of the number of black pixels in the detection region divided by the total number of sampling points in the corresponding detection region exceeds the set threshold A, if it is judged to be, the detection region is marked as a black region, step three is executed, if it is judged to be not, the detection region is output.
6. The method of claim 5, wherein: The multi-mode color judgment method includes brightness judgment method, color distance judgment method and mean threshold judgment method.
7. The method of claim 6, wherein: Step three specific operation as follows: Step 31: count the detection regions marked as black regions, and judge whether the four edges of the video frame exist black edges through all the detection regions marked as black regions on the edges; Step 32: the video frame is located on the left side of the vertical center, and the detection area located on the horizontal center is classified as the left side area; the video frame is located on the right side of the vertical center, and the detection area located on the horizontal center is classified as the right side area; the video frame is located on the upper side of the horizontal center, and the detection area located on the vertical center is classified as the upper side area; the video frame is located on the lower side of the horizontal center, and the detection area located on the vertical center is classified as the lower side area; Step 33: patrol all the detection areas in the left side area to determine whether they are marked as black areas, and locate the range of the black edge of the left side area, as well as the first start position and the first end position; Step 34: patrol all the detection areas in the right side area to determine whether they are marked as black areas, and locate the range of the black edge of the right side area, as well as the second start position and the second end position; Step 35: patrol all the detection areas in the upper side area to determine whether they are marked as black areas, and locate the range of the black edge of the upper side area, as well as the third start position and the third end position; Step 36: patrol all the detection areas in the lower side area to determine whether they are marked as black areas, and locate the range of the black edge of the lower side area, as well as the fourth start position and the fourth end position.
8. The detection method of claim 7, wherein: Step five is specifically operated as follows: Step 51: calculate the pixel-level boundary in the horizontal direction through the range of the black edge of the left side area, as well as the first start position and the first end position, the range of the black edge of the right side area, as well as the second start position and the second end position; Step 52: calculate the pixel-level boundary in the vertical direction through the range of the black edge of the upper side area, as well as the third start position and the third end position, the range of the black edge of the lower side area, as well as the fourth start position and the fourth end position; Step 53: combine the pixel-level boundary in the horizontal direction and the pixel-level boundary in the vertical direction to form a complete pixel-level boundary.
9. The detection method of claim 8, wherein: Step 51 is specifically operated as follows: Step 511: calculate the starting point in the horizontal direction through the range of the black edge of the left side area, as well as the first start position and the first end position, the range of the black edge of the right side area, as well as the second start position and the second end position; Step 512: calculate two opposite start positions of the bidirectional progressive scanning; Step 513: simultaneously perform bidirectional progressive scanning from the inside to the outside from the two different start positions to determine the location of the black edge boundary; Step 514: the black edge boundary further scans through the boundary scanning function, and the range of the black edge boundary is narrowed; Step 515: the narrowed black edge boundary is scanned in the pixel level to obtain the pixel-level boundary in the horizontal direction.
10. The detection method of claim 9, wherein: Step 51 and step 52 have the same running logic, and the corresponding orientation can be adjusted.
Citation Information
Cited By
Video content area detection method and device, electronic equipment and storage medium
CN121661570A