Video processing method and device, storage medium and electronic equipment

A video processing and video frame technology, applied in the computer field, can solve the problems of poor video playback effect and poor adaptation effect, etc.

Pending Publication Date: 2022-04-29
TCL通讯科技(成都)有限公司
0 Cites 0 Cited by

AI-Extracted Technical Summary

Problems solved by technology

At present, there is a solution to play the video after the video is performed according to the size of the video frame and the display interface. However, in the current method, there will be areas that are considered to be valid images in the video frame, such a...
View more

Method used

According to formula Ti=D/(K+2)*i, extract a plurality of video frames as video frame samples according to predetermined time intervals from described target video segment, wherein, 0
All video frames in video are zoomed according to unified reference scaling ratio, obtain target video, and target video can make effective picture in the initial video when playing in display interface, and the adaptive display interface of effective picture is effectively avoided in video frame. The playback experience of content with other black borders outside the effective screen is affected.
In this way, based on step S110 to step S150, detect the outline of effective picture in a plurality of video frames in video, by being expanded into the target area that comprises effective picture, when calculating target area video display interface, corresponding video frame zoom Ratio, and fuse the scaling ratio of multiple video frames to determine the unified reference scaling ratio of all video frames in the video. After scaling and processing all video frames based on the reference scaling ratio, the effective picture in the video can be efficiently and accurately adapted to the display interface reliably. , thereby effectively improving the adaptation effect between the video playback and the display interface, and improving the video playback effect.
In this way, based on the video processing device 200, the contour of the effective picture in a plurality of video frames in the video can be detected, by being expanded to include the target ...
View more

Abstract

The invention discloses a video processing method and device, a storage medium and electronic equipment, and relates to the technical field of computers, and the method comprises the steps: obtaining a plurality of video frames from a video as video frame samples, and detecting the contour of an effective picture in each video frame sample; expanding the contour in each video frame sample into a target area containing an effective picture; calculating the scaling of a video frame sample corresponding to each target area when each target area is adapted to a display interface; performing fusion analysis based on the scaling corresponding to each video frame sample, and determining reference scaling of all video frames in the video; and performing scaling processing on video frames in the video according to the reference scaling to obtain a target video adapted to the display interface. According to the invention, the adaptation effect with the display interface during video playing can be improved, and the video playing effect is improved.

Application Domain

Image enhancementImage analysis +2

Technology Topic

EngineeringComputer graphics (images) +2

Image

  • Video processing method and device, storage medium and electronic equipment
  • Video processing method and device, storage medium and electronic equipment
  • Video processing method and device, storage medium and electronic equipment

Examples

  • Experimental program(1)

Example Embodiment

