CN114022498A - Blank area detection method, device, equipment and storage medium - Google Patents

Blank area detection method, device, equipment and storage medium Download PDF

Info

Publication number
CN114022498A
CN114022498A CN202111177775.2A CN202111177775A CN114022498A CN 114022498 A CN114022498 A CN 114022498A CN 202111177775 A CN202111177775 A CN 202111177775A CN 114022498 A CN114022498 A CN 114022498A
Authority
CN
China
Prior art keywords
straight line
blank area
binary image
image
scanning
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111177775.2A
Other languages
Chinese (zh)
Inventor
韩凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bigo Technology Pte Ltd
Original Assignee
Bigo Technology Pte Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bigo Technology Pte Ltd filed Critical Bigo Technology Pte Ltd
Priority to CN202111177775.2A priority Critical patent/CN114022498A/en
Publication of CN114022498A publication Critical patent/CN114022498A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the invention discloses a blank area detection method, a device, equipment and a storage medium, wherein the method comprises the following steps: carrying out edge detection on the video frame image to obtain a corresponding binary image; detecting straight lines contained in the binary image based on a preset straight line detection algorithm to generate straight line information, wherein the straight line information comprises straight line positions and corresponding straight line lengths; and scanning the binary image according to a set direction, and determining the first scanning position as a blank area boundary when the number of the edge points of the image obtained when the binary image is scanned to the first scanning position is determined to be less than or equal to the corresponding adaptive threshold and the length of the straight line corresponding to the first scanning position is greater than or equal to the preset length threshold. According to the scheme, a blank area detection mechanism is optimized, the detection accuracy and real-time performance are guaranteed, and the resource consumption is low.

Description

