CN107886518B - Picture detection method and device, electronic equipment and readable storage medium - Google Patents

Picture detection method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN107886518B
CN107886518B CN201711187177.7A CN201711187177A CN107886518B CN 107886518 B CN107886518 B CN 107886518B CN 201711187177 A CN201711187177 A CN 201711187177A CN 107886518 B CN107886518 B CN 107886518B
Authority
CN
China
Prior art keywords
picture
target video
detected
preset
edge
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711187177.7A
Other languages
Chinese (zh)
Other versions
CN107886518A (en
Inventor
陈雪桂
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Alibaba China Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN201711187177.7A priority Critical patent/CN107886518B/en
Publication of CN107886518A publication Critical patent/CN107886518A/en
Application granted granted Critical
Publication of CN107886518B publication Critical patent/CN107886518B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

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

Landscapes

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

Abstract

The embodiment of the invention provides a picture detection method and device, electronic equipment and a readable storage medium, and belongs to the technical field of video processing. The method comprises the following steps: performing edge detection on a picture to be detected, wherein the picture to be detected is one frame in a target video; and when the ratio of black pixel points in the edge picture of the picture to be detected is smaller than a preset value, taking the picture to be detected as the current cover picture of the target video. Compared with the mode of manually selecting the video cover picture in the prior art, the method effectively improves the quality of the video cover picture and further improves the user experience.

Description

Picture detection method and device, electronic equipment and readable storage medium
Technical Field
The invention relates to the technical field of video processing, in particular to a picture detection method, a picture detection device, electronic equipment and a readable storage medium.
Background
In some mobile phone applications, a large amount of video is introduced into each mobile phone, in the prior art, a picture is selected from a video as a cover picture of the video in a manual mode, but the manual cost is greatly increased in the selection mode, personnel are required to play the video, and then the video is captured to serve as the cover picture, so that the actual cost is higher, the video can not be imagined for warehousing tens of thousands of media, and moreover, the cover picture selected manually is probably not clear or the content of the picture is not rich, so that the quality of the cover picture of the video is not high.
Disclosure of Invention
In view of the above, embodiments of the present invention provide a picture detection method, a picture detection apparatus, an electronic device, and a readable storage medium, so as to solve the problem of poor user experience caused by low cover picture quality of a video.
In a first aspect, an embodiment of the present invention provides a picture detection method, where the method includes: performing edge detection on a picture to be detected, wherein the picture to be detected is one frame in a target video; and when the ratio of black pixel points in the edge picture of the picture to be detected is smaller than a preset value, taking the picture to be detected as the current cover picture of the target video.
In a second aspect, an embodiment of the present invention provides an apparatus for detecting a picture, where the apparatus includes: the edge detection module is used for carrying out edge detection on a picture to be detected, wherein the picture to be detected is one frame in a target video; and the cover picture selecting module is used for taking the picture to be detected as the current cover picture of the target video when the proportion of black pixel points in the edge picture of the picture to be detected is less than a preset value.
In a third aspect, an embodiment of the present invention provides an electronic device, which includes a processor and a memory coupled to the processor, the memory storing instructions that when executed by the processor, the electronic device performs the following operations: performing edge detection on a picture to be detected, wherein the picture to be detected is one frame in a target video; and when the ratio of black pixel points in the edge picture of the picture to be detected is smaller than a preset value, taking the picture to be detected as the current cover picture of the target video.
In a fourth aspect, an embodiment of the present invention provides a readable storage medium, which is stored in a computer and includes a plurality of instructions configured to cause the computer to execute the picture detection method.
The embodiment of the invention provides a picture detection method, a picture detection device, electronic equipment and a readable storage medium.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 shows a block diagram of an electronic device applicable to an embodiment of the present invention;
fig. 2 is a flowchart of a picture detection method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an image for edge detection using a Roberts operator according to an embodiment of the present invention;
fig. 4 is a block diagram of a picture detection apparatus according to an embodiment of the present invention;
fig. 5 is a block diagram of an edge detection module according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present invention, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Fig. 1 shows a block diagram of an electronic device 100 applicable to an embodiment of the present invention. As shown in fig. 1, the electronic device 100 includes a memory 101, a memory controller 102, one or more processors 103 (only one of which is shown), a peripheral interface 104, a radio frequency module 105, and the like. These components communicate with each other via one or more communication buses/signal lines 106.
The memory 101 may be used to store software programs and modules, such as program instructions/modules corresponding to the page switching processing method and apparatus in the embodiments of the present invention, and the processor 103 executes various functional applications and data processing, such as the page switching processing method provided in the embodiments of the present invention, by running the software programs and modules stored in the memory 101.
Memory 101 may include high speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. Access to the memory 101 by the processor 103 and possibly other components may be under the control of the memory controller 102.
The peripheral interface 104 couples various input/output devices to the processor 103 as well as to the memory 101. In some embodiments, the peripheral interface 104, the processor 103, and the memory controller 102 may be implemented in a single chip. In other examples, they may be implemented separately from the individual chips.
The rf module 105 is used for receiving and transmitting electromagnetic waves, and implementing interconversion between the electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices.
It will be appreciated that the configuration shown in FIG. 1 is merely illustrative and that electronic device 100 may include more or fewer components than shown in FIG. 1 or have a different configuration than shown in FIG. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
In the embodiment of the present invention, the electronic device 100 is installed with a client, which may be a browser or a third-party application, and corresponds to a Server (Server) end, and provides a service for a user, such as an electronic book reading service, for playing a local document or an electronic book.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 2, fig. 2 is a flowchart of a picture detection method according to an embodiment of the present invention, where the method is applied to the electronic device, and the method includes the following steps:
step S110: and carrying out edge detection on the picture to be detected.
The picture to be detected is a frame in a target video, namely the picture to be detected is a picture obtained from the target video according to a preset strategy or a currently existing cover picture of the target video.
When video cover pictures are selected for a target video, one picture, namely one frame, can be selected from the target video to serve as the current cover picture of the target video, but in order to select a proper picture to serve as the current cover picture of the target video, the picture can be acquired from the target video to serve as a picture to be detected according to a preset strategy, and edge detection processing is carried out on the picture to be detected, so that the current cover picture meeting the conditions is obtained.
The preset strategy can be set to be that an FFMpeg tool is adopted to extract key frames of the target video, namely the preset strategy is to acquire key frames meeting a preset gray threshold and a preset color threshold from the target video, the key frames are used as pictures to be detected, the key frames are pictures with a plurality of frames which can represent the content of the target video in comparison in the target video, namely the representative frames of the target video and can represent the main content of the target video and the shot, and one shot can have one or more key frames.
FFMpeg is a suite of open-source computer programs that can be used to record, convert digital audio, video, and convert them into streams, which provides a complete solution to recording, converting, and streaming audio and video. The method can be used for screenshot of the video, and for the selected video, the thumbnail of the designated time is intercepted, and the related frame pictures in the video are captured.
As one way, the step of using FFMpeg tool to obtain key frame from the target video is as follows:
(1) a gray level histogram is generated for each frame of the target video.
(2) And calculating the similarity of the gray level histograms of the two frames, and comparing the similarity with a preset gray level threshold value to extract candidate key frames.
In practical applications, the gray threshold may be set to 60% as desired.
(3) And converting the extracted candidate key frames into H, S and V modes, and calculating a color histogram by dividing H into 16 levels and S into 8 levels.
(4) And calculating the color similarity of the two frames by using a phase difference coefficient method, and comparing the color similarity with a preset color threshold value to extract the key frame.
In practical applications, the color threshold may be set to 80% as desired.
As one way, the process of using FFMpeg tool to obtain key frames from the target video can be further as follows:
firstly, related information of a target video is obtained, which can be obtained through the following program codes:
input video file for ffprobe file in [ ffprobe ] -v quick-print _ format json-show _ format-show _ streams [ input ] ffprobe ffmpeg (ffprobe. exe file under windows)
The key frame interception of the target video can be realized by the following program codes:
[ffmpeg]-i[input]-b[vBitRate]-r[frameRate]-vf select='eq(pict_type\\,I)'-vsync 2-s[size]-f image2[output]/thumbnails-%02d.jpeg
parameter interpretation:
ffmpeg ffmpeg path of the execution file (below windows, ffmpeg. exe)
input video file
vBitRATE video stream coding rate
Framerate video stream frame rate
size of size video stream frame
In addition, as one mode, the key frame in the target video can be obtained through a pixel frame averaging method or a histogram frame averaging method. The pixel frame averaging method is to take pixel values at certain positions of all frames in a target video to average the pixel values as a comparison standard, and take a frame with the pixel value at the position closest to the average value in the target video as a key frame of the target video. The histogram frame averaging method is to select the average value of all frame histograms as a standard and take the frame with the histogram closest to the average value as the key frame of the target video.
It should be noted that the above examples are only for better illustrating the technical solutions of the present invention, and not for limiting the present invention, and those skilled in the art should understand that any implementation manner for acquiring the key frames in the video thereof should be included in the scope of the present invention.
After the key frames in the target video are obtained by the method, the number of the obtained key frames may be multiple, the key frames are used as the pictures to be detected, the pictures to be detected are subjected to edge detection, and the methods for detecting the edges of the pictures are various, such as a Sobel operator, a Roberts operator, a Canny operator, a Prewitt operator and the like.
In this embodiment, edge detection is performed on the picture to be detected through a Roberts edge detection algorithm, that is, edge detection is performed on the picture to be detected through a Roberts operator, and since the picture to be detected acquired from the target video is a color picture, the possible edge of the picture may be blurred, which may damage the visual effect of the image, the picture to be detected may be sharpened first, and a sharpened picture is obtained.
The image sharpening can eliminate fuzzy edges in the image, enhance high-frequency components in the image, sharpen the edges, transform original information of the image into instructions beneficial to people to watch, and improve the visual effect of the image, so that the edges of objects in the image become sharp. In practical application, the method for sharpening the picture to be detected can be a spatial domain differentiation method and a high-pass filtering method, wherein the spatial domain differentiation method comprises a gradient sharpening method and a laplacian sharpening method, and the method can be selected at will to sharpen the picture to be detected, so that a sharpened picture is obtained.
Then, edge detection is carried out on the sharpened picture by adopting the Roberts operator, the Sobel operator, the Canny operator or the Prewitt operator, so as to obtain an edge picture after edge detection,
the following description will take the example of edge detection using the Roberts operator. The Roberts operator is proposed by Roberts, which is an operator that finds edges using local difference operators, and mainly has two modes of detecting two diagonal directions and horizontal and vertical directions.
The Roberts operator detects two diagonal directions, and the formula is:
Figure BDA0001479095310000071
wherein g (x, y) represents the gray value of the picture to be detected after processing, and f (x, y) represents the gray value of the picture to be detected before processing.
The Roberts operator detects the horizontal and vertical directions, and the formula is as follows:
Figure BDA0001479095310000081
the Roberts operator detects two diagonal convolution templates as:
Figure BDA0001479095310000082
the Roberts operator detects the convolution templates in the horizontal and vertical directions as:
Figure BDA0001479095310000083
referring to fig. 3, fig. 3 is a schematic diagram of an image for edge detection by using a Roberts operator according to an embodiment of the present invention, where fig. 3a is an original image, that is, a sharpened image obtained by sharpening a to-be-detected image, fig. 3b is an image obtained by detecting a diagonal direction by using the Roberts operator, and fig. 3c is an image obtained by detecting horizontal and vertical directions by using the Roberts operator.
The Roberts operator carries out edge detection, the difference between two adjacent pixels is adopted to represent the sudden change of a signal, the algorithm is high in image positioning accuracy and sensitive to noise, and the detected edge is thin.
It should be noted that, the above examples are only for better illustrating the technical solutions of the present invention, and not for limiting the present invention, and those skilled in the art should understand that any implementation manner of performing edge detection on a picture should be included in the scope of the present invention.
Step S120: and when the ratio of black pixel points in the edge picture of the picture to be detected is smaller than a preset value, taking the picture to be detected as the current cover picture of the target video.
In the above steps, after performing edge detection on the picture to be detected, an edge picture is obtained, in order to detect the image contour condition in the edge picture, it is further necessary to determine whether the black pixel ratio in the edge picture is smaller than a preset value, then, first, the black pixel ratio in the edge picture is calculated, by obtaining the number of black pixels and the total pixel number in the edge picture, the edge picture is a binary black-and-white picture, 0 represents a black pixel, and 255 represents a white pixel, the electronic device can obtain the number of black pixels and the total pixel number in the edge picture through a relevant java program, and the black pixel ratio is equal to the ratio of the number of black pixels to the total pixel number.
The method comprises the steps that a preset value is stored in the electronic equipment in advance, the preset value can be set by a user as required, in actual operation, the preset value can be generally set to be 0.03, if the black pixel ratio of an obtained edge picture is smaller than 0.03, the outline of the edge picture is rich, namely the content is rich, the picture to be detected is used as a current cover picture of a target video, if the black pixel ratio of the obtained edge picture is larger than or equal to 0.03, the picture to be detected corresponding to the edge picture is considered to be a pure-color background picture, and the picture to be detected is directly discarded.
It should be noted that when the number of the pictures to be detected is multiple, a picture to be detected corresponding to one edge picture with the smallest black pixel ratio can be selected from the obtained multiple edge pictures as the current cover picture of the target video, and certainly, if there are several same edge pictures with the smallest black pixel ratio and the same black pixel ratio, a picture to be detected corresponding to one edge picture can be randomly selected as the current cover picture of the target video, so that the quality of the cover picture of the video is improved, and further, when a user selects the video, the user experience is improved through the high-quality video cover picture.
In addition, as a mode, when the target video already has a current cover picture, but sometimes the current cover picture of the target video is not clear, or the image contour is not rich, and the target video cannot be represented, so that the user experience is poor, the current cover picture of the target video is detected first, that is, the current cover picture of the target video is used as a picture to be detected, that is, the picture to be detected is the current existing cover picture of the target video, the edge detection is performed on the current cover picture of the target video, and the method for performing the edge detection on the current cover picture of the target video refers to the above related description, and is not described in detail herein.
Performing edge detection on the current cover picture of the target video to obtain an edge picture of the current cover picture, judging whether the black pixel ratio of the edge picture is smaller than a preset value, if the preset value is 0.03, if the black pixel ratio of the edge picture is greater than or equal to 0.03, indicating that the current cover picture corresponding to the edge picture is not rich and not clear in profile, reselecting the picture from the target video as the current cover picture of the target video, namely acquiring the picture from the target video as a picture to be detected according to a preset strategy, and then executing step S110, so as to select a proper picture to be detected to replace the current cover picture of the target video; if the proportion of the black pixel points of the edge picture is less than 0.03, the fact that the outline of the current cover picture corresponding to the edge picture is rich and clear is represented, the current cover picture of the target video is not replaced again, the quality of the video cover picture is improved, and then when a user selects a video, the user experience is improved through the high-quality video cover picture.
Referring to fig. 4, fig. 4 is a block diagram of a picture detection apparatus 200 according to an embodiment of the present invention, the apparatus includes:
the edge detection module 210 is configured to perform edge detection on a picture to be detected, where the picture to be detected is one frame in a target video.
And a cover picture selecting module 220, configured to, when the black pixel ratio in the edge picture of the picture to be detected is smaller than a preset value, take the picture to be detected as the current cover picture of the target video.
The picture to be detected is a picture obtained from the target video according to a preset strategy or a currently existing cover picture of the target video.
As a mode, when the picture to be detected is a currently existing cover picture of the target video, the edge detection module 210 is further configured to perform edge detection on the currently existing cover picture of the target video.
The cover picture selecting module 220 is further configured to determine whether a black pixel ratio in an edge picture of a currently existing cover picture of the target video is smaller than a preset value; and when the proportion of black pixel points in the edge picture of the current cover picture of the target video is greater than or equal to a preset value, acquiring a picture from the target video as a picture to be detected according to a preset strategy.
As a mode, the preset strategy is to acquire a key frame meeting a preset gray threshold and a preset color threshold from the target video, and use the key frame as a picture to be detected.
As one way, referring to fig. 5, the edge detection module 210 includes:
and a sharpening unit 212, configured to sharpen the picture to be detected, so as to obtain a sharpened picture.
And the detecting unit 214 is configured to perform edge detection on the sharpened picture by using a Roberts operator to obtain an edge picture after edge detection.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus described above may refer to the corresponding process in the foregoing method, and will not be described in too much detail herein.
In summary, embodiments of the present invention provide a picture detection method, an apparatus, an electronic device, and a readable storage medium, where an edge of a picture to be detected is detected, where the picture to be detected is a frame in a target video, and then when a ratio of black pixels in the edge picture of the picture to be detected is smaller than a preset value, the picture to be detected is used as a current cover picture of the target video.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention. It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention, and all the changes or substitutions should be covered within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (8)

1. A picture detection method, the method comprising:
performing edge detection on a picture to be detected, wherein the picture to be detected is one frame in a target video;
when the ratio of black pixel points in the edge picture of the picture to be detected is smaller than a preset value, taking the picture to be detected as the current cover picture of the target video; the picture to be detected is a picture obtained from the target video according to a preset strategy or a currently existing cover picture of the target video;
the acquiring a picture from the target video as a picture to be detected according to a preset strategy comprises the following steps:
acquiring a key frame meeting a preset gray threshold and a preset color threshold from the target video, and taking the key frame as a picture to be detected;
the method for acquiring the key frames meeting the preset gray threshold and the preset color threshold from the target video comprises the following steps:
generating a gray level histogram for each frame of a target video;
calculating the similarity of the gray level histograms of the two frames, and comparing the similarity with a preset gray level threshold value to extract candidate key frames;
converting the extracted candidate key frames into H, S and V modes, and calculating a color histogram by dividing H into 16 levels and S into 8 levels;
and calculating the color similarity of the two frames by using a phase difference coefficient method, and comparing the color similarity with a preset color threshold value to extract the key frame.
2. The method according to claim 1, wherein when the picture to be detected is a currently existing cover picture of the target video, the method further comprises:
before edge detection is carried out on a picture to be detected, edge detection is carried out on the currently existing cover picture of the target video;
judging whether the ratio of black pixel points in the edge picture of the current cover picture of the target video is smaller than a preset value;
and if not, acquiring a picture from the target video as the picture to be detected according to a preset strategy.
3. The method according to claim 1, wherein performing edge detection on the picture to be detected comprises:
sharpening a picture to be detected to obtain a sharpened picture;
and carrying out edge detection on the sharpened picture by using a Roberts operator, a Sobel operator, a Canny operator or a Prewitt operator to obtain an edge picture after edge detection.
4. A picture detection apparatus, characterized in that the apparatus comprises:
the edge detection module is used for carrying out edge detection on a picture to be detected, wherein the picture to be detected is one frame in a target video;
the cover picture selecting module is used for taking the picture to be detected as the current cover picture of the target video when the ratio of black pixel points in the edge picture of the picture to be detected is smaller than a preset value; the picture to be detected is a picture obtained from the target video according to a preset strategy or a currently existing cover picture of the target video; the preset strategy is to acquire a key frame meeting a preset gray threshold and a preset color threshold from the target video, and the key frame is used as a picture to be detected;
the method for acquiring the key frames meeting the preset gray threshold and the preset gray color threshold from the target video comprises the following steps:
generating a gray level histogram for each frame of a target video;
calculating the similarity of the gray level histograms of the two frames, and comparing the similarity with a preset gray level threshold value to extract candidate key frames;
converting the extracted candidate key frames into H, S and V modes, and calculating a color histogram by dividing H into 16 levels and S into 8 levels;
and calculating the color similarity of the two frames by using a phase difference coefficient method, and comparing the color similarity with a preset color threshold value to extract the key frame.
5. The apparatus according to claim 4, wherein when the picture to be detected is a currently existing cover picture of the target video, the apparatus comprises:
the edge detection module is further configured to perform edge detection on the currently existing cover picture of the target video;
the cover picture selecting module is also used for judging whether the ratio of black pixel points in the edge picture of the currently existing cover picture of the target video is less than a preset value; and when the proportion of black pixel points in the edge picture of the current cover picture of the target video is greater than or equal to a preset value, acquiring a picture from the target video as a picture to be detected according to a preset strategy.
6. The apparatus of claim 4 or 5, wherein the edge detection module comprises:
the sharpening unit is used for sharpening the picture to be detected to obtain a sharpened picture;
and the detection unit is used for carrying out edge detection on the sharpened picture by adopting a Roberts operator, a Sobel operator, a Canny operator or a Prewitt operator so as to obtain an edge picture after edge detection.
7. An electronic device, comprising a processor and a memory coupled to the processor, the memory storing instructions that when executed by the processor, the electronic device performs the following:
performing edge detection on a picture to be detected, wherein the picture to be detected is one frame in a target video;
when the ratio of black pixel points in the edge picture of the picture to be detected is smaller than a preset value, taking the picture to be detected as the current cover picture of the target video; the picture to be detected is a picture obtained from the target video according to a preset strategy or a currently existing cover picture of the target video;
the acquiring a picture from the target video as a picture to be detected according to a preset strategy comprises the following steps:
acquiring a key frame meeting a preset gray threshold and a preset gray color threshold from the target video, and taking the key frame as a picture to be detected;
the method for acquiring the key frames meeting the preset gray threshold and the preset gray color threshold from the target video comprises the following steps:
generating a gray level histogram for each frame of a target video;
calculating the similarity of the gray level histograms of the two frames, and comparing the similarity with a preset gray level threshold value to extract candidate key frames;
converting the extracted candidate key frames into H, S and V modes, and calculating a color histogram by dividing H into 16 levels and S into 8 levels;
and calculating the color similarity of the two frames by using a phase difference coefficient method, and comparing the color similarity with a preset color threshold value to extract the key frame.
8. A readable storage medium stored in a computer, the readable storage medium comprising a plurality of instructions configured to cause the computer to perform the method of any one of claims 1-3.
CN201711187177.7A 2017-11-23 2017-11-23 Picture detection method and device, electronic equipment and readable storage medium Active CN107886518B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711187177.7A CN107886518B (en) 2017-11-23 2017-11-23 Picture detection method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711187177.7A CN107886518B (en) 2017-11-23 2017-11-23 Picture detection method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN107886518A CN107886518A (en) 2018-04-06
CN107886518B true CN107886518B (en) 2020-10-09

Family

ID=61774930

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711187177.7A Active CN107886518B (en) 2017-11-23 2017-11-23 Picture detection method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN107886518B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108833938B (en) * 2018-06-20 2021-05-28 南京尚网网络科技有限公司 Method and apparatus for selecting video covers
CN113160083A (en) * 2021-04-19 2021-07-23 广州欢网科技有限责任公司 Media asset video cover map optimization method, device, equipment and storage medium
CN113407774A (en) * 2021-06-30 2021-09-17 广州酷狗计算机科技有限公司 Cover determining method and device, computer equipment and storage medium
CN114443894A (en) * 2022-01-05 2022-05-06 荣耀终端有限公司 Data processing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7734088B2 (en) * 2005-07-08 2010-06-08 Seiko Epson Corporation Low-bandwidth image streaming
CN102087652A (en) * 2009-12-08 2011-06-08 百度在线网络技术(北京)有限公司 Method for screening images and system thereof
CN204346530U (en) * 2015-01-15 2015-05-20 宁波时代仪表有限公司 A kind of tap water meter
CN106559697A (en) * 2016-11-22 2017-04-05 深圳创维数字技术有限公司 A kind of recorded file front cover display packing and system based on PVR Set Top Boxes

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7734088B2 (en) * 2005-07-08 2010-06-08 Seiko Epson Corporation Low-bandwidth image streaming
CN102087652A (en) * 2009-12-08 2011-06-08 百度在线网络技术(北京)有限公司 Method for screening images and system thereof
CN204346530U (en) * 2015-01-15 2015-05-20 宁波时代仪表有限公司 A kind of tap water meter
CN106559697A (en) * 2016-11-22 2017-04-05 深圳创维数字技术有限公司 A kind of recorded file front cover display packing and system based on PVR Set Top Boxes

Also Published As

Publication number Publication date
CN107886518A (en) 2018-04-06

Similar Documents

Publication Publication Date Title
CN107886518B (en) Picture detection method and device, electronic equipment and readable storage medium
JP5908174B2 (en) Image processing apparatus and image processing method
US20200175658A1 (en) Contrast enhancement and reduction of noise in images from cameras
TWI406560B (en) Method and apparatus for converting video and image signal bit depths and artcle comprising a non-transitory computer readable storage medium
Fontani et al. Hiding traces of median filtering in digital images
US20130336582A1 (en) Image processing apparatus, image processing method, and storage medium
US9811882B2 (en) Method and apparatus for processing super resolution image using adaptive preprocessing filtering and/or postprocessing filtering
CN108369649B (en) Focus detection
WO2006022493A1 (en) Method for removing noise in image and system thereof
CN111445424B (en) Image processing method, device, equipment and medium for processing mobile terminal video
EP2375748A1 (en) Method and apparatus for detecting coding artifacts in an image
CN109214996B (en) Image processing method and device
CN109255752B (en) Image self-adaptive compression method, device, terminal and storage medium
US10296539B2 (en) Image extraction system, image extraction method, image extraction program, and recording medium storing program
Baracchi et al. Facing image source attribution on iPhone X
US9818178B1 (en) Method and system for detection of ghosting artifact in a video
JP2010286959A (en) Method, device and program for enhancing face image resolution
CN112950491B (en) Video processing method and device
KR101615479B1 (en) Method and apparatus for processing super resolution image using adaptive pre/post-filtering
WO2015168893A1 (en) Video quality detection method and device
Lee et al. Compressed domain video saliency detection using global and local spatiotemporal features
Yalman A histogram based image quality index
Jacobson et al. Scale-aware saliency for application to frame rate upconversion
Pandey et al. A passive forensic method for video: Exposing dynamic object removal and frame duplication in the digital video using sensor noise features
Sonawane et al. Image quality assessment techniques: An overview

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20200527

Address after: 310051 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Alibaba (China) Co.,Ltd.

Address before: 510627 Guangdong city of Guangzhou province Whampoa Tianhe District Road No. 163 Xiping Yun Lu Yun Ping square B radio tower 15 layer self unit 02 (only for office use)

Applicant before: GUANGZHOU UC NETWORK TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant