Specific embodiment
Below in conjunction with drawings and embodiments, the present invention is described in detail.
Refering to fig. 1, in one embodiment of creation method of video file thumbnail of the present invention, comprising steps of
Step S101: the Pixel Information of one of video frame of video file is obtained.
Wherein, in the present embodiment, since first video frame of video file, the picture of first video frame is obtained
Prime information.
Wherein, Pixel Information may include luminance information, colouring information, high-frequency information and/or transparence value etc..
Step S102: judge whether the corresponding image of video frame is solid color image according to Pixel Information.
Solid color image refers to the image of same type color, the figure of image and graduated colors including same color
Picture.Same color image is, for example, all black picture, full white image, complete red image etc., graduated colors image be, for example, from it is dark red gradually
Fade to the image of light red.Solid color image is since the color that each pixel is presented is identical or approximately, single face
The Pixel Information of each pixel of chromatic graph picture is closer to, therefore whether judges the corresponding image of video frame according to Pixel Information
For solid color image.
Step S103: if it is not, obtaining the corresponding image of video frame then to generate the thumbnail of video file.
Unlike solid color image, the image with video content usually has multiple color, such as works as video
When content is personage's head portrait, the color difference at each position such as hair, clothes, skin of personage is all larger, therefore when the view obtained
When the corresponding image of frequency frame is not solid color image, illustrate that a possibility that video frame presents video content is larger, therefore
The thumbnail that the corresponding image of the video frame is generated to video file, it is possible thereby to improve the general of the thumbnail with video content
Rate, so that thumbnail generated being capable of more acurrate displaying video content.Therefore on electronic equipment such as mobile phone, computer
The thumbnail can be used when showing video file to be shown as the path indexing of video file.
Further, when the corresponding image of first video frame that judgement obtains is solid color image, then the is obtained
The Pixel Information of two video frames judges whether the corresponding image of second video frame is single with the Pixel Information according to acquisition
Color image, and so on, according to the playing sequence of video frame until finding non-solid color image.
Above embodiment is to obtain the pixel of first video frame first since first video frame of video file
Information is judged, in other embodiments of the invention, is also possible to obtain one of video of video file at random
The Pixel Information of frame judged, at this time when judging the corresponding image of video frame that this is obtained at random for solid color image
When, then obtain the Pixel Information of another video frame at random to judge whether the corresponding image of another video frame is single
Color image, and so on, until finding non-solid color image.
Referring to Fig.2, obtaining the pixel letter of one of video frame of video file in the embodiment of the invention
The step of breath includes: the color value for obtaining each pixel of video frame, to obtain Pixel Information.
The color value refers to the grayscale value of pixel.Image is formed by multiple pixels that ranks arrange, and each pixel includes R
Three (red), G (green), B (indigo plant) primary color sub-pixels, each primary color sub-pixels have a color value, which can be 0
Value between~255, including endpoint value.Wherein, in present embodiment, the color value of each pixel refers to through each pixel
One color value of the respective pixel that the color value of tri- primary color sub-pixels of RGB converts.Due to the conversion of above-mentioned color value
Belong to the scope of the prior art, and where the emphasis of non-present invention, so it will not go into details.
Wherein, judge that the corresponding image of video frame whether be solid color image includes following sub-step according to Pixel Information
It is rapid:
Sub-step S201: the absolute value of the difference of selected pixel pixel color value adjacent thereto is calculated.
Wherein, selecting pixel is each pixel in every one-row pixels.In conjunction with Fig. 3, it is assumed that acquired video frame is corresponding
Image include 6x4 pixel, then select pixel be the first row pixel P11~P16, the second row pixel P21~P26..., the 6th
Row pixel P61~P66.To select the third line pixel P31~P36In pixel P33For, with pixel P33Adjacent pixel has P32、
P34、P43、P23, it is as follows with the calculating process of the absolute value of the difference of the color value of adjacent pixel:
A1=| GP33-GP32|
A2=| GP33-GP34|
A3=| GP33-GP43|
A4=| GP33-GP23|
Wherein, GP33、GP32、GP34、GP43、GP23Respectively pixel P33And its adjacent four pixel P32、P34、P43、P23Face
Color value, A1~A4Respectively pixel P33And its adjacent four pixel P32、P34、P43、P23Color value difference absolute value.
And so on the difference of the color value of other pixels pixel adjacent thereto absolute value, do not do repeat one by one herein.
The absolute value of the difference of the color value of selected pixel pixel adjacent thereto is smaller, illustrates selected pixel picture adjacent thereto
The difference of color shown by element is smaller, more levels off to same color.Conversely, then color difference is bigger.For example, working as A1=0
When, pixels illustrated P33With pixel P32Shown color is identical, works as A1When=2, pixels illustrated P33With pixel P32Shown face
Color is closer to, slightly difference.When the absolute value of the difference of all selected pixel pixel color values adjacent thereto is 0, say
A possibility that color shown by each pixel of the corresponding image of the video frame of bright acquisition is most of all identical, is solid-color image is got over
Greatly.When all selected pixel pixel color values adjacent thereto difference absolute value for example in the range of 3~8, illustrate to obtain
The corresponding image of video frame each pixel shown by color be closer to, it may be possible to the image of graduated colors.
Sub-step S202: when the absolute value for the difference for detecting selected pixel pixel color value adjacent thereto is respectively less than first
When threshold value, assessed value is made to add 1.
Wherein, first threshold for example can be 3,5 or 8 etc..
Wherein, by taking first threshold is 8 as an example, it is assumed that A1=0, A2=2, A3=5, A4=7, therefore pixel P33And its it is adjacent
Four pixel P32、P34、P43、P23The absolute value of difference of color value be respectively less than first threshold, thought at this time in pixel P33It is attached
The color closely presented relatively, such as may be only red, light red difference, therefore, it is determined that being pixel P33The face nearby shown
Color is identical, therefore assessed value is made to add 1.
Wherein, due to the color slightly difference of each pixel in the image of graduated colors, in order to reduce the figure of graduated colors
As the probability as video thumbnails, first threshold can be set to the larger value, such as can be set to 10,15 or 30 etc..
Sub-step S203: when assessed value is less than second threshold, then judge that the corresponding image of video frame is not solid color
Image.
Wherein, assessed value is bigger, illustrates that the same or similar pixel of color is more, and image is solid color image (pure color
Image or graduated colors image) probability it is bigger, otherwise illustrate that the same or similar pixel of color is fewer, image be non-single face
The probability of chromatic graph picture is fewer.Wherein second threshold can be set according to the pixel total amount of the image of video frame.Such as work as picture
When plain total amount is 800x600, pixel is 800 at once, and column pixel is 600, is still in every one-row pixels with selected pixel
For each pixel, then whether the absolute value for selecting the difference of pixel pixel color value adjacent thereto is respectively less than the inspection of first threshold
Surveying number is 800 times, and it is 600 that second threshold can be set at this time.When assessed value is less than second threshold, assessed value is smaller, says
The negligible amounts of the same or similar pixel of bright color judge that the corresponding image of video frame is not solid color image at this time, when
When assessed value is greater than or equal to second threshold, assessment check-in is larger, illustrates that the quantity of the same or similar pixel of color is more, this
When judge the corresponding image of video frame for solid color image.
By the above-mentioned means, can image corresponding compared with accurate judgement video frame be pure background color image, to drop
The probability of the low thumbnail as video file that uses pure background colour.
Certainly, in other embodiments of the present invention, the color value of each pixel be may also mean that included by each pixel
Tri- primary color sub-pixels of RGB color value.The absolute value of the difference of selected pixel and its adjacent pixel color value is calculated at this time
It include: the absolute value for calculating the difference of correspondence primary color sub-pixels color value of selected pixel and its adjacent pixel.More specifically,
Calculate the R sub-pixel of the selected pixel absolute value with the difference of the color value of the R sub-pixel of the adjacent pixel respectively, Yi Jiji
Calculate the G sub-pixel absolute value with the difference of the color value of the G sub-pixel of the adjacent pixel, and calculating respectively of selected pixel
The B sub-pixel of the selected pixel absolute value with the difference of the color value of the B sub-pixel of the adjacent pixel respectively.Wherein, work as inspection
When measuring the absolute value of the difference of the color value of each primary color sub-pixels of selected pixel pixel adjacent thereto and being respectively less than first threshold,
So that assessed value is added 1, i.e., when the absolute value of the difference of the color value of the correspondence primary color sub-pixels between pixel is respectively less than first threshold,
And selected pixel is respectively less than the first threshold with the absolute value of the difference of the color value of the corresponding primary color sub-pixels of all adjacent pixels
When value, assessed value is made to add 1.
Refering to Fig. 4, in still another embodiment of the present invention, the pixel of one of video frame of video file is obtained
The step of information includes: transparency (Alpha) value for obtaining each pixel of video frame, to obtain Pixel Information.
Each pixel also has a transparence value other than with color value, to indicate the transparency or not of pixel
Transparency.Wherein, transparence value can between 0~255 value, including endpoint value, transparence value is 0 to indicate transparent, transparent
Angle value is that 255 expressions are opaque.
Wherein, according to Pixel Information judge the corresponding image of video frame whether be solid color image principle and Fig. 2 institute
Show the similar of embodiment, specifically include following sub-step:
Sub-step S401: the absolute value of the difference of selected pixel pixel transparent angle value adjacent thereto is calculated.
Wherein, selecting pixel is each pixel in every a line.In conjunction with Fig. 3, still to select the third line pixel P31~P36
In pixel P33For, it is as follows with the calculating process of the absolute value of the difference of the transparence value of adjacent pixel:
B1=| AP33-AP32|
B2=| AP33-AP34|
B3=| BP33-BP43|
B4=| BP33-BP23|
Wherein, AP33、AP32、AP34、AP43、AP23Respectively pixel P33And its adjacent four pixel P32、P34、P43、P23It is saturating
Brightness value, B1~B4Respectively pixel P33And its adjacent four pixel P32、P34、P43、P23Transparence value difference it is absolute
Value.
And so on the difference of the transparence value of other pixels pixel adjacent thereto absolute value, do not do go to live in the household of one's in-laws on getting married one by one herein
It states.
The absolute value of the difference of the transparence value of selected pixel pixel adjacent thereto is smaller, illustrates that selected pixel is adjacent thereto
The difference of color shown by pixel is smaller, more levels off to same color.Conversely, then color difference is bigger.
Sub-step S402: when the absolute value for the difference for detecting selected pixel pixel transparent angle value adjacent thereto is less than third
When threshold value, assessed value is made to add 1.
Wherein, third threshold value for example can be 5,8 or 10 etc..
Sub-step S403: when assessed value is less than four threshold values, then judge that the corresponding image of video frame is not solid color
Image.
Wherein, assessed value is bigger, illustrates that the same or similar pixel of color is more, and image is the probability of solid color image
It is bigger, on the contrary illustrate that the same or similar pixel of color is fewer, and image is that the probability of non-solid color image is fewer.
Wherein the 4th threshold value can be set according to the pixel total amount of the image of video frame, and the setting with second threshold is former
It manages similar, this is not repeated.
When assessed value is less than four threshold values, assessed value is smaller, illustrates the negligible amounts of the same or similar pixel of color,
Judge that the corresponding image of video frame is not solid color image at this time, when assessed value is greater than or equal to four threshold values, assessed value
Machine is larger, illustrates that the quantity of the same or similar pixel of color is more, judges the corresponding image of video frame for solid color at this time
Image.
In the above-described embodiment, selecting pixel is each pixel in every one-row pixels.In the another embodiment party of the present invention
In formula, selected pixels can be spaced, wherein obtain video file one of video frame Pixel Information the step of include: from
Reference point starts to obtain the Pixel Information that pixel and its adjacent pixel are selected in video frame at equal intervals.
For example, being selected when Pixel Information is the color value of pixel since being obtained at equal intervals reference point in video file
The color value of pixel and its adjacent pixel.By taking dot structure shown in Fig. 3 as an example, using the first row pixel as reference point, at interval of
One-row pixels then obtain the color value of each pixel and its adjacent pixel in one-row pixels, more specifically, the first row, the third line,
Each pixel in fifth line pixel is selected pixel, so that is obtained is in the first row, the third line and fifth line pixel
The color value of each pixel and its adjacent pixel, therefore be only to calculate each of the first row, the third line and fifth line pixel
The absolute value of the difference of the color value of pixel pixel adjacent thereto.
Certainly, in other embodiments, reference point is also possible to the first pixel in every one-row pixels, every a line picture
Started in element with first pixel, then choosing a pixel at interval of predetermined pixel (such as can be and be spaced 3 or 5 etc.) is
Whether selected pixel to obtain the Pixel Information of selected pixel pixel adjacent thereto, and then judges the corresponding image of video frame
For solid color image.
Refering to Fig. 5, in one embodiment of electronic device of present invention creation video file thumbnail, electronic device includes
Obtain module 51, judgment module 52 and generation module 53.
Wherein, the Pixel Information that module 51 is used to obtain one of video frame of video file is obtained.Present embodiment
In, module 51 is obtained since first video frame of video file, obtains the Pixel Information of first video frame.
Wherein, Pixel Information may include luminance information, colouring information, high-frequency information and/or transparence value etc..
Judgment module 52 is used to judge whether the corresponding image of video frame is solid color image according to Pixel Information.
Solid color image refers to that the image of same type color, the image of the same type color refer to the whole of image
The color difference of width picture is smaller comprising the image of same color and the image of graduated colors.Same color image is, for example,
All black picture, full white image, complete red image etc., graduated colors image is, for example, the image from dark red gradual change to light red.It is single
Color image is since the color that each pixel is presented is identical or approximately, the pixel of each pixel of solid color image
Information is closer to, therefore judges whether the corresponding image of video frame is solid color image according to Pixel Information.
Generation module 53 is used for when judgment module 52 judges that the corresponding image of video frame is not solid color image, is obtained
The corresponding image of video frame is to generate the thumbnail of video file.
Unlike solid color image, the image with video content usually has multiple color, such as works as video
When content is personage's head portrait, the color difference at each position such as hair, clothes, skin of personage is all larger, therefore when the view obtained
When the corresponding image of frequency frame is not solid color image, illustrate that a possibility that video frame presents video content is larger, therefore
The thumbnail that the corresponding image of the video frame is generated to video file, it is possible thereby to improve the general of the thumbnail with video content
Rate, so that thumbnail generated being capable of more acurrate displaying video content.Therefore on electronic equipment such as mobile phone, computer
The thumbnail can be used when showing video file to be shown as the path indexing of video file.
Further, when judgment module 52 judges that the corresponding image of video frame is solid color image, then module is obtained
51 obtain the Pixel Information of second video frame judge whether the corresponding image of second video frame is solid color figure
Picture, until finding non-solid color image.
Above embodiment is to obtain the pixel of first video frame first since first video frame of video file
Information is judged, in other embodiments of the invention, is obtained module 51 and is also possible to its random for obtaining video file
In the Pixel Information of a video frame judged that the video frame for judging that this is obtained at random when judgment module 52 at this time is corresponding
When image is solid color image, then obtains module 51 and obtain the Pixel Information of another video frame at random to be judged, with
This analogizes, until finding non-solid color image.
Refering to Fig. 6, in one specific embodiment of electronic device of the present invention, Pixel Information is the color value of pixel.Wherein,
It obtains module 51 to be specifically used for obtaining the color value of each pixel of video frame, to obtain Pixel Information.
Wherein, in present embodiment, the color value of each pixel refers to tri- primary color sub-pixels of RGB by each pixel
The color value of respective pixel that converts of color value.
Wherein judgment module 52 includes the first computing unit 61, the first accumulated unit 62 and the first judging unit 63.
First computing unit 61 is used to calculate the absolute value of the difference of selected pixel pixel color value adjacent thereto.Selected picture
The absolute value of the difference of the color value of element pixel adjacent thereto is smaller, illustrates color shown by selected pixel pixel adjacent thereto
Difference it is smaller, more level off to same color.Conversely, then color difference is bigger.
First accumulated unit 62, which is used to work as, detects that the absolute value of the difference of selected pixel pixel color value adjacent thereto is equal
When less than first threshold, assessed value is made to add 1.Wherein, first threshold for example can be 3,5 or 8 etc..
First judging unit 63 is used to judge that the very corresponding image of video is not single when assessed value is less than second threshold
Color image.Wherein, assessed value is bigger, illustrates that the same or similar pixel of color is more, and image is the general of solid color image
Rate is bigger, otherwise illustrates that the same or similar pixel of color is fewer, and image is that the probability of non-solid color image is fewer.Wherein
Two threshold values can be set according to the pixel total amount of the image of video frame.When assessed value be less than second threshold when, assessed value compared with
It is small, illustrate the negligible amounts of the same or similar pixel of color, judges that the corresponding image of video frame is not solid color figure at this time
Picture, when assessed value is greater than or equal to second threshold, assessment check-in is larger, illustrate the quantity of the same or similar pixel of color compared with
It is more, judge the corresponding image of video frame for solid color image at this time.
By the above-mentioned means, can image corresponding compared with accurate judgement video frame be pure background color image, to drop
The probability of the low thumbnail as video file that uses pure background colour.
Certainly, in other embodiments of the present invention, the color value of each pixel be may also mean that included by each pixel
Tri- primary color sub-pixels of RGB color value.
Refering to Fig. 7, in the another embodiment of electronic device of the present invention, obtains module 51 and be specifically used for obtaining video frame
Transparency (Alpha) value of each pixel, to obtain Pixel Information.
Wherein, judgment module 52 includes the second computing unit 71, the second accumulated unit 72 and second judgment unit 73.
Second computing unit 71 is used to calculate the absolute value of the difference of the transparence value of selected pixel pixel adjacent thereto.Choosing
The absolute value for determining the difference of the transparence value of pixel pixel adjacent thereto is smaller, illustrates shown by selected pixel pixel adjacent thereto
Color difference it is smaller, more level off to same color.Conversely, then color difference is bigger.
Second accumulated unit 72 is used for the absolute value when the difference for detecting selected pixel pixel transparent angle value adjacent thereto
When less than third threshold value, assessed value is made to add 1.Wherein, third threshold value for example can be 5,8 or 10 etc..
Second judgment unit 73 is used for when assessed value is less than four threshold values, judges that the corresponding image of video frame is not single
Color image.Wherein, assessed value is bigger, illustrates that the same or similar pixel of color is more, and image is the general of solid color image
Rate is bigger, otherwise illustrates that the same or similar pixel of color is fewer, and image is that the probability of non-solid color image is fewer.Wherein
Four threshold values can be set according to the pixel total amount of the image of video frame.
In the another embodiment of electronic device of the present invention, module 51 is obtained for obtaining view at equal intervals since reference point
The Pixel Information of pixel and its adjacent pixel is selected in frequency frame.
For example, obtaining module 51 when Pixel Information is the color value of pixel and obtaining video at equal intervals since reference point
The color value of pixel and its adjacent pixel is selected in file.It is reference with the first row pixel by taking dot structure shown in Fig. 3 as an example
Point then obtains the color value of each pixel and its adjacent pixel in one-row pixels at interval of one-row pixels, more specifically, first
Row, the third line, each pixel in fifth line pixel are selected pixel, so that is obtained is the first row, the third line and the 5th
The color value of each pixel and its adjacent pixel in row pixel, therefore be only to calculate the first row, the third line and fifth line picture
The absolute value of the difference of the color value of each pixel pixel adjacent thereto in element.
Certainly, in other embodiments, reference point is also possible to the first pixel in every one-row pixels, every a line picture
Started in element with first pixel, then choosing a pixel at interval of predetermined pixel (such as can be and be spaced 3 or 5 etc.) is
Whether selected pixel to obtain the Pixel Information of selected pixel pixel adjacent thereto, and then judges the corresponding image of video frame
For solid color image.
Mode the above is only the implementation of the present invention is not intended to limit the scope of the invention, all to utilize this
Equivalent structure or equivalent flow shift made by description of the invention and accompanying drawing content, it is relevant to be applied directly or indirectly in other
Technical field is included within the scope of the present invention.