Blank area detection method, device, equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a blank area detection method, a blank area detection device, a blank area detection equipment and a storage medium.
Background
With the popularization of networks, video entertainment is becoming the mainstream of entertainment. Each large video platform provides a large amount of video content to users for viewing. However, due to reasons such as a video content producer, a video format, and a terminal playing device, a frame exists in the video content during playing, and the appearance of the frame may cause the viewing experience of a user during playing of the video content to be reduced.
In the prior art, common border detection methods include detection based on a deep learning algorithm and conventional image visual detection. The detection based on the deep learning algorithm mainly adopts a large amount of data training classifiers with labels, and has the defects of large amount of labeled data, high data collection cost, high requirement on training equipment due to the fact that a training model needs GPU support, low real-time performance during deployment and need to occupy a large amount of equipment resources. Based on the traditional image visual detection method, the accuracy rate is low, the situation that the video content is complex cannot be processed, and the application range is limited.
Disclosure of Invention
The embodiment of the invention provides a blank area detection method, a device, equipment and a storage medium, solves the problems of low detection efficiency, poor real-time performance and serious resource consumption of a blank area in the prior art, optimizes a blank area detection mechanism, ensures the detection accuracy and real-time performance and has low resource consumption.
In a first aspect, an embodiment of the present invention provides a blank area detection method, where the method includes:
carrying out edge detection on the video frame image to obtain a corresponding binary image;
detecting straight lines contained in the binary image based on a preset straight line detection algorithm to generate straight line information, wherein the straight line information comprises straight line positions and corresponding straight line lengths;
and scanning the binary image according to a set direction, and determining the first scanning position as a blank area boundary when the number of the edge points of the image obtained when the binary image is scanned to the first scanning position is determined to be less than or equal to the corresponding adaptive threshold and the length of the straight line corresponding to the first scanning position is greater than or equal to the preset length threshold.
In a second aspect, an embodiment of the present invention further provides a blank area detection apparatus, including:
the edge detection module is used for carrying out edge detection on the video frame image to obtain a corresponding binary image;
the line detection module is used for detecting a line contained in the binary image based on a preset line detection algorithm to generate line information, and the line information comprises a line position and a corresponding line length;
and the blank area determining module is used for scanning the binary image according to a set direction, and determining the first scanning position as a blank area boundary when the number of the edge points of the image obtained when the binary image is scanned to the first scanning position is determined to be less than or equal to the corresponding adaptive threshold and the length of the straight line corresponding to the first scanning position is greater than or equal to the preset length threshold.
In a third aspect, an embodiment of the present invention further provides a blank area detection apparatus, where the apparatus includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the blank area detection method according to the embodiment of the present invention.
In a fourth aspect, the present invention further provides a storage medium storing computer-executable instructions, which are used to execute the blank area detection method according to the present invention when executed by a computer processor.
In the embodiment of the invention, after the edge detection is carried out on the video frame image to obtain the corresponding binary image, the line contained in the binary image is detected to generate the line information based on the preset line detection algorithm, wherein the line information comprises the line length, the binary image is scanned according to the set direction, when the number of the edge points of the image obtained when the binary image is scanned to the first scanning position is determined to be less than or equal to the corresponding self-adaptive threshold value, and the line length corresponding to the first scanning position is greater than or equal to the preset length threshold value, the first scanning position is determined to be the blank area boundary, the blank area detection mechanism is optimized, the detection accuracy and real-time are ensured, and the resource consumption is low.
Drawings
Fig. 1 is a flowchart of a blank area detection method according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for detecting a binary image according to a line detection algorithm according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a first scan position determined according to an embodiment of the present invention;
FIG. 4 is a flowchart illustrating another blank area detection method according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of another determined first scanning position according to an embodiment of the present invention;
FIG. 6 is a flowchart illustrating a method for detecting white space by calculating an adaptive threshold according to an embodiment of the present invention;
FIG. 7 is a flowchart illustrating another blank area detection method according to an embodiment of the present invention;
FIG. 8 is a block diagram of a blank area detection apparatus according to an embodiment of the present invention;
fig. 9 is a schematic structural diagram of a blank area detection apparatus according to an embodiment of the present invention.
Detailed Description
The embodiments of the present invention will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of and not restrictive on the broad invention. It should be further noted that, for convenience of description, only some structures, not all structures, relating to the embodiments of the present invention are shown in the drawings.
The terms first, second and the like in the description and in the claims of the present application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that embodiments of the application may be practiced in sequences other than those illustrated or described herein, and that the terms "first," "second," and the like are generally used herein in a generic sense and do not limit the number of terms, e.g., the first term can be one or more than one. In addition, "and/or" in the specification and claims means at least one of connected objects, a character "/" generally means that a preceding and succeeding related objects are in an "or" relationship.
Fig. 1 is a flowchart of a blank area detection method provided in an embodiment of the present invention, which can be applied to detect a blank area in video information, and the method can be executed by a computing device such as a desktop computer, a notebook computer, a background server, a tablet computer, and a smart phone, and specifically includes the following steps:
and S101, performing edge detection on the video frame image to obtain a corresponding binary image.
The video frame image may be a frame image obtained by performing frame extraction processing on video information.
In one embodiment, for example, to determine the blank area of the video information, the frame image in the video information is selected to identify the blank area. Optionally, the frame extraction processing may be to extract frames from the video information at a fixed time period, for example, capture a video frame image every 2 seconds in the playing process of the video information. Optionally, the time period may also be determined according to the playing duration of the video information, for example, one fifth of the playing duration is used as the period of the frame extraction processing.
It should be noted that the video frame image is exemplified by video information, the blank area detection method in the present invention can also be used for detecting a blank area of image information alone, and the present solution is not limited to processing of video information only. The blank area refers to a blank area formed by a blank frame and an image boundary contained in the video frame image. Because the size problem of the video frame image is not set in the full-screen display mode, white frames with different sizes may appear around the screen to form a blank area when the video frame image is displayed in a playing mode, so that the watching experience of a user is influenced.
In an embodiment, a method for performing edge detection on a video image to obtain a binary image in this scheme is described by taking a Canny-based edge detection algorithm as an example. Firstly, carrying out gray level processing on a video frame image to obtain a corresponding gray level image, and filtering out noise signals in the video frame image by using Gaussian filteringAnd (4) information. For a pixel point at a position (m, n) in a video frame image, assuming that the gray value is f (m, n), the gray value g after Gaussian filtering processingσThe calculation of (m, n) is as follows:
Figure BDA0003295968070000041
the gray value g is measuredσ(m, n) and sobel operator or other operators are subjected to point multiplication to obtain gradient values g of every other pixel point in the video frame image along the directions of the x axis and the y axisx(m,n),gy(m, n), and obtaining the comprehensive gradient value G (m, n) of the pixel point by the following formula:
Figure BDA0003295968070000042
Figure BDA0003295968070000043
based on the comprehensive gradient value G (m, n), pixel points higher than the gradient amplitude value are reserved in a hysteresis threshold calculation mode to obtain a binary image of an edge detection result corresponding to the video frame image.
Step S102, detecting straight lines contained in the binary image based on a preset straight line detection algorithm to generate straight line information, wherein the straight line information comprises straight line positions and corresponding straight line lengths.
The preset straight line detection algorithm can detect straight lines meeting conditions in the binary image to generate straight line information. The line information includes the position and length of the line.
Fig. 2 is a flowchart of a method for detecting a binary image according to a line detection algorithm, which is provided in the embodiment of the present invention, and specifically includes:
and S1021, detecting all straight lines contained in the binary image based on a first preset straight line detection algorithm.
The first preset line detection algorithm may be a hough transform line detection algorithm, an LSD line detection algorithm, or an EDLines line detection algorithm. Taking hough transform line detection algorithm used in the scheme as an example, the hough transform line detection algorithm maps the binary image represented by the first coordinate space into the second coordinate space, and performs line detection on the binary image represented by the second coordinate space to obtain all lines. Specifically, the first coordinate space may be an x-y rectangular coordinate system space, where a straight line in the x-y rectangular coordinate system space may be represented by the equation y ═ kx + b, k represents a slope of the straight line, and b represents an intercept. The second coordinate space is a polar coordinate space of the distance angle parameter, that is, coordinates (x, y) are mapped to the polar coordinate space ρ ═ xcos θ + ysin θ, points in the original image in the distance angle parameter space are mapped to a single curve, and the position and length of the straight line are obtained by finding the focus of the sinusoidal curve, that is, by detection.
And step S1022, screening all the detected straight lines to obtain straight line generation straight line information meeting the comparison condition.
In one embodiment, the straight lines detected by the first preset straight line detection algorithm are screened to obtain qualified straight lines. Specifically, straight lines perpendicular to the preset coordinate axis direction are screened out from all the straight lines, the straight line length of the screened straight lines is determined, and the straight line positions of the screened straight lines and the corresponding straight line lengths are stored to generate straight line information. The preset coordinate axis direction can be the x-axis direction and the y-axis direction of the rectangular coordinate system, namely, a straight line perpendicular to the x-axis direction and the y-axis direction is screened out. Of course, the straight lines not perpendicular to the x-axis direction and the y-axis direction may be selected and eliminated.
Step S103, scanning the binary image according to a set direction, and determining the first scanning position as a blank area boundary when the number of the edge points of the image obtained when the binary image is scanned to the first scanning position is less than or equal to the corresponding adaptive threshold and the length of the straight line corresponding to the first scanning position is greater than or equal to the preset length threshold.
The set direction may be a left-to-right direction, a right-to-left direction, a top-to-bottom direction, or a bottom-to-top direction. Preferably, the binary image is sequentially scanned from left to right, from right to left, and from top to bottom, and from bottom to top, line by line, so as to obtain the frame position of the blank region and determine the blank region of the video frame image.
For example, taking the column-by-column scanning from left to right for the binary image as an example, it is assumed that the size of the binary image is 256 × 256, and one of the binary images contains 256 columns. When each column is scanned, the number of image edge points included in each column is determined according to the result obtained by the edge detection in step S101, and is recorded as count [1] by taking the first column as an example, when the second column is calculated, the sum of the number of image edge points determined by the second column and the number of image edge points determined in the scanning process is recorded as the number of image edge points corresponding to the current column, and the count [ i ] is recorded as count [ i-1] + ci by taking the number of image edge points scanned by the ith column as an example.
When each row is scanned, the number of edge points of all images of the front row corresponding to the row is calculated and compared with the adaptive threshold. For example, when the first scanning position is scanned, assuming that the number of edge points of the scanned image at the determined first scanning position is less than or equal to the adaptive threshold, the length of the straight line of the column is further determined according to the straight line information determined in step S102. And if the length of the straight line is greater than or equal to a preset length threshold value, determining the first scanning position as a blank area boundary. Wherein the adaptive threshold may be calculated according to the size of the different video frame images and the specific positions scanned, and the preset length threshold may be 4/5 of the length or width of the video frame image as an example.
And taking the determined first scanning position as the boundary of a blank area in the video frame image. When the blank area is determined based on the boundary, optionally, when the first scanning position is obtained by scanning from left to right, the left area of the first scanning position is determined as the blank area.
Fig. 3 is a schematic diagram of a determined first scanning position according to an embodiment of the present invention. As shown in fig. 3, taking the display interface as 01 as an example, scanning is performed row by row from left to right through the above steps, and it is determined that the number of edge points of the image is smaller than the adaptive threshold and the length of the corresponding straight line is greater than the preset length threshold at the first scanning position 02.
According to the scheme, after the edge detection is carried out on the video frame image to obtain the corresponding binary image, the line contained in the binary image is detected to generate the line information based on the preset line detection algorithm, wherein the line information comprises the line length, the binary image is scanned according to the set direction, when the number of the edge points of the image obtained when the binary image is scanned to the first scanning position is determined to be smaller than or equal to the corresponding self-adaptive threshold value, and the line length corresponding to the first scanning position is greater than or equal to the preset length threshold value, the first scanning position is determined to be the blank area boundary, the blank area detection mechanism is optimized, the detection accuracy and real-time performance are guaranteed, and the resource consumption is low.
Fig. 4 is a flowchart of another blank area detection method according to an embodiment of the present invention, which shows a specific method for obtaining a blank area by scanning, and a specific scheme is shown in fig. 4, where the specific scheme includes:
step S201, performing edge detection on the video frame image to obtain a corresponding binary image.
Step S202, detecting straight lines contained in the binary image based on a preset straight line detection algorithm to generate straight line information, wherein the straight line information comprises straight line positions and corresponding straight line lengths.
Step S203, respectively carrying out row-by-row scanning from left to right and from right to left on the binary image, and carrying out row-by-row scanning from top to bottom and from bottom to top, and when the number of the edge points of the image obtained when the binary image is scanned to a first scanning position is determined to be less than or equal to a corresponding adaptive threshold value, and the length of a straight line corresponding to the first scanning position is greater than or equal to a preset length threshold value, determining the first scanning position as a blank area boundary.
Wherein the first scanning position comprises at least one of a left boundary position, a right boundary position, an upper boundary position and a lower boundary position. Fig. 5 is a schematic diagram of another determined first scanning position according to an embodiment of the present invention, where it is assumed that the first scanning position (left boundary position) is determined to be 03 during left-to-right scanning, the first scanning position (right boundary position) is determined to be 04 during right-to-left scanning, and the first scanning position satisfying the condition is not determined during top-to-bottom and top-to-top progressive scanning.
Correspondingly, when the blank area is determined based on the first scanning position, if the first scanning position is a left boundary position, determining an area from the left boundary position to a left image boundary of the video frame image as the blank area; if the first scanning position is a right boundary position, determining an area from the right boundary position to a right image boundary of the video frame image as a blank area; if the first scanning position is an upper boundary position, determining an area from the upper boundary position to an upper image boundary of the video frame image as a blank area; and if the first scanning position is a lower boundary position, determining an area from the lower boundary position to a lower image boundary of the video frame image as a blank area. Taking the example of fig. 5 as an example, a region 07 from the left boundary position 03 to the left image boundary 05 is determined as a blank region, and a region 08 from the right boundary position 04 to the right image boundary 06 is determined as a blank region.
According to the scheme, based on the edge detection and straight line detection algorithm, the method for scanning the video frame image to respectively obtain the blank frames (the first scanning positions) and further determining the blank areas of the video frame image can calculate the accurate blank areas in the video frame image in real time, efficiently and at low power consumption.
Fig. 6 is a flowchart of a method for detecting a blank area by calculating an adaptive threshold value according to an embodiment of the present invention, which provides a specific method for detecting a blank area of a video frame image by calculating an adaptive threshold value, and the specific scheme is as shown in fig. 6, and includes:
step S301, performing edge detection on the video frame image to obtain a corresponding binary image.
Step S302, detecting the straight lines contained in the binary image based on a preset straight line detection algorithm to generate straight line information, wherein the straight line information comprises straight line positions and corresponding straight line lengths.
Step S303, scanning the binary image according to a set direction, obtaining an adaptive threshold value according to the first scanning position and a first preset calculation formula when the binary image is determined to be scanned to the first scanning position, and determining the first scanning position as a blank area boundary if the number of edge points of the scanned image is less than or equal to the adaptive threshold value and the length of a straight line corresponding to the first scanning position is greater than or equal to a preset length threshold value.
The parameters of the first preset calculation formula include a length value, a width value and a calculation weight of the video image. For example, taking the image size of the video frame as w × h, when scanning the ith column, the corresponding adaptive threshold is calculated by the following formula: 0.01 x i 2 x h/w. Wherein w is the width value of the video frame image, h is the height value of the video frame image, and 0.01 is the weight value.
It should be noted that the adaptive threshold may also be calculated by using a preset function curve, where the preset function curve represents a corresponding relationship of the adaptive thresholds when the current row or column is scanned.
According to the scheme, the blank area frame is determined by adopting the calculated self-adaptive threshold, so that the blank area can be calculated efficiently, and the calculation accuracy can be still realized for the condition that a video frame image contains a large amount of frosted glass effect and fuzzy effect.
Fig. 7 is a flowchart of another blank area detection method according to an embodiment of the present invention, which provides a method for scoring video information based on a determined blank area, and a specific scheme is shown in fig. 7, where the method includes:
step S401, video information is obtained, and video frame extraction processing is carried out on the video information to obtain a plurality of video frame images.
And S402, carrying out edge detection on the video frame image to obtain a corresponding binary image.
Step S403, detecting a straight line included in the binary image based on a preset straight line detection algorithm to generate straight line information, where the straight line information includes a straight line position and a corresponding straight line length.
Step S404, scanning the binary image according to a set direction, and determining the first scanning position as a blank area boundary when the number of the edge points of the image obtained when the binary image is scanned to the first scanning position is less than or equal to the corresponding adaptive threshold and the length of the straight line corresponding to the first scanning position is greater than or equal to the preset length threshold.
Step S405, determining the blank area influence score of each video frame image according to the size of the blank area and a second preset formula to obtain the watching experience score of the video information.
In one embodiment, the blank area influence score of the video frame image is calculated after the blank area of the current video frame image is determined, the viewing experience score of the video information is finally obtained by calculating the blank area influence score of the corresponding video frame image for each video frame image extracted from the video information, and the size of the blank area and the viewing experience condition of the user are further correlated.
Specifically, taking w1 and w2 as the left boundary position and the right boundary position, respectively, and h1 and h2 as the upper boundary position and the lower boundary position, respectively, as an example, the second preset formula for calculating the viewing experience score of the video information may be:
Figure BDA0003295968070000091
wherein, the watching experience score is expressed by score, and n is the number of video frame images extracted from the video information.
According to the scheme, the blank area influence score of each video frame image is determined according to the size of the blank area and the second preset formula to obtain the watching experience score of the video information, the video quality condition can be evaluated, and the method is applied to other business logics, so that the blank area detection function is enriched.
Fig. 8 is a block diagram of a blank area detection apparatus according to an embodiment of the present invention, where the system is configured to execute the blank area detection method according to the foregoing embodiment, and has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 8, the system specifically includes: an edge detection module 101, a straight line detection module 102, and a blank region determination module 103, wherein,
the edge detection module 101 is configured to perform edge detection on a video frame image to obtain a corresponding binary image;
the line detection module 102 is configured to detect a line included in the binary image based on a preset line detection algorithm to generate line information, where the line information includes a line position and a corresponding line length;
and the blank area determining module 103 is configured to scan the binary image according to a set direction, and determine the first scanning position as a blank area boundary when the number of edge points of the image obtained when the binary image is scanned to the first scanning position is determined to be less than or equal to the corresponding adaptive threshold and the length of the straight line corresponding to the first scanning position is greater than or equal to the preset length threshold.
According to the scheme, after the edge detection is carried out on the video frame image to obtain the corresponding binary image, the line contained in the binary image is detected to generate the line information based on the preset line detection algorithm, wherein the line information comprises the line length, the binary image is scanned according to the set direction, when the number of the edge points of the image obtained when the binary image is scanned to the first scanning position is determined to be smaller than or equal to the corresponding self-adaptive threshold value, and the line length corresponding to the first scanning position is greater than or equal to the preset length threshold value, the first scanning position is determined to be the blank area boundary, the blank area detection mechanism is optimized, the detection accuracy and real-time performance are guaranteed, and the resource consumption is low.
In a possible embodiment, the line detection module 102 is specifically configured to:
detecting all straight lines contained in the binary image based on a first preset straight line detection algorithm;
and screening all the detected straight lines to obtain straight line generation straight line information meeting the comparison conditions.
In a possible embodiment, the line detection module 102 is specifically configured to:
and mapping the binary image represented by the first coordinate space into a second coordinate space representation based on a Hough transform line detection algorithm, and performing line detection on the binary image represented by the second coordinate space to obtain all lines.
In a possible embodiment, the line detection module 102 is specifically configured to:
screening out straight lines which are vertical to the direction of a preset coordinate axis from all the straight lines;
and determining the straight line length of the screened straight line, and storing the straight line position of the screened straight line and the corresponding straight line length to generate straight line information.
In a possible embodiment, the blank area determining module 103 is specifically configured to:
and respectively carrying out row-by-row scanning from left to right and/or from right to left on the binary image, and carrying out row-by-row scanning from top to bottom and/or from bottom to top.
In a possible embodiment, the first scanning position includes at least one of a left boundary position, a right boundary position, an upper boundary position, and a lower boundary position, and the blank area determination module 103 is specifically configured to at least one of:
if the first scanning position is a left boundary position, determining an area from the left boundary position to a left image boundary of the video frame image as a blank area;
if the first scanning position is a right boundary position, determining an area from the right boundary position to a right image boundary of the video frame image as a blank area;
if the first scanning position is an upper boundary position, determining an area from the upper boundary position to an upper image boundary of the video frame image as a blank area;
and if the first scanning position is a lower boundary position, determining an area from the lower boundary position to a lower image boundary of the video frame image as a blank area.
In a possible embodiment, the adaptive threshold is calculated according to the first scanning position and a first preset calculation formula or a preset function, and parameters of the preset calculation formula or the preset function include a length value, a width value, and a calculation weight of the video image.
In a possible embodiment, the device further comprises a video frame image acquisition module and a video information scoring module, wherein the video frame image acquisition module acquires video information before performing edge detection on a video frame image to obtain a corresponding binary image, and performs video frame extraction processing on the video information to obtain a plurality of video frame images;
the video information scoring module is used for:
after the first scanning position is determined as the blank area boundary, determining the blank area influence score of each video frame image according to the size of the blank area and a second preset formula to obtain the watching experience score of the video information.
Fig. 9 is a schematic structural diagram of a blank area detecting apparatus according to an embodiment of the present invention, as shown in fig. 9, the apparatus includes a processor 201, a memory 202, an input device 203, and an output device 204; the number of the processors 201 in the device may be one or more, and one processor 201 is taken as an example in fig. 9; the processor 201, the memory 202, the input device 203 and the output device 204 in the apparatus may be connected by a bus or other means, and the connection by the bus is exemplified in fig. 9. The memory 202 is a computer-readable storage medium for storing software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the blank area detection method in the embodiment of the present invention. The processor 201 executes various functional applications and data processing of the apparatus by executing software programs, instructions and modules stored in the memory 202, that is, the blank area detection method described above is realized. The input device 203 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function controls of the apparatus. The output device 204 may include a display device such as a display screen.
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, where the computer-executable instructions are executed by a computer processor to perform the blank area detection method described in the foregoing embodiment, and the method specifically includes:
carrying out edge detection on the video frame image to obtain a corresponding binary image;
detecting straight lines contained in the binary image based on a preset straight line detection algorithm to generate straight line information, wherein the straight line information comprises straight line positions and corresponding straight line lengths;
and scanning the binary image according to a set direction, and determining the first scanning position as a blank area boundary when the number of the edge points of the image obtained when the binary image is scanned to the first scanning position is determined to be less than or equal to the corresponding adaptive threshold and the length of the straight line corresponding to the first scanning position is greater than or equal to the preset length threshold.
It should be noted that, in the embodiment of the blank area detection apparatus, the included units and modules are only divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be realized; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the invention.
It should be noted that the foregoing is only a preferred embodiment of the present invention and the technical principles applied. Those skilled in the art will appreciate that the embodiments of the present invention are not limited to the specific embodiments described herein, and that various obvious changes, adaptations, and substitutions are possible, without departing from the scope of the embodiments of the present invention. Therefore, although the embodiments of the present invention have been described in more detail through the above embodiments, the embodiments of the present invention are not limited to the above embodiments, and many other equivalent embodiments may be included without departing from the concept of the embodiments of the present invention, and the scope of the embodiments of the present invention is determined by the scope of the appended claims.

