Summary of the invention
The invention provides a kind of video frequency monitoring method and video monitoring system, improved the integrality and the definition of the video data of a plurality of camera outputs.
Technical scheme of the present invention is: a kind of video frequency monitoring method, and it comprises step:
Step 1, through first camera collection, first video data, through second camera collection, second video data;
After step 1, also comprise the step of said first video data or second video data being carried out video correction:
Said first video data of preliminary election or second video data as benchmark image, obtain the angle point of said benchmark image in the data of predetermined instant;
Obtain the match point of said first video data or the said relatively angle point of the data of second video data behind said predetermined instant through the zone coupling;
Calculate the motion excursion amount of said match point according to affine model with respect to said angle point; According to said motion excursion amount said first video data or second video data are carried out motion compensation;
Detect the light or the side-play amount of said first video data or the said relatively benchmark image of the data of second video data behind said predetermined instant; When light or side-play amount etc. satisfies predefined light or offset value, be benchmark image with the Data Update behind the said predetermined instant;
Whether step 2, the setting angle through first camera and second camera detect the video data of said first camera and the output of second camera overlapping; After judging the overlapping angle of first video data and second video data, according to said overlapping said first video data of angle extraction in first overlapped data of overlapping region and said second video data second overlapped data in the overlapping region;
Step 3, convert said first overlapped data into first gray-scale map, convert said second overlapped data into second gray-scale map;
Step 4, to said first gray-scale map in the pixel of first presumptive area and second gray-scale map pixel in second presumptive area; Adopt by pixel method relatively the positional information that the pixel of utilizing the piece adaptation function to calculate pixel and said second presumptive area of said first presumptive area is complementary;
Step 5, go out the vertical and horizontal offset of relative second gray-scale map of said first gray-scale map, said first video data and second video data are spliced according to said vertical and horizontal offset according to said positional information calculation.
The present invention has also disclosed a kind of video monitoring system, and it comprises:
First camera is used to gather first video data;
Second camera is used to gather second video data;
The video correction module, be used for said first video data of preliminary election or second video data in the data of predetermined instant as benchmark image, obtain the angle point of said benchmark image;
Obtain the match point of said first video data or the said relatively angle point of the data of second video data behind said predetermined instant through the zone coupling;
Calculate the motion excursion amount of said match point according to affine model with respect to said angle point; According to said motion excursion amount said first video data or second video data are carried out motion compensation;
Detection module is used for
Detect the light or the side-play amount of said first video data or the said relatively benchmark image of the data of second video data behind said predetermined instant; When light or side-play amount etc. satisfies predefined light or offset value, be benchmark image with the Data Update behind the said predetermined instant;
Extraction module; Whether being used for setting angle through first camera and second camera, to detect the video data of said first camera and the output of second camera overlapping; Judge first video data and the overlapping angle of second video data, and according to said overlapping said first video data of angle extraction in first overlapped data of overlapping region and said second video data second overlapped data in the overlapping region;
Modular converter is used for converting said first overlapped data into first gray-scale map, converts said second overlapped data into second gray-scale map;
Computing module; Be used for said first gray-scale map in the pixel of first presumptive area and second gray-scale map pixel in second presumptive area; Adopt by pixel method relatively the positional information that the pixel of utilizing the piece adaptation function to calculate pixel and said second presumptive area of said first presumptive area is complementary;
Concatenation module goes out the vertical and horizontal offset of relative second gray-scale map of said first gray-scale map according to said positional information calculation, according to said vertical and horizontal offset said first video data and second video data is spliced.
Video frequency monitoring method of the present invention and video monitoring system; Said video frequency monitoring method can be when said first video data and second video data be overlapping; Calculate the vertical and horizontal offset of relative second video data of first video data; According to said vertical and horizontal offset said first video data and second video data are spliced processing; Make the video data comparison complete sum of win camera and the output of second camera clear, the overlapping video data can not occur, made things convenient for the user to check; Owing to the wide coverage of a plurality of cameras, then can realize in addition large-scale video monitoring.
Embodiment
Video frequency monitoring method of the present invention and video monitoring system; Said video frequency monitoring method can be when said first video data and second video data be overlapping; Calculate the vertical and horizontal offset of relative second video data of first video data; According to said vertical and horizontal offset said first video data and second video data are spliced processing; Make the video data comparison complete sum of win camera and the output of second camera clear, the overlapping video data can not occur, made things convenient for the user to check; Owing to the wide coverage of a plurality of cameras, then can realize in addition large-scale video monitoring.
Below in conjunction with accompanying drawing specific embodiment of the present invention is done a detailed elaboration.
Video frequency monitoring method of the present invention like Fig. 1, comprises step:
S101, through first camera collection, first video data, through second camera collection, second video data; The angle that first camera and second camera are installed can be installed as required, enlarges the scope of video monitoring through two cameras are installed.
S102, when said first video data and second video data are overlapping, then extract said first video data in first overlapped data of overlapping region and said second video data second overlapped data in the overlapping region; In a preferred embodiment; Before when said first video data and second video data are overlapping; Can also comprise step: it is overlapping whether the video data that the setting angle through said first camera and second camera detects said first camera and the output of second camera has, and also can judge whether the video data of said first camera and the output of second camera has overlapping through other method.After having judged the overlapping angle of first video data and second video data, can extract said first video data in first overlapped data of overlapping region and said second video data second overlapped data according to said overlapping angle in the overlapping region.
S103, convert said first overlapped data into first gray-scale map, convert said second overlapped data into second gray-scale map.
S104, to said first gray-scale map in the pixel of first presumptive area and second gray-scale map pixel in second presumptive area; Adopt by pixel method relatively the positional information that the pixel of utilizing the piece adaptation function to calculate pixel and said second presumptive area of said first presumptive area is complementary.
First presumptive area can be a part of data of first gray-scale map; It also can be the total data of first gray-scale map; Second presumptive area can be a part of data of second gray-scale map; It also can be the total data of second gray-scale map; When first presumptive area be the total data of first gray-scale map, when second presumptive area is the total data of second gray-scale map, the positional information that the pixel of utilizing the piece adaptation function to calculate pixel and said second presumptive area of said first presumptive area is complementary is the most accurate.This piece adaptation function can be the average of calculating pixel difference absolute value in a preferred embodiment, can certainly adopt other piece adaptation function to calculate.Adopt by pixel method relatively; The positional information that the pixel of utilizing the piece adaptation function to calculate pixel and said second presumptive area of said first presumptive area is complementary; Specifically can be: get each pixel of first presumptive area and each pixel of second presumptive area respectively; Calculate the average of pixel difference absolute value of each pixel of each pixel and second presumptive area of first presumptive area; Get the minimum value of the average of pixel difference absolute value, certain locations of pixels information of certain the locations of pixels information of first presumptive area and second presumptive area when average of recording pixel difference absolute value is got minimum value.
S105, go out the vertical and horizontal offset of relative second gray-scale map of said first gray-scale map, said first video data and second video data are spliced according to said vertical and horizontal offset according to said positional information calculation.Can know the vertical and horizontal offset of relative second gray-scale map of said first gray-scale map according to said positional information, thereby can splice first video data and second video data according to vertical and horizontal offset.
Need to prove; In practical application, can also gather video data through more than two cameras, design according to actual needs; The video monitoring range of camera is wider like this, only shows first camera and second camera in the above-described embodiments.
In order to prevent that first video data or second video data from shake occurring or deformity occurring; In a preferred embodiment; Said first video data or second video data are through the data behind the video correction; Like Fig. 2, can between step S101 and step S102, also comprise said video correction process S1011, said first video data or second video data are carried out video correction, detailed process comprises as follows:
Step 1, said first video data of preliminary election or second video data as benchmark image, obtain the angle point of said benchmark image in the data of predetermined instant; This angle point promptly is the characteristic point of said benchmark image;
Step 2, obtain the match point of said first video data or the said relatively angle point of the data of second video data behind said predetermined instant through zone coupling;
Step 3, calculate the motion excursion amount of said match point with respect to said angle point according to affine model; According to said motion excursion amount said first video data or second video data are carried out motion compensation.
In a preferred embodiment, said affine model is four parameter affine models.
In a preferred embodiment; In said step S1011; Can also comprise step: the distinguishing characteristics that detects said first video data or the said relatively benchmark image of the data of second video data behind said predetermined instant; When said distinguishing characteristics satisfies predetermined condition, be benchmark image with the Data Update behind the said predetermined instant.This distinguishing characteristics can be characteristics such as light or side-play amount, and predetermined condition is predefined, is that predefined light or side-play amount are equivalent, when light or side-play amount etc. satisfies predefined value, just needs to upgrade benchmark image.Through bringing in constant renewal in benchmark image, can improve the effect of video correction, prevent that small shake from appearring in video data.
Below in conjunction with specific embodiment the method for above-mentioned first video data and second video data splicing is done a detailed elaboration:
Consider that first video data and second video data need do the splicing on level and the vertical direction, taked by pixel way relatively.If first video data is I, second video data is J, and its size is respectively Wi, hi and Wj, hj, and hi=hj is then arranged, and Wi and Wj represent the width of first video data and second video data, and hi and hj represent the height of first video data and second video data.
1. getting I the right and J left side size does
The zone be the overlapping region, changing first video data and second video data data in the overlapping region respectively is gray-scale map I
rAnd J
l
2. establish w for comparing width, h is than height,
For?h=(-□h,+□h)
If?h<0
Calculate D [I
r(1~w ,-h~h
i), J
l(1~w, 1~h+h
j)];
Else
Calculate D [I
r(1~w, 1~h
i-h), J
l(1~w, h~h
j)];
Get the coordinate information of the corresponding pixel of minimum D value; Calculate the vertical and horizontal offset of relative second video data of first video data according to the coordinate information of the pixel of correspondence, first video data and second video data are spliced according to said vertical and horizontal offset.
Wherein (I J) is the piece adaptation function to D, is defined as the average of pixel difference absolute value here.I (x
1~x
2, y
1~y
2) represent to get the subimage of image I, its coordinate range is x ∈ [x
1, x
2], y ∈ [y
1, y
2].The video data coordinate is since 1.Δ h is the hunting zone on the vertical direction of being scheduled to, and in realization, can get h/20.
The present invention has also disclosed a kind of video monitoring system, like Fig. 2, comprising: first camera, second camera, extraction module, modular converter, computing module and concatenation module; The output of said first camera and second camera is connected with the input of extraction module respectively, and the output of extraction module is connected with concatenation module through modular converter, computing module successively;
First camera is used to gather first video data;
Second camera is used to gather second video data; The angle that first camera and second camera are installed can be installed as required, can enlarge the scope of video monitoring through two cameras are installed;
Extraction module when said first video data and second video data are overlapping, is used to extract said first video data in first overlapped data of overlapping region and said second video data second overlapped data in the overlapping region; In a preferred embodiment; Said extraction module also be used for according to the angle that said first camera and second camera are installed detect said first video data and second video data whether overlapping, also can detect said first video data through other method and second video data whether overlapping; After having detected overlapping angle, can extract said first video data in first overlapped data of overlapping region and said second video data second overlapped data according to said overlapping angle in the overlapping region;
Modular converter is used for converting said first overlapped data into first gray-scale map, converts said second overlapped data into second gray-scale map;
Computing module; Be used for said first gray-scale map in the pixel of first presumptive area and second gray-scale map pixel in second presumptive area; Adopt by pixel method relatively the positional information that the pixel of utilizing the piece adaptation function to calculate pixel and said second presumptive area of said first presumptive area is complementary; In a preferred embodiment, said adaptation function is the average that is used for calculating pixel difference absolute value, also can adopt other piece adaptation function to calculate; The positional information that the pixel of utilizing the piece adaptation function to calculate pixel and said second presumptive area of said first presumptive area is complementary; Specifically can for: calculate the average of absolute value of difference of pixel of pixel and second presumptive area of said first presumptive area, the locations of pixels information of locations of pixels information and said second presumptive area of getting pairing said first presumptive area of minimum mean is as the positional information that is complementary.
Concatenation module goes out the vertical and horizontal offset of relative second gray-scale map of said first gray-scale map according to said positional information calculation, according to said vertical and horizontal offset said first video data and second video data is spliced.
In a preferred embodiment, like Fig. 4, video monitoring system of the present invention also comprises the video correction module, is connected between the input of output and said extraction module of said first camera and second camera, is used for:
Said first video data of preliminary election or second video data as benchmark image, obtain the angle point of said benchmark image in the data of predetermined instant;
Obtain the match point of said first video data or the said relatively angle point of the data of second video data behind said predetermined instant through the zone coupling;
Calculate the motion excursion amount of said match point according to affine model with respect to said angle point; According to said motion excursion amount said first video data or second video data are carried out motion compensation.
So just can carry out video correction, prevent that the phenomenon of shake or deformity from appearring in first video data or second video data first video data or second video data.
In a preferred embodiment, said affine model is four parameter affine models.
In a preferred embodiment; Video monitoring system of the present invention also comprises the detection module that is connected with said video correction module; It is used to detect the distinguishing characteristics of said first video data or the said relatively benchmark image of the data of second video data behind said predetermined instant; When said distinguishing characteristics satisfies predetermined condition, be benchmark image with the Data Update behind the said predetermined instant.This distinguishing characteristics can be characteristics such as light or side-play amount, and predetermined condition is predefined, is the sizes values of predefined light or side-play amount etc., when light or side-play amount etc. satisfies predefined sizes values, just needs to upgrade benchmark image.Through bringing in constant renewal in benchmark image, can improve the effect of video correction, prevent that small shake from appearring in video data.
Above-described embodiment of the present invention does not constitute the qualification to protection range of the present invention.Any modification of within spirit of the present invention and principle, being done, be equal to replacement and improvement etc., all should be included within the claim protection range of the present invention.