Embodiment
In order that those skilled in the art more fully understand the technical scheme in the application, it is real below in conjunction with the application
The accompanying drawing in example is applied, the technical scheme in the embodiment of the present application is clearly and completely described, it is clear that described implementation
Example only some embodiments of the present application, rather than whole embodiments.Based on the embodiment in the application, this area is common
The every other embodiment that technical staff is obtained under the premise of creative work is not made, should all belong to the application protection
Scope.
Fig. 1 to Fig. 3 is a kind of method flow diagram of the embodiment of electronic certificate identification triggering method described herein.Though
So this application provides such as following embodiments or method operating procedure shown in the drawings, but based on conventional or without creativeness
Work can include more or less operating procedures in the process.It is not present in logicality necessary causal
In step, the execution sequence of these steps is not limited to the embodiment of the present application description and execution sequence shown in the drawings.Described side
When method device in practice or end product are applied, progress order can be connected according to embodiment or method shown in the drawings
Perform or parallel execution (environment of such as parallel processor or multiple threads, or even distributed processing environment).
Electronic certificate identification triggering method and device that the application is provided, are by the video image in certificate rest area
Trigger signal is exported when certificate feature is detected in predeterminable area, the certificate rest area continuous collecting video is mainly utilized in
Image, and all single-frame images in the video image are converted into the initial picture of rgb color pattern, with described initial
The change of the average gray value and average color component that are detected in the difference predeterminable area of picture is turned to certificate feature, to judge
Certificate whether is placed in the certificate rest area, and thus exports trigger signal.It follows that utilizing the embodiment party of the application
Case, is sentenced by comparing the average gray value between the difference predeterminable area of adjacent two frames initial picture and average color component
It is disconnected whether to export trigger signal, therefore, judge that precision is higher;In addition, trigger signal is actively exported by trigger module, it is not necessary to
Staff presses certificate or separately uses operation button again, effectively increases the operating efficiency of certificate identification;Moreover, using
The electronic certificate identification triggering method or device of the application, it is not necessary to extra in electronic certificate identification equipment to install LED hairs
The part such as pipe and LED reception pipe is penetrated, cost is not only effectively reduced, the trouble point of equipment is also effectively reduced.
Wherein, rgb color pattern (be also translated as " RGB ", fewer with) is a kind of color standard of industrial quarters, is
By to red (Red), green (Green), the change of blue (Blue) three Color Channels and their superpositions each other come
To miscellaneous color, RGB is the color for representing three passages of red, green, blue, and this standard almost includes the mankind and regarded
The all colours that power can be perceived are current with one of most wide color system.Rgb color pattern is figure using RGB models
The intensity level that the RGB component of each pixel is distributed in the range of one 0 to 255 as in.For example:Pure red R values are that 255, G values are
0, B value is 0;Tri- values of R, G, B of grey are equal (except 0 and 255);R, G, B of white are 255;R, G, B of black be
0.RGB image is only using three kinds of colors, so that it may so that they are mixed according to different ratios, 16777216 kinds are reappeared on screen
Color.Under RGB patterns, every kind of RGB compositions all can be used from 0 (black) to the value of 255 (whites).For example, shiny red uses R
Value 246, G values 20 and B values 50.When all three signal component values are equal, gray shade is produced.When the value of all the components is 255
When, result is pure white;When the value is 0, result is ater.
Specifically as shown in Figure 1 to Figure 3, a kind of electronic certificate identification triggering method that embodiments herein is provided, can be with
Including:
Step 1:To certificate rest area continuous collecting video image, and all single-frame images in the video image are equal
It is converted into the initial picture of rgb color pattern;
The single frames picture is converted into the initial picture of rgb color pattern, made each in the initial picture
Individual pixel all has red component, green component and blue component, in order to the red component beneficial to pixel, green component
And blue component, carry out the calculating of next step.The S301 in S201 and Fig. 3 in specific S101, Fig. 2 referred in Fig. 1.
Step 2:Calculate the average gray value and/or average color component of the difference predeterminable area of the initial picture;
The average gray value of the difference predeterminable area of the initial picture and average color component, which can be used as, judges institute
State the parameter that certificate whether is placed in certificate rest area.
In a specific embodiment as shown in Figure 1, the average ash of the difference predeterminable area of the initial picture is selected
Angle value is used as the parameter for judging whether to place certificate in the certificate rest area, as S102:Calculate the difference of the initial picture
It is worth the average gray value of predeterminable area.
Wherein, the average gray value of the difference predeterminable area refers to the ash of all pixels point in the difference predeterminable area
The average value of angle value.In step S101, we have been obtained for the red point of each pixel in the initial picture
Amount, green component and blue component.The gray value for calculating pixel by the color component of pixel has a variety of conversion formulas,
In actual use, most suitable formula can be chosen according to the Target Photo and identifying purpose of image recognition.
Particularly, step S102 can include:
S1021:By red component, green component and the blue component of each pixel in the difference predeterminable area,
Calculate the gray value of each pixel in the difference predeterminable area;
By taking any pixel point in the difference predeterminable area as an example, each pixel can be passed through by below equation
Red component, green component and the blue component of point, calculate the gray value of the pixel:
Grey=0.299*R+0.587*G+0.114*B
In addition, in order to avoid the floating-point operation of low speed, it would however also be possible to employ integer arithmetic, such as by scaling 1000 times come real
Existing integer arithmetic algorithm, i.e., calculate Grey value by below equation:
Grey=(299*R+587*G+114*B)/1000
Wherein, Grey represents the gray value of the pixel, and R represents the red component of the pixel, and G represents the pixel
Green component, B represents the blue component of the pixel.
S1022:The average value of the gray value of all pixels point in the difference predeterminable area is calculated, the difference preset areas is used as
The average gray value in domain.
In a specific embodiment as shown in Figure 2, the average face of the difference predeterminable area of the initial picture is selected
Colouring component is used as the parameter for judging whether to place certificate in the certificate rest area, as S202:Calculate the initial picture
The average color component of difference predeterminable area.
It is well known that color component includes red component, green component and blue component.With the average color component
During as judging whether to place the parameter of certificate in the certificate rest area, red component, green component and blueness can be chosen
One of which, two of which in component or three kinds are all selected, and this just includes six kinds of situations.According to selected color point
Amount, the average color component of the difference predeterminable area includes average red component and/or average green component and/or average indigo plant
Colouring component;Accordingly, the average color component of the difference predeterminable area of the initial picture is calculated, including:
It is the flat of the difference predeterminable area to calculate the average value of the red component of all pixels point in the difference predeterminable area
Equal red component, and/or
It is the flat of the difference predeterminable area to calculate the average value of the green component of all pixels point in the difference predeterminable area
Equal green component, and/or
It is the flat of the difference predeterminable area to calculate the average value of the blue component of all pixels point in the difference predeterminable area
Equal blue component.
In a specific embodiment as shown in Figure 3, the average ash of the difference predeterminable area of the initial picture is selected
Angle value and average color component are as the parameter for judging whether to place certificate in the certificate rest area, as S302:Calculate
The average gray value and average color component of the difference predeterminable area of the initial picture.
Such a situation be exactly using the average gray value in first two situation and average color component as parameter, therefore,
Calculating in this case, both needs to complete the calculating of average gray value, it is also desirable to complete the calculating of average color component.By
Include six kinds of situations in the selection of the average color component, therefore, such a situation correspondingly also includes six kinds of situations.
Step 3:Accordingly, initial picture described in former frame difference predeterminable area average gray value and a later frame
When the absolute value of difference between the average gray value of the difference predeterminable area of the initial picture is more than gray value difference threshold,
And/or initial picture described in former frame difference predeterminable area average color component and initial picture described in a later frame difference
When the absolute value for being worth the difference between the average color component of predeterminable area is more than color component difference threshold, output triggering letter
Number.
S103:It is corresponding with the first situation in S102, if as shown in figure 1, selecting the difference of the initial picture pre-
If the average gray value in region is as the parameter for judging whether to place certificate in the certificate rest area, i.e., described in former frame just
The average gray of the difference predeterminable area of initial picture described in the average gray value and a later frame of the difference predeterminable area of beginning picture
When the absolute value of difference between value is more than gray value difference threshold, it is believed that exist in the difference predeterminable area of the initial picture
" certificate feature ", that is to say, that there is certificate in the certificate rest area, now, exports trigger signal.
In order to further improve the precision of output trigger signal, at least one gray scale is additionally provided with the initial picture
Be worth predeterminable area, and initial picture described in former frame difference predeterminable area average gray value and a later frame described in it is initial
The absolute value of difference between the average gray value of the difference predeterminable area of picture is more than gray value difference threshold and a later frame institute
When the average gray value for stating at least one gray value predeterminable area of initial picture is more than gray value threshold value, trigger signal is exported.
Particularly, include a difference predeterminable area in the initial picture and multiple gray values are default
Region;The gray value threshold value includes multiple secondary gray value threshold values;In the difference predeterminable area of initial picture described in former frame
Average gray value and a later frame described in initial picture difference predeterminable area average gray value between difference absolute value
More than the average gray value of each gray value predeterminable area of initial picture described in gray value difference threshold and a later frame
When being all higher than the corresponding secondary gray value threshold value, trigger signal is exported.
S203:It is corresponding with second of situation in S102, as shown in Fig. 2 the difference that have selected the initial picture is pre-
If the average color component in region is as the parameter for judging whether to place certificate in the certificate rest area, i.e., described in former frame
The average color component of the difference predeterminable area of initial picture is averaged with the difference predeterminable area of initial picture described in a later frame
When the absolute value of difference between color component is more than color component difference threshold, it is believed that the difference preset areas of the initial picture
There is " certificate feature " in domain, that is to say, that there is certificate in the certificate rest area, now, export trigger signal.
From the foregoing it will be appreciated that according to selected color component, being divided into six kinds of situations, the average face of the difference predeterminable area
Colouring component includes average red component and/or average green component and/or average blue component;So, accordingly, the face
Colouring component difference threshold includes red component difference threshold and/or green component difference threshold and/or blue component difference threshold.
Therefore, in this step, the condition of output trigger signal also accordingly includes following several situations:
The difference of the average red component of the difference predeterminable area of the former frame picture and a later frame picture is preset
When difference between the average red component in region is more than the red component difference threshold, and/or
The difference of the average green component of the difference predeterminable area of the former frame picture and a later frame picture is preset
When difference between the average green component in region is more than the green component difference threshold, and/or
The difference of the average blue component of the difference predeterminable area of the former frame picture and a later frame picture is preset
When difference between the average blue component in region is more than the blue component difference threshold.
So that the average color component of the difference predeterminable area includes red component as an example, touched to further improve output
The precision of signalling, sets at least one red component predeterminable area in the initial picture, and in former frame picture
Between the average red component of the difference predeterminable area of the average red component of difference predeterminable area and a later frame picture
Difference is more than at least one red component predeterminable area of initial picture described in the red component difference threshold and a later frame
When average red component is more than red component threshold value, trigger signal is exported.
Particularly, include a difference predeterminable area in the initial picture and multiple red components are pre-
If region;The red component threshold value includes multiple secondary red component threshold values;In the difference predeterminable area of former frame picture
Difference between the average red component of the difference predeterminable area of average red component and a later frame picture is more than described red
The average red component of each red component predeterminable area of initial picture described in colouring component difference threshold and a later frame
When being all higher than the corresponding secondary red component threshold value, trigger signal is exported.
Again so that the average color component of the difference predeterminable area includes green component as an example, in order to further improve output
The precision of trigger signal, sets at least one green component predeterminable area in the initial picture, and in former frame picture
Difference predeterminable area average green component and a later frame picture difference predeterminable area average green component between
Difference be more than at least one green component predeterminable area of initial picture described in the green component difference threshold and a later frame
Average green component be more than green component threshold value when, export trigger signal.
Particularly, include a difference predeterminable area in the initial picture and multiple green components are pre-
If region;The green component threshold value includes multiple secondary green component threshold values;In the difference predeterminable area of former frame picture
Difference between the average green component of the difference predeterminable area of average green component and a later frame picture is more than described green
The average green component of each green component predeterminable area of initial picture described in colouring component difference threshold and a later frame
When being all higher than the corresponding secondary green component threshold value, trigger signal is exported.
Then so that the average color component of the difference predeterminable area includes blue component as an example, in order to further improve defeated
Go out the precision of trigger signal, at least one blue component predeterminable area is set in the initial picture, and in former frame figure
The average blue component of the difference predeterminable area of the average blue component of the difference predeterminable area of piece and a later frame picture it
Between difference be more than at least one blue component preset areas of initial picture described in the blue component difference threshold and a later frame
When the average blue component in domain is more than blue component threshold value, trigger signal is exported.
Particularly, include a difference predeterminable area in the initial picture and multiple blue components are pre-
If region;The blue component threshold value includes multiple secondary blue component threshold values;In the difference predeterminable area of former frame picture
Difference between the average blue component of the difference predeterminable area of average blue component and a later frame picture is more than the indigo plant
The average blue component of each blue component predeterminable area of initial picture described in colouring component difference threshold and a later frame
When being all higher than the corresponding secondary blue component threshold value, trigger signal is exported.
When the average color component of the difference predeterminable area includes its in red component, green component and blue component
In two kinds or three kinds all include when, by that analogy, repeat no more.
S303:It is corresponding with the third situation in S102, as shown in figure 3, the difference that have selected the initial picture is pre-
If the average gray value in region and average color component are as the parameter for judging whether to place certificate in the certificate rest area,
So, initial picture described in former frame difference predeterminable area average gray value and a later frame described in initial picture difference
The absolute value of difference between the average gray value of predeterminable area is more than initial picture described in gray value difference threshold and former frame
Difference predeterminable area average color component and initial picture described in a later frame difference predeterminable area average color component
Between difference absolute value be more than color component difference threshold when, can just export trigger signal.Equally, export in such cases
The standard of trigger signal, it is different according to the average color component of selection, also including six kinds of situations.
Based on same inventive concept, a kind of electronic certificate identification triggering device is additionally provided in embodiments herein, such as
Described in the following examples.Because electronic certificate recognizes that triggering device solves the principle of problem and electronic certificate recognizes triggering method
It is similar, therefore the implementation of electronic certificate identification triggering device may refer to the implementation that electronic certificate recognizes triggering method, repetition
Place is repeated no more.Used below, term " unit ", " subelement " or " module " can realize the software of predetermined function
And/or the combination of hardware.Although the device described by following examples is preferably realized with software, hardware, or soft
The realization of the combination of part and hardware is also that may and be contemplated.
Fig. 4 is that the electronic certificate of the embodiment of the present application recognizes a kind of structured flowchart of triggering device.Although the application is provided
Such as following embodiments or apparatus structure shown in the drawings, but based on it is conventional or without performing creative labour in said device
More or less modular units can be included.It is not present in logicality in necessary causal structure, these devices
Modular structure be not limited to the embodiment of the present application description and modular structure shown in the drawings.Described modular structure is in practice
When device or end product are applied, can be connected according to embodiment or modular structure shown in the drawings the execution of carry out order or
It is parallel to perform (such as the environment of parallel processor or multiple threads, or even distributed processing environment).
Specifically as shown in Figures 4 to 6, the electronic certificate identification triggering device that a kind of embodiment of the application is provided, can
With including:Image capture module 401, computing module 402 and output module 403,
Described image acquisition module 401, for certificate rest area continuous collecting video image, and by the video image
In all single-frame images be converted into the initial picture of rgb color pattern;
The computing module 402, the average gray value of the difference predeterminable area for calculating the initial picture, and/or
For the average color component for the difference predeterminable area for calculating the initial picture;
The output module 403, for initial picture described in former frame difference predeterminable area average gray value with after
The absolute value of difference between the average gray value of the difference predeterminable area of initial picture described in one frame is more than gray value difference threshold
During value, and/or, the average color component of the difference predeterminable area of initial picture described in former frame and initial picture described in a later frame
Difference predeterminable area average color component between difference absolute value be more than color component difference threshold when, output triggering
Signal.
In a feasible embodiment, as shown in figure 4, selecting being averaged for the difference predeterminable area of the initial picture
Gray value is used as the parameter for judging whether to place certificate in the certificate rest area.The computing module 402 includes gray value meter
Calculate module 4021 and average gray value computing module 4022;
The gray value computing module 4021 be used for by the red component of each pixel in the difference predeterminable area,
Green component and blue component, calculate the gray value of each pixel in the difference predeterminable area;
The average gray value computing module 4022 is used for the gray value for calculating all pixels point in the difference predeterminable area
Average value, be used as the average gray value of the difference predeterminable area.
In order to further improve the precision of output trigger signal, the output module 403, for initial described in former frame
The average gray value of the difference predeterminable area of initial picture described in the average gray value and a later frame of the difference predeterminable area of picture
Between difference absolute value be more than gray value difference threshold when and a later frame described in initial picture at least one gray value it is pre-
If the average gray value in region is more than gray value threshold value, trigger signal is exported.
Particularly, the initial picture includes a difference predeterminable area and multiple gray value preset areas
Domain;The gray value threshold value includes multiple secondary gray value threshold values;
The output module 403, the average gray for the difference predeterminable area in initial picture described in former frame
The absolute value of difference between the average gray value of the difference predeterminable area of initial picture described in value and a later frame is more than ash
The average gray value of each gray value predeterminable area of initial picture is big during angle value difference threshold and described in a later frame
When the corresponding secondary gray value threshold value, trigger signal is exported.
In another optional embodiment, the average color of the difference predeterminable area of the initial picture can be selected
Component is used as the parameter for judging whether to place certificate in the certificate rest area.As shown in Fig. 5 to Figure 10, the average color point
Amount can include average red component and/or average green component and/or average blue component;Accordingly, the color point
Amount difference threshold can also include red component difference threshold and/or green component difference threshold and/or blue component difference threshold
Value;Accordingly, the computing module 402 includes red component computing module 4023 and/or green component computing module 4024
And/or blue component computing module 4025;Wherein,
The red component computing module 4023 is used for the red component for calculating all pixels point in the difference predeterminable area
Average value be the difference predeterminable area average red component,
The green component computing module 4024 is used for the green component for calculating all pixels point in the difference predeterminable area
Average value be the difference predeterminable area average green component,
The blue component computing module 4025 is used for the blue component for calculating all pixels point in the difference predeterminable area
Average value be the difference predeterminable area average blue component;
Accordingly, the output module 403 include red output module 4031 and/or green output module 4032 and/
Or blue output module 4033, wherein,
The red output module 4031 be used for the former frame picture difference predeterminable area average red component with
Difference between the average red component of the difference predeterminable area of a later frame picture is more than the red component difference threshold
When, trigger signal is exported,
The green output module 4032 be used for the former frame picture difference predeterminable area average green component with
Difference between the average green component of the difference predeterminable area of a later frame picture is more than the green component difference threshold
When, trigger signal is exported,
The blue output module 4033 be used for the former frame picture difference predeterminable area average blue component with
Difference between the average blue component of the difference predeterminable area of a later frame picture is more than the blue component difference threshold
When, export trigger signal.
In order to further improve the precision of output trigger signal, when the average color component includes red component,
At least one red component predeterminable area is additionally provided with the initial picture.The red output module 4031 be used for it is described before
The average red of the average red component of the difference predeterminable area of one frame picture and the difference predeterminable area of a later frame picture
Difference between component is more than at least one red component of initial picture described in the red component difference threshold and a later frame
When the average red component of predeterminable area is more than red component threshold value, trigger signal is exported.
Particularly, the initial picture includes a difference predeterminable area and multiple red component preset areas
Domain;The red component threshold value includes multiple secondary red component threshold values;The red output module 4031 is used for described previous
The average red point of the average red component of the difference predeterminable area of frame picture and the difference predeterminable area of a later frame picture
Difference between amount is more than each described red component of initial picture described in the red component difference threshold and a later frame
When the average red component of predeterminable area is all higher than the corresponding secondary red component threshold value, trigger signal is exported.
Likewise, when the average color component includes green component, being additionally provided with least in the initial picture
One green component predeterminable area.The green output module 4032 is used for the flat of the difference predeterminable area of the former frame picture
Difference between the average green component of the difference predeterminable area of equal green component and a later frame picture is more than the green
The average green component of at least one green component predeterminable area of initial picture described in component difference threshold and a later frame is more than
During green component threshold value, trigger signal is exported.
Particularly, the initial picture includes a difference predeterminable area and multiple green component preset areas
Domain;The green component threshold value includes multiple secondary green component threshold values;The green output module 4031 is used for described previous
The average green point of the average green component of the difference predeterminable area of frame picture and the difference predeterminable area of a later frame picture
Difference between amount is more than each described green component of initial picture described in the green component difference threshold and a later frame
When the average green component of predeterminable area is all higher than the corresponding secondary green component threshold value, trigger signal is exported.
Likewise, when the average color component includes blue component, being additionally provided with least in the initial picture
One blue component predeterminable area.The blue output module 4033 is used for the flat of the difference predeterminable area of the former frame picture
Difference between the average blue component of the difference predeterminable area of equal blue component and a later frame picture is more than the blueness
The average blue component of at least one blue component predeterminable area of initial picture described in component difference threshold and a later frame is more than
During blue component threshold value, trigger signal is exported.
Particularly, the initial picture includes a difference predeterminable area and multiple blue component preset areas
Domain;The blue component threshold value includes multiple secondary blue component threshold values;The blue output module 4031 is used for described previous
The average blueness point of the average blue component of the difference predeterminable area of frame picture and the difference predeterminable area of a later frame picture
Difference between amount is more than each described blue component of initial picture described in the blue component difference threshold and a later frame
When the average blue component of predeterminable area is all higher than the corresponding secondary blue component threshold value, trigger signal is exported.
With average gray value, average red component and the average green point of the difference predeterminable area for selecting the initial picture
Amount is simultaneously peaceful with average gray value as exemplified by the parameter for judging whether to place certificate in the certificate rest area, illustrating how
Equal color component is as a parameter to judge whether place certificate in the certificate rest area.The initial picture includes an institute
State difference predeterminable area, multiple gray value predeterminable areas, multiple red component predeterminable areas and multiple greens
Component predeterminable area;The gray value threshold value includes multiple secondary gray value threshold values;The red component threshold value includes multiple times
Level red component threshold value;The green component threshold value includes multiple secondary green component threshold values.
As shown in figure 11, the computing module 402 includes gray value computing module 4021, average gray value computing module
4022nd, red component computing module 4023 and green component computing module 4025;
The output module 403, for when meeting three below condition, exporting trigger signal:
1st, initial graph described in the average gray value and a later frame of the difference predeterminable area of initial picture described in former frame
It is when the absolute value of difference between the average gray value of the difference predeterminable area of piece is more than gray value difference threshold and latter
The average gray value of the gray value predeterminable area of each of initial picture described in frame is all higher than the corresponding secondary ash
Angle value threshold value;
2nd, the difference of the average red component of the difference predeterminable area of the former frame picture and a later frame picture is pre-
If the difference between the average red component in region is more than initial picture described in the red component difference threshold and a later frame
The average red component of each red component predeterminable area is all higher than the corresponding secondary red component threshold value;
3rd, the difference of the average green component of the difference predeterminable area of the former frame picture and a later frame picture is pre-
If the difference between the average green component in region is more than initial picture described in the green component difference threshold and a later frame
The average green component of each green component predeterminable area is all higher than the corresponding secondary green component threshold value.
Device or module that above-described embodiment is illustrated, can specifically be realized by computer chip or entity, or by with
The product of certain function is realized.For convenience of description, it is divided into various modules during description apparatus above with function to describe respectively.
The function of each module can be realized in same or multiple softwares and/or hardware when implementing the application.It is of course also possible to
It will realize that the module of certain function combines realization by multiple submodule or subelement.
As seen through the above description of the embodiments, those skilled in the art can be understood that the application can
Realized by the mode of software plus required hardware.Understood based on such, the technical scheme of the application is substantially in other words
The part contributed to prior art can be embodied in the form of software product, can also be by the implementation of Data Migration
During embody.The application's can be used for numerous general or special purpose computing system environments or configuration in whole or in part
In.For example:Personal computer, server computer, handheld device or portable set, laptop device, mobile communication terminal,
Multicomputer system, the system based on microprocessor, programmable electronic equipment, network PC, minicom, mass computing
DCE of machine including any of the above system or equipment etc..
Although depicting the application by embodiment, it will be appreciated by the skilled addressee that the application have it is many deformation and
Change is without departing from spirit herein, it is desirable to which appended claim includes these deformations and changed without departing from the application's
Spirit.