Claims (11)

1. A blank area detection method, comprising:
carrying out edge detection on the video frame image to obtain a corresponding binary image;
detecting straight lines contained in the binary image based on a preset straight line detection algorithm to generate straight line information, wherein the straight line information comprises straight line positions and corresponding straight line lengths;
and scanning the binary image according to a set direction, and determining the first scanning position as a blank area boundary when the number of the edge points of the image obtained when the binary image is scanned to the first scanning position is determined to be less than or equal to the corresponding adaptive threshold and the length of the straight line corresponding to the first scanning position is greater than or equal to the preset length threshold.
2. The blank area detection method according to claim 1, wherein the detecting straight lines included in the binary image based on a preset straight line detection algorithm to generate straight line information comprises:
detecting all straight lines contained in the binary image based on a first preset straight line detection algorithm;
and screening all the detected straight lines to obtain straight line generation straight line information meeting the comparison conditions.
3. The blank region detection method according to claim 2, wherein the detecting all the lines included in the binary image based on the first preset line detection algorithm comprises:
and mapping the binary image represented by the first coordinate space into a second coordinate space representation based on a Hough transform line detection algorithm, and performing line detection on the binary image represented by the second coordinate space to obtain all lines.
4. The blank area detection method according to claim 2, wherein the step of screening all the detected lines to obtain line generation line information meeting the comparison condition comprises:
screening out straight lines which are vertical to the direction of a preset coordinate axis from all the straight lines;
and determining the straight line length of the screened straight line, and storing the straight line position of the screened straight line and the corresponding straight line length to generate straight line information.
5. The blank region detection method according to claim 1, wherein said scanning the binary image in a set direction includes:
and respectively carrying out row-by-row scanning from left to right and/or from right to left on the binary image, and carrying out row-by-row scanning from top to bottom and/or from bottom to top.
6. The blank region detection method according to claim 5, wherein the first scanning position comprises at least one of a left boundary position, a right boundary position, an upper boundary position and a lower boundary position, and the determining the first scanning position as the blank region boundary comprises at least one of:
if the first scanning position is a left boundary position, determining an area from the left boundary position to a left image boundary of the video frame image as a blank area;
if the first scanning position is a right boundary position, determining an area from the right boundary position to a right image boundary of the video frame image as a blank area;
if the first scanning position is an upper boundary position, determining an area from the upper boundary position to an upper image boundary of the video frame image as a blank area;
and if the first scanning position is a lower boundary position, determining an area from the lower boundary position to a lower image boundary of the video frame image as a blank area.
7. The method according to any of claims 1-6, wherein the adaptive threshold is calculated according to the first scanning position and a first predetermined calculation formula or a predetermined function, and the parameters of the first predetermined calculation formula or the predetermined function include a length value, a width value and a calculation weight of the video image.
8. The blank region detection method of claim 1, wherein before performing edge detection on the video frame image to obtain the corresponding binary image, the method comprises:
acquiring video information, and performing video frame extraction processing on the video information to obtain a plurality of video frame images;
after determining the first scanning position as a blank area boundary, further comprising:
and determining the blank area influence score of each video frame image according to the size of the blank area and a second preset formula to obtain the watching experience score of the video information.
9. A blank area detection device is characterized by comprising:
the edge detection module is used for carrying out edge detection on the video frame image to obtain a corresponding binary image;
the line detection module is used for detecting a line contained in the binary image based on a preset line detection algorithm to generate line information, and the line information comprises a line position and a corresponding line length;
and the blank area determining module is used for scanning the binary image according to a set direction, and determining the first scanning position as a blank area boundary when the number of the edge points of the image obtained when the binary image is scanned to the first scanning position is determined to be less than or equal to the corresponding adaptive threshold and the length of the straight line corresponding to the first scanning position is greater than or equal to the preset length threshold.
10. A white space detection apparatus, the apparatus comprising: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the white space detection method of any one of claims 1-8.
11. A storage medium storing computer-executable instructions for performing the white space region detection method of any one of claims 1-8 when executed by a computer processor.
CN202111177775.2A 2021-10-09 2021-10-09 Blank area detection method, device, equipment and storage medium Pending CN114022498A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111177775.2A CN114022498A (en) 2021-10-09 2021-10-09 Blank area detection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111177775.2A CN114022498A (en) 2021-10-09 2021-10-09 Blank area detection method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114022498A true CN114022498A (en) 2022-02-08

