Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Based on the embodiment in the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
Due to present video playback field, tend to the mode that adopts active and standby two-way video-signal to broadcast simultaneously, so particularly important for the conforming detection of two-way video-signal.As shown in Figure 1, the present embodiment provides a kind of method of two-way video-signal consistency detection, and the method comprises the following steps:
101, calculate the relative displacement of a two field picture B of a two field picture A of one tunnel vision signal wherein and other one tunnel vision signal;
Described relative displacement refers to the number of the pixel that image A is offset respectively with respect to image B on abscissa and ordinate.
102, according to the view data of described relative displacement and described image A, B, calculate the difference value of described image A, B;
103, described difference value and default differential threshold are made comparisons, judge whether described image A, B be consistent.
If described difference value less than described default differential threshold, thinks that described image A, B are consistent; Otherwise, think that described image A, B are inconsistent.
The method of the two-way video-signal consistency detection that the embodiment of the present invention provides, by on the basis of considering image A, B relative displacement, calculate the difference value of described image A, B, and described difference value and the differential threshold of presetting are compared, just can judge the consistency of image A, B; Scheme provided by the invention can be carried out conforming detection to the two-path video signal real-time and accurately in the permissible error scope, in time to avoid the generation of broadcast accident.
The below will be specifically addressed the method with an embodiment.
Embodiment one:
As shown in Figure 2, the present embodiment provides a kind of method of two-way video-signal consistency detection, specifically comprises the following steps:
201, wherein a two field picture A of one tunnel vision signal and a two field picture B of another road vision signal carry out respectively the image preliminary treatment;
Described image preliminary treatment comprises the brightness signal Y value of extracting described image A, each pixel of B, also comprises further the picture number that records described image A, B.
202, calculate the relative displacement of described image A, B;
At first, B is offset m pixel on the abscissa direction with image B mn presentation video, the image that obtains after n pixel of skew on the ordinate direction; Wherein, M 〉=m 〉=0, N 〉=n 〉=0, M, N are the image maximum offset on abscissa and ordinate direction respectively; Can set according to the maximum that actual conditions allow for maximum offset.
Below, the implementation procedure of step 202 is elaborated, this step specifically comprises:
Any value for m, n in its scope, carry out following two steps:
S1, the Y value of subregion pixel in described image A and image B mn are subtracted each other in the Y value of the corresponding pixel points of co-located region ask for difference, obtain the area difference image;
S2, the area difference image that step S1 is obtained carry out view data to be processed, and obtains pixel and the value of the area difference image after described processing, specifically comprises:
S21, described area difference image is carried out binary conversion treatment;
The area difference image of S22, the described binary conversion treatment of process that will be obtained by step S21 carries out erosion operation;
The Y value addition of each pixel of the area difference image of S23, the described erosion operation of process that will be obtained by step S22 obtains pixel and the value of area difference image.
Next, carry out next step:
S3, pixel and the value that will obtain for the different values of m, n compare, and record makes pixel and minimum m, the n value of value of described area difference image, and m, the n value of this moment are designated as respectively m
i, n
i
Wherein, m
i, n
iBe the relative displacement of described image A, B.
203, according to the view data of described relative displacement and described image A, B, calculate the difference value of described image A, B;
Wherein, described view data comprises the Y value of image A, each pixel of B.
Below, the implementation procedure of step 203 is elaborated, this step specifically comprises:
Q1, with Y value and the image B m of each pixel in described image A
in
iIn the Y value of corresponding pixel points subtract each other and ask for difference, obtain complete difference image;
Q2, described complete difference image is carried out view data process, to obtain pixel and the value of the complete difference image after described processing.
Specific implementation process and the above-mentioned steps S2 of this step Q2 are similar, just the area difference image in step S2 are replaced with complete difference image, just can try to achieve pixel and the value of described complete difference image, have also just obtained whether mating at image the difference value of epigraph A, B.
204, described difference value and default differential threshold are made comparisons, judge whether described image A, B be consistent.
Whether consistent this step comprises image A, B whether consistent judgement on images match, also be included in further on the image sequential judgement; For whether consistent judgement on images match, described differential threshold is matching threshold; For whether consistent judgement on the image sequential, described differential threshold is for allowing delay threshold.
For clearly this step being set forth, suppose that at first the image A that is obtained by step 201, the picture number of B are respectively a, b, note D
0=| a-b|, herein, D
0Be to represent the time difference with the frame number of two images is poor, pixel and the value of the complete image that is obtained by step 203 are P
0, predefined described permission delay threshold is D, presetting described matching threshold is P.
Then, this process of judgement consistency is described in detail:
(1) work as P
0During≤P,
If 1. D
0≤ D, the image A under current state, B images match not only, and in time-delay also in allowed band, belong to consistent state this moment; Image A, B under the deletion current state, and go to the judgement that step 201 is carried out next frame image A 1 and image B 1.
If 2. D
0>D, although image A, the B images match under current state, its time difference, belonged to inconsistent state this moment, can by an audible-visual annunciator is set, send warning when this state not within allowed band; Image A, B under the deletion current state, and go to the judgement that step 201 is carried out next frame image A 1 and image B 1.
(2) work as P
0During>P,
I keeps the next frame image B 1 that current image A is constant and take out present image B, repeats step 201~204, until image A and image B i (i 〉=1) images match, and record the not successful number of times i of images match;
If 1. i≤D, for whether being consistent state, carry out step 204 for image A and image B i in (1) judge; After this, deleted image A and image B go to the judgement that step 201 is carried out next frame image A 1 and image B 1.
If 2. i>D, current state is inconsistent state, sends warning; After this, deleted image A and image B go to the judgement that step 201 is carried out next frame image A 1 and image B 1.
If II is in the process of carrying out above-mentioned I, until image B i is the last frame image, and image A and image B i still do not mate, keep the next frame image A 1 that image B is constant and take out present image A, repeat step 201~204, until image A j and image B (j 〉=1) images match, and record the not successful number of times j of images match;
If 1. j≤D, for whether being consistent state, carry out step 204 for image A j and image B in (1) judge; After this, deleted image A and image B go to the judgement that step 201 is carried out next frame image A 1 and image B 1.
If 2. i>D, current state is inconsistent state, sends warning; After this, deleted image A and image B go to the judgement that step 201 is carried out next frame image A 1 and image B 1.
If III carries out II, until image A j is the last frame image, and image A j and image B are not still mated, and current state is inconsistent state, sends warning; After this, deleted image A and image B go to the judgement that step 201 is carried out next frame image A 1 and image B 1.
The method of the two-way video-signal consistency detection that the embodiment of the present invention provides, by on the basis of considering image A, B relative displacement, calculate pixel and the value of the difference image of described image A, B, and the pixel that obtains and value and default matching threshold are compared just can judge whether both are consistent on images match; And considered the time-delay that allows on the sequential, finally judged the consistency of image A, B; Scheme provided by the invention can be carried out conforming detection to the two-path video signal real-time and accurately in the permissible error scope, in time to avoid the generation of broadcast accident.
The method of the two-way video-signal consistency detection that provides for above-described embodiment, below also will provide corresponding with it checkout gear in embodiment.
As shown in Figure 3, the present embodiment provides a kind of device of two-way video-signal consistency detection, comprising:
Offset units 31 be used for to be calculated the relative displacement of a two field picture B of a two field picture A of one tunnel vision signal wherein and other one tunnel vision signal;
Difference unit 32 is used for the view data according to described relative displacement and described image A, B, calculates the difference value of described image A, B;
Judging unit 33 is used for described difference value and default differential threshold are made comparisons, and judges whether described image A, B be consistent.
The device of the two-way video-signal consistency detection that the embodiment of the present invention provides, by on the basis of the image A of considering to be obtained by offset units, B relative displacement, calculated the difference value of described image A, B by computing unit, and by judging unit, described difference value and the differential threshold of presetting are compared, just can judge the consistency of image A, B; Scheme provided by the invention can be carried out conforming detection to the two-path video signal real-time and accurately in the permissible error scope, in time to avoid the generation of broadcast accident.
Embodiment two:
The concrete methods of realizing of the two-way video-signal consistency detection that provides corresponding to embodiment one, as shown in Figure 4, the present embodiment will provide a kind of device of two-way video-signal consistency detection, and this device comprises:
Pretreatment unit 41 is used for extracting respectively the brightness signal Y value of each pixel of two field picture B of a two field picture A of one tunnel vision signal wherein and another road vision signal;
Further, described pretreatment unit is also for the picture number that records described image A, B.
Offset units 42 is for the relative displacement that calculates described image A, B;
At first, B is offset m pixel on the abscissa direction with image B mn presentation video, the image that obtains after n pixel of skew on the ordinate direction; Wherein, M 〉=m 〉=0, N 〉=n 〉=0, M, N are the image maximum offset on abscissa and ordinate direction respectively; Can set according to the maximum that actual conditions allow for maximum offset.
Described offset units 42 comprises following three modules:
Ask differential mode piece 421, be used for the Y value of described image A subregion pixel and image B mn are subtracted each other in the Y value of the corresponding pixel points of co-located region and ask for difference, obtain the area difference image;
Processing module 422 is used for that described area difference image is carried out view data and processes, and obtains pixel and the value of the area difference image after described processing;
, do not repeat them here referring to the step S2 in embodiment one for the realization of this functions of modules.
Comparison module 423, the pixel and the value that are used for the described area difference image that will obtain for the different values of m, n compare, and record makes pixel and minimum m, the n value of value of described area difference image, and m, n value at this moment is designated as respectively m
i, n
i
m
i, n
iBe the relative displacement of described image A, B.
Difference unit 43 is used for the view data according to the relative displacement that is obtained by described offset units 42 and described image A, B, calculates the difference value of described image A, B;
Wherein, described view data comprises the Y value of image A, each pixel of B.
Described difference unit 43 comprises following two modules:
Ask differential mode piece 431, be used for Y value and image B m with described each pixel of image A
in
iIn the Y value of corresponding pixel points subtract each other and ask for difference, obtain complete difference image;
Processing module 432 is used for that described complete difference image is carried out view data and processes, and obtains pixel and the value of the complete difference image after described processing; Also just obtained whether mating at image the difference value of epigraph A, B.
Judging unit 44 is used for and will be made comparisons with default differential threshold by described difference unit 43 described difference value, judges whether described image A, B be consistent.
Described judging unit 44, the pixel of the concrete pixel that is used for described complete difference image that described difference unit 43 is obtained and value and the complete difference image that sets and the maximum of value are made comparisons, and judge described image A, the B consistency on images match; Further,
Described judging unit 44 also is used for the picture number difference of described image A, B is made comparisons with the maximum of the picture number difference that sets, and judges described image A, the consistency of B on the image sequential.
For the specific implementation of this element, can with reference to the step 204 in embodiment one, not repeat them here.
The device of the two-way video-signal consistency detection that the embodiment of the present invention provides, by on the basis of the image A of considering to be obtained by offset units, B relative displacement, calculated pixel and the value of the difference image of described image A, B by computing unit, and by judging unit, the pixel that obtains and value and default matching threshold are compared and just can judge whether both are consistent on images match; And considered further the time-delay that allows on the sequential, finally by the publish picture consistency of picture A, B of judgment unit judges; Scheme provided by the invention can be carried out conforming detection to the two-path video signal real-time and accurately in the permissible error scope, in time to avoid the generation of broadcast accident.
Below, provide the effect of scheme with illustrating the embodiment of the present invention, if detect the inconsistent situation in the two-path video signal, namely provide corresponding sound and light alarm information.
The video material that has two-way to make, wherein one is normal material, another is the problem material, this problem material has comprised some bad situations of broadcasting, and is followed successively by: 3 seconds slight mosaics, 2 seconds serious mosaics, 5 seconds contents are inconsistent with normal material, 1 frame colour bar, 1 frame color, 1 second black field, the 5 quiet frames of frame, 1 frame frame order are inverted, time-delay 10 frames, time-delay 20 frames, 30 frames of delaying time; And these two materials are played back with two device synchronization, use the scheme of this invention and carry out signals collecting and relatively work.
At first setting matching threshold is 2000, and allowing delay threshold is 25 frames; Detailed process is as follows:
Start-up routine is shown as consistent state;
When running into 3 seconds slight mosaics, program is inconsistent state and sound and light alarm, reports to the police after 3 seconds and eliminates;
When running into 2 seconds serious mosaics, program is inconsistent state and sound and light alarm, reports to the police after 2 seconds and eliminates;
When running into 5 seconds contents and normally material is inconsistent, program is inconsistent state and sound and light alarm, reports to the police after 5 seconds and eliminates;
When running into 1 frame colour bar, program is inconsistent state and sound and light alarm, reports to the police after 1 frame and eliminates;
When running into the color field of 1 frame, program is inconsistent state and sound and light alarm, reports to the police after 1 frame and eliminates;
When running into 1 second black, program is inconsistent state and sound and light alarm, the elimination of reporting to the police afterwards in 1 second;
When running into the 5 quiet frame of frame, program is inconsistent state and sound and light alarm, reports to the police after 5 frames and eliminates;
When running into 1 frame frame order inversion, program is inconsistent state and sound and light alarm, reports to the police after 1 frame and eliminates;
When running into time-delay 10 frame, due in allowing the delay threshold scope, program is consistent state;
When running into time-delay 20 frame, due in allowing the delay threshold scope, program is consistent state;
When running into time-delay 30 frame, owing to having exceeded permission delay threshold scope, program is inconsistent state and sound and light alarm.
By the description to above effect, can be clear that whether scheme provided by the invention can unanimously judge real-time and accurately to the two-path video signal.
Through the above description of the embodiments, the those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential common hardware, can certainly pass through hardware, but in a lot of situation, the former is better execution mode.Based on such understanding, the part that technical scheme of the present invention contributes to prior art in essence in other words can embody with the form of software product, this computer software product is stored in the storage medium that can read, floppy disk as computer, hard disk or CD etc., comprise some instructions with so that computer equipment (can be personal computer, server, the perhaps network equipment etc.) carry out the described method of each embodiment of the present invention.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited to this, anyly is familiar with those skilled in the art in the technical scope that the present invention discloses; the variation that can expect easily or replacement are within all should being encompassed in protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion with the protection range of described claim.