[0028] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, but not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative labor belong to the scope of protection in this application.
[0029] Figure 1 A flowchart of a video processing method according to one embodiment of the present application is schematically shown. The executing body of the video processing method can be any device, such as mobile phones, tablet computers, smart watches and household appliances (such as smart TVs).
[0030] such as Figure 1 As shown, the video processing method may include steps S110 to S150.
[0031] S110, obtaining a plurality of video frames from the video as video frame samples, and detecting the outline of an effective picture in each video frame sample;
[0032] S120, expanding the outline in each video frame sample into a target area containing an effective picture;
[0033] S130, calculating the scaling ratio of the video frame sample corresponding to each target area when each target area is adapted to the display interface;
[0034] S140, performing fusion analysis based on the scaling ratio corresponding to each video frame sample, and determining the reference scaling ratio of all video frames in the video;
[0035] S150, scaling a video frame in the video according to the reference scaling ratio to obtain a target video adapted to the display interface.
[0036] Multiple video frames, that is, at least two video frames, can be extracted from the video as video frame samples according to the extraction strategy. For each video frame sample, an effective picture can be detected, and the effective picture can be a picture whose brightness is higher than a predetermined threshold, such as 0 or 1. For the detected effective picture, the contour of the effective picture in the video frame sample can be detected. For example, when the effective picture is a human body, the contour is the outer contour of the human body.
[0037] The detected contour is usually irregular because the effective picture is irregular, and the contour of the effective picture is also irregular. Each contour is expanded into a target area containing the effective picture. By specifying the style (such as shape) of the target area, the video can be effectively processed according to the target area.
[0038] After each contour is expanded into a target area, the scaling ratio of the video frame sample corresponding to the target area is calculated when the target area is adapted to the display interface, and then the target area in the video frame sample can be effectively adapted to the display interface after scaling the video frame sample according to the scaling ratio, so that the effective picture can also be effectively adapted to the display picture (such as the screen), thus avoiding the influence of other areas outside the target area on display adaptation.
[0039] According to the scaling ratios corresponding to multiple video frame samples, the reference scaling ratio suitable for all video frames in the video can be further determined through fusion analysis, and all video frames in the video can be scaled according to the reference scaling ratio to obtain the target video, which can make the video display interface effective when the target video is played in the display interface.
[0040] In this way, based on steps S110 to S150, the contours of effective pictures in multiple video frames in the video are detected, and the scaling ratio of the corresponding video frames in the video display interface of the target area is calculated by expanding into the target area containing effective pictures, and the unified reference scaling ratio of all video frames in the video is determined by fusing the scaling ratios of multiple video frames. After all video frames are scaled based on the reference scaling ratio, the effective pictures in the video can be efficiently and accurately adapted to the display interface reliably, thereby effectively improving the adaptation between the video and the display interface.
[0041] The following describes the specific process of each step during video processing.
[0042] S110, obtaining a plurality of video frames from the video as video frame samples, and detecting the outline of an effective picture in each video frame sample.
[0043] In one embodiment, refer to Figure 2 In step S110, detecting the outline of the effective picture in each video frame sample includes:
[0044] S111, converting each video frame sample into a grayscale image; S112, binarizing each gray image to obtain a binarized image; S113, extracting at least one contour formed by two types of pixels in each binary image to obtain the contour of the effective picture in each video frame sample.
[0045] Gray-scale digital image is an image with only one sampling color per pixel, which is usually displayed in gray scale from the darkest black to the brightest white. Each video frame sample is loaded into the native layer and converted into the BGR format image required by OpenCV. Then, the BGR format image is grayed out to get the gray image.
[0046]Binary image is an image formed by only two types of pixels (such as two sampled colors). According to the binarization algorithm, the color values of the sampled colors of all pixels in each gray image can be converted into two types (such as black and white), and then a binary image that can distinguish the foreground from the background is formed.
[0047] BINARY processing algorithms such as binary with fixed threshold and OTSU with adaptive threshold are selected. In the fixed threshold algorithm BINARY, the threshold can be set manually. When the color value of a pixel is greater than the threshold, the pixel value takes the maximum threshold, otherwise it is set to 0, and then binarization is completed. OTSU, the adaptive threshold algorithm, can be used in conjunction with BINARY, a fixed threshold algorithm, which can automatically calculate the appropriate segmentation threshold according to the pixel allocation without manual setting.
[0048] After being converted into a binary image, at least one contour formed by two types of pixels in each binary image (that is, the boundary line formed by the foreground area and the background area) can be extracted to obtain the contour of the effective picture in each video frame sample.
[0049] In one embodiment, refer to Figure 2 S113, extracting at least one contour formed by two types of pixels in each binary image to obtain the contour of the effective picture in each video frame sample, including:
[0050] S1131, performing histogram equalization on each binary image to obtain a histogram equalization image; S1132, at least one contour formed by two types of pixels in each histogram equalization image is extracted to obtain the contour of the effective picture in each video frame sample.
[0051] Histogram equalization means broadening the gray scale with more pixels in the binary image, while reducing the gray scale with less pixels, so as to improve the definition of the binary image and obtain the histogram equalization image. The contrast of the histogram equalization image is high, which can improve the accuracy of contour extraction. Among them, we can use the findContours () method of OpenCV open source library to extract all contours in the histogram equalization image, and finally get at least one contour set.
[0052] In one embodiment, refer to Figure 2 S112, binarizing each grayscale image to obtain a binarized image, including S1121, denoising each grayscale image to obtain a denoised image; S1122, binarizing each denoised image to obtain a binarized image.
[0053] Denoising the gray image can prevent the noise in the image from affecting the contour generation, in which the gray image can be filtered by Gaussian filtering, the current pixel in the gray image is taken as the core, the neighboring pixels around the current pixel are weighted by convolution kernel, and the weighted average value is taken as the new value of the current pixel. The accuracy of contour extraction is further improved when the denoised image obtained after denoising is subjected to subsequent processing.
[0054] In one embodiment, in step S110, obtaining a plurality of video frames as video frame samples from a video includes: determining a target video segment from the video; Extracting a plurality of video frames as video frame samples from the target video segment according to a predetermined time interval.
[0055] The target video segment can be specified according to the actual situation. In one example, the target video segment is all the video segments, and in another example, the target video segment is the middle segment of the video. The middle segment, such as the video, is evenly divided into four segments and then two segments in the middle.
[0056] Selecting multiple video frames as video frame samples from the target video segment according to a predetermined time interval can ensure the reliability of processing based on the video frame samples in the subsequent steps.
[0057] In an embodiment, extracting a plurality of video frames from the target video segment at a predetermined time interval as video frame samples comprises:
[0058] According to the formula Ti = d/(k+2) * i, a plurality of video frames are extracted from the target video segment at predetermined time intervals as video frame samples, where 0 < i < = k, k is the number of extracted video frames, i is the number of extracted video frames, d is the duration of the target video segment, and ti is the video time point corresponding to the ith video frame. Based on this formula, the video frame sample is extracted from the target video segment, and the applicant found that it can effectively improve the reliability of the subsequent steps based on the video frame sample.
[0059] S120, expanding the outline in each video frame sample into a target area containing an effective picture.
[0060] In an embodiment, expanding the outline in each video frame sample into a target area containing an effective picture comprises:
[0061] Determining a target contour from the detected contour in each video frame sample; Aiming at the target outline in each video frame sample, expanding the target outline into a rectangular area with the smallest area containing an effective picture to obtain the target area in each video frame sample.
[0062] At least one contour can be detected in each video frame sample, and the current contour can be one selected according to the situation. The target contour is expanded to obtain a rectangular area with the smallest area and effective picture as the target area, and the screen of the effective video matrix and the effective interface can be effective video screens.
[0063] In one embodiment, expanding the target outline into a rectangular area with the smallest area including an effective picture includes: detecting the coordinates of each pixel in the target outline; Determining a minimum abscissa, a maximum abscissa, a minimum ordinate and a maximum ordinate according to the coordinates of each pixel point; Calculating a center coordinate based on the minimum abscissa, the maximum abscissa, the minimum ordinate and the maximum ordinate; Determining an upper left corner pixel point, a lower left corner pixel point, an upper right corner pixel point and a lower right corner pixel point farthest from the central coordinate among the pixel points in the target outline; Forming the rectangular area based on the maximum coordinate values and minimum coordinate values corresponding to the upper left corner pixel, the lower left corner pixel, the upper right corner pixel and the lower right corner pixel.
[0064] consult Figure 3 , by analyzing the pixel point set C in the target contour max The coordinates of each pixel point can be obtained by polygon approximation, and the coordinates of each pixel point include abscissa x and ordinate y, and then the fitted polygon point set DP = {(x, y)} of the contour can be found.
[0065] Traverse the polygon point set DP = {(x, y)}, and you can determine the minimum abscissa, maximum abscissa, minimum ordinate and maximum ordinate according to the coordinates of each pixel point, that is, get to the point set DP = {(x, y)} where X is located. min 、X max 、Y min And y max.
[0066] According to c x =(X max -X min )/2、C y =(Y max -Y min ) /2, the center coordinate of the center point of the target contour can be calculated (C x ,C y )。
[0067] Traverse the polygon point set DP = {(x, y)}, and you can find the off-center coordinates (C x ,C y ) The farthest upper left corner pixel, the lower left corner pixel, the upper right corner pixel and the lower right corner pixel form a point set P = {P i ,0
[0068] If the point set p = {p i There are four points in 0 < = I < 4}, which can traverse the point set p = {p i , 0 < = I < 4}, find the maximum and minimum coordinate values (maximum and minimum coordinate values), and get the point set P = {P. i X in 0 < = I < 4} min 、X max 、Y min And y max. Accord to x in point set p = {pi, 0 < = I < 4} min 、X max 、Y min And y max These four coordinate values construct a symmetrical rectangle, that is, a rectangular area.
[0069] In one embodiment, at least one contour is detected in each video frame sample; Determining the target contour from the detected contours in each of the video frame samples includes: determining the contour with the largest area from at least one contour detected in each of the video frame samples; Determining the contour with the largest area as the target contour.
[0070] See further Figure 3 At least one contour is detected in each video frame sample, and a contour set C can be formed. The contour C with the largest area can be selected by sorting the set C in descending order of contour area. max , the outline c with the largest area max Determine the target contour to further improve the video processing effect.
[0071] S130, calculating the scaling ratio of the video frame sample corresponding to each target area when each target area is adapted to the display interface.
[0072] In one embodiment, the target area is a rectangular area; S130, calculating the scaling ratio of the video frame sample corresponding to each target area when each target area is adapted to the display interface, including:
[0073] Calculating the ratio of the width of each rectangular area to the width of a video frame sample corresponding to each rectangular area to obtain a first ratio corresponding to each video frame sample; Calculating the ratio of the height of each rectangular area to the height of video frame samples corresponding to each rectangular area to obtain a second ratio corresponding to each video frame sample; Taking the smallest ratio of the first ratio and the second ratio corresponding to each video frame sample as the scaling ratio of each video frame sample.
[0074] In this way, that minimum value of the first ratio and the second ratio is taken as the zoom ratio of the correspond video frame sample, so that at least two symmetrical sides of the rectangular area of the video frame sample stick to the edge of the display interface and the effective picture is completely display after the zoom processing.
[0075] Furthermore, in one embodiment, the target area is an arbitrary shape area; S130, calculating the scaling ratio of the video frame sample corresponding to each target area when each target area is adapted to the display interface, including: calculating the first area of each arbitrary shape area and obtaining the number of pixels in the outline of the effective area in each arbitrary shape area; Acquiring a second area of a video frame in the video; Calculating the ratio of the first area and the second area of each arbitrary shape area to obtain the corresponding ratio of each arbitrary shape area; The adjustment coefficient corresponding to the number of pixels in the outline of the effective area in each arbitrary shape area is obtained from the preset adjustment table, and the target value of multiplying the ratio corresponding to each arbitrary shape area by the adjustment coefficient is taken as the scaling ratio of the video frame sample corresponding to each arbitrary shape area.
[0076] In this way, when the applicant finds that it is possible to expand the arbitrary shape area in the video frame sample according to the requirements, it can also effectively adapt the display interface.
[0077] S140, performing fusion analysis based on the scaling ratio corresponding to each video frame sample, and determining the reference scaling ratio of all video frames in the video.
[0078] In one embodiment, step S140 performs fusion analysis based on the scaling ratio corresponding to each video frame sample, and determines the reference scaling ratios of all video frames in the video, including: removing the scaling ratio exceeding a predetermined scaling range from the scaling ratios corresponding to each video frame sample to obtain the remaining scaling ratio; Determining the reference scaling ratios of all video frames in the video based on the remaining scaling ratios.
[0079] The predetermined scale range is a predetermined scale range, for example, 1 ~ 1.3. If the set of scaling ratios corresponding to each video frame sample is r = {r i | 0 < = I < k}, after the scaling ratios exceeding the predetermined scaling range are eliminated, the set R composed of the remaining scaling ratios is obtained. r ={R i |1
[0080] In an embodiment, determining the reference scaling of all video frames in the video based on the remaining scaling includes determining the median of the remaining scaling; And taking the median as a reference scaling ratio of all video frames in the video.
[0081] Sort the remaining scaling ratios, you can choose the scaling ratio in the middle as the median, or take the average of the remaining scaling ratios as the median, and the median as the reference scaling ratio of all video frames in the video can be reliably applied to all video frames in the video.
[0082] S150, scaling a video frame in the video according to the reference scaling ratio to obtain a target video adapted to the display interface.
[0083] All video frames in the video are scaled according to the uniform reference scaling ratio to obtain the target video. When the target video is played in the display interface, the effective picture in the initial video can be well adapted to the display interface, thus effectively avoiding the influence of the playing experience of other black border contents except the effective picture in the video frame.
[0084] In order to better implement the video processing method provided by the embodiment of the application, the embodiment of the application also provides a video processing device based on the video processing method. The meanings of the nouns are the same as those in the above video processing method, and the specific implementation details can refer to the description in the method embodiment. Figure 4 A block diagram of a video processing apparatus according to one embodiment of the present application is shown.
[0085] such as Figure 4 As shown, the video processing device 200 may include a detection module 210, an expansion module 220, a calculation module 230, an analysis module 240 and a processing module 250.
[0086] The detection module 210 can be used to obtain a plurality of video frames from the video as video frame samples, and detect the outline of an effective picture in each of the video frame samples; The expansion module 220 may be used to expand the outline in each of the video frame samples into a target area containing an effective picture; The calculation module 230 can be used to calculate the scaling ratio of the video frame samples corresponding to each target area when each target area is adapted to the display interface; The analysis module 240 can be used to perform fusion analysis based on the scaling ratio corresponding to each video frame sample, and determine the reference scaling ratio of all video frames in the video; The processing module 250 may be used for scaling the video frames in the video according to the reference scaling ratio to obtain a target video adapted to the display interface.
[0087]In some embodiments of the present application, the detection module 210 includes a conversion unit for converting each video frame sample into a grayscale image; A binarization unit for binarizing each gray image to obtain a binarized image; The extraction unit is used for extracting at least one contour formed by two types of pixels in each of the binary images to obtain the contour of the effective picture in each of the video frame samples.
[0088] In some embodiments of the present application, the extraction unit is configured to perform histogram equalization on each of the binary images to obtain histogram equalization images; At least one contour formed by two types of pixels in each histogram equalization image is extracted to obtain the contour of an effective picture in each video frame sample.
[0089] In some embodiments of the present application, the binarization unit is configured to denoise each gray image to obtain a denoised image; And binarizing each denoised image to obtain a binarized image.
[0090] In some embodiments of the present application, the expansion module 220 includes a contour determination unit for determining a target contour from the detected contours in each of the video frame samples; The contour expanding unit is used for expanding the target contour in each video frame sample into a rectangular area with the smallest area, including an effective picture, to obtain the target area in each video frame sample.
[0091] In some embodiments of the present application, the contour expansion unit is configured to: detect the coordinates of each pixel point in the target contour; Determining a minimum abscissa, a maximum abscissa, a minimum ordinate and a maximum ordinate according to the coordinates of each pixel point; Calculating a center coordinate based on the minimum abscissa, the maximum abscissa, the minimum ordinate and the maximum ordinate; Determining an upper left corner pixel point, a lower left corner pixel point, an upper right corner pixel point and a lower right corner pixel point farthest from the central coordinate among the pixel points in the target outline; Forming the rectangular area based on the maximum coordinate values and minimum coordinate values corresponding to the upper left corner pixel, the lower left corner pixel, the upper right corner pixel and the lower right corner pixel.
[0092] In some embodiments of the present application, at least one contour is detected in each video frame sample; The contour determining unit is used for determining the contour with the largest area from at least one contour detected in each video frame sample; Determining the contour with the largest area as the target contour.
[0093] In some embodiments of the present application, the detection module 210 includes a video frame extraction unit, which is used to determine a target video segment from the video; Extracting a plurality of video frames as video frame samples from the target video segment according to a predetermined time interval.
[0094] In some embodiments of the present applicaTion, the video frame extraction unit is configured to extract a plurality of video frames as video frame samples from the target video segment according to the formula ti = d/(k+2) * i, where 0 < i < = k, k is the number of extracted video frames, i is the number of extracted video frames, d is the duration of the target video segment, and ti is the ith one.
[0095] In some embodiments of the present application, the target area is a rectangular area; The calculating module 230 is configured to calculate the ratio of the width of each rectangular area to the width of each video frame sample corresponding to each rectangular area, and obtain the first ratio corresponding to each video frame sample; Calculating the ratio of the height of each rectangular area to the height of video frame samples corresponding to each rectangular area to obtain a second ratio corresponding to each video frame sample; Taking the smallest ratio of the first ratio and the second ratio corresponding to each video frame sample as the scaling ratio of each video frame sample.
[0096] In some embodiments of the present application, the analysis module 240 includes a culling unit, which is used to cull the scaling ratio that exceeds the predetermined scaling range in the scaling ratio corresponding to each video frame sample to obtain the remaining scaling ratio; A scale determination unit, configured to determine the reference scales of all video frames in the video based on the remaining scales.
[0097] In some embodiments of the present application, the ratio determination unit is used to determine the median of the remaining scaling ratios; And taking the median as a reference scaling ratio of all video frames in the video.
[0098] In this way, based on the video processing device 200, it is possible to detect the contours of effective pictures in multiple video frames, calculate the scaling ratio of the corresponding video frames in the video display interface of the target area by expanding them into the target area containing effective pictures, and fuse the scaling ratios of multiple video frames to determine the unified reference scaling ratio of all video frames in the video. After scaling all video frames based on the reference scaling ratio, the effective pictures in the video can be efficiently and accurately adapted to the display interface, thus effectively improving the display interface during video playback.
[0099] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. Actually, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units.
[0100] In addition, the embodiment of the present application also provides an electronic device, which can be a terminal or a server, such as Figure 5 Fig. 3 shows a schematic diagram of the structure of an electronic device according to an embodiment of the present application, specifically:
[0101] The electronic device may include a processor 301 of one or more processing cores, a memory 302 of one or more computer-readable storage media, a power supply 303, an input unit 304 and other components. As will be understood by those skilled in the art, Figure 5 The electronic device structure shown in does not constitute a limitation on the electronic device, and may include more or less components than those shown, or combine some components, or different component arrangements. Among them:
[0102] The processor 301 is the control center of the electronic equipment. It connects all parts of the whole computer equipment with various interfaces and lines, executes various functions of the computer equipment and processes data by running or executing software programs and/or modules stored in the memory 302, and calls the data stored in the memory 302, so as to monitor the electronic equipment as a whole. Optionally, the processor 301 may include one or more processing cores; Preferably, the processor 301 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user pages and application programs, and the modem processor mainly processes wireless communication. It can be understood that the above modem processor may not be integrated into the processor 301.
[0103] The memory 302 can be used to store software programs and modules, and the processor 301 executes various functional applications and data processing by running the software programs and modules stored in the memory 302. The memory 302 can mainly include a storage program area and a storage data area, wherein the storage program area can store an operating system, application programs required by at least one function (such as sound playing function, image playing function, etc.), etc. The storage data area can store data created according to the use of computer equipment, etc. In addition, the memory 302 may include a high-speed random access memory and a nonvolatile memory, such as at least one disk memory device, a flash memory device, or other volatile solid-state memory devices. Accordingly, the memory 302 may also include a memory controller to provide the processor 301 with access to the memory 302.
[0104]The electronic device also includes a power supply 303 that supplies power to various components. Preferably, the power supply 303 can be logically connected to the processor 301 through a power management system, so that the functions of managing charging, discharging, and power consumption management can be realized through the power management system. The power supply 303 may also include one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator and any other components.
[0105] The electronic device may further include an input unit 304, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0106] Although not shown, the electronic device may also include a display unit and the like, which will not be described here. In this specific embodiment, the processor 301 in the electronic device will load the executable files corresponding to the processes of one or more computer programs into the memory 302 according to the following instructions, and the processor 301 will run the computer programs stored in the memory 302, so as to realize various functions in the aforementioned embodiments of this application. For example, the processor 301 can perform the following steps:
[0107] Acquiring a plurality of video frames from a video as video frame samples, and detecting the outline of an effective picture in each video frame sample; Expanding the outline in each video frame sample into a target area containing an effective picture; Calculating the scaling ratio of the video frame sample corresponding to each target area when each target area is adapted to the display interface; Performing fusion analysis based on the scaling ratio corresponding to each video frame sample, and determining the reference scaling ratio of all video frames in the video; Scaling the video frames in the video according to the reference scaling ratio to obtain a target video adapted to the display interface.
[0108] In some embodiments of the present application, when detecting the outline of an effective picture in each of the video frame samples, the processor 301 may perform the following steps: converting each of the video frame samples into a grayscale image; Binarizing each gray image to obtain a binarized image; At least one contour formed by two types of pixels in each binary image is extracted to obtain the contour of the effective picture in each video frame sample.
[0109] In some embodiments of the present application, when extracting at least one contour formed by two types of pixels in each of the binary images to obtain the contour of an effective picture in each of the video frame samples, the processor 301 may perform histogram equalization processing on each of the binary images to obtain a histogram equalization image; At least one contour formed by two types of pixels in each histogram equalization image is extracted to obtain the contour of an effective picture in each video frame sample.
[0110] In some embodiments of the present application, when binarizing each gray-scale image to obtain a binary image, the processor 301 may perform the following steps: denoising each gray-scale image to obtain a denoised image; And binarizing each denoised image to obtain a binarized image.
[0111] In some embodiments of the present application, when expanding the contour in each of the video frame samples into a target area containing an effective picture, the processor 301 may perform the following steps: determining the target contour from the detected contour in each of the video frame samples; Aiming at the target outline in each video frame sample, expanding the target outline into a rectangular area with the smallest area containing an effective picture to obtain the target area in each video frame sample.
[0112] In some embodiments of the present application, when expanding the target outline into a rectangular area with the smallest area including an effective picture, the processor 301 may perform the following steps: detecting the coordinates of each pixel point in the target outline; Determining a minimum abscissa, a maximum abscissa, a minimum ordinate and a maximum ordinate according to the coordinates of each pixel point; Calculating a center coordinate based on the minimum abscissa, the maximum abscissa, the minimum ordinate and the maximum ordinate; Determining an upper left corner pixel point, a lower left corner pixel point, an upper right corner pixel point and a lower right corner pixel point farthest from the central coordinate among the pixel points in the target outline; Forming the rectangular area based on the maximum coordinate values and minimum coordinate values corresponding to the upper left corner pixel, the lower left corner pixel, the upper right corner pixel and the lower right corner pixel.
[0113] In some embodiments of the present application, at least one contour is detected in each video frame sample; When determining the target contour from the contours detected in each of the video frame samples, the processor 301 may perform the following steps: determining the contour with the largest area from at least one contour detected in each of the video frame samples; Determining the contour with the largest area as the target contour.
[0114] In some embodiments of the present application, when obtaining a plurality of video frames from a video as video frame samples, the processor 301 may perform: determining a target video segment from the video; Extracting a plurality of video frames as video frame samples from the target video segment according to a predetermined time interval.
[0115] In some embodiments of the present applicaTion, when extracting a plurality of video frames as video frame samples from the target video segment at a predetermined time interval, the processor 301 may perform the following steps: extracting a plurality of video frames as video frame samples from the target video segment at a predetermined time interval according to the formula ti = d/(k+2) * i, where 0 < i < = k, k is the number of extracted video frames, and i is the number of extracted video frames.
[0116] In some embodiments of the present application, the target area is a rectangular area; When calculating the scaling ratio of the video frame samples corresponding to each target area when each target area is adapted to the display interface, the processor 301 can perform the following steps: calculating the ratio of the width of each rectangular area to the width of the video frame samples corresponding to each rectangular area to obtain the first ratio corresponding to each video frame sample; Calculating the ratio of the height of each rectangular area to the height of video frame samples corresponding to each rectangular area to obtain a second ratio corresponding to each video frame sample; Taking the smallest ratio of the first ratio and the second ratio corresponding to each video frame sample as the scaling ratio of each video frame sample.
[0117] In some embodiments of the present application, when the fusion analysis is performed based on the scaling ratio corresponding to each video frame sample to determine the reference scaling ratios of all video frames in the video, the processor 301 may perform the following steps: removing the scaling ratio exceeding the predetermined scaling range from the scaling ratios corresponding to each video frame sample to obtain the remaining scaling ratio; Determining the reference scaling ratios of all video frames in the video based on the remaining scaling ratios.
[0118] In some embodiments of the present application, when determining the reference scaling of all video frames in the video based on the remaining scaling, the processor 301 may perform: determining the median of the remaining scaling; And taking the median as a reference scaling ratio of all video frames in the video.
[0119] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by a computer program, or related hardware can be controlled by a computer program, which can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0120] Therefore, the embodiment of the present application also provides a storage medium in which a computer program is stored, and the computer program can be loaded by a processor to execute the steps in any method provided by the embodiment of the present application.
[0121] The storage medium may include Read Only Memory (ROM), Random Access Memory (RAM), magnetic disk or optical disk, etc.
[0122]Since the computer program stored in the storage medium can execute the steps of any method provided by the embodiment of the present application, the beneficial effects of the method provided by the embodiment of the present application can be realized. Please refer to the previous embodiment for details, and repeat them here.
[0123] Those skilled in the art will easily think of other embodiments of this application after considering the specification and practicing the embodiments disclosed herein. This application is intended to cover any variations, uses or adaptations of this application, which follow the general principles of this application and include common knowledge or common technical means in the technical field not disclosed in this application.
[0124] It should be understood that this application is not limited to the embodiments described above and shown in the drawings, but various modifications and changes can be made without departing from the scope thereof.

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products