Family

ID=80055816

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111177775.2A Pending CN114022498A (en) 2021-10-09 2021-10-09 Blank area detection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114022498A (en)

Similar Documents

Publication Publication Date Title
US10896349B2 (en) Text detection method and apparatus, and storage medium
WO2020140698A1 (en) Table data acquisition method and apparatus, and server
CN110033471B (en) Frame line detection method based on connected domain analysis and morphological operation
CN110210440B (en) Table image layout analysis method and system
CN109598185B (en) Image recognition translation method, device and equipment and readable storage medium
CN104915944A (en) Method and device for determining black margin position information of video
CN112752158A (en) Video display method and device, electronic equipment and storage medium
CN111062331A (en) Mosaic detection method and device for image, electronic equipment and storage medium
CN110708568A (en) Video content mutation detection method and device
CN112419207A (en) Image correction method, device and system
CN111259907A (en) Content identification method and device and electronic equipment
CN110705442A (en) Method for automatically acquiring test paper answers, terminal equipment and storage medium
CN112419275B (en) Image quality determination method, device and system
CN114022498A (en) Blank area detection method, device, equipment and storage medium
CN111683213A (en) Self-adaptive character superposition system and method based on region-of-interest gray level image
CN114418848B (en) Video processing method and device, storage medium and electronic equipment
CN106355172A (en) Character recognition method and device
CN113221742B (en) Video split screen line determining method, device, electronic equipment, medium and program product
CN113850238B (en) Document detection method and device, electronic equipment and storage medium
CN110619597A (en) Semitransparent watermark removing method and device, electronic equipment and storage medium
CN116168192A (en) Image detection area determination method and device, electronic equipment and storage medium
CN111507139A (en) Image effect generation method and device and electronic equipment
CN110674778B (en) High-resolution video image target detection method and device
CN112434696A (en) Text direction correction method, device, equipment and storage medium
CN113361371A (en) Road extraction method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination