A kind of video color exception analysis method and device
Technical field
The present invention relates to image processing techniques, refer to a kind of video color exception analysis method and device especially.
Background technology
Video monitoring system is very extensive in the application of social every field, as traffic, bank, army, warehouse, public security, community, office building, hotel, public place, market etc. field.
Color exception mainly is owing to circuit loose contact, external disturbance or camera failure and other reasons, the phenomenon that the full frame solid color that causes or multiple color mix.
At present, be to find by manually watching the monitor video image attentively whether image color exception occurs.Existing notice and the sense of responsibility that the analysis of video color exception is relied on fully the staff, find that at the video wall that is covered with monitoring display certain monitor generation video color exception takes artificial energy really very much, can can not in time find or can't find owing to artificial factor, the situation of omission also will inevitably occur monitoring.Like this, after video generation color, can cause visual incompatibility, also can lose some details, particularly lose the place that details is distinguished in some Color Channels.When color exception appears in video and can not get in time handling, will inevitably have influence on watch-dog to the validity of associated scenario actual conditions record, thereby greatly reduce the confidence level of video monitoring system; In addition, video color exception might cause owing to other faults, if untimely repairing can cause the generation of other faults of watch-dog.
Summary of the invention
In view of this, fundamental purpose of the present invention is to provide a kind of video color exception analysis method, can be in time and the unusual degree of monitor video color of image all sidedly, guarantee the confidence level of video monitoring system.
Another object of the present invention is to provide a kind of video color exception analytical equipment, can be in time and the unusual degree of monitor video color of image all sidedly, guarantee the confidence level of video monitoring system.
For achieving the above object, technical scheme of the present invention specifically is achieved in that
A kind of video color exception analysis method, this method may further comprise the steps:
Extract the image of each Color Channel of video; Obtain color average and the color maximal value of the image of each Color Channel respectively;
The color average that compares R, B passage and G passage respectively obtains color average fiducial value; The color maximal value that compares R, B passage and G passage respectively obtains color maximal value fiducial value; And according to the color average fiducial value and the color maximal value fiducial value that obtain, obtain the color degree.
The method of the color average of the described image that obtains each Color Channel is:
At different color channels, set in advance pixel region, calculate the mean value of the value of each pixel in this pixel region.
The color average R of the R passage in the described Color Channel is:
The color average G of the G passage in the described Color Channel is:
The color average B of the B passage in the described Color Channel is:
Wherein, M, N are respectively the height and width of the pixel region that sets in advance; I
r(x, y), I
g(x, y) and I
b(x y) represents the color value of certain pixel in R passage in the predeterminable area, G passage and the B passage respectively, and x, y represent horizontal ordinate and the ordinate of pixel respectively.
The color maximal value R of the R passage in the described Color Channel
MaxFor:
The color maximal value G of the G passage in the described Color Channel
MaxFor:
The color maximal value of the B passage in the described Color Channel
Wherein, I
r(x, y), I
g(x, y) and I
b(x y) represents the color value of certain pixel in R passage, G passage and the B passage respectively, and x, y represent horizontal ordinate and the ordinate of pixel respectively.
Described color average fiducial value comprises the color average fiducial value α of R passage and G passage
RgColor average fiducial value α with B passage and G passage
Bg, wherein,
Color average fiducial value α
RgMerchant for the color average G of the color average R of R passage and G passage; Color average fiducial value α
BgMerchant for the color average G of the color average B of B passage and G passage.
Described color maximal value fiducial value comprises the color maximal value fiducial value β of R passage and G passage
RgColor maximal value fiducial value β with B passage and G passage
Bg, wherein,
Color maximal value fiducial value β
RgColor maximal value R for the R passage
MaxColor maximal value G with the G passage
MaxThe merchant; Described color maximal value fiducial value β
BgColor maximal value B for the B passage
MaxColor maximal value G with the G passage
MaxThe merchant.
The described method of obtaining the color degree is: described color degree Dev is the metric sum of the colour cast degree of R passage and B passage, wherein,
The metric of the colour cast degree of R passage is: the color average fiducial value α of the R passage in the described color average fiducial value and G passage
RgWith R passage in the described color maximal value fiducial value and the color maximal value fiducial value β of G passage
RgSum;
The metric of the colour cast degree of B passage is: the color average fiducial value α of the B passage in the described color average fiducial value and G passage
BgWith B passage in the described color maximal value fiducial value and the color maximal value fiducial value β of G passage
BgSum.
A kind of video color exception analytical equipment, this device comprises:
Image extraction module, color average acquisition module, color maximal value acquisition module, color average fiducial value acquisition module, color maximal value fiducial value acquisition module and color degree acquisition module, wherein,
The image extraction module comprises R channel image extraction module, G channel image extraction module and B channel image extraction module, is respectively applied to from from extracting R channel image, G channel image and B channel image the video image of image collecting device such as camera;
Color average acquisition module, be used for according to R channel image, G channel image and B channel image from the image extraction module, obtain R passage color average, G passage color average and B passage color average in the pixel region default obtaining, and export to color average fiducial value acquisition module;
Color maximal value acquisition module, be used for according to R channel image, G channel image and B channel image from the image extraction module, obtain R passage color maximal value, G passage color maximal value and B passage color maximal value, and export to color maximal value fiducial value acquisition module;
Color average fiducial value acquisition module, be used for according to R passage color average, G passage color average and B passage color average, obtain R passage and the color average fiducial value of G passage and the color average fiducial value of B passage and G passage, and export to color degree acquisition module;
Color maximal value fiducial value acquisition module, be used for according to R passage color maximal value, G passage color maximal value and B passage color maximal value, obtain R passage and the color maximal value fiducial value of G passage and the color maximal value fiducial value of B passage and G passage, and export to color degree acquisition module;
Color degree acquisition module is used for according to the color average fiducial value and the color maximal value fiducial value that obtain, obtains the color degree by adding with computing.
As seen from the above technical solution, the present invention obtains color average and the color maximal value that R, G and B channel image are calculated each Color Channel respectively respectively from video image, and according to the comparison of R and B passage and G passage, obtain color average fiducial value and color maximal value fiducial value, thereby obtain the color degree.The present invention passes through the analysis to the variation of video content, judge the situation of change of each Color Channel, provide video image exactly and the situation whether the colour cast problem namely exists color exception whether occurred, in time also monitored the unusual degree of video image color all sidedly.And by in time the video color exception situation being fed back to the staff, feasible adjustment or maintenance to video image equipment obtained timely processing, prevented the generation of fault and event, guaranteed the confidence level of video monitoring system.
Description of drawings
Fig. 1 is the process flow diagram of the method for video color exception analysis of the present invention;
Fig. 2 is the composition structural representation of the device of video color exception analysis of the present invention.
Embodiment
For making purpose of the present invention, technical scheme and advantage clearer, below with reference to the accompanying drawing embodiment that develops simultaneously, the present invention is described in more detail.
Fig. 1 is the process flow diagram of the method for video color exception analysis of the present invention, and as shown in Figure 1, the inventive method comprises step:
Step 100: the image that extracts each Color Channel of video.
Video image can not need every frame all to extract, and such as setting in advance a time interval, this time interval can be set different values according to different places, such as being an interval with 5 seconds.
According to R, G, three Color Channels of B are divided into three number of sub images with coloured image, and specific implementation belongs to those skilled in the art's conventional techniques means, repeats no more here.
Step 101: color average and the color maximal value of obtaining the image of each Color Channel respectively.
The acquisition methods of the color average of the image of Color Channel is: at different color channels, set in advance pixel region, calculate the mean value of the value of each pixel in this pixel region.
The color average R of R passage is as shown in Equation (1):
Wherein, M, N are respectively the height and width of the pixel region that sets in advance; I
r(x, y represent horizontal ordinate and the ordinate of pixel respectively for x, the y) color value of R passage pixel in the expression predeterminable area.
The color average G of G passage is as shown in Equation (2):
Wherein, M, N are respectively the height and width of the pixel region that sets in advance; I
g(x, y represent horizontal ordinate and the ordinate of pixel respectively for x, the y) color value of G passage pixel in the expression predeterminable area.
The color average B of B passage is as shown in Equation (3):
Wherein, M, N are respectively the height and width of the pixel region that sets in advance; I
b(x, y represent horizontal ordinate and the ordinate of pixel respectively for x, the y) color value of G passage pixel in the expression predeterminable area.
The color maximal value R of R passage
MaxAs shown in Equation (4):
Wherein, I
r(x, y represent horizontal ordinate and the ordinate of pixel respectively for x, the y) color value of expression R passage pixel.
The color maximal value G of G passage
MaxAs shown in Equation (5):
Wherein, I
g(x, y represent horizontal ordinate and the ordinate of pixel respectively for x, the y) color value of expression G passage pixel.
The color maximal value B of B passage
MaxAs shown in Equation (6):
Wherein, I
b(x, y represent horizontal ordinate and the ordinate of pixel respectively for x, the y) color value of expression B passage pixel.
Step 102: compare the color average of R, B passage and G passage respectively, obtain color average fiducial value; The color maximal value that compares R, B passage and G passage respectively obtains color maximal value fiducial value.
The color average fiducial value α of R passage and G passage
RgAs shown in Equation (7):
The color average fiducial value α of B passage and G passage
BgAs shown in Equation (8):
The color maximal value fiducial value β of R passage and G passage
RgAs shown in Equation (9):
The color maximal value fiducial value β of B passage and G passage
BgAs shown in Equation (10):
Step 103: color average fiducial value and color maximal value fiducial value according to obtaining, obtain the color degree.Color degree Dev is the metric of colour cast degree, is the metric sum of the colour cast degree of R passage and B passage, and it obtains as shown in Equation (11):
Dev=Dev_r+Dev_b (11)
Wherein, the metric of the colour cast degree of R passage is: the color average fiducial value α of the R passage in the described color average fiducial value and G passage
RgWith R passage in the described color maximal value fiducial value and the color maximal value fiducial value β of G passage
RgSum, i.e. Dev_r=α
Rg+ β
Rg
The metric of the colour cast degree of B passage is: the color average fiducial value α of the B passage in the described color average fiducial value and G passage
BgWith B passage in the described color maximal value fiducial value and the color maximal value fiducial value β of G passage
BgSum, i.e. Dev_b=α
Bg+ β
Bg
Can be the color exception situation that the staff obtains current monitor video intuitively by dynamic Show Color degree Dev on monitoring screen.
The present invention passes through the analysis to the variation of video content, judge the situation of change of each Color Channel, provide video image exactly and the situation whether the colour cast problem namely exists color exception whether occurred, in time also monitored the unusual degree of video image color all sidedly.And by in time the video color exception situation being fed back to the staff, feasible adjustment or maintenance to video image equipment obtained timely processing, prevented the generation of fault and event, guaranteed the confidence level of video monitoring system.
Corresponding the inventive method, a kind of video color exception analytical equipment also is provided, as shown in Figure 2, video color exception analytical equipment of the present invention comprises image extraction module, color average acquisition module, color maximal value acquisition module, color average fiducial value acquisition module, color maximal value fiducial value acquisition module and color degree acquisition module, wherein
The image extraction module comprises R channel image extraction module, G channel image extraction module and B channel image extraction module, is respectively applied to from from extracting R channel image, G channel image and B channel image the video image of image collecting device such as camera.
Color average acquisition module, be used for according to R channel image, G channel image and B channel image from the image extraction module, obtain R passage color average, G passage color average and B passage color average in the pixel region default obtaining, and export to color average fiducial value acquisition module.
Color maximal value acquisition module, be used for according to R channel image, G channel image and B channel image from the image extraction module, obtain R passage color maximal value, G passage color maximal value and B passage color maximal value, and export to color maximal value fiducial value acquisition module.
Color average fiducial value acquisition module, be used for according to R passage color average, G passage color average and B passage color average, obtain R passage and the color average fiducial value of G passage and the color average fiducial value of B passage and G passage, and export to color degree acquisition module.
Color maximal value fiducial value acquisition module, be used for according to R passage color maximal value, G passage color maximal value and B passage color maximal value, obtain R passage and the color maximal value fiducial value of G passage and the color maximal value fiducial value of B passage and G passage, and export to color degree acquisition module.
Color degree acquisition module is used for according to the color average fiducial value and the color maximal value fiducial value that obtain, obtains the color degree by adding with computing.
The above is preferred embodiment of the present invention only, is not for limiting protection scope of the present invention.Within the spirit and principles in the present invention all, any modification of doing, be equal to and replace and improvement etc., all should be included within protection scope of the present invention.