Detailed description of the invention
Below in conjunction with drawings and embodiments, the present invention is described in detail.
Refering to Fig. 1, in creation method one embodiment of video file thumbnail of the present invention, including
Step:
Step S101: obtain the Pixel Information of one of them frame of video of video file.
Wherein, in the present embodiment, from the beginning of the first of video file frame of video, the is obtained
The Pixel Information of one frame of video.
Wherein, Pixel Information can include monochrome information, colouring information, high-frequency information and/or transparent
Angle value etc..
Step S102: judge whether image corresponding to frame of video is solid color figure according to Pixel Information
Picture.
Solid color image refers to the image of same type color, including the image and gradually of same color
Become the image of color.Same color image e.g. all black picture, full white image, complete red image etc.,
Graduated colors image e.g. from dark red gradual change to ruddy image.Solid color image is due to often
The color that individual pixel presents is identical or approximately, the therefore picture of each pixel of solid color image
Prime information is closer to, and therefore judges whether image corresponding to frame of video is single according to Pixel Information
One color image.
Step S103: if it is not, then obtain image corresponding to frame of video to generate the contracting of video file
Sketch map.
Unlike solid color image, the image with video content is generally of multiple face
Color, such as when video content is personage's head portrait, each position such as the hair of personage, clothes, skin
Color distortion the biggest, be not therefore solid color image when the image that the frame of video obtained is corresponding
Time, illustrate that this frame of video presents the probability of video content relatively greatly, therefore that this frame of video is corresponding
Image generate the thumbnail of video file, thus can improve the thumbnail with video content
Probability, so that the thumbnail generated can more accurately show video content.Therefore at electronics
This thumbnail can be used as video file when showing video file on equipment such as mobile phone, computer
Path indexing show.
Further, when judging that image corresponding to first frame of video obtained is solid color image
Time, then obtain the Pixel Information of second frame of video to judge second according to the Pixel Information obtained
Whether image corresponding to frame of video is solid color image, by that analogy, according to the broadcasting of frame of video
Order is till finding non-solid color image.
Above-mentioned embodiment is from the beginning of the first of video file frame of video, first obtains first
The Pixel Information of frame of video judges, in other embodiments of the present invention, it is also possible to be with
The Pixel Information of one of them frame of video that machine obtains video file judges, now when judging this
When image corresponding to the frame of video of secondary random acquisition is solid color image, obtain another the most at random
Whether the Pixel Information of frame of video is single face with the image that judgement another frame of video described is corresponding
Color image, by that analogy, till finding non-solid color image.
Refering to Fig. 2, in the embodiment of the invention, obtain one of them of video file
The step of the Pixel Information of frame of video includes: obtain the color value of each pixel of frame of video, to obtain
Pixel information.
Described color value refers to the grey decision-making of pixel.Multiple pixels that image is arranged by ranks are formed,
Each pixel includes R (red), G (green), three primary color sub-pixels of B (blue), each primary colours
Sub-pixel has a color value, this color value can between 0~255 value, including endpoint value.
Wherein, in present embodiment, the color value of each pixel refers to the RGB tri-by each pixel
One color value of the respective pixel that the color value conversion of individual primary color sub-pixels obtains.Due to above-mentioned face
The conversion of colour belongs to the category of prior art, and the emphasis place of non-invention, thus the most superfluous
State.
Wherein, judge whether image corresponding to frame of video is solid color image bag according to Pixel Information
Include following sub-step:
Sub-step S201: calculate the absolute value that selected pixel is adjacent the difference of pixel color value.
Wherein, each pixel during selected pixel is every one-row pixels.In conjunction with Fig. 3, it is assumed that obtained
Image corresponding to the frame of video that takes includes 6x4 pixel, then selecting pixel is the first row pixel
P11~P16, the second row pixel P21~P26..., the 6th row pixel P61~P66.With selected the third line
Pixel P31~P36In pixel P33As a example by, 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 neighbor:
A1=| GP33-GP32|
A2=| GP33-GP34|
A3=| GP33-GP43|
A4=| GP33-GP23|
Wherein, GP33、GP32、GP34、GP43、GP23It is respectively pixel P33And adjacent four pictures
Element P32、P34、P43、P23Color value, A1~A4It is respectively pixel P33And adjacent four pictures
Element P32、P34、P43、P23The absolute value of difference of color value.
Other pixels are adjacent the absolute value of difference of color value of pixel by that analogy, at this not
Do and repeat one by one.
The absolute value of the difference that selected pixel is adjacent the color value of pixel is the least, and selected picture is described
The difference that element is adjacent the color shown by pixel is the least, more levels off to same color.Otherwise,
Then color distortion is the biggest.Such as, A is worked as1When=0, pixels illustrated P33With pixel P32Shown
Color is identical, works as A1When=2, pixels illustrated P33With pixel P32Shown color is closer to,
Slightly difference.The absolute value of the difference being adjacent pixel color value when all selected pixels is 0
Time, the color major part all phases shown by each pixel of image corresponding to frame of video obtained are described
With, the probability for solid-color image is the biggest.When all selected pixels are adjacent pixel color value
The absolute value of difference such as in the range of 3~8, image corresponding to frame of video illustrating to obtain each
Color shown by pixel is closer to, it may be possible to the image of graduated colors.
Sub-step S202: when detecting that selected pixel is adjacent the absolute of the difference of pixel color value
When value is respectively less than first threshold, assessed value is made to add 1.
Wherein, first threshold can be such as 3,5 or 8 etc..
Wherein, as a example by first threshold is 8, it is assumed that A1=0, A2=2, A3=5, A4=7, because of
This pixel P33And adjacent four pixels P32、P34、P43、P23Difference absolute of color value
Value is respectively less than first threshold, now thinks in pixel P33Near the color that presented relatively,
May be such as only red, light red difference, therefore, it is determined that be pixel P33The color phase of neighbouring display
With, therefore make assessed value add 1.
Wherein, due to the color slightly difference of pixel each in the image of graduated colors, in order to reduce by
First threshold, as the probability of video thumbnails, can be set to bigger by the image of graduated colors
Value, such as, could be arranged to 10,15 or 30 etc..
Sub-step S203: when assessed value is less than Second Threshold, then judge the image that frame of video is corresponding
It it not solid color image.
Wherein, assessed value is the biggest, illustrates that the same or like pixel of color is the most, and image is single
The probability of color image (solid-color image or graduated colors image) is the biggest, otherwise explanation color is identical
Or close pixel is the fewest, image is that the probability of non-solid color image is the fewest.Wherein Second Threshold
Can be set according to the pixel total amount of the image of frame of video.When pixel total amount it is such as
During 800x600, pixel is 800 at once, and row pixel is 600, is still every with selected pixel
As a example by each pixel in one-row pixels, then select pixel and be adjacent the difference of pixel color value
Whether absolute value is respectively less than the detection number of times of first threshold is 800 times, now can arrange the second threshold
Value is 600.When assessed value is less than Second Threshold, assessed value is less, illustrates that color is identical or phase
The negligible amounts of near pixel, now judges that image corresponding to frame of video is not solid color image,
When assessed value is more than or equal to Second Threshold, assessed value machine is relatively big, illustrates that color is same or like
The quantity of pixel more, now judge that image corresponding to frame of video is solid color image.
By the way, can be compared with accurately judging that image corresponding to frame of video is pure background colour
Image, thus reduce the probability using pure background colour as the thumbnail of video file.
Certainly, in other embodiments of the present invention, the color value of each pixel may also mean that often
The color value of tri-primary color sub-pixels of RGB included by individual pixel.Now calculate selected pixel and
The absolute value of the difference of its neighbor color value includes: calculate selected pixel and neighbor thereof
The absolute value of the difference of corresponding primary color sub-pixels color value.More specifically, selected pixel is calculated
R sub-pixel respectively with the absolute value of the difference of the color value of the R sub-pixel of described neighbor, with
And calculate the G sub-pixel of selected pixel respectively with the color value of the G sub-pixel of described neighbor
The absolute value of difference, and calculate the B sub-pixel of selected pixel respectively with the B of described neighbor
The absolute value of the difference of the color value of sub-pixel.Wherein, when detecting that selected pixel is adjacent picture
When the absolute value of the difference of the color value of each primary color sub-pixels of element is respectively less than first threshold, make assessment
Value adds 1, i.e. the absolute value of the difference of the color value of the corresponding primary color sub-pixels between pixel is the least
In first threshold, and the color value of selected pixel and the corresponding primary color sub-pixels of all neighbors
The absolute value of difference when being respectively less than first threshold, make assessed value add 1.
Refering to Fig. 4, in still another embodiment of the present invention, obtain wherein the one of video file
The step of the Pixel Information of individual frame of video includes: obtain the transparency of each pixel of frame of video
(Alpha) value, to obtain Pixel Information.
Each pixel, in addition to having color value, also has a transparence value, in order to represent pixel
Transparency or opacity.Wherein, transparence value can between 0~255 value, including end
Point value, transparence value is that 0 expression is transparent, and transparence value is that 255 expressions are opaque.
Wherein, judge whether image corresponding to frame of video is solid color image according to Pixel Information
Principle is similar with Fig. 2 illustrated embodiment, specifically includes following sub-step:
Sub-step S401: the selected pixel of calculating is adjacent the absolute of the difference of pixel transparent angle value
Value.
Wherein, each pixel during selected pixel is every a line.In conjunction with Fig. 3, still with selected the
Three row pixels P31~P36In pixel P33As a example by, the difference of its transparence value with neighbor
The calculating process of absolute value is as follows:
B1=| AP33-AP32|
B2=| AP33-AP34|
B3=| BP33-BP43|
B4=| BP33-BP23|
Wherein, AP33、AP32、AP34、AP43、AP23It is respectively pixel P33And adjacent four pictures
Element P32、P34、P43、P23Transparence value, B1~B4It is respectively pixel P33And adjacent four
Pixel P32、P34、P43、P23The absolute value of difference of transparence value.
Other pixels are adjacent the absolute value of difference of transparence value of pixel by that analogy, at this
Do not do and repeat one by one.
The absolute value of the difference that selected pixel is adjacent the transparence value of pixel is the least, illustrates selected
The difference that pixel is adjacent the color shown by pixel is the least, more levels off to same color.Instead
It, then color distortion is the biggest.
Sub-step S402: when detecting that selected pixel is adjacent the exhausted of the difference of pixel transparent angle value
During to value less than three threshold values, assessed value is made to add 1.
Wherein, the 3rd threshold value can be such as 5,8 or 10 etc..
Sub-step S403: when assessed value is less than four threshold values, then judge the image that frame of video is corresponding
It it not solid color image.
Wherein, assessed value is the biggest, illustrates that the same or like pixel of color is the most, and image is single
The probability of color image is the biggest, otherwise the explanation same or like pixel of color is the fewest, and image is non-
The probability of solid color image is the fewest.
Wherein the 4th threshold value can be set according to the pixel total amount of the image of frame of video, with second
The setting principle of threshold value is similar, does not repeats this.
When assessed value is less than four threshold values, assessed value is less, and the picture that color is same or like is described
The negligible amounts of element, now judges that image corresponding to frame of video is not solid color image, works as assessment
When value is more than or equal to four threshold values, assessed value machine is relatively big, and the pixel that color is same or like is described
Quantity more, now judge that image corresponding to frame of video is solid color image.
In the above-described embodiment, each pixel during selected pixel is every one-row pixels.At this
In bright another embodiment, selected pixels can be spaced, wherein obtain video file one of them
The step of the Pixel Information of frame of video includes: start to obtain at equal intervals frame of video selected from reference point
Pixel and the Pixel Information of neighbor thereof.
Such as, when the color value that Pixel Information is pixel, start to obtain at equal intervals to regard from reference point
Selected pixel and the color value of neighbor thereof in frequency file.As a example by the dot structure shown in Fig. 3,
With the first row pixel as reference point, then obtain at interval of one-row pixels in one-row pixels each pixel and
The color value of its neighbor, more specifically, every in the first row, the third line, fifth line pixel
Individual pixel is selected pixel, thus obtain is in the first row, the third line and fifth line pixel
Each pixel and the color value of neighbor thereof, be the most only to calculate the first row, the third line and the
Each pixel in five elements' pixel is adjacent the absolute value of the difference of the color value of pixel.
Certainly, in other embodiments, reference point can also be first in every one-row pixels
Pixel, starts with first pixel in every one-row pixels, at interval of a predetermined pixel (can be such as
Be spaced 3 or 5 etc.) then choose a pixel for selected pixel, thus obtain selected pixel with
The Pixel Information of its neighbor, and then judge whether image corresponding to frame of video is solid color figure
Picture.
Refering to Fig. 5, in the present invention creates electronic installation one embodiment of video file thumbnail,
Electronic installation includes acquisition module 51, judge module 52 and generation module 53.
Wherein, acquisition module 51 is for obtaining the pixel letter of one of them frame of video of video file
Breath.In present embodiment, acquisition module 51, from the beginning of the first of video file frame of video, obtains
Take the Pixel Information of first frame of video.
Wherein, Pixel Information can include monochrome information, colouring information, high-frequency information and/or transparent
Angle value etc..
According to Pixel Information, judge module 52 is for judging whether image corresponding to frame of video is single
Color image.
Solid color image refers to the image of same type color, the image of described same type color
Refer to that the color distortion of the entire picture of image is less, it image including same color and gradual change face
The image of color.Same color image e.g. all black picture, full white image, complete red image etc., gradually
Become color image e.g. from dark red gradual change to ruddy image.Solid color image is due to each
The color that pixel presents is identical or approximately, the therefore pixel of each pixel of solid color image
Information is closer to, and therefore judges whether image corresponding to frame of video is single according to Pixel Information
Color image.
When judge module 52, generation module 53 is for judging that image corresponding to frame of video is not single face
During color image, obtain image corresponding to frame of video to generate the thumbnail of video file.
Unlike solid color image, the image with video content is generally of multiple face
Color, such as when video content is personage's head portrait, each position such as the hair of personage, clothes, skin
Color distortion the biggest, be not therefore solid color image when the image that the frame of video obtained is corresponding
Time, illustrate that this frame of video presents the probability of video content relatively greatly, therefore that this frame of video is corresponding
Image generate the thumbnail of video file, thus can improve the thumbnail with video content
Probability, so that the thumbnail generated can more accurately show video content.Therefore at electronics
This thumbnail can be used as video file when showing video file on equipment such as mobile phone, computer
Path indexing show.
Further, judge that image corresponding to frame of video is solid color image when judge module 52
Time, then acquisition module 51 obtains the Pixel Information of second frame of video to carry out judging that second regards
Whether the image that frame is corresponding frequently is solid color image, until finding non-solid color image.
Above-mentioned embodiment is from the beginning of the first of video file frame of video, first obtains first
The Pixel Information of frame of video judges, in other embodiments of the present invention, and acquisition module 51
Can also be that the Pixel Information of one of them frame of video obtaining video file at random judges, this
Time judge that image corresponding to this frame of video obtained at random is solid color figure when judge module 52
During picture, then acquisition module 51 obtains the Pixel Information of another frame of video at random to judge,
By that analogy, till finding non-solid color image.
Refering to Fig. 6, in electronic installation one detailed description of the invention of the present invention, Pixel Information is pixel
Color value.Wherein, acquisition module 51 is specifically for obtaining the color of each pixel of frame of video
Value, to obtain Pixel Information.
Wherein, in present embodiment, the color value of each pixel refers to the RGB by each pixel
One color value of the respective pixel that the color value conversion of three primary color sub-pixels obtains.
Wherein judge module 52 includes first computing unit the 61, first accumulated unit 62 and first
Judging unit 63.
First computing unit 61 is adjacent the difference of pixel color value for calculating selected pixel
Absolute value.The absolute value of the difference that selected pixel is adjacent the color value of pixel is the least, and choosing is described
The difference that fixation element is adjacent the color shown by pixel is the least, more levels off to same color.
Otherwise, then color distortion is the biggest.
First accumulated unit 62 is for when detecting that selected pixel is adjacent the difference of pixel color value
When the absolute value of value is respectively less than first threshold, assessed value is made to add 1.Wherein, first threshold such as may be used
Being 3,5 or 8 etc..
First judging unit 63 is for when assessed value is less than Second Threshold, it is judged that video is the most corresponding
Image be not solid color image.Wherein, assessed value is the biggest, illustrates that color is same or like
Pixel is the most, and image is that the probability of solid color image is the biggest, otherwise explanation color is same or like
Pixel the fewest, image is that the probability of non-solid color image is the fewest.Wherein Second Threshold can root
It is set according to the pixel total amount of the image of frame of video.When assessed value is less than Second Threshold, assessment
It is worth less, the negligible amounts of the same or like pixel of color is described, now judge that frame of video is corresponding
Image be not solid color image, when assessed value more than or equal to Second Threshold time, assessed value machine
Relatively big, illustrate that the quantity of the same or like pixel of color is more, now judge that frame of video is corresponding
Image is solid color image.
By the way, can be compared with accurately judging that image corresponding to frame of video is pure background colour
Image, thus reduce the probability using pure background colour as the thumbnail of video file.
Certainly, in other embodiments of the present invention, the color value of each pixel may also mean that often
The color value of tri-primary color sub-pixels of RGB included by individual pixel.
Refering to Fig. 7, in the another embodiment of electronic installation of the present invention, acquisition module 51 is specifically used
In transparency (Alpha) value of each pixel obtaining frame of video, to obtain Pixel Information.
Wherein, it is judged that module 52 includes second computing unit the 71, second accumulated unit 72 and
Two judging units 73.
Second computing unit 71 is for calculating the difference that selected pixel is adjacent the transparence value of pixel
The absolute value of value.The absolute value of the difference that selected pixel is adjacent the transparence value of pixel is the least,
Illustrate that selected pixel is adjacent the difference of the color shown by pixel the least, more level off to same
Color.Otherwise, then color distortion is the biggest.
Second accumulated unit 72 is for when detecting that selected pixel is adjacent pixel transparent angle value
When the absolute value of difference is less than three threshold values, assessed value is made to add 1.Wherein, the 3rd threshold value such as may be used
Being 5,8 or 10 etc..
Second judging unit 73 is for when assessed value is less than four threshold values, it is judged that frame of video is corresponding
Image be not solid color image.Wherein, assessed value is the biggest, illustrates that color is same or like
Pixel is the most, and image is that the probability of solid color image is the biggest, otherwise explanation color is same or like
Pixel the fewest, image is that the probability of non-solid color image is the fewest.Wherein the 4th threshold value can root
It is set according to the pixel total amount of the image of frame of video.
In the another embodiment of electronic installation of the present invention, acquisition module 51 is for opening from reference point
Begin to obtain at equal intervals selected pixel and the Pixel Information of neighbor thereof in frame of video.
Such as, when the color value that Pixel Information is pixel, acquisition module 51 is from the beginning of reference point
Obtain selected pixel and the color value of neighbor thereof in video file at equal intervals.Shown in Fig. 3
As a example by dot structure, with the first row pixel as reference point, then obtain a line picture at interval of one-row pixels
Each pixel and the color value of neighbor thereof in element, more specifically, the first row, the third line,
Each pixel in five elements' pixel is selected pixel, thus obtain be the first row, the third line and
Each pixel in fifth line pixel and the color value of neighbor thereof, be the most only calculating first
Each pixel in row, the third line and fifth line pixel is adjacent the difference of the color value of pixel
Absolute value.
Certainly, in other embodiments, reference point can also be first in every one-row pixels
Pixel, starts with first pixel in every one-row pixels, at interval of a predetermined pixel (can be such as
Be spaced 3 or 5 etc.) then choose a pixel for selected pixel, thus obtain selected pixel with
The Pixel Information of its neighbor, and then judge whether image corresponding to frame of video is solid color figure
Picture.
The foregoing is only embodiments of the present invention, not thereby limit the patent model of the present invention
Enclosing, every equivalent structure utilizing description of the invention and accompanying drawing content to be made or equivalence flow process become
Change, or be directly or indirectly used in other relevant technical fields, be the most in like manner included in the present invention's
In scope of patent protection.