Image interception method, electronic equipment and storage medium
By combining time interval and color analysis methods during video interception, the effective image of the video is determined, which solves the problem of interception ineffective images and improves the effectiveness and accuracy of image interception.
Patent Information
- Application Number
- CN202410944980.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-11-15
AI Technical Summary
In the prior art, when intercepting video images, it is difficult to avoid intercepting invalid images, especially when the data volume is large or the image information is complex, resulting in the intercepted image containing a large number of invalid images, affecting effectiveness.
By obtaining the intercepting time interval of the video, the intercepting image is intercepted, and the intercepting image is analyzed based on the color value interval, the target intercepting image is determined, and the intercepting image is avoided and the effectiveness of intercepting is improved.
Ensure that the intercepted images are valid images, avoid intercepting invalid images, and improve the effectiveness and accuracy of image intercepting.
Smart Images

Figure CN118972503A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image capture, and more specifically, to an image capture method, electronic device and storage medium in image capture. Background Art
[0002] In the prior art, when identifying and intercepting video content, image interception is usually performed through the time dimension; however, if the video data volume is large or the image information of the video is complex, the intercepted image will contain a large number of invalid images; therefore, how to avoid intercepting invalid images when intercepting videos and improve the effectiveness of image interception is a problem that needs to be solved at present. Summary of the invention
[0003] The present application provides an image capture method, an electronic device and a storage medium. The method can avoid capturing invalid images when capturing images of a video, thereby improving the effectiveness of image capture.
[0004] In a first aspect, an image capture method is provided, the method comprising:
[0005] Get the time interval between the target video and the target video;
[0006] Intercepting the target video based on the interception time interval to obtain an intercepted image of the target video;
[0007] Partitioning the color values corresponding to the target video to determine a plurality of color value intervals; wherein the plurality of color value intervals are associated with a color mode corresponding to the target video;
[0008] Performing color analysis on the captured image based on the color value interval, determining a target captured image in the captured image; and outputting the target captured image.
[0009] In an embodiment of the present application, an image of a target video is captured based on a capture time interval to obtain a captured image, and a color analysis is performed on the captured image based on multiple color value intervals to determine a target captured image in the captured image; since the color value interval is determined by partitioning the color value corresponding to the target video, the color analysis is performed on the captured image based on multiple color value intervals; that is, the validity of the captured image can be determined by the distribution of the color value of the captured image in multiple color value intervals; compared with the prior art that captures images through the time dimension; this scheme captures the target video based on the two dimensions of capture time interval and color analysis; ensures that the captured target captured image is a valid image; in addition, since the color analysis is performed through the divided color value intervals; therefore, the valid image in the captured image can be determined more accurately; avoids capturing invalid images, thereby improving the validity of image capture.
[0010] In combination with the first aspect, in some implementations of the first aspect, performing color analysis on the captured images based on the color value interval to determine the target captured image in the captured images includes:
[0011] Determine a target intercepted image in the intercepted image based on the proportion of the color value of the pixel points in the intercepted image in the color value interval; or,
[0012] Based on the target number of target color value intervals corresponding to the pixels in the captured image, a target captured image in the captured image is determined; wherein the target color value interval is a color value interval in which the color values of the pixels in the captured image are located.
[0013] In an embodiment of the present application, when performing color analysis on a captured image, in one case, a target captured image in the captured image is determined based on the proportion of the color value of the pixel points in the captured image in the color value interval; since the color value interval is determined by partitioning the color value corresponding to the target video; therefore, the validity of the captured image of the target video can be reflected by the proportion of the color value of the pixel points in the captured image in the color value interval. In another case, based on the target number of target color value intervals corresponding to the pixel points in the captured image; since the target color value interval is the color value interval where the color value of the pixel points in the captured image is located; therefore, the validity of the captured image is reflected by the number of target color value intervals; and according to the validity of the captured image, the target captured image is determined.
[0014] In combination with the first aspect and the above implementation manner, in some implementation manners of the first aspect, determining a target intercepted image in the intercepted image based on a proportion of color values of pixels in the intercepted image in a color value interval includes:
[0015] If the proportion of the color value of the pixel point in the captured image in each color value interval is less than a first preset threshold, determining that the captured image is a target captured image;
[0016] If the proportion of the color value of the pixel points in the captured image in the first preset color value interval is greater than the second preset threshold and less than the first preset threshold, the captured image is determined to be the target captured image; wherein the first preset color value interval is a color value interval among multiple color value intervals.
[0017] In an embodiment of the present application, when determining a target captured image based on the proportion of the color value of a pixel in a color value interval, if the proportion of the color value of the pixel in each color value interval is less than a first preset threshold value, it indicates that the pixel of the captured image is located in at least two color value intervals, that is, the captured image is not a single-color image (for example, a black image), and therefore, the captured image is determined to be a target captured image. If the proportion of the color value of the pixel in the first preset color value interval is greater than the second preset threshold value and less than the first preset threshold value, it indicates that the color value of the captured image in the first preset color value interval accounts for a significant proportion, and the captured image is not a single-color image; and the captured image is determined to be a target captured image.
[0018] In combination with the first aspect and the above implementations, in some implementations of the first aspect, the following further includes:
[0019] Determine the main color tone information of the target video based on the video content of the target video
[0020] Based on the main color tone information, a first preset color value interval is determined.
[0021] In an embodiment of the present application, based on the video content of the target video, the main color tone information of the target video is determined; and based on the main color tone information, the first preset color value interval is determined; because the main color tone information can reflect the main color information of the target video; if the color value of the captured image is more similar to the main color tone information, the effectiveness of the captured image is better; therefore, the first preset color value interval determined based on the main color tone information of the target video can be used to determine the effectiveness of image capture.
[0022] In combination with the first aspect and the above implementation manner, in some implementation manners of the first aspect, determining a target intercepted image in the intercepted image based on the target number of target color value intervals corresponding to the pixel points in the intercepted image includes:
[0023] determining a target number of target color value intervals in the color value interval;
[0024] If the number of targets is greater than a third preset threshold, the captured image is determined to be a target captured image.
[0025] In an embodiment of the present application, when determining a target captured image in a captured image based on the target number of the target color value interval, if the target number of the target color value interval is greater than a third preset threshold, the captured image is determined to be a target captured image; since the target color value interval is the color value interval in which the color values of the pixels in the captured image are located; if the number of target color value intervals is greater, the color of the captured image is richer, that is, the effectiveness of the captured image is better; therefore, if the number of targets in the target color value interval is greater than the third preset threshold, the captured image is determined to be a target captured image.
[0026] In combination with the first aspect and the foregoing implementations, in some implementations of the first aspect, obtaining a target video includes:
[0027] If the target video is a real-time video, the real-time video stream is obtained through the properties of the media stream component and the video tag; wherein the properties of the video tag include the video address of the target video;
[0028] If the target video is a video other than a real-time video, the target video is obtained through the attributes of the video tag.
[0029] In an embodiment of the present application, if the target video is a real-time video, it is impossible to directly obtain all the video content; therefore, the real-time video stream is obtained through the attributes of the media stream component and the video tag. If the target video is a video other than the real-time video, it means that the target video is a non-real-time video; therefore, the target video is directly obtained through the attributes of the video tag.
[0030] In combination with the first aspect and the above implementations, in some implementations of the first aspect, the following further includes:
[0031] Update the capture time interval of the target video;
[0032] The target video is intercepted based on the interception time interval to obtain an intercepted image of the target video, including:
[0033] The target video is image-captured based on the updated capture time interval to obtain a captured image of the target video.
[0034] In an embodiment of the present application, the capture time interval of the target video is updated, and when the target video is captured, the target video is captured according to the updated capture time interval; ensuring that the capture time interval can be adjusted according to demand when the target video is captured.
[0035] In combination with the first aspect and the above implementations, in some implementations of the first aspect, the following further includes:
[0036] Determine the number of invalid images detected continuously in the target video; wherein the invalid image is an image other than the target intercepted image in the intercepted image;
[0037] Update the capture time interval of the target video, including:
[0038] If the number of invalid images is greater than a preset number, the capture time interval of the target video is updated.
[0039] In an embodiment of the present application, the number of invalid images detected continuously in a target video is determined; if the number of invalid images detected continuously is greater than a preset number, the capture time interval of the target video is updated; since the number of invalid images detected is greater than the preset number, it indicates that the image validity of the current time period of the target video is low; therefore, the capture time interval of the target video is updated, and the capture of invalid images is skipped; thereby improving the efficiency of image capture and color analysis.
[0040] In combination with the first aspect and the above implementations, in some implementations of the first aspect, the following further includes:
[0041] Divide the target video into at least two video segments;
[0042] The target video is intercepted based on the interception time interval to obtain an intercepted image of the target video, including:
[0043] Based on the capture time interval and the timestamp information of the at least two video segments, image capture is performed on each of the at least two video segments at the same time to obtain a captured image of each of the at least two video segments.
[0044] In an embodiment of the present application, a target video is divided into at least two video segments; when image capture is performed on the target video, image capture is performed on each of the at least two video segments at the same time based on a capture time interval; since the process of image capture on each of the at least two video segments is performed simultaneously, the efficiency of image capture can be improved.
[0045] In combination with the first aspect and the above implementations, in some implementations of the first aspect, the following further includes:
[0046] generating an analysis result of the target intercepted image based on the timestamp information of the target intercepted image and the number of the target intercepted images;
[0047] Output the analysis results of the target captured image.
[0048] In an embodiment of the present application, after the target video is image captured, an analysis result of the target captured image is generated based on the timestamp information of the target captured image and the number of target captured images, and the analysis result is output; ensuring that the user can obtain the analysis result of the target captured image in a timely manner, thereby improving the user experience.
[0049] In a second aspect, an image capture device is provided, the device comprising:
[0050] An acquisition module, used to acquire the time interval between the target video and the interception time of the target video;
[0051] An interception module is used to intercept the target video based on the interception time interval to obtain the intercepted image of the target video;
[0052] A first determination module is used to partition the color values corresponding to the target video to determine a plurality of color value intervals; wherein the plurality of color value intervals are associated with a color mode corresponding to the target video;
[0053] The second determination module is used to perform color analysis on the captured image based on the color value interval, determine the target captured image in the captured image, and output the target captured image.
[0054] In a third aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, so that the electronic device executes the method in the above-mentioned first aspect or any possible implementation of the first aspect.
[0055] In a fourth aspect, a computer program product is provided, comprising: a computer program code, which, when executed on a computer, enables the computer to execute the method in the first aspect or any possible implementation of the first aspect.
[0056] In a fifth aspect, a computer-readable storage medium is provided, which stores a computer program code. When the computer program code runs on a computer, the computer executes the method in the above-mentioned first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 This is a schematic diagram of a scenario provided by an embodiment of the present application;
[0058] Figure 2 This is a schematic diagram of the distribution of image pixels provided in an embodiment of the present application;
[0059] Figure 3 is another schematic diagram of the distribution of image pixels provided in an embodiment of the present application;
[0060] Figure 4 is a schematic flow chart of an image capture method provided in an embodiment of the present application;
[0061] Figure 5 is a schematic flow chart of another image capture method provided in an embodiment of the present application;
[0062] Figure 6 is a structural schematic diagram of an image capture device provided in an embodiment of the present application;
[0063] Figure 7It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0064] The technical solution in the present application will be described clearly and in detail below in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B: "and / or" in the text is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.
[0065] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.
[0066] Figure 1 It is a schematic diagram of a scenario provided in an embodiment of the present application.
[0067] For example, Figure 1 The scene 100 shown is a display interface of a terminal device, wherein the terminal device is a device for playing videos and capturing video images. For example, the terminal device includes but is not limited to mobile phones, tablets, computers and other devices.
[0068] For example, when the terminal device is playing a video, when the user clicks on the video image capture, the currently playing video will be captured and the captured image will be output; the user can quickly understand the content of the video through the output captured image.
[0069] It should be noted that when capturing an image of a video, you can click on the video playback interface to capture the image, such as Figure 1 As shown in the scene 100 in FIG. 1 , it is also possible to directly capture the image of the selected video without entering the video playback interface. The above is an example of the display interface of the terminal display device, and this application does not limit this.
[0070] In the prior art, when capturing images from a video, the image capture is usually performed through the time dimension; that is, the image capture is performed at preset time intervals, starting from the start time of the video, and capturing an image at regular intervals; for example, an image is captured every 3 seconds until the required number of images are captured, or the entire video is traversed, and finally an image set containing multiple images is output.
[0071] However, if the video data volume is large or the image information of the video is complex, the captured image will contain a large number of invalid images; for example, pure black images or pure white images when transition scenes appear in the video; therefore, how to avoid capturing invalid images when capturing images from the video and improve the effectiveness of image capture is a problem that needs to be solved at present.
[0072] In view of this, the present application provides an image capture method, an electronic device and a storage medium. Through the embodiments of the present application, after capturing an image of a target video based on a capture time interval and obtaining a captured image, a color analysis is performed on the captured image based on a color value interval to determine the target captured image in the captured image, thereby ensuring that the validity of the captured image can be determined by the distribution of the color value of the captured image in multiple color value intervals; avoiding the capture of invalid images, thereby improving the validity of image capture.
[0073] Combine the following Figures 2 to 4 The image capture method provided in the embodiment of the present application is described in detail.
[0074] Figure 2 This is a schematic diagram of the distribution of image pixels provided in an embodiment of the present application.
[0075] Exemplarily, the validity of an image is determined based on the distribution of image pixels; based on the validity of the image, the image is divided into a valid image and an invalid image. The following describes how to determine the validity of an image based on the distribution of image pixels.
[0076] For example, if there are only pixels of a single color or pixels of similar colors in an image, it indicates that the image is a pure color image. Figure 2 As shown in (a) in the figure, if all the pixels in the image are white, the image has no practical meaning. Figure 2 The image shown in (a) is an invalid image.
[0077] Exemplarily, if there are at least two colors of pixels in the image, and the proportion of pixels of each color to the total pixels of the image is less than a first preset threshold; for example, the proportion is less than 95% of the total pixels; it means that the image is not a single-color image, and therefore, the image is determined to be a valid image.
[0078] like Figure 2 As shown in (b), the image includes two colors of pixels; the proportion of black pixels to the total pixel points of the image is 8%, and the proportion of white pixels to the total pixel points is 92%, both of which are less than the preset ratio threshold, then it is determined Figure 2 The image shown in (b) is a valid image.
[0079] Figure 3This is another schematic diagram of the distribution of image pixels provided in an embodiment of the present application.
[0080] Exemplarily, according to the distribution of pixels of different color values in the image, the valid images are divided into valid frames, meaningful frames and wonderful frames; different categories of valid images are described in detail below.
[0081] Among them, a valid frame is an image in which the proportion of pixels of a single color or similar colors to the total pixels is less than a first preset threshold, and the image frame is considered a valid frame; for example, a pure black or pure white image has no practical meaning and should be considered invalid. A valid frame usually refers to an image with good image quality and actual content. Figure 2 As shown in (a) in .
[0082] Exemplarily, a meaningful frame is a frame defined based on color partitioning and pixel distribution. When capturing an image of a video, the main color tone information of the video is identified based on the video content; and the color value interval corresponding to the main color tone information is determined. If the pixel points of the captured image conform to the color value interval corresponding to the main color tone information, and are greater than the second preset threshold (for example, 40% of the total pixels) but less than the first preset threshold of the valid frame (less than 95%), it means that the captured image is consistent with the main color tone of the video; therefore, the image is determined to be a meaningful frame. Meaningful frames usually contain more important visual information, which is used for content analysis and key information extraction.
[0083] For example, Figure 3 As shown in (a), if the color value corresponding to gray is within the color value interval corresponding to the main color tone and accounts for 46%, which is greater than the second preset threshold and less than the first preset threshold, it means that the image is a meaningful frame in the valid image.
[0084] Exemplarily, a wonderful frame refers to a frame in a video that is rich in color and has great visual differences. This type of image frame is usually more visually attractive and is often seen at climaxes or important moments in a video. It is determined by analyzing the diversity and difference of the color blocks of the pixels; if the number of color intervals corresponding to the pixels in the image is more, the image has richer colors; when the number of color value intervals corresponding to the pixels is greater than a third preset threshold, the image is a wonderful frame.
[0085] It should be noted that Figure 2 and Figure 3 This is an example to illustrate the distribution of image pixels, and this application does not limit this.
[0086] Figure 4 It is a schematic flow chart of an image capture method provided in an embodiment of the present application.
[0087] For example, Figure 4The image capture method 400 shown may be executed by a terminal device; or executed by a processor of the terminal device.
[0088] like Figure 4 As shown, the image interception method 400 includes S410 to S440, and S410 to S440 are described in detail below.
[0089] S410, obtaining a time interval between captures of a target video and a target video.
[0090] The target video refers to the video from which images are captured; and the capture time interval refers to the time interval between each captured image when the target video is captured.
[0091] Exemplarily, when acquiring the target video, if the target video is a real-time video, the real-time video stream is acquired through the attributes of the media stream component and the video tag; wherein the attributes of the video tag include the video address of the target video; if the target video is a video other than a real-time video, the target video is acquired through the attributes of the video tag.
[0092] For example, real-time video uses video streaming technology with almost no delay, allowing remote participants to interact instantly like face-to-face communication. In real-time video, the video signal is compressed and sent immediately over the network, and the receiving end decompresses and displays it at the same time, with a short delay, usually within a few hundred milliseconds, to ensure interactivity. Real-time video includes: live video, video conferencing, remote monitoring, online education, etc.
[0093] Among them, live video refers to live content that viewers can watch and participate in interactions in real time, such as e-sports live broadcasts, concert live broadcasts, sports event live broadcasts, etc.; video conferencing refers to video calls between multiple people via the Internet, which is common in areas such as corporate collaboration and remote work; remote monitoring refers to real-time video streaming through security cameras, which is used to monitor and record on-site conditions in real time; online education refers to real-time video teaching between teachers and students, which can achieve interactive Q&A and demonstrations.
[0094] For example, if the target video is a real-time video, the real-time video stream is obtained through the properties of the media stream component (MediaStream) and the video tag; wherein the media stream component is used to obtain the real-time video stream, and the video tag is used to embed a media player in the interface; by setting the properties of the video tag, the address of the video to be played and the width, height, sound, etc. of the video when it is played can be determined. If the target video is a video other than a real-time video (for example, a video on demand), the target video is directly obtained through the properties of the video tag.
[0095] It should be noted that the difference between real-time video and on-demand video lies in the real-time nature of the video; real-time video exists in the form of a live media stream and is usually not directly stored as a physical file; after the real-time video ends, it cannot be watched again if it is not recorded; on-demand video refers to video that is stored in advance in a server or cloud storage in the form of a physical file and can be repeatedly played and downloaded at any time; users choose to watch content according to their own schedule and do not need to follow a specific time; for example, real-time video includes: live video, video conferencing, remote monitoring, online classes, etc.; on-demand video includes: movies, TV series, documentaries, educational training courses, etc.
[0096] In an embodiment of the present application, if the target video is a real-time video, it is impossible to directly obtain all the video content; therefore, the real-time video stream is obtained through the attributes of the media stream component and the video tag. If the target video is a video other than the real-time video, it means that the target video is a non-real-time video; therefore, the target video is directly obtained through the attributes of the video tag.
[0097] S420, capturing an image of the target video based on a capture time interval to obtain a captured image of the target video.
[0098] Exemplarily, images of the target video are captured based on a capture time interval; for example, the capture time interval is 2 seconds; if the timing starts from capturing the first captured image, the second captured image is captured at the 2nd second, the third captured image is captured at the 4th second, and so on, according to the capture time interval; that is, the capture time interval is the time interval between two adjacent captured images.
[0099] In one implementation, the capture time interval of the target video is updated; and the image of the target video is captured based on the updated capture time interval to obtain a captured image of the target video.
[0100] Exemplarily, when capturing the target video, the time interval may be updated; if an update of the time interval is detected, the target video is captured based on the updated time interval.
[0101] For example, in the initial stage, the capture time interval is 2 seconds, and the timing starts from the capture of the first captured image. According to the capture time interval, the second captured image is captured at the 2nd second, the third captured image is captured at the 4th second, and the fourth captured image is captured at the 6th second. If the capture time interval is updated after the fourth captured image is captured, the updated capture time interval is 4 seconds. Based on the updated capture time interval, the 5th captured image is captured at the 10th second, and the 6th captured image is captured at the 14th second.
[0102] It should be noted that the above is an example of the interception time interval, and this application does not make any specific limitation on this.
[0103] In an embodiment of the present application, the capture time interval of the target video is updated, and when the target video is captured, the target video is captured according to the updated capture time interval; ensuring that the capture time interval can be adjusted according to demand when the target video is captured.
[0104] The following is a further description of an embodiment of updating the interception time interval.
[0105] Exemplarily, the number of invalid images detected continuously in the target video is determined; wherein the invalid images are images other than the target captured images in the captured images; if the number of invalid images is greater than a preset number, the capture time interval of the target video is updated.
[0106] For example, an invalid image refers to an image that only has pixels of a single color, or pixels of similar colors; that is, an invalid image refers to an image of pure color and no practical meaning; for example, a pure white image, a pure black image, etc.; Figure 2 The image shown in (a) in .
[0107] Exemplarily, if multiple invalid images are detected continuously in the target video, the number of invalid images is determined. If the number of invalid images is greater than a preset number, it means that there are more invalid images in the video segment currently undergoing image capture, and the image validity in the current video segment is low; therefore, the target captured image is updated; thereby skipping invalid images and reducing invalid images in the captured images.
[0108] Optionally, when updating the interception time interval, the interception time interval may be gradually increased according to the validity of the intercepted images. That is, if after updating the interception time interval, the number of invalid images continuously intercepted is greater than a preset number, the interception time interval is updated again.
[0109] For example, the initial capture time interval is 2 seconds, and the preset number is 5. If, when capturing images of the target video, 5 consecutive captured images are invalid images, the capture time interval is updated to 4 seconds. The target video is continued to be captured according to the updated capture time interval. If 5 consecutive captured images are invalid images, the capture time interval is updated again to 6 seconds, and the target video is captured based on the 6-second capture time interval.
[0110] It should be noted that the above are examples of the interception time interval, the preset number and the updated interception time interval, and this application does not make any specific limitations on this.
[0111] It should be understood that the interception time interval and the updated time interval can be set by the user. If the user's setting operation on the interception time interval is detected, the interception is performed according to the interception time interval set by the user.
[0112] Optionally, when capturing a target video, the time information of two adjacent target captured images in the target video can be used to determine the time difference between the two adjacent target captured images; the video playback speed can be adjusted according to the time difference; if the time difference is greater than the preset time difference, the target video can be accelerated.
[0113] In an embodiment of the present application, the time difference between adjacent target captured images in the target video is determined. If the time difference is greater than the preset time difference, it means that the number of valid images (target captured images) in the current target video is small; therefore, the target video is accelerated; thereby improving the efficiency of capturing the target video.
[0114] In an embodiment of the present application, the number of invalid images detected continuously in a target video is determined; if the number of invalid images detected continuously is greater than a preset number, the capture time interval of the target video is updated; since the number of invalid images detected is greater than the preset number, it indicates that the image validity of the current time period of the target video is low; therefore, the capture time interval of the target video is updated, and the capture of invalid images is skipped; thereby improving the efficiency of image capture and color analysis.
[0115] In one implementation, the target video is divided into at least two video segments; based on the capture time interval and the timestamp information of the at least two video segments, an image of each of the at least two video segments is captured simultaneously to obtain a captured image of each of the at least two video segments.
[0116] Exemplarily, the target video is divided into multiple video segments, and when the target video is intercepted, images of each of the multiple video segments are intercepted at the same time based on the interception time interval; that is, the target video is intercepted and color analyzed by a parallel processing method. For example, if the target video is a 45-minute video, the target video is divided into three 15-minute video segments; when the video is intercepted, images of the three video segments are intercepted at the same time.
[0117] It should be noted that when dividing the target video into multiple video segments, it is necessary to ensure that the target video is a video other than the real-time video, that is, ensure that the target video is a video on demand, or a video file after recording the real-time video.
[0118] In a possible implementation, a binary search method may be used for image capture; when determining the key content that may exist in a video, the binary search method is used to quickly locate the target image for capture, which is suitable for long videos or scenarios that require precise analysis; for example, based on the duration information of the target video, the target video is divided into two video segments; the video segment containing the key content in the two video segments is determined; and the video segment containing the key content is divided again; the above steps are repeated in the remaining video segments until the key content in the target video is determined.
[0119] In an embodiment of the present application, a target video is divided into at least two video segments; when image capture is performed on the target video, image capture is performed on each of the at least two video segments at the same time based on a capture time interval; since the process of image capture on each of the at least two video segments is performed simultaneously, the efficiency of image capture can be improved.
[0120] S430, partitioning the color values corresponding to the target video to determine a plurality of color value intervals.
[0121] Among them, multiple color value intervals are associated with the color mode corresponding to the target video.
[0122] Exemplarily, the color modes include: RGB mode, HSB mode, grayscale mode, YUV mode, etc.; several color modes are described below respectively.
[0123] Among them, the RGB mode is divided into three color channel values, which are the values of the three basic tones of red (R), green (G) and blue (B). For example, the RGB of dark gray is (79,79,79), and the RGB of light gray is (156,156,156). HSB mode stands for hue, saturation and brightness; hue refers to the type of color, saturation refers to the purity or intensity of the color, and brightness refers to the lightness or darkness of the color. HSB mode is closer to the human eye's perception of color; grayscale mode only uses different gray levels to represent the image, without color information; in a grayscale image, the value of each pixel represents a brightness level from pure black (0) to pure white (255). YUV mode is mainly used for television and video signal processing. Y stands for luminance, and U and V stand for chrominance, that is, color information. This mode can reduce the bandwidth requirements of color video signals while maintaining image quality.
[0124] It should be noted that different color modes have different ways of expressing colors; the following description will be given using the RGB color mode as an example.
[0125] For example, by setting a color value threshold, if the difference between two colors in the three channels of R, G, and B is within the color value threshold, they are determined to be the same or similar colors; according to this standard, the entire RGB space is divided into multiple small cube areas according to the color value threshold, and each cube represents a color value interval; for example, if the color value threshold is 50, the size of each color value interval is 50×50×50.
[0126] It should be noted that the above is a description of the distance for dividing the color value intervals, and this application does not limit this.
[0127] Exemplarily, the color values corresponding to the target video are partitioned to determine multiple color value intervals; that is, multiple colors existing in the target video are determined; each color corresponds to a color value interval; for example, red is a type of color, and the corresponding color value interval is R value in the interval (205, 255), G value and B value in the interval (0, 50); if the color value of the color is within this color value interval, then the color is determined to be red.
[0128] S440, performing color analysis on the captured image based on the color value interval, determining a target captured image in the captured image, and outputting the target captured image.
[0129] In one implementation, the color analysis of the captured images based on the color value interval to determine the target captured image in the captured images includes:
[0130] Based on the proportion of the color values of the pixels in the captured image in the color value interval, the target captured image in the captured image is determined; or, based on the target number of the target color value interval corresponding to the pixels in the captured image, the target captured image in the captured image is determined; wherein the target color value interval is the color value interval in which the color values of the pixels in the captured image are located.
[0131] Exemplarily, when determining the target captured image, in one case, the target captured image in the captured image is determined based on the proportion of the color value of the pixel points in the captured image in the color value interval; in another case, the target captured image in the captured image is determined based on the number of targets in the target color value interval corresponding to the pixel points in the captured image; these two cases are described in detail below.
[0132] Case 1: Based on the proportion of the color value of the pixel points in the captured image in the color value range, the target captured image in the captured image is determined.
[0133] In one implementation, the above-mentioned determining the target intercepted image in the intercepted image based on the proportion of the color value of the pixel point in the intercepted image in the color value interval includes:
[0134] If the proportion of the color value of the pixel point in the captured image in each color value interval is less than a first preset threshold, determining that the captured image is a target captured image;
[0135] If the proportion of the color value of the pixel points in the captured image in the first preset color value interval is greater than the second preset threshold and less than the first preset threshold, the captured image is determined to be the target captured image; wherein the first preset color value interval is a color value interval among multiple color value intervals.
[0136] Exemplarily, if the proportion of the color value of the pixel points in each color value interval in the captured image is less than the first preset threshold, that is, the proportion of the pixel points in each color value interval in the total pixel points of the captured image is less than the first preset threshold, it means that there are at least two colors in the captured image; that is, the captured image is not an invalid image of a single color, and therefore, the captured image is determined to be the target captured image, such as Figure 2 The image shown in (b).
[0137] For example, the first preset threshold is 95%. If there are two color value intervals in the captured image, namely the color value interval corresponding to white and the color value interval corresponding to black; if it is detected that the proportion of pixels of the two colors is less than 95%; then the captured image is determined to be the target captured image.
[0138] Exemplarily, if the proportion of the color value of the pixel points in the captured image in the first preset color value interval is greater than the second preset threshold and less than the first preset threshold; it means that the distribution of the pixels in the captured image in the first preset color value interval is more significant; wherein the first preset color value interval is the color value interval corresponding to the main color tone information; if the pixel points of the captured image conform to the color value interval corresponding to the main color tone information, and are greater than the second preset threshold (for example, greater than 40%) but less than the first preset threshold (for example, less than 95%), it means that the captured image is consistent with the main color tone of the video; therefore, the captured image is determined to be the target captured image.
[0139] It should be noted that the above is an example of the color value range of the captured image, the first preset threshold and the second preset threshold, and the present application does not limit this.
[0140] In an embodiment of the present application, when determining a target captured image based on the proportion of the color value of a pixel in a color value interval, if the proportion of the color value of the pixel in each color value interval is less than a first preset threshold value, it indicates that the pixel of the captured image is located in at least two color value intervals, that is, the captured image is not a single-color image (for example, a black image), and therefore, the captured image is determined to be a target captured image. If the proportion of the color value of the pixel in the first preset color value interval is greater than the second preset threshold value and less than the first preset threshold value, it indicates that the color value of the captured image in the first preset color value interval accounts for a large proportion, and the captured image is not a single-color image; and the captured image is determined to be a target captured image.
[0141] In one implementation, the method further includes: determining main color tone information of the target video based on the video content of the target video; and determining a first preset color value interval based on the main color tone information.
[0142] Exemplarily, when determining the first preset color value interval, it is determined according to main color tone information corresponding to the video content of the target video.
[0143] Optionally, the color interval with the highest frequency of occurrence can be determined based on the distribution of different color intensities in the color histogram of the target video, and the color interval with the highest frequency of occurrence can be used as the first preset color value interval; or, the main color tone information of the target video can be determined based on the average color of the video frames in the target video.
[0144] In an embodiment of the present application, based on the video content of the target video, the main color tone information of the target video is determined; and based on the main color tone information, the first preset color value interval is determined; because the main color tone information can reflect the main color information of the target video; if the color value of the captured image is more similar to the main color tone information, the effectiveness of the captured image is better; therefore, the first preset color value interval determined based on the main color tone information of the target video can be used to determine the effectiveness of image capture.
[0145] Case 2: Determine a target intercepted image in the intercepted image based on the target number of target color value intervals corresponding to the pixels in the intercepted image.
[0146] In one implementation, the step of determining the target intercepted image in the intercepted image based on the target number of target color value intervals corresponding to the pixels in the intercepted image includes:
[0147] Determine the target number of the target color value interval in the color value interval; if the target number is greater than a third preset threshold, determine that the captured image is the target captured image.
[0148] Exemplarily, the target number of target color value intervals corresponding to pixels in the captured image is determined; wherein the target color value interval is the color value interval in which the color values of the pixels in the captured image are located; the target number of target color value intervals is used to indicate the types of colors in the captured image; if the target number of target color value intervals is greater, the colors of the captured image are richer; if the target number of target color value intervals is greater than a third preset threshold, the captured image is determined to be a target captured image.
[0149] For example, the third preset threshold is 4; if the target number of color value intervals corresponding to the pixel points in the captured image is 5; that is, the pixel points in the captured image have 5 colors; Figure 3 As shown in (b) in FIG. 1 , the captured image is determined to be the target captured image.
[0150] It should be noted that the above is an example of the third preset threshold, and this application does not limit this.
[0151] Optionally, the proportion of pixels of the captured image in each color value interval is determined; the number of color intervals whose proportion is greater than a preset proportion is determined, and if the number is greater than a third preset threshold, the captured image is determined to be a target captured image.
[0152] Exemplarily, the proportion of pixels in the captured image in each color value interval is determined. If the proportion is greater than a preset proportion, it means that the color corresponding to the color value interval can be distinguished by the human eye; if the number of color intervals whose proportion is greater than the preset proportion is greater than a third preset threshold, it means that the number of color types that can be distinguished by the human eye in the captured image reaches the third preset threshold; therefore, the captured image is determined to be a target captured image.
[0153] In an embodiment of the present application, when determining a target captured image in a captured image based on the target number of the target color value interval, if the target number of the target color value interval is greater than a third preset threshold, the captured image is determined to be a target captured image; since the target color value interval is the color value interval in which the color values of the pixels in the captured image are located; if the number of target color value intervals is greater, the color of the captured image is richer, that is, the effectiveness of the captured image is better; therefore, if the number of targets in the target color value interval is greater than the third preset threshold, the captured image is determined to be a target captured image.
[0154] In one implementation, the method further includes: generating analysis results of the target captured images based on timestamp information of the target captured images and the number of the target captured images; and outputting the analysis results of the target captured images.
[0155] Exemplarily, an analysis result of the target captured image is generated based on the timestamp information of the target captured image and the number of the target captured images; for example, the number of target captured images in the target video and the timestamp information of each target captured image are displayed in the analysis result; if the target video is a video other than real-time video, the user can click on the target captured image to make the target video jump to the position corresponding to the target captured image; that is, the user can determine the video segment to be watched based on the target captured image without browsing the entire target video.
[0156] Optionally, in the output analysis results, the target captured images can be classified into valid frames, meaningful frames and wonderful frames for easy viewing by users; wherein, valid frames, meaningful frames and wonderful frames refer to Figure 2 and Figure 3 The relevant description will not be repeated here.
[0157] In an embodiment of the present application, after the target video is image captured, an analysis result of the target captured image is generated based on the timestamp information of the target captured image and the number of target captured images, and the analysis result is output; ensuring that the user can obtain the analysis result of the target captured image in a timely manner, thereby improving the user experience.
[0158] In the above embodiment, the target video is captured based on the capture time interval to obtain the captured image, and the captured image is color analyzed based on multiple color value intervals to determine the target captured image in the captured image; the color value interval is determined by partitioning the color value corresponding to the target video, and since the color analysis of the captured image is performed based on multiple color value intervals; therefore, the validity of the captured image can be determined by the distribution of the color value of the captured image in multiple color value intervals; compared with the image capture through the time dimension in the prior art; this scheme captures the target video based on the two dimensions of capture time interval and color analysis; ensures that the captured target captured image is a valid image; in addition, since the color analysis is performed through the divided color value intervals; therefore, the valid image in the captured image can be determined more accurately; avoids capturing invalid images, thereby improving the validity of image capture.
[0159] Figure 5 It is a schematic flow chart of another image capture method provided in an embodiment of the present application.
[0160] For example, Figure 5 The image capture method 500 shown may be executed by a terminal device; or executed by a processor of the terminal device.
[0161] like Figure 5 As shown, the image interception method 500 includes S501 to S513, and S501 to S513 are described in detail below.
[0162] S501, obtaining the target video and the time interval between the capture.
[0163] Exemplarily, the target video refers to the video for image capture; the target video includes real-time video and videos other than real-time video; wherein, the real-time video includes: live video, video conferencing, remote monitoring, online education, etc.; the videos other than real-time video include: movies, TV series, documentaries, education and training courses, etc.
[0164] For example, the capture time interval refers to the time interval between each captured image when capturing the target video; the capture time interval can be set by the user or a preset capture time interval can be used, and updated as needed during the image capture process. If the type of the target video is different, the method of obtaining the target video may be different.
[0165] Optionally, the implementation of S501 can refer to Figure 4 The relevant description of S410 is not repeated here.
[0166] S502, capturing images of the target video based on a time interval to obtain captured images.
[0167] Optionally, the implementation of S502 can refer to Figure 4 The relevant description of S420 is not repeated here.
[0168] S503: partition the color value to determine a plurality of color value intervals.
[0169] Exemplarily, the color value interval is associated with the color mode corresponding to the target video; since the representation of color in different color modes is different; therefore, if the color mode corresponding to the target video is different, the corresponding color interval is different.
[0170] Exemplarily, when distinguishing color values, they are divided according to the similarity of colors; color values corresponding to similar or identical colors are divided into the same color value interval; that is, each color value interval corresponds to one color.
[0171] Optionally, the implementation of S503 can refer to Figure 4 The relevant description of S430 is not repeated here.
[0172] S504: Determine the proportion of each color value of the pixel point in the captured image in the color value range.
[0173] Exemplarily, the number of color values of pixels in the captured image in each color value interval is determined, and based on the number of color values of pixels in each color value interval, the proportion of pixels of each color in the total number of pixels is determined; and whether the captured image is the target captured image is determined based on the proportion.
[0174] S505, determine whether the proportion is less than a first preset threshold; if so, execute S511.
[0175] Exemplarily, it is determined whether the proportion of the color value of the pixel in each color value interval is less than a first preset threshold; if so, the captured image is determined to be a target captured image.
[0176] Optionally, the implementation of S504 and S505 can refer to Figure 4 The relevant description of situation 1 of S440 will not be repeated here.
[0177] S506: Determine a first preset color value interval among multiple color value intervals.
[0178] Exemplarily, the first preset color value interval is a color value interval determined according to main color tone information of the target video.
[0179] Optionally, the color interval with the highest frequency of occurrence can be determined based on the distribution of different color intensities in the color histogram of the target video, and the color interval with the highest frequency of occurrence can be used as the first preset color value interval; or, the main color tone information of the target video can be determined based on the average color of the video frames in the target video.
[0180] S507: Determine the proportion of pixels in the captured image in a first preset color value range.
[0181] Exemplarily, determining the number of color values of pixels in the captured image in the first preset color value interval, determining the proportion of pixels in the first preset color value interval to the total number of pixels based on the number of color values of pixels in the first preset color value interval; and determining whether the captured image is the target captured image based on the proportion.
[0182] S508, determine whether the proportion is greater than the second preset threshold and less than the first preset threshold; if so, execute S511.
[0183] Exemplarily, it is determined whether the proportion is greater than a second preset threshold and less than a first preset threshold; if so, the captured image is determined to be a target captured image.
[0184] Optionally, the implementation of S506 to S508 can refer to Figure 4 The relevant description of situation 1 of S440 will not be repeated here.
[0185] S509, determining the target number of target color value intervals corresponding to the pixel points in the captured image.
[0186] Exemplarily, the target color value interval refers to the color value interval in which the color values of the pixels in the captured image are located; and whether the captured image is the target captured image is determined based on the target number of the target color value intervals corresponding to the pixels.
[0187] S510, determine whether the target quantity is greater than a third preset threshold; if so, execute S511.
[0188] Exemplarily, if the number of targets in the target color value interval is greater than a third preset threshold, the captured image is determined to be a target captured image.
[0189] Optionally, the implementation of S509 and S510 can refer to Figure 4 The relevant description of situation 2 of S440 will not be repeated here.
[0190] S511, determining that the captured image is a target captured image.
[0191] Exemplarily, if the above judgment conditions are met, the captured image is determined to be a valid image, that is, the captured image is determined to be a target captured image.
[0192] S512: If the target video is captured, an analysis result of the target captured image is generated.
[0193] Exemplarily, if the capture of the target video is completed, the analysis results of the target captured images are generated; wherein, the analysis results of the target captured images include the number of target captured images in the target video and the timestamp information of each target captured image; the user can click on the target captured image to make the target video jump to the position corresponding to the target captured image; that is, the user can determine the video segment to be watched based on the target captured image; thereby improving the user experience.
[0194] S513, outputting the target intercepted image and the analysis result of the target intercepted image.
[0195] In an embodiment of the present application, image capture is performed on a target video based on a time interval; and the validity of the captured image is determined based on the distribution of color values corresponding to pixel points in the captured image in a color value interval; a valid image is determined as a target captured image and output; invalid images are avoided from being captured, thereby improving the validity of image capture; and during the image capture process, the capture time interval is adjusted according to the validity of the captured image, and invalid content in the target video is skipped; thereby improving the efficiency of image capture.
[0196] Combination of the above Figure 4 and Figure 5 The image capture method provided by the embodiment of the present application is described in detail; Figure 6 and Figure 7 The device embodiments of the present application are described in detail. It should be understood that the device in the embodiments of the present application can execute the various methods of the aforementioned embodiments of the present application, that is, the specific working processes of the following various products can refer to the corresponding processes in the aforementioned method embodiments.
[0197] Figure 6 It is a structural schematic diagram of an image capture device provided in an embodiment of the present application.
[0198] For example, Figure 6 As shown, the image capture device 600 includes:
[0199] An acquisition module 610 is used to acquire a time interval between a target video and a capture of a target video;
[0200] The capture module 620 is used to capture the target video based on the capture time interval to obtain the captured image of the target video;
[0201] A first determination module 630 is used to partition the color value corresponding to the target video to determine a plurality of color value intervals; wherein the plurality of color value intervals are associated with a color mode corresponding to the target video;
[0202] The second determination module 640 is used to perform color analysis on the captured images based on the color value interval, determine a target captured image in the captured images, and output the target captured image.
[0203] Optionally, as an embodiment, the second determining module 640 is specifically configured to:
[0204] Based on the proportion of the color values of the pixels in the captured image in the color value interval, the target captured image in the captured image is determined; or, based on the target number of the target color value interval corresponding to the pixels in the captured image, the target captured image in the captured image is determined; wherein the target color value interval is the color value interval in which the color values of the pixels in the captured image are located.
[0205] Optionally, as an embodiment, the second determining module 640 is specifically configured to:
[0206] If the proportion of the color value of the pixel point in the captured image in each color value interval is less than the first preset threshold, the captured image is determined to be the target captured image; if the proportion of the color value of the pixel point in the captured image in the first preset color value interval is greater than the second preset threshold and less than the first preset threshold, the captured image is determined to be the target captured image; wherein the first preset color value interval is a color value interval among multiple color value intervals.
[0207] Optionally, as an embodiment, the second determining module 640 is further configured to:
[0208] Based on the video content of the target video, main color tone information of the target video is determined; based on the main color tone information, a first preset color value interval is determined.
[0209] Optionally, as an embodiment, the second determining module 640 is specifically configured to:
[0210] Determine the target number of the target color value interval in the color value interval; if the target number is greater than a third preset threshold, determine that the captured image is the target captured image.
[0211] Optionally, as an embodiment, the acquisition module 610 is specifically used for:
[0212] If the target video is a real-time video, the real-time video stream is obtained through the properties of the media stream component and the video tag; wherein the properties of the video tag include the video address of the target video; if the target video is a video other than a real-time video, the target video is obtained through the properties of the video tag.
[0213] Optionally, as an embodiment, it further includes an updating module, the updating module is used to: update the interception time interval of the target video;
[0214] The capture module 620 is specifically used to capture images of the target video based on the updated capture time interval to obtain a captured image of the target video.
[0215] Optionally, as an embodiment, the update module is specifically used for:
[0216] Determine the number of invalid images detected continuously in the target video; wherein the invalid images are images other than the target captured images in the captured images; if the number of invalid images is greater than a preset number, update the capture time interval of the target video.
[0217] Optionally, as an embodiment, the interception module 620 is specifically used for:
[0218] The target video is divided into at least two video segments; based on the capture time interval and the timestamp information of the at least two video segments, an image of each of the at least two video segments is captured simultaneously to obtain a captured image of each of the at least two video segments.
[0219] Optionally, as an embodiment, it further includes an output module, which is used to generate analysis results of the target captured images based on the timestamp information of the target captured images and the number of the target captured images; and output the analysis results of the target captured images.
[0220] It should be noted that the above-mentioned image capture device is embodied in the form of a functional unit. The term "module" here can be implemented in the form of software and / or hardware, and is not specifically limited to this.
[0221] For example, a "module" may be a software program, a hardware circuit, or a combination of the two that implements the above functions. The hardware circuit may include an application specific integrated circuit (ASIC), an electronic circuit, a processor (such as a shared processor, a dedicated processor, or a group processor, etc.) and a memory for executing one or more software or firmware programs, a combined logic circuit, and / or other suitable components that support the described functions.
[0222] Therefore, the units of each example described in the embodiments of the present application can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
[0223] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application.
[0224] Exemplarily, the electronic device 700 includes: a processor 710 , a memory 720 , and an executable program code 730 .
[0225] Exemplarily, the electronic device 700 includes one or more processors 710, which can support the electronic device 700 to implement the method of the electronic device in the method embodiment. The processor 710 can be a general-purpose processor or a special-purpose processor. For example, the processor 710 can be a central processing unit (CPU), a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, such as discrete gates, transistor logic devices, or discrete hardware components.
[0226] Exemplarily, the processor 710 may be used to control the electronic device 700, execute software programs, and process data of the software programs. The electronic device 700 may also include a communication unit to implement input (reception) and output (transmission) of signals.
[0227] Exemplarily, the electronic device 700 may include one or more memories 720 on which executable program code 730 is stored. The executable program code 730 can be executed by the processor 710 to generate instructions so that the processor 710 executes the method described in the above method embodiment according to the instructions.
[0228] Optionally, data may be stored in the memory 720. Optionally, the processor 710 may read data stored in the memory 720, which may be stored at the same storage address as the executable program code 730, or may be stored at a different storage address from the executable program code 730.
[0229] Exemplarily, the processor 710 and the memory 720 may be provided separately or integrated together, for example, integrated on a system on chip (SOC) of the terminal device.
[0230] Exemplarily, the memory 720 can be used to store relevant programs of the method of the electronic device provided in the embodiment of the present application, and the processor 720 can be used to call the executable program code 730 stored in the memory 720 when controlling the electronic device to execute the image capture method of the embodiment of the present application; for example, obtaining the capture time interval between the target video and the target video; based on the capture time interval, performing image capture on the target video to obtain a captured image of the target video; partitioning the color value corresponding to the target video to determine multiple color value intervals; wherein the multiple color value intervals are associated with the color mode corresponding to the target video; performing color analysis on the captured image based on the color value interval to determine the target captured image in the captured image; and outputting the target captured image.
[0231] The present application also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the steps of the image capture method of any of the aforementioned embodiments are implemented.
[0232] Among them, computer-readable storage media may include but are not limited to any type of disk, including floppy disks, optical disks, digital versatile disks (Digital Video Disc, DVD), compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), microdrives and magneto-optical disks, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable programmable read only memory (Electrically Erasable Programmable read only memory, EEPROM), dynamic random access memory (Dynamic Random Access Memory, DRAM), video random access memory (Video Random Access Memory, VRAM), flash memory devices, magnetic cards or optical cards, nanosystems (including molecular memory ICs), or any type of medium or device suitable for storing instructions and / or data.
[0233] The present application also provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the above-mentioned related steps to implement an image capture method in the above-mentioned embodiment.
[0234] In addition, the electronic device provided in the embodiments of the present application may specifically be a chip, a component or a module, and the electronic device may include a connected processor and a memory; wherein the memory is used to store instructions, and when the electronic device is running, the processor may call and execute instructions so that the chip executes an image capture method in the above-mentioned embodiments.
[0235] Among them, the electronic device, computer-readable storage medium, computer program product or chip provided in this application are all used to execute the corresponding image capture method provided above. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding image capture method provided above, and will not be repeated here.
[0236] Through the description of the above implementation methods, technical personnel in the relevant field can understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0237] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0238] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An image capture method, characterized in that: The method comprises: Obtaining a target video and a time interval between captures of the target video; Performing image interception of the target video based on the interception time interval to obtain an intercepted image of the target video; Partitioning the color values corresponding to the target video to determine a plurality of color value intervals; wherein the plurality of color value intervals are associated with the color mode corresponding to the target video; Performing color analysis on the captured image based on the color value interval to determine a target captured image in the captured image; and outputting the target captured image.
2. The method according to claim 1, characterized in that The performing color analysis on the captured image based on the color value interval to determine a target captured image in the captured image includes: Determine a target intercepted image in the intercepted image based on the proportion of the color values of the pixels in the intercepted image in the color value range; or Based on the target number of target color value intervals corresponding to the pixels in the captured image, a target captured image in the captured image is determined; wherein the target color value interval is a color value interval in which the color values of the pixels in the captured image are located.
3. The method according to claim 2, characterized in that The determining the target intercepted image in the intercepted image based on the proportion of the color values of the pixels in the intercepted image in the color value range includes: If the proportion of the color value of the pixel point in the captured image in each of the color value intervals is less than a first preset threshold, determining that the captured image is the target captured image; If the proportion of the color value of the pixel points in the captured image in the first preset color value interval is greater than the second preset threshold and less than the first preset threshold, the captured image is determined to be the target captured image; wherein the first preset color value interval is a color value interval among the multiple color value intervals.
4. The method according to claim 3, characterized in that Also includes: Determine the main color tone information of the target video based on the video content of the target video Based on the main color information, the first preset color value interval is determined.
5. The method according to claim 2, characterized in that: The determining of a target intercepted image in the intercepted image based on the target number of target color value intervals corresponding to the pixels in the intercepted image comprises: Determining a target number of the target color value intervals in the color value interval; If the target quantity is greater than a third preset threshold, the captured image is determined to be the target captured image.
6. The method according to claim 1, characterized in that The step of obtaining the target video comprises: If the target video is a real-time video, the real-time video stream is obtained through the attributes of the media stream component and the video tag; wherein the attributes of the video tag include the video address of the target video; If the target video is a video other than the real-time video, the target video is obtained through the attributes of the video tag.
7. The method according to claim 1, characterized in that Also includes: Updating the capture time interval of the target video; The step of performing image interception on the target video based on the interception time interval to obtain the intercepted image of the target video includes: The image of the target video is captured based on the updated capture time interval to obtain the captured image of the target video.
8. The method according to claim 7, characterized in that Also includes: Determine the number of invalid images detected continuously in the target video; wherein the invalid images are images in the captured images other than the target captured images; The updating of the interception time interval of the target video includes: If the number of the invalid images is greater than a preset number, the capture time interval of the target video is updated.
9. The method according to any one of claims 1 to 8, characterized in that Also includes: Dividing the target video into at least two video segments; The step of performing image interception on the target video based on the interception time interval to obtain the intercepted image of the target video includes: Based on the capture time interval and the timestamp information of the at least two video segments, image capture is performed on each of the at least two video segments at the same time to obtain the captured image of each of the at least two video segments.
10. The method according to any one of claims 1 to 8, characterized in that Also includes: generating an analysis result of the target intercepted image based on the timestamp information of the target intercepted image and the number of the target intercepted images; The analysis result of the target captured image is outputted.
11. An electronic device, characterized in that: The electronic device comprises: A memory for storing executable program codes; A processor, configured to call and run the executable program code from the memory, so that the electronic device executes the method as claimed in any one of claims 1 to 10.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on an electronic device, the electronic device executes the method according to any one of claims 1 to 10.
