Summary of the invention
Existing video camera definition detection method wastes time and energy in order to overcome, the deficiency that reliability is relatively poor, and the present invention provides a kind of convenient and swift, video camera definition detection method based on identification resolution chart that reliability is good.
The technical solution adopted for the present invention to solve the technical problems is:
A kind of video camera definition detection method based on identification resolution chart, said video camera definition detection method may further comprise the steps:
1) video camera of the different levels of sharpness of selection; The image of shooting clear degree test card; Measure the definition functional value of this identification resolution chart, and the corresponding relation of definition functional value and levels of sharpness is saved in the database, definition functional value computational process is following:
1.1) gradient of detected image:
With I
sAmong the representative image I with (x, y) for the center 8 face the territory subgraph, with two width of cloth mask convolution images, obtain the gradient image of image level and vertical direction, then the gradient calculation formula of x direction and y direction is:
In the formula, S
xBe the gradient of the x direction of image, S
yBe the gradient of the y direction of image, T
xBe the x direction template; T
yBe the y direction template;
The gradient image addition of both direction is obtained the total gradient image S of image each point any direction;
S=S
x+S
y (2)
Wherein, S is total gradient image, S
xBe the gradient image of horizontal direction, i.e. the gradient image of x direction, S
yBe the gradient image of vertical direction, i.e. the gradient image of y direction;
1.2) threshold process is following:
In the formula, (x is gradient image S in that ((x is y) for judging (whether x, gray value y) are the sign functions of effective gradient value to S, and T is a preset threshold for n for x, gray value y) y) to S;
1.3) to calculate the sharpness evaluation function value following:
In the formula, f is a definition values, and (x is that the gradient image of x direction is at (x, gray value y), S y) to S
y(x is that the gradient image of y direction is at (x, gray value y) y);
1.4) normalization handles as follows:
In the formula, F is the definition normalized value, and m is the length of image, and n is the wide of image;
2) with a width of cloth picture of camera shooting clear degree test card to be detected; Calculate the definition functional value of this picture; With the definition functional value of preserving in definition functional value and the database relatively; Obtain immediate numerical value, the levels of sharpness that said immediate numerical value is corresponding is the levels of sharpness of video camera to be detected.
Further, the value of having preserved through video camera sharpness evaluation function value and lane database compares, and uses the levels of sharpness of the levels of sharpness of the nearest value correspondence that finds as video camera to be detected.
Further again, be applied to the sharpness evaluation function that is used for the video camera automatic focusing system definition evaluation of video camera.
Technical conceive of the present invention is: the video definition test card has standardization, normalized characteristics, and the definition that detects video camera with it helps standardization, and handled image has identical textural characteristics, the influence of avoiding change of background to bring.
Detect video camera level and vertical two orthogonal direction gradient values,, obtain the gradient image of image again with the addition of two values; Edge image is carried out thresholding to be handled; Calculate the sharpness evaluation function value again, clearly then the Grad on the edge is just big for image edge clear, and the fuzzy soft edge then Grad on the edge is just little; Sharpness evaluation function based on edge gradient is directly proportional to edge gradient; Under the identical situation of background (in this invention is identification resolution chart), utilize this characteristic of sharpness evaluation function, can distinguish the image of different definition.
At present, people have carried out extensive studies aspect the Image Definition that is used for the image processing method, and desirable sharpness evaluation function should have following character.
1. unbiasedness.During planes, the focusing evaluation function should be obtained extreme value in object plane and focusing, is not taken in to focus on to obtain extreme value when inaccurate.
2. highly sensitive.Be meant the focusing function curve in effective focusing range, particularly near burnt zone, slope ratio is bigger, and slope is sensitiveer more greatly, and the evaluation of definition is just accurate more.
3. the dull scope of curve.The dull scope of curve is meant the range size that is dull downward trend at the peak point place of curve to the extension of a certain side; This index has directly determined promptly to have determined the levels of sharpness that can detect according to the range size of this focusing characteristic curve effective focusing that can realize.
4. unimodality.Evaluation function has and only has an extreme value, and extreme value other local extremums can not occur corresponding to distinct image.Cause focusing function appraisal curve some Interference Peaks to occur in the part,, cause than mistake promptly for the evaluation of definition if Interference Peaks near main peak, will cause than mistake to the focusing result.Therefore, desirable focusing curve should smoother no local extremum.
Propose many Image Definition at present, can be divided into 4 big types basically:
1) statistics function
2) informatics function
3) frequency-domain function
4) based on the function of image border gradient
Wherein based on the sharpness evaluation function of image border gradient, antijamming capability is strong, calculates fast, and effect is better.
Select the video camera of different levels of sharpness, the photo of shooting clear degree test card calculates the sharpness evaluation function value of every photos, and sharpness evaluation function value levels of sharpness of used video camera when taking this image is preserved as a record together.When detecting the definition of other video camera; Width of cloth picture with camera shooting clear degree test card to be detected; Sharpness evaluation function value through captured picture compares with the value of having preserved; Obtain immediate data, use the corresponding levels of sharpness of this numerical value as the foundation of confirming video camera levels of sharpness to be detected.
Beneficial effect of the present invention mainly shows: convenient and swift, reliability is good.
Embodiment
Further describe in the face of the present invention down.
A kind of video camera definition detection method based on the video definition test card, said video camera definition detection method may further comprise the steps:
1) video camera of the different levels of sharpness of selection; The image of shooting clear degree test card; Measure the definition functional value of this resolving power test card graphic, and the corresponding relation of definition functional value and levels of sharpness is saved in the database, definition functional value computational process is following:
1.1) gradient of detected image:
The gradient of detection level and vertical direction: the notion of at first introducing neighborhood; With pixel a (i; J) be the center; The set of 4 formations in upper and lower, left and right of pixel is called the neighbours territory of pixel a, and the neighbours territory point of pixel a adds that the set that four points on the diagonal constitute is called eight neighborhoods, and is as follows:
The template of the gradient of detection level and vertical direction is following; The convolution template that these two templates are the Sobel operator; Parameter in the template is represented the weighted value of respective pixel, the weighted difference of the template representation x direction of x direction, the weighted difference of the template representation y direction of y direction; With the pixel weighted value of the nearest position, neighbours territory of central point be 2; Pixel weighted value on the eight neighborhood diagonal slightly a little further is 1, and the size of parameter has just been represented the size of weights, and parameter distributions and symbol have just been represented the direction of gradient.With template respectively convolved image obtain the gradient image of image x direction, y direction, then the gradient calculation formula of x direction and y direction as shown in the formula:
Compute gradient: the gradient calculation image of the gentle vertical both direction of water is put total gradient at this:
S=S
x+S
y (2)
In the formula, S is total gradient image, S
xBe the gradient image of the x direction of image, S
yBe the gradient image of the y direction of image, T
xTemplate for the x direction; T
yTemplate for the y direction;
1.2) threshold process
The distinct image edge contour is clear, and the narrower variation of transition band is violent, and then the image border gray scale is on the contrary for blurred picture; Excessively be with broad, grey scale change is slow, makes the pixel count of little Grad increase; The little gradient pixel count of blurred picture is more; This characteristics are made that though the Grad of certain point is less in the transition band zone, transition band inside gradient value with not necessarily little or be more or less the same with comparing than its distinct image, this makes that the sensitivity of sharpness evaluation function is not high; In order to make sharpness evaluation function better sensitivity arranged in the peak value both sides; Must reduce transition band to gradient and influence, therefore need to suppress transition band shared proportion in the intensity level of image border, can adopt the method for gradient image being carried out threshold process; Remove the less edge gradient value of image, the sensitivity of the evaluation function that promotes clearness and accuracy.Another effect that thresholding is handled is a pixel value of eliminating non-edge; 1.1) in the gradient image that detects to have much be not that the pixel at edge also can calculate Grad; But Grad is very little; These little gradient pixels have occupied the significant proportion of gradient sum of all pixels in the image on the edge of, and to reject these be not the influence of the pixel of marginal point through threshold value is set, and improves the sensitivity that detects.Specific practice is, if the gray value of certain pixel, just can think that it has represented edge of image greater than pre-set threshold; If gray value, thinks then that it is not a marginal point, gives up this point less than threshold value; Thereby detect real original image edge gradient, be shown below:
In the formula, S (x y) is the gradient image of image, and T is a preset threshold, n (x, y) for judge S (x, whether gray value y) is the sign function of effective gradient value;
1.3) calculate the value of sharpness evaluation function:
Sharpness evaluation function is defined as:
In the formula, f is a definition values, S
x(x y) is the gradient image S of x direction
x(x, gray value y), S
y(x y) is the gradient image S of y direction
y(x, gray value y).
1.4) normalization handles: with the above-mentioned sharpness evaluation function value that calculates might occur resolution big, faintly the sharpness evaluation function value that goes out of image calculation than resolution little, than the last width of cloth image calculation big situation of functional value of coming out clearly; For the clear degree evaluation of estimate that the yardstick pictures different is calculated clearly can compare; The method that adopts normalization to handle; Specific practice is exactly with the value of the Image Definition whole number of pixels divided by image, is shown below:
In the formula, F is the definition normalized value, and m is the length of image, and n is the wide of image.
2) confirm the levels of sharpness of image:
After obtaining the definition functional value of the resolving power test card graphic that the video camera of different levels of sharpness takes, with these sharpness evaluation function values and the levels of sharpness of taking the used video camera of this image as a recorded and stored in database.
Detect the levels of sharpness of video camera; Width of cloth picture with camera shooting clear degree test card to be detected; According to above-mentioned steps 1.1)~1.4) calculate the sharpness evaluation function value of picture, search database then is with already present definition functional value comparison in this definition function currency and the database; Select immediate numerical value; Select immediate numerical value, be worth the levels of sharpness of corresponding levels of sharpness, think that this levels of sharpness is exactly the levels of sharpness of video camera to be detected as image to be detected with this.