CN104599263B - A kind of method and device of image detection - Google Patents
A kind of method and device of image detection Download PDFInfo
- Publication number
- CN104599263B CN104599263B CN201410814281.4A CN201410814281A CN104599263B CN 104599263 B CN104599263 B CN 104599263B CN 201410814281 A CN201410814281 A CN 201410814281A CN 104599263 B CN104599263 B CN 104599263B
- Authority
- CN
- China
- Prior art keywords
- pixel
- color image
- value
- targeted
- image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10016—Video; Image sequence
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10024—Color image
Abstract
The present invention relates to computer vision intellectual analysis field, more particularly to a kind of method and device of image detection, to solve the problem of current image detecting method is easily caused flase drop.This method includes:Determine the corresponding first intensity of variation value of each pixel in targeted color image, and the second intensity of variation value, according to the first intensity of variation value and the second intensity of variation value, determine the corresponding 3rd intensity of variation value of each pixel in targeted color image, according to the 3rd intensity of variation value, the corresponding prospect degree value of each pixel in targeted color image is determined, according to prospect degree value, the different pixel of background color image in targeted color image is determined.This technical scheme is due to detecting pixel that targeted color image is different from background color image by the 3rd degree changing value, the accuracy for determining the targeted color image pixel different from background color image is improved while the complexity for reducing algorithm, so that reducing causes the possibility of flase drop.
Description
Technical field
The present invention relates to computer vision intellectual analysis field, more particularly to a kind of method and device of image detection.
Background technology
In recent years, with the continuous progress of society, although video monitoring system has been widely used in bank, market, car
Stand, the public place such as traffic intersection, but actual monitor task stills need more be accomplished manually.
For example, some domestic businessmans are in order to canvass business orders, often in various buildings, main roads, construct beyond the region of objective existence and stand
The vertically hung scroll of various commercial, the height hung due to vertically hung scroll are hung in face, trees, traffic guardrail, river course, enclosure wall and communal facility
It is uneven, it is crisscross, not only influence city look and feel, and some vertically hung scrolls are after the suspension long period, the feelings such as appearance is broken, dropped
Condition, certain potential safety hazard is constituted to vehicular traffic and pedestrian.
To find the vertically hung scroll of suspension in violation of rules and regulations in time, video monitoring system is introduced.But, traditional video monitoring system by
Artificial work shift monitors that because control point is relatively more, staff is less so that much the vertically hung scroll of violations is not sent out in time
It is existing.Meanwhile, human eye is easy to cause visual fatigue after long-time stares at monitoring screen, makes decreased attention.With computer
Vision technique continuing to develop and applying, it is already possible to replaces human eye and human brain using computer technology, carrys out automatic identification video
Image in monitoring system.
In the prior art, image detection is carried out using color histogram, the region of image change is extracted, when existing in scene
With monitoring objective color or shape during close object, flase drop is easily caused.
In summary, current image detecting method is easily caused flase drop.
The content of the invention
The embodiments of the invention provide a kind of image detecting method and device, to solve image present in prior art
The problem of detection method is easily caused flase drop.
The embodiments of the invention provide a kind of method of image detection, including:
The color value of each pixel in targeted color image and background color image, is determined in targeted color image
Each corresponding first intensity of variation value of pixel, and each pixel in targeted color image and background color image
Gradient intensity value and gradient direction value, determine the corresponding second intensity of variation value of each pixel, wherein institute in targeted color image
Stating the first intensity of variation value is used to represent the picture of corresponding pixel and background color image in same position in targeted color image
Intensity of variation of the element in color, the second intensity of variation value is used to represent corresponding pixel and background in targeted color image
Pixel intensity of variation on texture of the coloured image in same position;
According to the corresponding first intensity of variation value of each pixel and the second intensity of variation value, determine that target is color
The corresponding 3rd intensity of variation value of each pixel in color image, wherein the 3rd intensity of variation value is used to represent in targeted color image
The degree that corresponding pixel changes in color and texture simultaneously with background color image in the pixel of same position;
According to the corresponding 3rd intensity of variation value of each pixel, determine that each pixel is corresponding in targeted color image
Prospect degree value, wherein the prospect degree value represents in targeted color image corresponding pixel with background color image identical
The pixel of position probability simultaneously different in color and texture;
According to the corresponding prospect degree value of each pixel in the targeted color image, determine in the targeted color image
The different pixel of the background color image.
Due to determining the 3rd degree changing value according to the first degree changing value and the second degree changing value in the present invention, and lead to
Cross the 3rd degree changing value to detect pixel that targeted color image is different from background color image, reduce the complexity of algorithm
The accuracy for determining the targeted color image pixel different from background color image is improved while spending, is led so as to reduce
Cause the possibility of flase drop.
It is preferred that gradient intensity value and the gradient side of each pixel in targeted color image and background color image
To value, the corresponding second intensity of variation value of each pixel in targeted color image is determined, including:
The gradient intensity value and gradient direction value of each pixel in targeted color image and background color image, really
The each pixel in coloured image of setting the goal to background color image the pixel of same position the first texture difference value, and really
Determine each pixel in background color image to targeted color image the pixel of same position the second texture difference value;
According to the corresponding first texture difference value of each pixel and the second texture difference value, each pixel is determined
Corresponding second intensity of variation value.
It is preferred that the gradient intensity value and ladder of each pixel in the targeted color image and the background color image
Degree direction value meets following equation:
Wherein, x represents the abscissa of the pixel in targeted color image and background color image;Y represents targeted color figure
The ordinate of pixel in picture and background color image;(x, y) is represented in targeted color image and background color image where pixel
Position;DTfb(x, y) represents the pixel of (x, y) position in targeted color image to (x, the y) position in background color image
Pixel the first texture difference value;DTbf(x, y) represents the pixel of (x, y) position in background color image to color in target
Second texture difference value of the pixel of (x, y) position in color image;S is the image block centered on location of pixels (x, y);u,v
For in S with coordinate that (x, y) is origin;For in targeted color image (x, y) position pixel gradient intensity value;
For in target image (x, y) position pixel gradient direction value;Represent in background color image in (x, y) position
The gradient intensity value of pixel;Represent background color image in (x, y) position pixel gradient direction value.
It is preferred that each 3rd intensity of variation value meets following equation:
Wherein, P (x, y) represents the corresponding prospect degree of pixel in (x, y) position in targeted color image;D (x, y) table
Show the 3rd intensity of variation value;α represents gain;β represents biasing.
It is preferred that determining background color image according to following manner:
For the multiple image of the continuous acquisition from video capture device, it is determined that the mixing of each pixel in per two field picture
Gauss model;
The priority of Gaussian Profile in the mixed Gauss model of each pixel in every two field picture, it is determined that described
The background distributions of each pixel in per two field picture;
The background distributions of each pixel in every two field picture of determination, determine the background image.
It is preferred that according to the corresponding prospect degree value of each pixel in the targeted color image, determining that the target is color
The different pixel of background color image described in color image, including:
According to the corresponding prospect degree value of each pixel in the targeted color image, the targeted color image is changed
Into binary map;
Determine the different pixel of background color image described in the targeted color image;
If it is determined that the number of pixel different from the background color image in the targeted color image is pre- less than first
If threshold value, a targeted color image is redefined, returns and determines the first intensity of variation value and the second intensity of variation value
The step of, and the background color image according to the targeted color image update.
Due to targeted color image is converted into binary map according to prospect degree value, the complexity of algorithm is significantly reduced
Degree, due to by it is determined that the number of pixel not different from background color image in targeted color image is preset less than first
After threshold value, redefine a targeted color image and detected again, the accuracy of image detection is improved, due to it is determined that mesh
The number of the not no pixel different from the background color image of coloured image is marked less than after the first predetermined threshold value, according to target
Coloured image updates background color image, so as to further increase the accuracy to targeted color image detection.
It is preferred that after determining pixels different from the background color image in the targeted color image, in addition to:
If it is determined that the number of pixel different from the background color image in the targeted color image is not less than first
Predetermined threshold value, is extracted in the binary map being converted into by the targeted color image by particular pixel group according to the number of specific pixel
Into at least one connected region, wherein, specific pixel represents that the targeted color image and the background image are asynchronous
Pixel in the corresponding binary map being converted into by the targeted color image of pixel;
For a connected region, the width and height of the connected region minimum enclosed rectangle are determined, according to the width
Degree and the height, after it is determined that the connected region meets selection condition, determine the gray level image of the connected region, and will
The greyscale image transitions of determination are into binary map;
According to the greyscale image transitions by each connected region into binary map, determine whether marker connected region.
Because the binary map being converted into according to the connected region for being determined for compliance with selection condition determines whether there is the company of mark
Logical region, that is to say, that in targeted color image whether marker, further reduced while image detection accuracy rate is improved
Cause the possibility of flase drop in test pattern.
It is preferred that judging whether the connected region meets selection condition according to following manner:
If the width and the ratio of the height are more than the second predetermined threshold value, it is determined that the connected region meets selection
Condition;
If the ratio of the height and the width is more than the 3rd predetermined threshold value, it is determined that the connected region meets selection
Condition;
If the width and the ratio of the height are not more than the second predetermined threshold value, and the ratio of the height and the width
Value is not more than the 3rd predetermined threshold value, it is determined that the connected region does not meet selection condition.
It is preferred that according to the greyscale image transitions by each connected region into binary map, determine whether marker connect
Logical region, including:
For a connected region, if the width of the connected region minimum enclosed rectangle and the ratio of height are more than described
Second predetermined threshold value, then according to the greyscale image transitions by the connected region into the gray value of each pixel of binary map exist
Vertical direction project obtaining drop shadow curve, if the crest quantity of drop shadow curve is more than the 4th predetermined threshold value, it is determined that described
Connected region is marker connected region, will be by the connected region if the crest quantity of drop shadow curve is not more than the 4th threshold value
The greyscale image transitions in domain into the gray value of each pixel of binary map inverted, according to the gray value after reversion vertical
Direction project obtaining drop shadow curve, if the crest quantity of drop shadow curve is more than the 4th predetermined threshold value, it is determined that the connection
Region is marker connected region;
For a connected region, the height of the connected region minimum enclosed rectangle and the ratio of width are more than described the
Three predetermined threshold values, then according to by the connected region greyscale image transitions into binary map each pixel gray value in water
Square projected to progress and to obtain drop shadow curve, if the crest quantity of statistics drop shadow curve is more than the 4th predetermined threshold value, it is determined that institute
It is marker connected region to state connected region, if the crest quantity of drop shadow curve is not more than the 4th threshold value, will be by the connection
The greyscale image transitions in region into the gray value of each pixel of binary map inverted, according to the gray value after reversion in water
Square projected to progress and to obtain drop shadow curve, if the crest quantity of drop shadow curve is more than the 4th predetermined threshold value, it is determined that the company
Logical region is marker connected region.
The embodiments of the invention provide a kind of device of image detection, including:
First degree value determining module, the face for each pixel in targeted color image and background color image
Colour, determines the corresponding first intensity of variation value of each pixel in targeted color image, and according to targeted color image and the back of the body
The gradient intensity value and gradient direction value of each pixel in scape coloured image, determine each pixel correspondence in targeted color image
The second intensity of variation value, wherein the first intensity of variation value be used for represent corresponding pixel and background in targeted color image
Coloured image is in intensity of variation of the pixel in color of same position, and the second intensity of variation value is used to represent targeted color
Intensity of variation of the pixel on texture of corresponding pixel and background color image in same position in image;
Second degree value determining module, for according to the corresponding first intensity of variation value of each pixel and described
Two intensity of variation values, determine the corresponding 3rd intensity of variation value of each pixel in targeted color image, wherein the 3rd intensity of variation
Be worth for represent corresponding pixel and background color image in targeted color image same position pixel simultaneously in color and
The degree changed on texture;
Prospect degree value determining module, for according to the corresponding 3rd intensity of variation value of each pixel, determining target
The corresponding prospect degree value of each pixel in coloured image, wherein the prospect degree value represents corresponding in targeted color image
Pixel is from background color image in the pixel of same position probability simultaneously different in color and texture;
Pixel determining module, for according to the corresponding prospect degree value of each pixel in the targeted color image, it is determined that
The pixel different from the background color image in the targeted color image.
It is preferred that the first degree value determining module specifically for:
The gradient intensity value and gradient direction value of each pixel in targeted color image and background color image, really
The each pixel in coloured image of setting the goal to background color image the pixel of same position the first texture difference value, and really
Determine each pixel in background color image to targeted color image the pixel of same position the second texture difference value;
According to the corresponding first texture difference value of each pixel and the second texture difference value, each pixel is determined
Corresponding second intensity of variation value.
It is preferred that described device also includes:
Background color image determining module, for determining background color image according to following manner:
For the multiple image of the continuous acquisition from video capture device, it is determined that the mixing of each pixel in per two field picture
Gauss model;
The priority of Gaussian Profile in the mixed Gauss model of each pixel in every two field picture, it is determined that described
The background distributions of each pixel in per two field picture;
The background distributions of each pixel in every two field picture of determination, determine the background color image.
It is preferred that the prospect degree value determining module specifically for:
According to the corresponding prospect degree value of each pixel in the targeted color image, the targeted color image is changed
Into binary map;Determine the different pixel of background color image described in the targeted color image;
The device also includes:
Return to module, the number for determining pixels different from the background color image in the targeted color image
Less than the first predetermined threshold value, a targeted color image is redefined, returns and determines the first intensity of variation value and described second
The step of intensity of variation value, and the background color image according to the targeted color image update.
It is preferred that the device also includes:
Judge module, the number for determining pixels different from the background color image in the targeted color image
After the first predetermined threshold value, extracted according to the number of specific pixel in the binary map being converted into by the targeted color image
At least one connected region being made up of specific pixel, wherein, specific pixel represents the targeted color image and the background
Pixel in the corresponding binary map being converted into by the targeted color image of the asynchronous pixel of coloured image;For a company
Logical region, determines the width and height of the connected region minimum enclosed rectangle, according to the width and the height, it is determined that
The connected region meets after selection condition, determines the gray level image of the connected region, and by the greyscale image transitions of determination
Into binary map;According to the greyscale image transitions by each connected region into binary map, determine whether marker connected region.
Brief description of the drawings
Fig. 1 is the flow chart of the method for the image detection of the embodiment of the present invention one;
Fig. 2 is the minimum enclosed rectangle schematic diagram of the connected region of the embodiment of the present invention two;
Fig. 3 is the flow chart of the method for the image detection of the embodiment of the present invention three;
Fig. 4 is the flow chart that the embodiment of the present invention four determines to have the method for marker in image;
Fig. 5 is the flow chart of the method for the image detection of the embodiment of the present invention five;
Fig. 6 is the schematic diagram of the device of the image detection of the embodiment of the present invention six.
Embodiment
The color value of each pixel of the embodiment of the present invention in targeted color image and background color image, determines mesh
The corresponding first intensity of variation value of each pixel in coloured image is marked, and according in targeted color image and background color image
Each pixel gradient intensity value and gradient direction value, determine the corresponding second change journey of each pixel in targeted color image
Angle value, wherein the first intensity of variation value is used to represent that corresponding pixel and background color image to be in identical bits in targeted color image
Intensity of variation of the pixel put in color, the second intensity of variation value is used to represent corresponding pixel and the back of the body in targeted color image
Pixel intensity of variation on texture of the scape coloured image in same position;According to the corresponding first intensity of variation value of each pixel
And the second intensity of variation value, the corresponding 3rd intensity of variation value of each pixel in targeted color image is determined, wherein the 3rd becomes
Changing degree value is used to represent in targeted color image that pixel of the corresponding pixel with background color image in same position to exist simultaneously
The degree changed in color and texture;According to the corresponding 3rd intensity of variation value of each pixel, determine every in targeted color image
The corresponding prospect degree value of individual pixel, wherein prospect degree value represent corresponding pixel and background color figure in targeted color image
As same position pixel simultaneously in color and texture different probability;It is corresponding according to each pixel in targeted color image
Prospect degree value, determines the different pixel of background color image in targeted color image.This technical scheme is due in the present invention
3rd degree changing value is determined according to the first degree changing value and the second degree changing value, and examined by the 3rd degree changing value
The targeted color image pixel different from background color image is surveyed, determination mesh is improved while the complexity for reducing algorithm
The accuracy of the coloured image pixel different from background color image is marked, so that reducing causes the possibility of flase drop.
The embodiment of the present invention is described in further detail with reference to Figure of description.
As shown in figure 1, the method for the image detection of the embodiment of the present invention one, including:
Step 100, the color value of each pixel in targeted color image and background color image, determines that target is color
The corresponding first intensity of variation value of each pixel in color image, and it is every in targeted color image and background color image
The gradient intensity value and gradient direction value of one pixel, determine corresponding second intensity of variation of each pixel in targeted color image
Value, wherein the first intensity of variation value is used to represent that corresponding pixel and background color image to be in same position in targeted color image
Intensity of variation of the pixel in color, the second intensity of variation value is used to represent corresponding pixel and background in targeted color image
Pixel intensity of variation on texture of the coloured image in same position;
Step 101, according to the corresponding first intensity of variation value of each pixel and the second intensity of variation value, determine that target is color
The corresponding 3rd intensity of variation value of each pixel in color image, wherein the 3rd intensity of variation value is used to represent in targeted color image
The degree that corresponding pixel changes in color and texture simultaneously with background color image in the pixel of same position;
Step 102, according to the corresponding 3rd intensity of variation value of each pixel, each pixel pair in targeted color image is determined
The prospect degree value answered, wherein prospect degree value represent in targeted color image corresponding pixel with background color image identical
The pixel of position probability simultaneously different in color and texture;
Step 103, according to the corresponding prospect degree value of each pixel in targeted color image, determine in targeted color image
The different pixel of background color image.
It should be noted that it is that targeted color image can be obtained by photo or by a certain moment from regarding
Obtained in frequency collecting device, the mode of targeted color image can be obtained by being also not necessarily limited to other.
Background color image preferably acquisition modes are:
For the multiple image of the continuous acquisition from video capture device, it is determined that the mixing of each pixel in per two field picture
Gauss model;
The priority of Gaussian Profile in the mixed Gauss model of each pixel in every two field picture, it is determined that described
The background distributions of each pixel in per two field picture;
The background distributions of each pixel in every two field picture of determination, determine the background image.
For example, the two field picture of video capture device continuous acquisition 500, often gathers a two field picture and determines respectively in the two field picture often
The mixed Gauss model of individual pixel, due to there is K Gaussian Profile in mixed Gauss model, it is assumed that K=3, is then determined each respectively
Corresponding 3 Gaussian Profiles of pixel, wherein corresponding 3 Gaussian Profiles of each pixel are carried out from big to small according to the value of priority
Arrangement, takes the preceding B branch of corresponding 3 Gaussian Profiles of each pixel, it is assumed that B=2, as background distributions, to each picture
The weights of the corresponding background distributions of element and mean value weighting summation obtain color value, by the corresponding face of each pixel in 500 two field pictures
Colour constitutes the background color image at current time.
Specifically, the value of priority is determined according to one of following equation:
Or λi=ωi (2)
Wherein, λiRepresent the value of the priority of i-th of Gaussian Profile;ωiRepresent the weight of i-th of Gaussian Profile;σiRepresent
The variance of i-th of Gaussian Profile.
It is determined that each pixel i-th of Gaussian Profile priority value when, if using formula (1), not using
Formula (2);Vice versa.That is it is determined that each pixel i-th of Gaussian Profile priority value when, do not hand over preferably
Fork uses formula (1) and formula (2).
And the corresponding color value of pixel in background color image in (x, y) position meets formula (3):
Wherein, bg (x, y) represents the corresponding color value of pixel in (x, y) position in background color image;ωiRepresent the
The weight of i Gaussian Profile;σiThe variance of i-th of Gaussian Profile is represented, B represents background distributions.
Wherein, the first intensity of variation value is obtained by color difference formula (4):
DC (x, y)=max (abs (r (x, y)-bgr(x,y),abs(g(x,y)-bgg(x,y)),abs(b(x,y)-bgb
(x,y))) (4)
In color difference formula (4), DC (x, y) represents the first intensity of variation value;X represents targeted color image and background
The abscissa of pixel in coloured image;Y represents the ordinate of pixel in targeted color image and background color image;(x,y)
Represent the position where pixel in targeted color image and background color image;R (x, y), g (x, y), b (x, y) represent mesh respectively
Mark coloured image in position (x, y) pixel red, green, blue triple channel color value;bgr(x,y)、bgg(x,y)、bgb(x,
Y) respectively represent background color image in position (x, y) pixel red, green, blue triple channel color value.
In targeted color image corresponding pixel and background color image same position simultaneously in color and texture not
Same probability, that is to say, that corresponding pixel is not belonging to the probability that background color image belongs to prospect in targeted color pixel, is needed
It is noted that the composition prospect different from pixel in background color image.
It is preferred that gradient intensity value and the gradient side of each pixel in targeted color image and background color image
To value, the corresponding second intensity of variation value of each pixel in targeted color image is determined, including:
The gradient intensity value and gradient direction value of each pixel in targeted color image and background color image, really
The each pixel in coloured image of setting the goal to background color image the pixel of same position the first texture difference value, and really
Determine each pixel in background color image to targeted color image the pixel of same position the second texture difference value;
According to the corresponding first texture difference value of each pixel and the second texture difference value, each pixel is determined
Corresponding second intensity of variation value.
It is preferred that the gradient intensity value and ladder of each pixel in the targeted color image and the background color image
Degree direction value meets formula (5):
The gradient intensity value and gradient direction of each pixel in the targeted color image and the background color image
Value meets formula (6):
Wherein, x represents the abscissa of the pixel in targeted color image and background color image;Y represents targeted color figure
The ordinate of pixel in picture and background color image;(x, y) is represented in targeted color image and background color image where pixel
Position;DTfb(x, y) represents the pixel of (x, y) position in targeted color image to (x, the y) position in background color image
Pixel the first texture difference value;DTbf(x, y) represents the pixel of (x, y) position in background color image to color in target
Second texture difference value of the pixel of (x, y) position in color image;S is the image block centered on location of pixels (x, y);u,v
For in S with coordinate that (x, y) is origin;For in targeted color image (x, y) position pixel gradient intensity value;
For in target image (x, y) position pixel gradient direction value;Represent in background color image in (x, y) position
The gradient intensity value of pixel;Represent background color image in (x, y) position pixel gradient direction value.
Specifically, image block S may be sized in 13*13, targeted color image and background color image
The gradient (including gradient intensity value and gradient direction value) of the pixel of position (x, y) can use what is commonly used in Digital Image Processing
Coloured image gradient calculation method is obtained.
It is preferred that according to the corresponding first texture difference value of each pixel and the second texture difference value, it is determined that
The corresponding second intensity of variation value of each pixel, including:
Using value larger in the corresponding first texture difference value of each pixel and the second texture difference value as
The corresponding second intensity of variation value of each pixel.
That is, the second intensity of variation value DT (x, y)=max (DTfb(x,y),DTbf(x,y))。
It is preferred that each 3rd intensity of variation value meets formula (7):
Wherein, P (x, y) represents the corresponding prospect degree value of pixel in (x, y) position in targeted color image;D(x,y)
Represent the 3rd intensity of variation value;α represents gain;β represents biasing.
Wherein, gain alpha, biasing β are, according to the different according to being configured the need for user of actual conditions, to be mainly used in
D (x, y) size is adjusted, so that obtained P (x, y) is more accurate.
It is preferred that in step 103, specifically, according to the corresponding prospect degree value of each pixel in targeted color image,
Targeted color image is converted into binary map;
Determine the different pixel of background color image described in the targeted color image.
That is, according to the corresponding prospect degree value of each pixel in targeted color image, will by thresholding method
Targeted color image is converted into binary map, and its specific practice is as follows:
So that the pixel in binary map includes white pixel and black picture element as an example, related description is carried out, binaryzation is will be greater than
Pixel in the corresponding targeted color image of prospect degree value of threshold value is expressed as white pixel, by no more than binary-state threshold
Pixel in the corresponding targeted color image of prospect degree value is expressed as black picture element, and the threshold value of wherein binaryzation is according to reality
Respective settings are carried out in situation the need for user, for example binary-state threshold could be arranged to 0.5.
Pixel in the corresponding targeted color image of its white pixel is exactly the pixels different from background color image.
It should be noted that the pixel in binary map is two different colors of pixel, white pixel is not restricted to
And black picture element, it can also represent that the pixel in corresponding targeted color image is exactly and background color with the pixel of other colors
The different pixel of image, as long as with representing the pixel in targeted color image in the binary map that is converted into by targeted color image just
Be color corresponding from background color image identical pixel pixel it is different.
It is preferred that after determining the different pixels of background color image described in the targeted color image, however, it is determined that institute
The number for stating pixels different from the background color image in targeted color image is less than the first predetermined threshold value, redefines one
Targeted color image, and return to the step of determining the first intensity of variation value and the second intensity of variation value.
First predetermined threshold value is according to being set the need for user in actual conditions, if being changed by targeted color image
Into binary map in only isolated several expressions pixel different from respective pixel in background color image, also by targeted color
Spectral discrimination be and the pixel identical situation in background color image.
That is, can be after it is determined that the color of object image of collection be identical with background color image, when default
Between redefine targeted color image, can also it is determined that collection color of object image it is identical with background color image after,
Directly redefine targeted color image.
It is preferred that determining that the number of pixels different from the background color image in the targeted color image is less than the
After one predetermined threshold value, the background color image according to targeted color image update.
Its detailed process is:Mixed Gauss model is updated using each pixel of targeted color image, updated
Afterwards, choose the Gaussian Profile that priority is preceding B and be defined as background distributions, it is corresponding to each pixel in new background distributions
The average of background distributions obtains color value as weighted sum, and obtained all colours value is constituted into the background color figure after updating
Picture.
It should be noted that mixed Gaussian will be set up to each pixel in the image that is gathered from video capture device
Model, and determine the priority that K is distributed in mixed Gauss model according to a formula in formula (1) and formula (2).Every
Background color image is updated every preset time, or after it is determined that the coloured image of target is identical with background color image,
Background color image is updated.
It is preferred that after determining pixels different from background color image in targeted color image, however, it is determined that targeted color
The number of the pixel different from background color image is not less than the first predetermined threshold value in image, is extracted according to the number of specific pixel
At least one connected region being made up of in the binary map being converted into by targeted color image specific pixel, wherein, specific pixel
Represent in the targeted color image binary map being converted into by targeted color image corresponding with the asynchronous pixel of background image
Pixel;
For a connected region, the width and height of connected region minimum enclosed rectangle are determined, according to width and height,
After it is determined that connected region meets selection condition, determine the gray level image of connected region, and by the greyscale image transitions of determination into
Binary map;
According to the greyscale image transitions by each connected region into binary map, determine whether marker connected region.
Wherein, marker can be vertically hung scroll, Sign Board or other marks different from background.
If it is determined that there is marker connected region, then illustrate there is marker in targeted color image, then send alarm, otherwise weigh
It is new to determine a targeted color image, return to the step of determining the first intensity of variation value and the second intensity of variation value.
It can then illustrate there is mark in targeted color image after it is determined that connected region is marker connected region
Thing, then no longer carry out continuation judgement, send alarm;Can also be it is determined that whether all connected regions be marker connected region
Afterwards, if so, then sending alarm, a targeted color image is otherwise redefined, returns and determines the first intensity of variation value and institute
The step of stating the second intensity of variation value.
So that the binary map that is converted into by targeted color image is constituted by white pixel and with black picture element as an example, wherein by mesh
Pixels different from background color image are expressed as white pixel in mark coloured image, using the opening operation in morphology and close
Computing is handled the binary map being converted into by targeted color image, removes some in the connected region being made up of white pixel
Isolated black picture element, and upper white pixel is filled into the position where former black picture element, according to white pixel in connected region
Number, extract connected region.The number of white pixel extracts connected region for how many when in specific connected region, is according to reality
Set in the situation of border the need for user.
The width and height of connected region are determined according to the minimum enclosed rectangle of its connected region, as shown in Fig. 2 connected region
The minimum enclosed rectangle in domain 200 is 201.
It is preferred that judging whether the connected region meets selection condition according to following manner:
If the width and the ratio of the height are more than the second predetermined threshold value, it is determined that the connected region meets selection
Condition;
If the ratio of the height and the width is more than the 3rd predetermined threshold value, it is determined that the connected region meets selection
Condition;
If the width and the ratio of the height are not more than the second predetermined threshold value, and the ratio of the height and the width
Value is not more than the 3rd predetermined threshold value, it is determined that the connected region does not meet selection condition.
Wherein the second predetermined threshold value and the 3rd predetermined threshold value be according to user in actual conditions the need for carry out related setting
, the second predetermined threshold value and the 3rd predetermined threshold value can be identical value, or different values, such as the second predetermined threshold value
Can take 5 simultaneously with the 3rd predetermined threshold value, can also the second predetermined threshold value go 6, the 3rd predetermined threshold value takes 5.
If without qualified connected region, then redefining a targeted color image, return and determine described first
The step of intensity of variation value and the second intensity of variation value.
It is preferred that according to the greyscale image transitions by each connected region into binary map, determine whether marker connect
Logical region:
For a connected region, if the width of the connected region minimum enclosed rectangle and the ratio of height are more than described
Second predetermined threshold value, then according to the greyscale image transitions by the connected region into the gray value of each pixel of binary map exist
Vertical direction project obtaining drop shadow curve, if the crest quantity of drop shadow curve is more than the 4th predetermined threshold value, it is determined that described
Connected region is marker connected region;, will be by the connected region if the crest quantity of drop shadow curve is not more than the 4th threshold value
The greyscale image transitions in domain into the gray value of each pixel of binary map inverted, according to the gray value after reversion vertical
Direction project obtaining drop shadow curve, if the crest quantity of drop shadow curve is more than the 4th predetermined threshold value, it is determined that the connection
Region is marker connected region;
For a connected region, the height of the connected region minimum enclosed rectangle and the ratio of width are more than described the
Three predetermined threshold values, then according to by the connected region greyscale image transitions into binary map each pixel gray value in water
Square projected to progress and to obtain drop shadow curve, if the crest quantity of statistics drop shadow curve is more than the 4th predetermined threshold value, it is determined that institute
It is marker connected region to state connected region, if the crest quantity of drop shadow curve is not more than the 4th threshold value, will be by the connection
The greyscale image transitions in region into the gray value of each pixel of binary map inverted, according to the gray value after reversion in water
Square projected to progress and to obtain drop shadow curve, if the crest quantity of drop shadow curve is more than the 4th predetermined threshold value, it is determined that the company
Logical region is marker connected region;
4th predetermined threshold value is set according to the need for user in actual conditions.
It should be noted that the gray level image of qualified connected region can be converted into binary map by following manner:
The targeted color image obtained from video capture device is converted into gray level image by formula (8):
Gray (x, y)=0.299*r (x, y)+0.587*g (x, y)+0.144*b (x, y) (8)
Wherein, gray (x, y) represents gray value of the targeted color image in the pixel of position (x, y);X represents targeted color
The abscissa of pixel in image;Y represents the ordinate of pixel in targeted color image;(x, y) is represented in targeted color image
Position where pixel;R (x, y), g (x, y), b (x, y) respectively represent the pixel at position (x, y) in targeted color image
The color value of red, green, blue triple channel.
Further according to the coordinate position of qualified connected region, cut in the gray level image being converted into from targeted color image
Take the gray level image of relevant position.
Connected region corresponding gray level image will be obtained two-value is translated into by the OTSU methods in Digital Image Processing
Figure, wherein binary map are made up of any two different colors of pixel, are illustrated by taking white pixel and black picture element as an example, black
The gray value of color pixel is 0, and the gray value of white pixel is 255.Black picture element in the binary map being converted into by connected region
The pixel in correspondence background color image may be represented, it is also possible to represent the pixel in corresponding targeted color image, work as black
When pixel represents the pixel in correspondence background color image, white pixel represents the pixel in correspondence targeted color image;When black
When color pixel represents the pixel in correspondence targeted color image, white pixel represents the pixel in correspondence background color image.
For example when marker is the vertically hung scroll for having character, the binary map changed into by connected region is character and background color
The combination of the brightness of image, wherein, when character is white pixel, background color image is black picture element;Otherwise background color figure
As being white pixel, character is black picture element.
Therefore after drop shadow curve is obtained, if crest quantity when being not more than four predetermined threshold values, it is necessary to which gray value is entered
Row reversion, is judged again, that is to say, that if the gray value of black picture element is 0, and the gray value of white pixel is 255, then instead
The gray value of black picture element is 255 after turning, and the gray value of white pixel is 0.
If the width of the connected region minimum enclosed rectangle and the ratio of height are more than second predetermined threshold value, also
To say that marker is horizontally suspended, then according to by the connected region greyscale image transitions into binary map each pixel ash
Angle value is projected in vertical direction;If the height of the connected region minimum enclosed rectangle and the ratio of width are more than described the
Three predetermined threshold values, that is to say, that marker vertical hanging, then according to by the connected region greyscale image transitions into two-value
The gray value of each pixel of figure is projected in the horizontal direction.
If after projecting twice, the quantity of drop shadow curve is all not more than the 4th predetermined threshold value, then does not have in targeted color image
There is marker.
As shown in figure 3, the image detecting method of the embodiment of the present invention three, including:
Step 300, the binary map changed into by targeted color image is entered using the opening operation in morphology and closed operation
Row processing.
Step 301, extract and targeted color image and background image are represented in the binary map being converted into by targeted color image
At least one connected region that pixel in the corresponding binary map being converted into by targeted color image of asynchronous pixel is constituted;
Step 302, for a connected region, the width and height of connected region minimum enclosed rectangle are determined, according to width
Degree and height, after it is determined that connected region meets selection condition, determine the gray level image of connected region, and by the gray-scale map of determination
As being converted into binary map;
Step 303, according to the greyscale image transitions by each connected region into binary map, determine whether marker connect
Logical region.
As shown in figure 4, the embodiment of the present invention four determines the method for having marker in image, including:
Step 400, targeted color image is converted into gray-scale map.
Step 401, the gray-scale map of qualified connected region is intercepted.
Step 402, the gray-scale map of qualified connected region is converted into binary map.
Step 403, the binary map that connected region is changed into is made to the projection of horizontal or vertical direction.
Step 404, judge whether the number of drop shadow curve's medium wave peak is more than the 4th predetermined threshold value, if crest number is more than the
Four predetermined threshold values, then perform step 405, otherwise performs step 406.
Step 405, determine there is marker in targeted color image, this flow terminates.
Step 406, obtain new by even after the gray value reversion of each pixel in binary map connected region changed into
Logical regioinvertions into binary map, make the projection of horizontal or vertical direction.
Step 407, judge whether the number of drop shadow curve's medium wave peak is more than the 4th predetermined threshold value, if crest number is more than the
Four predetermined threshold values, then perform step 405, otherwise performs step 408.
Step 408, determine there is no marker in targeted color image, this flow terminates.
As shown in figure 5, the method for the image detection of the embodiment of the present invention five, including:
Step 500, according to many color image frames obtained from video capture device, determine to carry on the back by mixed Gauss model
Scape coloured image.
Step 501, a new frame targeted color image is obtained from video equipment.
Step 502, according to the color value of each pixel in targeted color image and background color image, color difference is passed through
Formula determines that the first intensity of variation value, and the gradient intensity value and gradient direction value of each pixel determine the second intensity of variation
Value.
Step 503, it regard value larger in the first intensity of variation value and the second intensity of variation value as the 3rd intensity of variation value.
Step 504, the corresponding prospect journey of each pixel in targeted color image is determined according to the 3rd intensity of variation value
Angle value.
Step 505, according to the corresponding prospect degree value of each pixel in targeted color image, targeted color image is converted
As binary map.
Step 506, binary map is transformed into according to by targeted color image, judges whether have and carry on the back in targeted color image
The different pixel of scape coloured image, performs step 508 if having, and otherwise performs step 507.
Step 507, according to targeted color image update background color image, after background color image is updated, step is performed
Rapid 501.
Step 508, extract in the binary map being converted into by the targeted color image by expression targeted color image and the back of the body
Pixel in the corresponding binary map being converted into by targeted color image of the asynchronous pixel of scape coloured image constitute at least one
Individual connected region.
Step 509, judge whether the minimum enclosed rectangle of connected region meets preparatory condition, if meeting, perform step
510, otherwise perform step 507.
Step 510, according to the greyscale image transitions by each connected region into binary map, judge qualified connection
Whether region is marker connected region, if so, then performing step 511, otherwise performs step 507.
Step 511, it is determined that having marker in the targeted color image of detection, alarm is sent, this flow terminates.
Based on same inventive concept, a kind of device of image detection is additionally provided in the embodiment of the present invention, due to the present invention
The corresponding method of device of embodiment image detection is the method for image detection, therefore the implementation of device of the embodiment of the present invention can be with
Referring to the implementation of method, repeat part and repeat no more.
As shown in fig. 6, the device of the image detection of the embodiment of the present invention six, including:
First degree value determining module 600, for each pixel in targeted color image and background color image
Color value, determine the corresponding first intensity of variation value of each pixel in targeted color image, and according to targeted color image
With the gradient intensity value and gradient direction value of each pixel in background color image, each pixel in targeted color image is determined
Corresponding second intensity of variation value, wherein the first intensity of variation value be used to representing in targeted color image corresponding pixel with
Background color image is in intensity of variation of the pixel in color of same position, and the second intensity of variation value is used to represent target
Intensity of variation of the pixel on texture of corresponding pixel and background color image in same position in coloured image;
Second degree value determining module 601, for according to the corresponding first intensity of variation value of each pixel and institute
The second intensity of variation value is stated, the corresponding 3rd intensity of variation value of each pixel in targeted color image is determined, wherein the 3rd change
Degree value is used to represent the pixel of corresponding pixel and background color image in targeted color image in same position simultaneously in face
The degree changed on color and texture;
Prospect degree value determining module 602, for according to the corresponding 3rd intensity of variation value of each pixel, determining mesh
The corresponding prospect degree value of each pixel in coloured image is marked, wherein the prospect degree value represents correspondence in targeted color image
Pixel and background color image in the pixel of same position probability simultaneously different in color and texture;
Pixel determining module 603, for according to the corresponding prospect degree value of each pixel in the targeted color image, really
The pixel different from the background color image in the fixed targeted color image.
It is preferred that the first degree value determining module 600 specifically for:
The gradient intensity value and gradient direction value of each pixel in targeted color image and background color image, really
The each pixel in coloured image of setting the goal to background color image the pixel of same position the first texture difference value, and really
Determine each pixel in background color image to targeted color image the pixel of same position the second texture difference value;
According to the corresponding first texture difference value of each pixel and the second texture difference value, each pixel is determined
Corresponding second intensity of variation value.
It is preferred that the gradient intensity value and ladder of each pixel in the targeted color image and the background color image
Degree direction value meets formula:
Wherein, x represents the abscissa of the pixel in targeted color image and background color image;Y represents targeted color figure
The ordinate of pixel in picture and background color image;(x, y) is represented in targeted color image and background color image where pixel
Position;DTfb(x, y) represents the pixel of (x, y) position in targeted color image to (x, the y) position in background color image
Pixel the first texture difference value;DTbf(x, y) represents the pixel of (x, y) position in background color image to color in target
Second texture difference value of the pixel of (x, y) position in color image;S is the image block centered on location of pixels (x, y);u,v
For in S with coordinate that (x, y) is origin;For in targeted color image (x, y) position pixel gradient intensity value;
For in target image (x, y) position pixel gradient direction value;Represent in background color image in (x, y) position
The gradient intensity value of pixel;Represent background color image in (x, y) position pixel gradient direction value.
It is preferred that the second degree value determining module 601 specifically for:
Using value larger in the corresponding first texture difference value of each pixel and the second texture difference value as
The corresponding second intensity of variation value of each pixel.
It is preferred that each 3rd intensity of variation value meets following equation:
Wherein, P (x, y) represents the corresponding prospect degree of pixel in (x, y) position in targeted color image;D (x, y) table
Show the 3rd intensity of variation value;α represents gain;β represents biasing.
It is preferred that described device also includes:
Background color image determining module 604, for determining background color image according to following manner:
For the multiple image of the continuous acquisition from video capture device, it is determined that the mixing of each pixel in per two field picture
Gauss model;
The priority of Gaussian Profile in the mixed Gauss model of each pixel in every two field picture, it is determined that described
The background distributions of each pixel in per two field picture;
The background distributions of each pixel in every two field picture of determination, determine the background image.
It is preferred that the pixel determining module 603 specifically for:
According to the corresponding prospect degree value of each pixel in the targeted color image, the targeted color image is changed
Into binary map;
Determine the different pixel of background color image described in the targeted color image.
It is preferred that the device also includes:
Module 605 is returned to, for determining in the targeted color image the not picture different from the background color image
The number of element is less than the first predetermined threshold value, redefines a targeted color image, and return to determination the first intensity of variation value
The step of with the second intensity of variation value.
It is preferred that the return module 605 is additionally operable to:
Determine that the number of the pixel different from the background color image is not less than first in the targeted color image
After predetermined threshold value, the background color image according to the targeted color image update.
It is preferred that the device also includes:
Judge module 606, for determining pixels different from the background color image in the targeted color image
Number is not less than after the first predetermined threshold value, and the two-value being converted into by the targeted color image is extracted according to the number of specific pixel
At least one connected region being made up of in figure specific pixel, wherein, specific pixel represent the targeted color image with it is described
Pixel in the corresponding binary map being converted into by the targeted color image of the asynchronous pixel of background color image;For one
Individual connected region, determines the width and height of the connected region minimum enclosed rectangle, according to the width and the height,
Determine that the connected region meets after selection condition, determine the gray level image of the connected region, and by the gray level image of determination
It is converted into binary map;According to the greyscale image transitions by each connected region into binary map, determine whether marker connect
Region.
It is preferred that judge module 606 judges whether the connected region meets selection condition according to following manner:
If the width and the ratio of the height are more than the second predetermined threshold value, it is determined that the connected region meets selection
Condition;
If the ratio of the height and the width is more than the 3rd predetermined threshold value, it is determined that the connected region meets selection
Condition;
If the width and the ratio of the height are not more than the second predetermined threshold value, and the ratio of the height and the width
Value is not more than the 3rd predetermined threshold value, it is determined that the connected region does not meet selection condition.
It is preferred that judge module 606 according to the greyscale image transitions by each connected region into binary map, judge whether
There is marker connected region:
For a connected region, if the width of the connected region minimum enclosed rectangle and the ratio of height are more than described
Second predetermined threshold value, then according to the greyscale image transitions by the connected region into the gray value of each pixel of binary map exist
Vertical direction project obtaining drop shadow curve, if the crest quantity of drop shadow curve is more than the 4th predetermined threshold value, it is determined that described
Connected region is marker connected region, will be by the connected region if the crest quantity of drop shadow curve is not more than the 4th threshold value
The greyscale image transitions in domain into the gray value of each pixel of binary map inverted, according to the gray value after reversion vertical
Direction project obtaining drop shadow curve, if the crest quantity of drop shadow curve is more than the 4th predetermined threshold value, it is determined that the connection
Region is marker connected region;
For a connected region, the height of the connected region minimum enclosed rectangle and the ratio of width are more than described the
Three predetermined threshold values, then according to by the connected region greyscale image transitions into binary map each pixel gray value in water
Square projected to progress and to obtain drop shadow curve, if the crest quantity of statistics drop shadow curve is more than the 4th predetermined threshold value, it is determined that institute
It is marker connected region to state connected region, if the crest quantity of drop shadow curve is not more than the 4th threshold value, will be by the connection
The greyscale image transitions in region into the gray value of each pixel of binary map inverted, according to the gray value after reversion in water
Square projected to progress and to obtain drop shadow curve, if the crest quantity of drop shadow curve is more than the 4th predetermined threshold value, it is determined that the company
Logical region is marker connected region.
The color value of each pixel of the embodiment of the present invention in targeted color image and background color image, determines mesh
The corresponding first intensity of variation value of each pixel in coloured image is marked, and according in targeted color image and background color image
Each pixel gradient intensity value and gradient direction value, determine the corresponding second change journey of each pixel in targeted color image
Angle value, wherein the first intensity of variation value is used to represent that corresponding pixel and background color image to be in identical bits in targeted color image
Intensity of variation of the pixel put in color, the second intensity of variation value is used to represent corresponding pixel and the back of the body in targeted color image
Pixel intensity of variation on texture of the scape coloured image in same position;According to the corresponding first intensity of variation value of each pixel
And the second intensity of variation value, the corresponding 3rd intensity of variation value of each pixel in targeted color image is determined, wherein the 3rd becomes
Changing degree value is used to represent in targeted color image that pixel of the corresponding pixel with background color image in same position to exist simultaneously
The degree changed in color and texture;According to the corresponding 3rd intensity of variation value of each pixel, determine every in targeted color image
The corresponding prospect degree value of individual pixel, wherein prospect degree value represent corresponding pixel and background color figure in targeted color image
As same position pixel simultaneously in color and texture different probability;It is corresponding according to each pixel in targeted color image
Prospect degree value, determines the different pixel of background color image in targeted color image.This technical scheme is due in the present invention
3rd degree changing value is determined according to the first degree changing value and the second degree changing value, and examined by the 3rd degree changing value
The targeted color image pixel different from background color image is surveyed, determination mesh is improved while the complexity for reducing algorithm
The accuracy of the coloured image pixel different from background color image is marked, so that reducing causes the possibility of flase drop, is solved
The problem of in the prior art image detection is easily caused flase drop.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program
Product.Therefore, the present invention can be using the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.Moreover, the present invention can be used in one or more computers for wherein including computer usable program code
The computer program production that usable storage medium is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product
Figure and/or block diagram are described.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram
Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided
The processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real
The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which is produced, to be included referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that in meter
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, thus in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.
, but those skilled in the art once know basic creation although preferred embodiments of the present invention have been described
Property concept, then can make other change and modification to these embodiments.So, appended claims are intended to be construed to include excellent
Select embodiment and fall into having altered and changing for the scope of the invention.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the present invention to the present invention
God and scope.So, if these modifications and variations of the present invention belong to the scope of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to comprising including these changes and modification.
Claims (13)
1. a kind of method of image detection, it is characterised in that this method includes:
The color value of each pixel in targeted color image and background color image, is determined each in targeted color image
The corresponding first intensity of variation value of pixel, and each pixel in targeted color image and background color image gradient
Intensity level and gradient direction value, determine the corresponding second intensity of variation value of each pixel in targeted color image, wherein described
One intensity of variation value is used to represent that corresponding pixel to exist with background color image in the pixel of same position in targeted color image
Intensity of variation in color, the second intensity of variation value is used to represent corresponding pixel and background color in targeted color image
Pixel intensity of variation on texture of the image in same position;
According to the corresponding first intensity of variation value of each pixel and the second intensity of variation value, targeted color figure is determined
The corresponding 3rd intensity of variation value of each pixel as in, wherein the 3rd intensity of variation value is used to represent correspondence in targeted color image
The degree that changes simultaneously in color and texture in the pixel of same position of pixel and background color image;
According to the corresponding 3rd intensity of variation value of each pixel, the corresponding prospect of each pixel in targeted color image is determined
Degree value, wherein the prospect degree value represents that corresponding pixel and background color image are in same position in targeted color image
Pixel probability different in color and texture simultaneously;
Wherein, each 3rd intensity of variation value meets following equation:
P (x, y) represents the corresponding prospect degree of pixel in (x, y) position in targeted color image;D (x, y) represents described the
Three intensity of variation values;α represents gain;β represents biasing;
According to the corresponding prospect degree value of each pixel in the targeted color image, determine in the targeted color image with institute
State the different pixel of background color image.
2. the method as described in claim 1, it is characterised in that each in targeted color image and background color image
The gradient intensity value and gradient direction value of pixel, determine the corresponding second intensity of variation value of each pixel in targeted color image,
Including:
The gradient intensity value and gradient direction value of each pixel in targeted color image and background color image, determine mesh
Each pixel in coloured image is marked to background color image in the first texture difference value of the pixel of same position, and the back of the body is determined
In scape coloured image each pixel to targeted color image the pixel of same position the second texture difference value;
According to the corresponding first texture difference value of each pixel and the second texture difference value, each pixel correspondence is determined
The second intensity of variation value.
3. method as claimed in claim 2, it is characterised in that in the targeted color image and the background color image
The gradient intensity value and gradient direction value of each pixel meet following equation:
Wherein, x represents the abscissa of the pixel in targeted color image and background color image;Y represent targeted color image and
The ordinate of pixel in background color image;(x, y) represents the position where pixel in targeted color image and background color image
Put;DTfb(x, y) represents the picture of the pixel to (x, y) position in background color image of (x, y) position in targeted color image
First texture difference value of element;DTbf(x, y) represents the pixel of (x, y) position in background color image in targeted color figure
The second texture difference value of the pixel of (x, y) position as in;S is the image block centered on location of pixels (x, y);U, v are in S
With the coordinate that (x, y) is origin;For in targeted color image (x, y) position pixel gradient intensity value;For mesh
In logo image (x, y) position pixel gradient direction value;Represent the pixel in (x, y) position in background color image
Gradient intensity value;Represent background color image in (x, y) position pixel gradient direction value.
4. the method as described in claim 1, it is characterised in that background color image is determined according to following manner:
For the multiple image of the continuous acquisition from video capture device, it is determined that the mixed Gaussian of each pixel in per two field picture
Model;
The priority of Gaussian Profile in the mixed Gauss model of each pixel in every two field picture, is determined described per frame
The background distributions of each pixel in image;
The background distributions of each pixel in every two field picture of determination, determine the background color image.
5. method as claimed in claim 4, it is characterised in that according to each pixel in the targeted color image it is corresponding before
Scape degree value, determines pixels different from the background color image in the targeted color image, including:
According to the corresponding prospect degree value of each pixel in the targeted color image, the targeted color image is converted into two
Value figure;
Determine pixels different from the background color image in the targeted color image:
If it is determined that the number of pixel different from the background color image in the targeted color image is less than the first default threshold
Value, redefines a targeted color image, returns to the step for determining the first intensity of variation value and the second intensity of variation value
Suddenly, the background color image and according to the targeted color image update.
6. method as claimed in claim 5, it is characterised in that determine in the targeted color image with the background color figure
After different pixels, in addition to:
If it is determined that the number of pixel different from the background color image in the targeted color image is preset not less than first
Threshold value, extracts what is be made up of in the binary map being converted into by the targeted color image specific pixel according to the number of specific pixel
At least one connected region, wherein, specific pixel represents that the targeted color image and the background color image are asynchronous
Pixel in the corresponding binary map being converted into by the targeted color image of pixel;
For a connected region, determine the width and height of the connected region minimum enclosed rectangle, according to the width and
The height, after it is determined that the connected region meets selection condition, determines the gray level image of the connected region, and will determine
Greyscale image transitions into binary map;
According to the greyscale image transitions by each connected region into binary map, determine whether marker connected region.
7. method as claimed in claim 6, it is characterised in that judge whether the connected region meets choosing according to following manner
Take condition:
If the width and the ratio of the height are more than the second predetermined threshold value, it is determined that the connected region meets selection bar
Part;
If the ratio of the height and the width is more than the 3rd predetermined threshold value, it is determined that the connected region meets selection bar
Part;
If the width and the ratio of the height are not more than the second predetermined threshold value, and the height and the width ratio not
More than the 3rd predetermined threshold value, it is determined that the connected region does not meet selection condition.
8. method as claimed in claim 7, it is characterised in that according to the greyscale image transitions by each connected region into two
Value figure, determines whether marker connected region, including:
For a connected region, if the width of the connected region minimum enclosed rectangle and the ratio of height are more than described second
Predetermined threshold value, then according to by the connected region greyscale image transitions into binary map each pixel gray value vertical
Direction project obtaining drop shadow curve, if the crest quantity of drop shadow curve is more than the 4th predetermined threshold value, it is determined that the connection
Region is marker connected region, if the crest quantity of drop shadow curve is not more than the 4th threshold value, by by the connected region
Greyscale image transitions into the gray value of each pixel of binary map inverted, according to the gray value after reversion in vertical direction
Progress, which is projected, obtains drop shadow curve, if the crest quantity of drop shadow curve is more than the 4th predetermined threshold value, it is determined that the connected region
It is marker connected region;
For a connected region, the height of the connected region minimum enclosed rectangle and the ratio of width are pre- more than the described 3rd
If threshold value, then according to by the connected region greyscale image transitions into binary map each pixel gray value in level side
Projected to progress and obtain drop shadow curve, if the crest quantity of statistics drop shadow curve is more than the 4th predetermined threshold value, it is determined that the company
Logical region is marker connected region, will be by the connected region if the crest quantity of drop shadow curve is not more than the 4th threshold value
Greyscale image transitions into the gray value of each pixel of binary map inverted, according to the gray value after reversion in level side
Projected to progress and obtain drop shadow curve, if the crest quantity of drop shadow curve is more than the 4th predetermined threshold value, it is determined that the connected region
Domain is marker connected region.
9. a kind of device of image detection, it is characterised in that the device includes:
First degree value determining module, the color for each pixel in targeted color image and background color image
Value, determines the corresponding first intensity of variation value of each pixel in targeted color image, and according to targeted color image and background
The gradient intensity value and gradient direction value of each pixel in coloured image, determine that each pixel is corresponding in targeted color image
Second intensity of variation value, wherein the first intensity of variation value is used to represent in targeted color image that corresponding pixel and background to be color
Color image is in intensity of variation of the pixel in color of same position, and the second intensity of variation value is used to represent targeted color figure
Intensity of variation of the pixel on texture of corresponding pixel and background color image in same position as in;
Second degree value determining module, for being become according to the corresponding first intensity of variation value of each pixel and described second
Change degree value, determine the corresponding 3rd intensity of variation value of each pixel in targeted color image, wherein the 3rd intensity of variation value use
In representing the pixel of corresponding pixel and background color image in targeted color image in same position simultaneously in color and texture
The degree of upper change;
Prospect degree value determining module, for according to the corresponding 3rd intensity of variation value of each pixel, determining targeted color
The corresponding prospect degree value of each pixel in image, wherein the prospect degree value represents corresponding pixel in targeted color image
From background color image in the pixel of same position probability simultaneously different in color and texture;
Wherein, each 3rd intensity of variation value meets following equation:
P (x, y) represents the corresponding prospect degree of pixel in (x, y) position in targeted color image;D (x, y) represents described the
Three intensity of variation values;α represents gain;β represents biasing;
Pixel determining module, for according to the corresponding prospect degree value of each pixel in the targeted color image, it is determined that described
The pixel different from the background color image in targeted color image.
10. device as claimed in claim 9, it is characterised in that the first degree value determining module specifically for:
The gradient intensity value and gradient direction value of each pixel in targeted color image and background color image, determine mesh
Each pixel in coloured image is marked to background color image in the first texture difference value of the pixel of same position, and the back of the body is determined
In scape coloured image each pixel to targeted color image the pixel of same position the second texture difference value;
According to the corresponding first texture difference value of each pixel and the second texture difference value, each pixel correspondence is determined
The second intensity of variation value.
11. device as claimed in claim 9, it is characterised in that described device also includes:
Background color image determining module, for determining background color image according to following manner:
For the multiple image of the continuous acquisition from video capture device, it is determined that the mixed Gaussian of each pixel in per two field picture
Model;
The priority of Gaussian Profile in the mixed Gauss model of each pixel in every two field picture, is determined described per frame
The background distributions of each pixel in image;
The background distributions of each pixel in every two field picture of determination, determine the background color image.
12. device as claimed in claim 11, it is characterised in that the prospect degree value determining module specifically for:
According to the corresponding prospect degree value of each pixel in the targeted color image, the targeted color image is converted into two
Value figure;Determine pixels different from the background color image in the targeted color image:
The device also includes:
Module is returned to, for determining that the number of pixels different from the background color image in the targeted color image is less than
First predetermined threshold value, redefines a targeted color image, returns and determines the first intensity of variation value and second change
The step of degree value, and the background color image according to the targeted color image update.
13. device as claimed in claim 12, it is characterised in that the device also includes:
Judge module, for determining that the number of pixels different from the background color image in the targeted color image is not small
In after the first predetermined threshold value, extracted according to the number of specific pixel in the binary map being converted into by the targeted color image by spy
At least one connected region of fixation element composition, wherein, the specific pixel represents the targeted color image and the background
Pixel in the corresponding binary map being converted into by the targeted color image of the asynchronous pixel of coloured image;For a company
Logical region, determines the width and height of the connected region minimum enclosed rectangle, according to the width and the height, it is determined that
The connected region meets after selection condition, determines the gray level image of the connected region, and by the greyscale image transitions of determination
Into binary map;According to the greyscale image transitions by each connected region into binary map, determine whether marker connected region.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410814281.4A CN104599263B (en) | 2014-12-23 | 2014-12-23 | A kind of method and device of image detection |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410814281.4A CN104599263B (en) | 2014-12-23 | 2014-12-23 | A kind of method and device of image detection |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104599263A CN104599263A (en) | 2015-05-06 |
CN104599263B true CN104599263B (en) | 2017-08-15 |
Family
ID=53125013
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410814281.4A Expired - Fee Related CN104599263B (en) | 2014-12-23 | 2014-12-23 | A kind of method and device of image detection |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104599263B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108573195B (en) * | 2017-03-10 | 2020-08-18 | 中国科学院声学研究所 | Barrel-shaped road barrier detection method based on image color pattern matching |
CN107730889B (en) * | 2017-10-30 | 2021-01-05 | 昆明理工大学 | Target vehicle retrieval method based on traffic video |
CN115512276B (en) * | 2022-10-25 | 2023-07-25 | 湖南三湘银行股份有限公司 | Video anti-counterfeiting identification method and system based on artificial intelligence |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102298781A (en) * | 2011-08-16 | 2011-12-28 | 长沙中意电子科技有限公司 | Motion shadow detection method based on color and gradient characteristics |
CN102316307A (en) * | 2011-08-22 | 2012-01-11 | 安防科技(中国)有限公司 | Road traffic video detection method and apparatus thereof |
CN102354388A (en) * | 2011-09-22 | 2012-02-15 | 北京航空航天大学 | Method for carrying out adaptive computing on importance weights of low-level features of image |
CN102509118A (en) * | 2011-09-28 | 2012-06-20 | 安科智慧城市技术(中国)有限公司 | Method for monitoring video retrieval |
CN102592144A (en) * | 2012-01-06 | 2012-07-18 | 东南大学 | Multi-camera non-overlapping view field-based pedestrian matching method |
CN102867183A (en) * | 2012-08-23 | 2013-01-09 | 安科智慧城市技术(中国)有限公司 | Method and device for detecting littered objects of vehicle and intelligent traffic monitoring system |
-
2014
- 2014-12-23 CN CN201410814281.4A patent/CN104599263B/en not_active Expired - Fee Related
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102298781A (en) * | 2011-08-16 | 2011-12-28 | 长沙中意电子科技有限公司 | Motion shadow detection method based on color and gradient characteristics |
CN102316307A (en) * | 2011-08-22 | 2012-01-11 | 安防科技(中国)有限公司 | Road traffic video detection method and apparatus thereof |
CN102354388A (en) * | 2011-09-22 | 2012-02-15 | 北京航空航天大学 | Method for carrying out adaptive computing on importance weights of low-level features of image |
CN102509118A (en) * | 2011-09-28 | 2012-06-20 | 安科智慧城市技术(中国)有限公司 | Method for monitoring video retrieval |
CN102592144A (en) * | 2012-01-06 | 2012-07-18 | 东南大学 | Multi-camera non-overlapping view field-based pedestrian matching method |
CN102867183A (en) * | 2012-08-23 | 2013-01-09 | 安科智慧城市技术(中国)有限公司 | Method and device for detecting littered objects of vehicle and intelligent traffic monitoring system |
Also Published As
Publication number | Publication date |
---|---|
CN104599263A (en) | 2015-05-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105404847B (en) | A kind of residue real-time detection method | |
CN105675623B (en) | It is a kind of based on the sewage color of sewage mouth video and the real-time analysis method of flow detection | |
CN106686377B (en) | A kind of video emphasis area determination method based on deep-neural-network | |
CN107506798A (en) | A kind of water level monitoring method based on image recognition | |
CN104598895B (en) | A kind of flame detecting method and device based on video image analysis | |
CN109377703A (en) | A kind of forest fireproofing early warning system and its method based on machine vision | |
CN107240079A (en) | A kind of road surface crack detection method based on image procossing | |
CN103310422B (en) | Obtain the method and device of image | |
CN106709453A (en) | Sports video key posture extraction method based on deep learning | |
CN103473950A (en) | Parking lot parking space monitoring method | |
CN104766071B (en) | A kind of traffic lights fast algorithm of detecting applied to pilotless automobile | |
CN106096603A (en) | A kind of dynamic flame detection method merging multiple features and device | |
CN104318266B (en) | A kind of image intelligent analyzes and processes method for early warning | |
CN104599263B (en) | A kind of method and device of image detection | |
CN108038867A (en) | Fire defector and localization method based on multiple features fusion and stereoscopic vision | |
CN109408008B (en) | Image identification system and information display method thereof | |
CN108074234A (en) | A kind of large space flame detecting method based on target following and multiple features fusion | |
CN104634784B (en) | atmospheric visibility monitoring method and device | |
CN104143077B (en) | Pedestrian target search method and system based on image | |
CN107729866A (en) | Ship based on timing diagram picture touches mark automatic detection device and method | |
CN110347870A (en) | The video frequency abstract generation method of view-based access control model conspicuousness detection and hierarchical clustering method | |
CN106886994A (en) | A kind of flow of the people intelligent detection device and detection method based on depth camera | |
CN109657612A (en) | A kind of quality-ordered system and its application method based on facial image feature | |
CN105469427B (en) | One kind is for method for tracking target in video | |
CN109087363A (en) | A kind of sewage discharge detection method based on hsv color space |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20170815 Termination date: 20171223 |