CN109389126A - A kind of method for detecting area based on color, device and electronic equipment - Google Patents
A kind of method for detecting area based on color, device and electronic equipment Download PDFInfo
- Publication number
- CN109389126A CN109389126A CN201710680189.7A CN201710680189A CN109389126A CN 109389126 A CN109389126 A CN 109389126A CN 201710680189 A CN201710680189 A CN 201710680189A CN 109389126 A CN109389126 A CN 109389126A
- Authority
- CN
- China
- Prior art keywords
- image
- detected
- foreground
- component value
- pixel
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/56—Extraction of image or video features relating to colour
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/60—Type of objects
- G06V20/62—Text, e.g. of license plates, overlay texts or captions on TV images
- G06V20/63—Scene text, e.g. street names
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V30/00—Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
- G06V30/10—Character recognition
- G06V30/14—Image acquisition
- G06V30/148—Segmentation of character regions
- G06V30/153—Segmentation of character regions using recognition of characters or words
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/60—Type of objects
- G06V20/62—Text, e.g. of license plates, overlay texts or captions on TV images
- G06V20/625—License plates
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Multimedia (AREA)
- Theoretical Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Image Analysis (AREA)
Abstract
The target area detection method and device based on color that the embodiment of the invention provides a kind of, this method comprises: obtaining image to be detected;Determine U component value corresponding to each pixel in image to be detected and V component value;According to U component value corresponding to each pixel and V component value, the target area comprising color of object in image to be detected is determined.The corresponding U component value of different colors can be distinct with V component value, and there are certain regularities of distribution, that is the corresponding U component value of the pixel of different colours can be distinct with V component value, and there are certain regularities of distribution, by the difference and the existing regularity of distribution of U component value corresponding to the pixel in image to be detected and V component value, may be implemented to detect the target area comprising color of object from image to be detected.
Description
Technical field
The present invention relates to technical field of image processing, more particularly to a kind of method for detecting area based on color, device
And electronic equipment.
Background technique
It is universal with image capture device (such as: monitoring device, camera etc.), can all there be a large amount of image to produce daily
It is raw, wherein there may be the contents that needs are paid close attention in above-mentioned image.In some scenes, the content that above-mentioned needs are paid close attention to is logical
The regional area in whole image is often existed only in, at this time, it is necessary to the content institute of above-mentioned needs concern is detected from image
Target area, then carry out subsequent processing for detected target area.For example, above-mentioned scene is license plate knowledge
Other scene, the content that above-mentioned needs are paid close attention to are the license plate of vehicle, are adopted specifically, image processing equipment obtains image capture device
After the image collected, need the target area where detecting license plate in above-mentioned image, then for above-mentioned target area into
Row identification.
So, how effectively to detect that above-mentioned target area is to have to the problem of facing in the picture.
Summary of the invention
A kind of target area detection method, device and the electronics based on color of being designed to provide of the embodiment of the present invention is set
It is standby, go out the target area in image to be detected based on color detection to realize.Specific technical solution is as follows:
On the one hand, the target area detection method based on color that the embodiment of the invention provides a kind of, which comprises
Obtain image to be detected;
Determine U component value corresponding to each pixel in described image to be detected and V component value;
According to U component value corresponding to each pixel and V component value, the target area in described image to be detected is determined
Domain, wherein the target area is the region comprising color of object.
Optionally, the U component value according to corresponding to each pixel and V component value, determine described image to be detected
In target area the step of, comprising:
Judge respectively U component value corresponding to each pixel whether more than the first predetermined threshold, and corresponding V component
Whether value is lower than the second predetermined threshold, obtains the first judging result, wherein first predetermined threshold and the second predetermined threshold
Value is equal are as follows: the value being arranged according to the color of object;
According to first judging result, the foreground pixel point for including in described image to be detected is determined, wherein before described
Scene vegetarian refreshments is that corresponding U component value is more than the first predetermined threshold, and corresponding V component value is lower than the second predetermined threshold
Pixel;
According to the foreground pixel point for including in described image to be detected, the first foreground image is determined;
According to first foreground image, the target area in described image to be detected is determined.
Optionally, the U component value according to corresponding to each pixel and V component value, determine described image to be detected
In target area the step of, comprising:
Calculate separately the first difference of U component value and V component value corresponding to each pixel;
First difference of each pixel is compared at least one default binarization threshold, obtains comparison result,
Wherein, at least one described default binarization threshold are as follows: the threshold value based on color of object setting;
According to the comparison result, at least one set of foreground pixel point for including in described image to be detected is determined, wherein one
The corresponding default binarization threshold of group foreground pixel point, every group of foreground pixel point are that the first difference is greater than corresponding preset
The pixel of binarization threshold;
According at least one set of foreground pixel point for including in described image to be detected, at least one second foreground picture is determined
Picture, wherein the corresponding one group of foreground pixel point of second foreground image;
According at least one described second foreground image, the target area in described image to be detected is determined.
Optionally, at least one set of prospect for including in described image to be detected is determined according to the comparison result described
Before the step of pixel, the method also includes:
Judge whether U component value corresponding to each pixel is more than third predetermined threshold respectively, and corresponding V component
Whether value is lower than the 4th predetermined threshold, obtains the second judging result, wherein the third predetermined threshold and the 4th predetermined threshold
Value is equal are as follows: the value being arranged according to the color of object;
It is described according to the comparison result, determine the step for at least one set of foreground pixel point for including in described image to be detected
Suddenly, comprising:
According to the comparison result and second judging result, include in described image to be detected at least one is determined
Group foreground pixel point.
Optionally, described according to first foreground image, determine the target area in described image to be detected
Step, comprising:
First foreground image is marked according to preset first connected component labeling rule, before determining described first
The first connected domain of at least one of scape image;
By every one first connected domain region, it is determined as the target area in described image to be detected.
Optionally, the target area is license plate region, and the license plate is blue license plate;
It is described according to first foreground image, the step of determining the target area in described image to be detected, packet
It includes:
First foreground image is marked according to preset second connected component labeling rule, before determining described first
The second connected domain of at least one of scape image;
From at least one described second connected domain, at least one first mesh for meeting the first default screening conditions is filtered out
Mark connected domain, wherein the first default screening conditions are as follows: according to the condition of the blue license plate setting;
It is determined as at least one described first object connected domain region where the license plate in described image to be detected
Region.
Optionally, described at least one second foreground image according to, determines the mesh in described image to be detected
The step of marking region, comprising:
Every one second foreground image is marked according to preset third connecting field mark rule, determines each foreground picture
At least one third connecting domain as in;
According at least one third connecting domain in identified every one second foreground image, described image to be detected is determined
In the target area.
Optionally, the target area is license plate region, and the license plate is blue license plate;
Described at least one second foreground image according to, determines the target area in described image to be detected
Step, comprising:
Every one second foreground image is marked according to preset four connected region marking convention, before determining every one second
At least one of scape image four connected region;
From at least one four connected region of every one second foreground image, filters out and meet the second default screening conditions
At least one second target connected domain, wherein the second default screening conditions are as follows: according to the item of the blue license plate setting
Part;
According to the second target connected domain of at least one of identified every one second foreground image, determine described to be detected
License plate region in image.
Optionally, the second target connected domain of at least one of described one second foreground image every according to determined by, really
The step of determining the license plate region in described image to be detected, comprising:
Obtain at least one of every one second foreground image location information of the second target connected domain and every one second
Corresponding relationship between at least one of foreground image the second target connected domain;
According to the second target connected domain of at least one of location information obtained and every one second foreground image it
Between corresponding relationship, obtain the license plate region in described image to be detected.
On the other hand, the embodiment of the invention provides a kind of target area detection device based on color, described device packet
It includes:
First obtains module, for obtaining image to be detected;
Second obtains module, for obtaining U component value corresponding to each pixel in described image to be detected and V points
Magnitude;
Determining module determines the mapping to be checked for the U component value according to corresponding to each pixel and V component value
Target area as in, wherein the target area is the region comprising color of object.
Optionally, the determining module includes that the first judging unit, the first determination unit, the second determination unit and third are true
Order member;
First judging unit, for judging whether U component value corresponding to each pixel is pre- more than first respectively
Determine threshold value, and whether corresponding V component value is lower than the second predetermined threshold, obtains the first judging result, wherein described first is pre-
Determine threshold value and second predetermined threshold is equal are as follows: the value being arranged according to the color of object;
First determination unit is determined in described image to be detected and includes for according to first judging result
Foreground pixel point, wherein the foreground pixel point is that corresponding U component value is more than the first predetermined threshold, and corresponding V divides
Magnitude is lower than the pixel of the second predetermined threshold;
Second determination unit, for according to the foreground pixel point for including in described image to be detected, before determining first
Scape image;
The third determination unit, for determining described in described image to be detected according to first foreground image
Target area.
Optionally, the determining module include computing unit, comparing unit, the 4th determination unit, the 5th determination unit and
6th determination unit;
The computing unit, first for calculating separately U component value and V component value corresponding to each pixel are poor
Value;
The comparing unit, for comparing the first difference of each pixel and at least one default binarization threshold
Compared with obtaining comparison result, wherein at least one described default binarization threshold are as follows: the threshold value based on color of object setting;
4th determination unit, for determining in described image to be detected to include at least according to the comparison result
One group of foreground pixel point, wherein the corresponding default binarization threshold of one group of foreground pixel point, every group of foreground pixel point are the
One difference is greater than the pixel of corresponding default binarization threshold;
5th determination unit, for according at least one set of foreground pixel point for including in described image to be detected, really
At least one fixed second foreground image, wherein the corresponding one group of foreground pixel point of second foreground image;
6th determination unit, for determining described image to be detected according at least one described second foreground image
In the target area.
Optionally, the determining module further includes second judgment unit;
The second judgment unit, for, according to the comparison result, determining in described image to be detected described and including
At least one set of foreground pixel point before, judge whether U component value corresponding to each pixel is more than the predetermined threshold of third respectively
Value, and whether corresponding V component value is lower than the 4th predetermined threshold, obtains the second judging result, wherein the predetermined threshold of third
Value and the 4th predetermined threshold are equal are as follows: the value being arranged according to the color of object;
4th determination unit is specifically used for determining institute according to the comparison result and second judging result
State at least one set of foreground pixel point for including in image to be detected.
Optionally, the third determination unit includes that the first determining submodule and second determine submodule;
Described first determines submodule, is used for according to preset first connected component labeling rule to first foreground image
It is marked, determines the first connected domain of at least one of first foreground image;
Described second determines submodule, for being determined as described image to be detected for every one first connected domain region
In the target area.
Optionally, the target area is license plate region, and the license plate is blue license plate;
The third determination unit includes that third determines that submodule, the first screening submodule and the 4th determine submodule;
The third determines submodule, is used for according to preset second connected component labeling rule to first foreground image
It is marked, determines the second connected domain of at least one of first foreground image;
The first screening submodule, it is default for from least one described second connected domain, filtering out satisfaction first
At least one first object connected domain of screening conditions, wherein the first default screening conditions are as follows: according to the blue license plate
The condition of setting;
Described 4th determines submodule, for being determined as institute at least one described first object connected domain region
State the license plate region in image to be detected.
Optionally, the 6th determination unit includes that the 5th determining submodule and the 6th determine submodule;
Described 5th determines submodule, is used for according to preset third connecting field mark rule to every one second foreground image
It is marked, determines at least one third connecting domain in each foreground image;
Described 6th determines submodule, for being connected according at least one third in identified every one second foreground image
Logical domain, determines the target area in described image to be detected.
Optionally, the target area is license plate region, and the license plate is blue license plate;6th determination unit
Determine that submodule, the second screening submodule and the 8th determine submodule including the 7th;
Described 7th determines submodule, is used for according to preset four connected region marking convention to every one second foreground image
It is marked, determines at least one of every one second foreground image four connected region;
The second screening submodule, for screening from least one four connected region of every one second foreground image
Meet at least one second target connected domain of the second default screening conditions out, wherein the second default screening conditions are as follows: root
According to the condition of the blue license plate setting;
Described 8th determines submodule, for according to the second mesh of at least one of identified every one second foreground image
Connected domain is marked, determines the license plate region in described image to be detected.
Optionally, it the described 8th determines submodule, is specifically used for
Obtain at least one of every one second foreground image location information of the second target connected domain and every one second
Corresponding relationship between at least one of foreground image the second target connected domain;
According to the second target connected domain of at least one of location information obtained and every one second foreground image it
Between corresponding relationship, obtain the license plate region in described image to be detected.
On the other hand, the embodiment of the invention provides a kind of electronic equipment, including processor, communication interface, memory and
Communication bus, wherein processor, communication interface, memory complete mutual communication by communication bus;
The memory, for storing computer program;
The processor when for executing the computer program stored on the memory, realizes above-mentioned any base
In the target area detection method of color.
On the other hand, the embodiment of the invention provides a kind of computer readable storage medium, the computer-readable storages
Dielectric memory contains computer program, and the computer program realizes above-mentioned any mesh based on color when being executed by processor
Mark method for detecting area.
In the embodiment of the present invention, image to be detected is obtained;Obtain U corresponding to each pixel in image to be detected points
Magnitude and V component value;According to U component value corresponding to each pixel and V component value, the target area in image to be detected is determined
Domain.The corresponding U component value of different colors can be distinct with V component value, and there are certain regularities of distribution, i.e. different colours
The corresponding U component value of pixel can be distinct with V component value, and there are certain regularity of distribution, pass through image to be detected
In pixel corresponding to U component value and V component value difference and the existing regularity of distribution, may be implemented from mapping to be checked
The target area comprising color of object is detected as in.Certainly, implement any of the products of the present invention or method it is not absolutely required to
Reach all the above advantage simultaneously.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with
It obtains other drawings based on these drawings.
Fig. 1 is a kind of flow diagram of the target area detection method based on color provided in an embodiment of the present invention;
Fig. 2 is a kind of exemplary diagram of each color corresponding U component value and V component value in 24 colour standard colour tables;
Fig. 3 A is a kind of schematic diagram of the statistic histogram of the corresponding Y-component Distribution value of blue;
Fig. 3 B is a kind of schematic diagram of the statistic histogram of the corresponding U component Distribution value of blue;
Fig. 3 C is a kind of schematic diagram of the statistic histogram of the corresponding V component Distribution value of blue;
Fig. 4 is a kind of flow diagram for determining the target area in image to be detected;
Fig. 5 A is a kind of schematic diagram of image to be detected comprising license plate;
It includes that image to be detected of license plate carries out a kind of schematic diagram of gained image after binaryzation that Fig. 5 B, which is shown in Fig. 5 A,;
Fig. 5 C, Fig. 5 D and Fig. 5 E are respectively after an image to be detected carries out binaryzation according to different default binarization thresholds
The schematic diagram of gained image;
Fig. 5 F is a kind of signal of the license plate region in image to be detected according to determined by Fig. 5 C, Fig. 5 D and Fig. 5 E
Figure;
Fig. 6 is a kind of structural schematic diagram of the target area detection device based on color provided in an embodiment of the present invention;
Fig. 7 is a kind of structural schematic diagram of determining module;
Fig. 8 is the structural schematic diagram of a kind of electronic equipment provided in an embodiment of the present invention.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
The embodiment of the invention provides a kind of target area detection method, device and electronic equipment based on color, with reality
Now gone out in image based on color detection with the presence or absence of target area.
As shown in Figure 1, the embodiment of the invention provides a kind of target area detection method based on color, may include as
Lower step:
S101: image to be detected is obtained;
It, can be with it is understood that a kind of target area detection method based on color provided by the embodiment of the present invention
Applied to any electronic equipment that can obtain image to be detected, above-mentioned electronic equipment can be computer, smart phone, video camera
Etc..
After electronic equipment obtains image to be detected, can first determine whether image to be detected whether be yuv format image, when
When judging image to be detected for the image of yuv format, can directly it execute subsequent based on face provided by the embodiment of the present invention
The target area testing process of color;When judging image to be detected not is the image of yuv format, first image to be detected can be turned
It is changed to yuv format, then executes the subsequent target area testing process based on color provided by the embodiment of the present invention.It needs
Bright, YUV is also known as YCrCb, is a kind of color coding mode used by eurovision system, wherein " Y " indicates brightness
(Luminance or Luma), that is, grayscale value;And " U " and " V " indicates coloration (Chrominance or Chroma), effect is
Colors of image and saturation degree, the color for specified pixel point are described." brightness " be through RGB (Red Green Blue, it is red green
It is blue) input signal come what is established, be that the specific part of RGB input signal is superimposed together." coloration " then defines color
Two aspects -- tone and saturation degree are indicated with Cr and Cb respectively.Wherein, Cr reflect RGB input signal RED sector with
Difference between RGB input signal brightness value.And Cb reflection is RGB input signal blue portion and the brightness of RGB input signal
Difference between value.
S102: U component value and V component value corresponding to each pixel in image to be detected are obtained;
Wherein, image to be detected is the image of yuv format, it is possible to understand that, in YUV color space, image to be detected
In each pixel correspond to U component value, V component value and Y-component value, i.e., the pixel of each pixel in image to be detected
Being worth (alternatively referred to as color value) can be characterized by U component value, V component value corresponding to each pixel and Y-component value,
In, U component value, V component value corresponding to each pixel can characterize the color of pixel;It, can be in YUV color space
Directly obtain U component value corresponding to each pixel in image to be detected and V component value.
S103: according to U component value corresponding to each pixel and V component value, the target area in image to be detected is determined
Domain, wherein target area is the region comprising color of object.
It is understood that in YUV color space there is area in the corresponding U component value of different colours and V component value
Not, and there are certain regularities of distribution.According to difference present in the corresponding U component value of different colours and V component value and deposited
The regularity of distribution, can determine the target area comprising color of object in image to be detected.
In one implementation, the U component value according to corresponding to each pixel and V component value, determine to be checked
The step of target area (S103) in altimetric image, may include:
Judge respectively U component value corresponding to each pixel whether more than the first predetermined threshold, and corresponding V component
Whether value is lower than the second predetermined threshold, obtains the first judging result, wherein the first predetermined threshold and the second predetermined threshold are equal are as follows:
The value being arranged according to color of object;
According to the first judging result, the foreground pixel point for including in image to be detected is determined, wherein foreground pixel point is institute
Corresponding U component value is more than the first predetermined threshold, and corresponding V component value is lower than the pixel of the second predetermined threshold;
According to the foreground pixel point for including in image to be detected, the first foreground image is determined;
According to the first foreground image, the target area in image to be detected is determined.
Wherein, the first above-mentioned predetermined threshold can be equal with the second predetermined threshold, can also be unequal, and above-mentioned first
Predetermined threshold can be set with the second predetermined threshold according to color of object, in addition, due to light conditions and acquiring to be checked
The performance etc. of the image capture device of altimetric image, existing on the pixel value of pixel influences (i.e. to U component corresponding to pixel
There is influence in value and V component value), when above-mentioned the first predetermined threshold and the second predetermined threshold is arranged, light can be considered simultaneously
According to factors such as the performances of image capture device of situation and acquisition image to be detected.
When judging that the corresponding U component value of pixel is more than the first predetermined threshold, and the corresponding V component value of pixel is lower than the
When two predetermined thresholds, then it can determine that the color of pixel is color of object, at this point it is possible to which pixel is determined as foreground pixel
Point;When judge the corresponding U component value of pixel be no more than the first predetermined threshold, and/or, the corresponding V component value of pixel is not low
When the second predetermined threshold, then it can determine that the color of pixel is not color of object, at this point it is possible to which pixel is determined as carrying on the back
Scene vegetarian refreshments.Further, it by the foreground pixel point for including in image to be detected for being determined, can determine comprising above-mentioned
First foreground image of foreground pixel point further determines the target area in image to be detected.
As shown in Fig. 2, for the corresponding U component value of color each in 24 colour standard colour tables and V component value, wherein 24 colour standards
The label of each color in colour table from left to right, from top to bottom is respectively 1~24.
It is illustrated so that color of object is blue as an example: marked as 3,6,8,13 in 24 colour standard colour table shown in Fig. 2
Color with 18 is blue.As shown in Fig. 2, there are one for the corresponding U component value of blue and V component value in 24 colour standard colour tables
The fixed regularity of distribution, specifically, the corresponding U component value of blue in 24 colour standard colour tables is corresponding larger, it is theoretically several
It is all larger than the first predetermined threshold;And the 24 corresponding V component value of blue in colour standard colour table is corresponding smaller, theoretically
Almost it is respectively less than the second predetermined threshold.It, can be by setting suitable the first blue predetermined threshold when color of object is blue
With the second predetermined threshold, detect that color is the pixel of blue from image to be detected, further, according to detected
Color is the pixel of blue, determines the target area comprising blue.
Theoretically, can by setting suitable threshold value (including the first predetermined threshold and second predetermined threshold), to
The pixel for color of object is detected in detection image, further detects the target area comprising color of object.
It in addition, as shown in Figure 3A, is a kind of schematic diagram of the statistic histogram of the corresponding Y-component Distribution value of blue, such as
It is as shown in Figure 3 C, right for blue for a kind of schematic diagram of the statistic histogram of the corresponding U component Distribution value of blue shown in Fig. 3 B
A kind of schematic diagram of the statistic histogram for the V component Distribution value answered.Wherein, schematic diagram shown in above-mentioned Fig. 3 A, Fig. 3 B and Fig. 3 C
Based on data it is equal are as follows: 10,000 blue license plates.From Fig. 3 B and Fig. 3 C can be seen that U component value focus primarily upon it is biggish
Gray value region is such as located at 128 right side, that is, is greater than 128, V component value focuses primarily upon lesser gray value region, is such as located at
128 left side, i.e., less than 128.Wherein, the horizontal axis in Fig. 3 A, Fig. 3 B and Fig. 3 C identifies gray value (0~255), " | " mark ash
128 position of angle value, the vehicle that the license plate quantity or gray value that the longitudinal axis mark gray value in Fig. 3 A, Fig. 3 B and Fig. 3 C is X are X
The quantity of board, the percentage of the total amount of Zhan Suoyou license plate, wherein X can take (0~255).
In another implementation, present in U component value and V component value corresponding to the pixel value based on different colours
Difference and the existing regularity of distribution, the difference of the U component value corresponding to pixel and V component value can also be passed through, determined
Whether the color of pixel is color of object, further determines that the foreground pixel point for including in image to be detected.Specifically, as schemed
Shown in 4, the U component value according to corresponding to each pixel and V component value determine the target area in image to be detected
(S103) the step of may include:
S401: the first difference of U component value and V component value corresponding to each pixel is calculated separately, wherein can incite somebody to action
It is poor that U component value corresponding to each pixel and V component value are made, and making poor acquired results is the first above-mentioned difference;
S402: the first difference of each pixel is compared at least one default binarization threshold, is compared
As a result, wherein at least one default binarization threshold are as follows: the threshold value based on color of object setting;
S403: according to comparison result, at least one set of foreground pixel point for including in image to be detected is determined, wherein one group
Foreground pixel point corresponds to a default binarization threshold, and every group of foreground pixel point is that the first difference is greater than corresponding default two
The pixel of value threshold value;
S404: according at least one set of foreground pixel point for including in image to be detected, at least one second foreground picture is determined
Picture, wherein the corresponding one group of foreground pixel point of second foreground image;
It is understood that the corresponding default binarization threshold of one group of foreground pixel point, second foreground image pair
Answer one group of foreground pixel point, the i.e. corresponding default binarization threshold of second foreground image.
S405: according at least one the second foreground image, the target area in image to be detected is determined.
As shown in Fig. 2, theoretically, the corresponding U component value of blue in 24 colour standard colour tables is all larger than V points corresponding to it
Magnitude.Based on the regularity of distribution of blue corresponding U component value and V component value in 24 above-mentioned colour standard colour tables, can pass through
It determines whether U component value corresponding to pixel and the first difference of V component value are greater than the first default value, determines mapping to be checked
It whether there is the target area comprising color of object as in.Wherein, above-mentioned first default value can be used as to image to be detected
The default binarization threshold of binaryzation is carried out, for example, when color of object is blue, above-mentioned first default value can be taken
Gray value 0~60, etc..
It is emphasized that according to comparison result, when determining at least one set of foreground pixel point for including in image to be detected,
Binaryzation can be carried out to image to be detected simultaneously.Wherein, when the first difference of pixel is greater than corresponding default binaryzation threshold
When value, the pixel value of the pixel can be assigned a value of to the first numerical value, i.e., the pixel value of foreground pixel point is assigned a value of the first number
Value, above-mentioned first numerical value can be 1, when the first difference of pixel is not more than corresponding default binarization threshold, can incite somebody to action
The pixel value of the pixel is assigned a value of second value, i.e., the pixel value of background pixel point is assigned a value of second value, and above-mentioned second
Numerical value can be 0.At this point, subsequent, according at least one set of foreground pixel point for including in image to be detected, it is identified at least
One the second foreground image is equal are as follows: binary image, and can only be the first number comprising pixel value in above-mentioned second foreground image
Value and/or pixel value are the pixel of second value.It as shown in Figure 5A, is a kind of signal of image to be detected comprising license plate
Figure, Fig. 5 B be Fig. 5 A shown in comprising license plate image to be detected carry out binaryzation after a kind of schematic diagram, i.e., above-mentioned one
Second foreground image.
Similarly, the foreground pixel point for including in image to be detected according to the first judging result, is being determined, it can also be right simultaneously
Image to be detected carries out binaryzation, at this point, above-mentioned obtained first foreground image is also binary image.
It is understood that in some scenes, since by illumination and image capture device (mapping to be checked can be acquired
The equipment of picture) the factors such as performance influence, the corresponding U component value of same color and V component value are it is possible that difference.In order to
The more accurate target area comprising color of object can be determined from image to be detected, can use the scheme of multi-threshold,
First difference of pixel can be compared at least one default binarization threshold.In turn, according to the of pixel
Each default binarization threshold in one difference and at least one default binarization threshold, determines at least one set foreground pixel
Point, also, the corresponding default binarization threshold of one group of foreground pixel point.
For example, at least one default binarization threshold can according to the first difference and A of pixel comprising A, B and C
To determine the corresponding one group of foreground pixel point a of A, according to the first difference and B of pixel, the corresponding one group of prospect of B can be determined
Pixel b can determine the corresponding one group of foreground pixel point c of C according to the first difference and C of pixel.Wherein, one group of prospect
Each foreground pixel point included in pixel a is equal are as follows: the first difference is greater than the pixel of A;Institute in one group of foreground pixel point b
The each foreground pixel point for including is equal are as follows: the first difference is greater than the pixel of B;To every included in one group of foreground pixel point c
Foreground pixel point is equal are as follows: the first difference is greater than the pixel of C.Above-mentioned pixel is the pixel in image to be detected.
In another implementation, the ratio of U component value and V component value corresponding to determining pixel can also be passed through
Whether it is greater than the second default value, determines with the presence or absence of the target area comprising color of object in image to be detected, for example,
When color of object is blue, above-mentioned second default value can be 1 etc..
In addition, in order to preferably determine the target area comprising color of object, in another implementation, described
According to comparison result, before the step of determining at least one set of foreground pixel point (S403) for including in image to be detected, the side
Method can also include:
Judge whether U component value corresponding to each pixel is more than third predetermined threshold respectively, and corresponding V component
Whether value is lower than the 4th predetermined threshold, obtains the second judging result, wherein third predetermined threshold and the 4th predetermined threshold are equal are as follows:
The value being arranged according to color of object;
At this point, S403 may include: to determine in image to be detected according to comparison result and the second judging result and include
At least one set of foreground pixel point.
Wherein, above-mentioned third predetermined threshold can be equal to the first above-mentioned predetermined threshold, can also be not equal to above-mentioned
First predetermined threshold, the 4th above-mentioned predetermined threshold can be equal to the second above-mentioned predetermined threshold, can also be not equal to above-mentioned
Second predetermined threshold, this is all possible.
In the above-described embodiments, the U component value corresponding to the pixel is more than third predetermined threshold, and corresponding V points
Magnitude is lower than the 4th predetermined threshold, and the first difference of U component value and V component value corresponding to pixel be greater than it is corresponding pre-
If when binarization threshold, can just be confirmed as foreground pixel point.
Using the embodiment of the present invention, image to be detected is obtained;Obtain U corresponding to each pixel in image to be detected
Component value and V component value;According to U component value corresponding to each pixel and V component value, the target in image to be detected is determined
Region.The corresponding U component value of different colors can be distinct with V component value, and there are certain regularity of distribution, i.e., different face
The corresponding U component value of the pixel of color can be distinct with V component value, and there are certain regularities of distribution, pass through mapping to be checked
The difference and the existing regularity of distribution of U component value corresponding to pixel as in and V component value, may be implemented to be detected
The target area comprising color of object is detected in image.
It in one implementation,, can be with when determining the target area in image to be detected according to the first foreground image
First determine at least one first connected domain included in the first foreground image, further according at least one the first connected domain,
Target area in image to be detected.Specifically, it is described according to the first foreground image, determine the target area in image to be detected
The step of, may include:
The first foreground image is marked according to preset first connected component labeling rule, is determined in the first foreground image
At least one first connected domain;
By every one first connected domain region, it is determined as the target area in image to be detected.Wherein, every one first connects
Logical domain region is the boundary rectangle region of every one first connected domain.
It is understood that above-mentioned first connected component labeling rule can be directly scanning labeling algorithm, or two
Value image connectivity field mark fast algorithm, etc., this is all possible.When above-mentioned first connected component labeling rule is directly to sweep
When retouching labeling algorithm, it can be four neighbourhood signatures' algorithms, be also possible to eight neighborhood labeling algorithm.
Target area is the region comprising color of object, it should be noted that above-mentioned target area can be completely by mesh
The region for marking color filling, is also possible to possess the target object region of above-mentioned color of object.In a kind of implementation
In, target area is license plate region, and license plate is blue license plate;
It is above-mentioned according to the first foreground image, the step of determining the target area in image to be detected, may include:
The first foreground image is marked according to preset second connected component labeling rule, is determined in the first foreground image
At least one second connected domain;
From at least one second connected domain, at least one first object company for meeting the first default screening conditions is filtered out
Logical domain, wherein the first default screening conditions are as follows: the condition being arranged according to blue license plate;
By at least one first object connected domain region, it is determined as the license plate region in image to be detected.
Wherein, above-mentioned second connected component labeling rule can be identical as above-mentioned first connected component labeling rule, can also not
Together, this is all possible.
It should be noted that license plate generally there are rule shape and size, when target area be license plate region,
And license plate can first determine blue region when being blue license plate from image to be detected, it is further, pre- according to first
If screening conditions, license plate region is filtered out from the blue region determined.Wherein, above-mentioned first screening conditions
May include: min/max width (such as: 60 pixels~200 pixels can be got), min/max height (such as:
12 pixels~40 pixels can be got), min/max area (such as: 720 pixels~8000 pixels can be got
Point), foreground pixel point proportion (25%~40% can be got) etc. in connected domain.It is emphasized that by above-mentioned
First default screening conditions can filter out most likely blue license plate institute from determining at least one second connected domain
In at least one corresponding first object connected domain of region.
In one implementation, it after determining at least one second foreground image, can be determined according to above-mentioned
At least one second foreground image, determines the target area in image to be detected.Specifically, described according at least one before second
Scape image the step of determining target area (S405) in image to be detected, may include:
Every one second foreground image is marked according to preset third connecting field mark rule, determines each foreground picture
At least one third connecting domain as in;
According at least one third connecting domain in identified every one second foreground image, determine in image to be detected
Target area.
It should be noted that the specific number and each default binarization threshold of at least one default binarization threshold
It can be set according to the actual situation.Above-mentioned third connecting field mark rule can be advised with the first above-mentioned connected component labeling
Then and/or the second connected component labeling rule is identical, can also be with the first connected component labeling rule stated and the second connected component labeling
Rule is all different, this is all possible.
In one implementation, when target area is license plate region, and license plate is blue license plate;The basis
At least one second foreground image the step of determining the target area in image to be detected, may include:
Every one second foreground image is marked according to preset four connected region marking convention, before determining every one second
At least one of scape image four connected region;
From at least one four connected region of every one second foreground image, filters out and meet the second default screening conditions
At least one second target connected domain, wherein the second default screening conditions are as follows: the condition being arranged according to blue license plate;
According to the second target connected domain of at least one of identified every one second foreground image, image to be detected is determined
In license plate region.
Above-mentioned four connected region marking convention can be with above-mentioned the first connected component labeling rule and/or the second connected domain mark
Note rule and/or above-mentioned third connecting field mark rule are identical, can also be connected to the first connected component labeling rule stated, second
Field mark rule and above-mentioned third connecting field mark rule are all different, this is all possible.
Above-mentioned second default screening conditions can be identical as the first above-mentioned default screening conditions, can also be with above-mentioned first
Default screening conditions are different.
In one implementation, the second target of at least one of described one second foreground image every according to determined by
Connected domain the step of determining the license plate region in image to be detected, may include:
Obtain at least one of every one second foreground image location information of the second target connected domain and every one second
Corresponding relationship between at least one of foreground image the second target connected domain;
According to the second target connected domain of at least one of location information obtained and every one second foreground image it
Between corresponding relationship, obtain image to be detected in license plate region.
Wherein, above-mentioned location information can be the coordinate on four vertex of the boundary rectangle of each second target connected domain.
Corresponding relationship between the second target connected domain of at least one of above-mentioned every one second foreground image are as follows: according to the second foreground picture
Relationship determined by the second target connected domain there are overlapping region for being included as between.
For example, at least one default binarization threshold is 3, respectively 1,2 and 3;
According to the first difference of each pixel in image to be detected and at least one default binarization threshold 1,2 and
3, it can determine three the second foreground images, be followed successively by the second foreground image one, two and three;
The second foreground image one, two and three is marked respectively according to preset four connected region marking convention, and root
After being screened according to the second default screening conditions to label gained four connected region, acquired results are as follows: the second foreground image one packet
Containing the second target connected domain A1;Second foreground image two includes the second target connected domain B1 and B2;Second foreground image three includes
Second target connected domain C1, C2 and C3;Wherein, the second target connected domain A1, the second foreground image in the second foreground image one
The second target connected domain B1 in two and between the second target connected domain C1 in the second foreground image three mutually exist be overlapped area
Domain, three's corresponding second target connected domain each other;The second target connected domain B2 and second in second foreground image two
Mutually there is overlapping region between the second target connected domain C2 in foreground image three, both corresponding second target each other
Connected domain;Corresponding second target connected domain is not present in the second target connected domain C3 in second foreground image three;
At this point it is possible to according to the second target connected domain A1 in the second foreground image one, in the second foreground image two
The second target connected domain C1 in two target connected domain B1 and the second foreground image three, the second target in the second foreground image two
The second target connected domain C2 in connected domain B2 and the second foreground image three, and, the second target in the second foreground image three
Connected domain C3 obtains the license plate region in image to be detected;Specifically,
Obtain four apex coordinates (a1, b1, c1 and d1) of the boundary rectangle of the second target connected domain A1, the second target connects
The boundary rectangle of four apex coordinates (e1, f1, g1 and h1) and the second target connected domain C1 of the boundary rectangle of logical domain B1
Four apex coordinates (m1, n1, p1 and q1);The intermediate value between a1, e1 and m1 is taken respectively;Intermediate value between b1, f1 and n1;c1,
Intermediate value between g1 and p1;Intermediate value between d1, h1 and q1.Such as: as a1 < e1 < m1, the intermediate value between a1, e1 and m1 at this time
For e1;
Four apex coordinates (e2, f2, g2 and h2) of the boundary rectangle of the second target connected domain B2 are obtained, the second target connects
Four apex coordinates (m2, n2, p2 and q2) of the boundary rectangle of logical domain C2;Lesser value between e2 and m2 can be determined at this time,
Lesser value, lesser value between g2 and p2, lesser value between h2 and q2 between f2 and n2;
Obtain four apex coordinates (m3, n3, p3 and q3) of the boundary rectangle of the second target connected domain C3
Further, will it is above-mentioned determined by boundary rectangle region composed by each intermediate value, will it is above-mentioned determined by respectively
Boundary rectangle region composed by lesser value, and, the boundary rectangle region of target connected domain C3 determines
For the license plate region in image to be detected.
It should be noted that the number for working as the second target connected domain included in second foreground image is even number
When, can respectively by the intermediate value of each vertex correspondence of the boundary rectangle region of identified second target connected domain compared with
Small, the corresponding vertex as license plate region.For example: the second mesh included in second foreground image
The number for marking connected domain is 4, respectively one (four vertex (x1, y1, z1, t1) of boundary rectangle), two (the four of boundary rectangle
A vertex (x2, y2, z2, t2)), three (four vertex (x3, y3, z3, t3) of boundary rectangle) and four (four of boundary rectangle tops
Point (x4, y4, z4, t4));
The intermediate value between x1, x2, x3 and x4 is determined first, such as: there are x1 < x2 < x3 < x4, identified intermediate value is x2
And x3, it regard value lesser between x2 and x3 as the corresponding vertex in license plate region, i.e., using x2 as license plate region phase
The vertex answered;
For the method for determination on other three vertex of license plate region, ibid, this will not be repeated here.
In another example when target area is license plate region, and license plate is blue license plate;And at least one set
Default binarization threshold is 3, respectively 6,12 and 24.One image to be detected is according at least one above-mentioned default binaryzation threshold
After value 6,12 and 24 carries out binaryzation respectively, the second foreground image of gained can be respectively as shown in Fig. 5 C, 5D and 5E, wherein figure
The corresponding default binarization threshold 6 of 5C, the corresponding default binarization threshold 12 of Fig. 5 D, the corresponding default binarization threshold 24 of Fig. 5 E;
Above-mentioned the second foreground image of gained is marked respectively according to four connected region marking convention, determines every one second
At least one of foreground image four connected region;
From at least one four connected region of every one second foreground image, filters out and meet the second default screening conditions
At least one second target connected domain;
According to the second target connected domain of at least one of identified every one second foreground image, image to be detected is determined
In license plate region.It as illustrated in figure 5f, include three regions, rectangle frame region in Fig. 5 F all can be utilize figure
Second foreground image shown in 5C, Fig. 5 D and Fig. 5 E, the license plate region in identified image to be detected.Wherein, institute is true
License plate region in fixed image to be detected is inaccurate, and there are errors, subsequent, can be continuing with above three area
Domain (the license plate region in identified image to be detected) carries out character recognition, to reach to license plate region more
Accurate detection.
It is understood that when target area is license plate region, and when license plate is blue license plate, using of the invention real
A kind of target area detection method based on color provided by example is applied, can detecte blue license plate at any angle, it can be with
The problem of avoiding when blue license plate sloped angle larger (being greater than 45 degree), can not detecting the blue license plate very well.
Corresponding to above method embodiment, the embodiment of the invention provides a kind of, and dress is detected in the target area based on color
It sets, as shown in fig. 6, the apparatus may include:
First obtains module 610, for obtaining image to be detected;
Second obtain module 620, for obtain U component value corresponding to each pixel in described image to be detected and
V component value;
Determining module 630 determines described to be detected for the U component value according to corresponding to each pixel and V component value
Target area in image, wherein the target area is the region comprising color of object.
Using the embodiment of the present invention, image to be detected is obtained;Obtain U corresponding to each pixel in image to be detected
Component value and V component value;According to U component value corresponding to each pixel and V component value, the target in image to be detected is determined
Region.The corresponding U component value of different colors can be distinct with V component value, and there are certain regularity of distribution, i.e., different face
The corresponding U component value of the pixel of color can be distinct with V component value, and there are certain regularities of distribution, pass through mapping to be checked
The difference and the existing regularity of distribution of U component value corresponding to pixel as in and V component value, may be implemented to be detected
The target area comprising color of object is detected in image.
In one implementation, the determining module 630 include the first judging unit, the first determination unit, second really
Order member and third determination unit;
First judging unit, for judging whether U component value corresponding to each pixel is pre- more than first respectively
Determine threshold value, and whether corresponding V component value is lower than the second predetermined threshold, obtains the first judging result, wherein described first is pre-
Determine threshold value and second predetermined threshold is equal are as follows: the value being arranged according to the color of object;
First determination unit is determined in described image to be detected and includes for according to first judging result
Foreground pixel point, wherein the foreground pixel point is that corresponding U component value is more than the first predetermined threshold, and corresponding V divides
Magnitude is lower than the pixel of the second predetermined threshold;
Second determination unit, for according to the foreground pixel point for including in described image to be detected, before determining first
Scape image;
The third determination unit, for determining described in described image to be detected according to first foreground image
Target area.
In one implementation, as shown in fig. 7, the determining module 630 includes computing unit 631, comparing unit
632, the 4th determination unit 633, the 5th determination unit 634 and the 6th determination unit 635;
The computing unit 631, for calculating separately first of U component value and V component value corresponding to each pixel
Difference;
The comparing unit 632, for by the first difference of each pixel and at least one default binarization threshold into
Row compares, and obtains comparison result, wherein at least one described default binarization threshold are as follows: based on color of object setting
Threshold value;
4th determination unit 633, for according to the comparison result, determine in described image to be detected include to
Few one group of foreground pixel point, wherein the corresponding default binarization threshold of one group of foreground pixel point, every group of foreground pixel point are
First difference is greater than the pixel of corresponding default binarization threshold;
5th determination unit 634, for according at least one set of foreground pixel point for including in described image to be detected,
Determine at least one second foreground image, wherein the corresponding one group of foreground pixel point of second foreground image;
6th determination unit 635, for determining the mapping to be checked according at least one described second foreground image
The target area as in.
In one implementation, the determining module 630 can also include second judgment unit;
The second judgment unit, for, according to the comparison result, determining in described image to be detected described and including
At least one set of foreground pixel point before, judge whether U component value corresponding to each pixel is more than the predetermined threshold of third respectively
Value, and whether corresponding V component value is lower than the 4th predetermined threshold, obtains the second judging result, wherein the predetermined threshold of third
Value and the 4th predetermined threshold are equal are as follows: the value being arranged according to the color of object;
4th determination unit 633 is specifically used for being determined according to the comparison result and second judging result
At least one set of foreground pixel point for including in described image to be detected.
In one implementation, the third determination unit includes that the first determining submodule and second determine submodule;
Described first determines submodule, is used for according to preset first connected component labeling rule to first foreground image
It is marked, determines the first connected domain of at least one of first foreground image;
Described second determines submodule, for being determined as described image to be detected for every one first connected domain region
In the target area.
In one implementation, the target area is license plate region, and the license plate is blue license plate;
The third determination unit includes that third determines that submodule, the first screening submodule and the 4th determine submodule;
The third determines submodule, is used for according to preset second connected component labeling rule to first foreground image
It is marked, determines the second connected domain of at least one of first foreground image;
The first screening submodule, it is default for from least one described second connected domain, filtering out satisfaction first
At least one first object connected domain of screening conditions, wherein the first default screening conditions are as follows: according to the blue license plate
The condition of setting;
Described 4th determines submodule, for being determined as institute at least one described first object connected domain region
State the license plate region in image to be detected.
In one implementation, the 6th determination unit 635 includes that the 5th determining submodule and the 6th determine submodule
Block;
Described 5th determines submodule, is used for according to preset third connecting field mark rule to every one second foreground image
It is marked, determines at least one third connecting domain in each foreground image;
Described 6th determines submodule, for being connected according at least one third in identified every one second foreground image
Logical domain, determines the target area in described image to be detected.
In one implementation, the target area is license plate region, and the license plate is blue license plate;
6th determination unit 635 includes the 7th determining submodule, the second screening submodule and the 8th determining submodule;
Described 7th determines submodule, is used for according to preset four connected region marking convention to every one second foreground image
It is marked, determines at least one of every one second foreground image four connected region;
The second screening submodule, for screening from least one four connected region of every one second foreground image
Meet at least one second target connected domain of the second default screening conditions out, wherein the second default screening conditions are as follows: root
According to the condition of the blue license plate setting;
Described 8th determines submodule, for according to the second mesh of at least one of identified every one second foreground image
Connected domain is marked, determines the license plate region in described image to be detected.
In one implementation, it the described 8th determines submodule, is specifically used for
Obtain at least one of every one second foreground image location information of the second target connected domain and every one second
Corresponding relationship between at least one of foreground image the second target connected domain;
According to the second target connected domain of at least one of location information obtained and every one second foreground image it
Between corresponding relationship, obtain the license plate region in described image to be detected.
Corresponding to above method embodiment, the embodiment of the invention provides a kind of electronic equipment, as shown in figure 8, including place
Manage device 810, communication interface 820, memory 830 and communication bus 840, wherein processor 810, communication interface 820, memory
830 complete mutual communication by communication bus 840;
The memory 830, for storing computer program;
The processor 810 when for executing the computer program stored on the memory, realizes that the present invention is implemented
Any target area detection method based on color provided by example.
Using the embodiment of the present invention, the executable program code stored in the processor run memory of the electronic equipment,
It to execute the target area detection method provided by the embodiment of the present invention based on color, therefore can be realized: from mapping to be checked
The target area comprising color of object is detected as in.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Pomponent
Interconnect, abbreviation PCI) bus or expanding the industrial standard structure (Extended Industry Standard
Architecture, abbreviation EISA) bus etc..The communication bus can be divided into address bus, data/address bus, control bus etc..
Only to be indicated with a thick line in figure, it is not intended that an only bus or a type of bus convenient for indicating.
Communication interface is for the communication between above-mentioned electronic equipment and other equipment.
Memory may include random access memory (Random Access Memory, abbreviation RAM), also may include
Nonvolatile memory (non-volatile memory), for example, at least a magnetic disk storage.Optionally, memory may be used also
To be storage device that at least one is located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit,
Abbreviation CPU), network processing unit (Network Processor, abbreviation NP) etc.;It can also be digital signal processor
(Digital Signal Processing, abbreviation DSP), specific integrated circuit (Application Specific
Integrated Circuit, abbreviation ASIC), field programmable gate array (Field-Programmable Gate Array,
Abbreviation FPGA) either other programmable logic device, discrete gate or transistor logic, discrete hardware components.
Corresponding to above method embodiment, the embodiment of the invention provides a kind of computer readable storage medium, the meter
It is stored with computer program in calculation machine readable storage medium storing program for executing, realizes that the present invention is implemented when the computer program is executed by processor
Any target area detection method based on color provided by example.
Using the embodiment of the present invention, computer-readable recording medium storage, which is performed, realizes that the embodiment of the present invention is mentioned
The computer program of the target area detection method based on color supplied, therefore can be realized: it is detected from image to be detected
Target area comprising color of object.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for system/
For Installation practice, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to method
The part of embodiment illustrates.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.
Claims (19)
1. a kind of target area detection method based on color, which is characterized in that the described method includes:
Obtain image to be detected;
Determine U component value corresponding to each pixel in described image to be detected and V component value;
According to U component value corresponding to each pixel and V component value, the target area in described image to be detected is determined,
In, the target area is the region comprising color of object.
2. the method according to claim 1, wherein U component value and the V according to corresponding to each pixel
Component value, the step of determining the target area in described image to be detected, comprising:
U component value corresponding to each pixel is judged respectively whether more than the first predetermined threshold, and corresponding V component value is
It is no to be lower than the second predetermined threshold, obtain the first judging result, wherein first predetermined threshold and second predetermined threshold are equal
Are as follows: the value being arranged according to the color of object;
According to first judging result, the foreground pixel point for including in described image to be detected is determined, wherein the prospect picture
Vegetarian refreshments is that corresponding U component value is more than the first predetermined threshold, and corresponding V component value is lower than the pixel of the second predetermined threshold
Point;
According to the foreground pixel point for including in described image to be detected, the first foreground image is determined;
According to first foreground image, the target area in described image to be detected is determined.
3. the method according to claim 1, wherein U component value and the V according to corresponding to each pixel
Component value, the step of determining the target area in described image to be detected, comprising:
Calculate separately the first difference of U component value and V component value corresponding to each pixel;
First difference of each pixel is compared at least one default binarization threshold, obtains comparison result, wherein
At least one described default binarization threshold are as follows: the threshold value based on color of object setting;
According to the comparison result, at least one set of foreground pixel point for including in described image to be detected is determined, wherein before one group
Scene vegetarian refreshments corresponds to a default binarization threshold, and every group of foreground pixel point is that the first difference is greater than corresponding default two-value
Change the pixel of threshold value;
According at least one set of foreground pixel point for including in described image to be detected, at least one second foreground image is determined,
In, the corresponding one group of foreground pixel point of second foreground image;
According at least one described second foreground image, the target area in described image to be detected is determined.
4. according to the method described in claim 3, it is characterized in that, being determined described to be checked described according to the comparison result
Before the step of at least one set of foreground pixel point for including in altimetric image, the method also includes:
Judge whether U component value corresponding to each pixel is more than third predetermined threshold respectively, and corresponding V component value is
It is no to be lower than the 4th predetermined threshold, obtain the second judging result, wherein the third predetermined threshold and the 4th predetermined threshold are equal
Are as follows: the value being arranged according to the color of object;
It is described according to the comparison result, the step of determining at least one set of foreground pixel point for including in described image to be detected,
Include:
According to the comparison result and second judging result, before determining at least one set for including in described image to be detected
Scene vegetarian refreshments.
5. according to the method described in claim 2, it is characterized in that, described according to first foreground image, determine it is described to
The step of target area in detection image, comprising:
First foreground image is marked according to preset first connected component labeling rule, determines first foreground picture
The first connected domain of at least one of picture;
By every one first connected domain region, it is determined as the target area in described image to be detected.
6. according to the method described in claim 2, it is characterized in that, the target area is license plate region, the license plate
For blue license plate;
It is described according to first foreground image, the step of determining the target area in described image to be detected, comprising:
First foreground image is marked according to preset second connected component labeling rule, determines first foreground picture
The second connected domain of at least one of picture;
From at least one described second connected domain, at least one first object company for meeting the first default screening conditions is filtered out
Logical domain, wherein the first default screening conditions are as follows: according to the condition of the blue license plate setting;
By at least one described first object connected domain region, it is determined as the license plate location in described image to be detected
Domain.
7. the method according to claim 3 or 4, which is characterized in that described at least one second foreground image according to,
The step of determining the target area in described image to be detected, comprising:
Every one second foreground image is marked according to preset third connecting field mark rule, is determined in each foreground image
At least one third connecting domain;
According at least one third connecting domain in identified every one second foreground image, determine in described image to be detected
The target area.
8. the method according to claim 3 or 4, which is characterized in that the target area is license plate region, the vehicle
Board is blue license plate;
Described at least one second foreground image according to, determines the step of the target area in described image to be detected
Suddenly, comprising:
Every one second foreground image is marked according to preset four connected region marking convention, determines every one second foreground picture
At least one of picture four connected region;
From at least one four connected region of every one second foreground image, filters out and meet the second default screening conditions at least
One the second target connected domain, wherein the second default screening conditions are as follows: according to the condition of the blue license plate setting;
According to the second target connected domain of at least one of identified every one second foreground image, described image to be detected is determined
In license plate region.
9. according to the method described in claim 8, it is characterized in that, in one second foreground image every according to determined by
At least one second target connected domain, the step of determining the license plate region in described image to be detected, comprising:
Obtain at least one of every one second foreground image location information of the second target connected domain and every one second prospect
Corresponding relationship between at least one of image the second target connected domain;
According between the second target connected domain of at least one of location information obtained and every one second foreground image
Corresponding relationship obtains the license plate region in described image to be detected.
10. a kind of target area detection device based on color, which is characterized in that described device includes:
First obtains module, for obtaining image to be detected;
Second obtains module, for obtaining U component value and V component corresponding to each pixel in described image to be detected
Value;
Determining module determines in described image to be detected for the U component value according to corresponding to each pixel and V component value
Target area, wherein the target area be the region comprising color of object.
11. device according to claim 10, which is characterized in that the determining module includes the first judging unit, first
Determination unit, the second determination unit and third determination unit;
First judging unit, for judging U component value corresponding to each pixel whether more than the first predetermined threshold respectively
Value, and whether corresponding V component value is lower than the second predetermined threshold, obtains the first judging result, wherein the first predetermined threshold
Value and second predetermined threshold are equal are as follows: the value being arranged according to the color of object;
First determination unit, for determining the prospect for including in described image to be detected according to first judging result
Pixel, wherein the foreground pixel point is that corresponding U component value is more than the first predetermined threshold, and corresponding V component value
Lower than the pixel of the second predetermined threshold;
Second determination unit, for determining the first foreground picture according to the foreground pixel point for including in described image to be detected
Picture;
The third determination unit, for determining the target in described image to be detected according to first foreground image
Region.
12. device according to claim 10, which is characterized in that the determining module include computing unit, comparing unit,
4th determination unit, the 5th determination unit and the 6th determination unit;
The computing unit, for calculating separately the first difference of U component value and V component value corresponding to each pixel;
The comparing unit, for the first difference of each pixel to be compared at least one default binarization threshold,
Obtain comparison result, wherein at least one described default binarization threshold are as follows: the threshold value based on color of object setting;
4th determination unit, for determining at least one set for including in described image to be detected according to the comparison result
Foreground pixel point, wherein the corresponding default binarization threshold of one group of foreground pixel point, every group of foreground pixel point is first poor
Value is greater than the pixel of corresponding default binarization threshold;
5th determination unit, for determining extremely according at least one set of foreground pixel point for including in described image to be detected
Few second foreground image, wherein the corresponding one group of foreground pixel point of second foreground image;
6th determination unit, for determining in described image to be detected according at least one described second foreground image
The target area.
13. device according to claim 12, which is characterized in that the determining module further includes second judgment unit;
The second judgment unit, for described according to the comparison result, determine in described image to be detected include to
Before few one group of foreground pixel point, judge whether U component value corresponding to each pixel is more than third predetermined threshold respectively, and
Whether corresponding V component value is lower than the 4th predetermined threshold, obtains the second judging result, wherein the third predetermined threshold and
4th predetermined threshold is equal are as follows: the value being arranged according to the color of object;
4th determination unit, is specifically used for according to the comparison result and second judging result, determine it is described to
At least one set of foreground pixel point for including in detection image.
14. device according to claim 11, which is characterized in that the third determination unit includes the first determining submodule
Submodule is determined with second;
Described first determines submodule, for carrying out according to preset first connected component labeling rule to first foreground image
Label, determines the first connected domain of at least one of first foreground image;
Described second determines submodule, for being determined as every one first connected domain region in described image to be detected
The target area.
15. device according to claim 11, which is characterized in that the target area is license plate region, the vehicle
Board is blue license plate;
The third determination unit includes that third determines that submodule, the first screening submodule and the 4th determine submodule;
The third determines submodule, for carrying out according to preset second connected component labeling rule to first foreground image
Label, determines the second connected domain of at least one of first foreground image;
The first screening submodule, for from least one described second connected domain, filtering out the default screening of satisfaction first
At least one first object connected domain of condition, wherein the first default screening conditions are as follows: be arranged according to the blue license plate
Condition;
Described 4th determines submodule, for will at least one described first object connected domain region, be determined as it is described to
License plate region in detection image.
16. device according to claim 12 or 13, which is characterized in that the 6th determination unit includes the 5th determining son
Module and the 6th determines submodule;
Described 5th determines submodule, for carrying out according to preset third connecting field mark rule to every one second foreground image
Label, determines at least one third connecting domain in each foreground image;
Described 6th determines submodule, for according at least one third connecting in identified every one second foreground image
Domain determines the target area in described image to be detected.
17. device according to claim 12 or 13, which is characterized in that the target area is license plate region, institute
License plate is stated as blue license plate;
6th determination unit includes the 7th determining submodule, the second screening submodule and the 8th determining submodule;
Described 7th determines submodule, for carrying out according to preset four connected region marking convention to every one second foreground image
Label, determines at least one of every one second foreground image four connected region;
The second screening submodule is full for filtering out from least one four connected region of every one second foreground image
At least one second target connected domain of the second default screening conditions of foot, wherein the second default screening conditions are as follows: according to institute
State the condition of blue license plate setting;
Described 8th determines submodule, for being connected according to the second target of at least one of identified every one second foreground image
Logical domain, determines the license plate region in described image to be detected.
18. device according to claim 17, which is characterized in that the described 8th determines submodule, is specifically used for
Obtain at least one of every one second foreground image location information of the second target connected domain and every one second prospect
Corresponding relationship between at least one of image the second target connected domain;
According between the second target connected domain of at least one of location information obtained and every one second foreground image
Corresponding relationship obtains the license plate region in described image to be detected.
19. a kind of electronic equipment, which is characterized in that including processor, communication interface, memory and communication bus, wherein processing
Device, communication interface, memory complete mutual communication by communication bus;
The memory, for storing computer program;
The processor when for executing the computer program stored on the memory, realizes any institute of claim 1-9
The target area detection method based on color stated.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710680189.7A CN109389126A (en) | 2017-08-10 | 2017-08-10 | A kind of method for detecting area based on color, device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710680189.7A CN109389126A (en) | 2017-08-10 | 2017-08-10 | A kind of method for detecting area based on color, device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109389126A true CN109389126A (en) | 2019-02-26 |
Family
ID=65415556
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710680189.7A Pending CN109389126A (en) | 2017-08-10 | 2017-08-10 | A kind of method for detecting area based on color, device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109389126A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111833398A (en) * | 2019-04-16 | 2020-10-27 | 杭州海康威视数字技术股份有限公司 | Method and device for marking pixel points in image |
CN113870226A (en) * | 2021-09-29 | 2021-12-31 | 南京领行科技股份有限公司 | Method and device for detecting compliance of additive, electronic equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140348433A1 (en) * | 2013-05-21 | 2014-11-27 | Ningbo Huayi Jiye Information Technology Co., Ltd | Image recognition method and device |
CN105096347A (en) * | 2014-04-24 | 2015-11-25 | 富士通株式会社 | Image processing device and method |
-
2017
- 2017-08-10 CN CN201710680189.7A patent/CN109389126A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140348433A1 (en) * | 2013-05-21 | 2014-11-27 | Ningbo Huayi Jiye Information Technology Co., Ltd | Image recognition method and device |
CN105096347A (en) * | 2014-04-24 | 2015-11-25 | 富士通株式会社 | Image processing device and method |
Non-Patent Citations (1)
Title |
---|
张潘潘: "道路交通标志检测与识别算法的研究", 《中国优秀硕士学位论文全文数据库信息科技辑》 * |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111833398A (en) * | 2019-04-16 | 2020-10-27 | 杭州海康威视数字技术股份有限公司 | Method and device for marking pixel points in image |
CN111833398B (en) * | 2019-04-16 | 2023-09-08 | 杭州海康威视数字技术股份有限公司 | Pixel point marking method and device in image |
CN113870226A (en) * | 2021-09-29 | 2021-12-31 | 南京领行科技股份有限公司 | Method and device for detecting compliance of additive, electronic equipment and storage medium |
CN113870226B (en) * | 2021-09-29 | 2024-03-22 | 南京领行科技股份有限公司 | Compliance detection method and device for additional object, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8774503B2 (en) | Method for color feature extraction | |
CN110136071A (en) | A kind of image processing method, device, electronic equipment and storage medium | |
CN108737875B (en) | Image processing method and device | |
CN107103606A (en) | A kind of image-recognizing method and device | |
CN108205671A (en) | Image processing method and device | |
CN106161974A (en) | Utilize display apparatus and the method thereof of HDR function | |
CN106815587B (en) | Image processing method and device | |
US10438376B2 (en) | Image processing apparatus replacing color of portion in image into single color, image processing method, and storage medium | |
CN108615030A (en) | A kind of title consistency detecting method, device and electronic equipment | |
CN109903265B (en) | Method and system for setting detection threshold value of image change area and electronic device thereof | |
CN110458789B (en) | Image definition evaluating method and device and electronic equipment | |
CN107464251A (en) | The black edge detection method and device of a kind of image | |
CN109389126A (en) | A kind of method for detecting area based on color, device and electronic equipment | |
CN113395440A (en) | Image processing method and electronic equipment | |
CN111369529B (en) | Article loss and leave-behind detection method and system | |
CN114155241A (en) | Foreign matter detection method and device and electronic equipment | |
CN111523551A (en) | Binarization method, device and equipment for blue object | |
CN111861893A (en) | Method, system, equipment and computer medium for eliminating false color edge of image | |
CN111311500A (en) | Method and device for carrying out color restoration on image | |
CN108921869A (en) | A kind of image binaryzation method and device | |
CN107292897A (en) | Image edge extraction method, device and terminal for YUV domains | |
US20150055858A1 (en) | Systems and methods for color recognition in computer vision systems | |
CN105740820B (en) | Method and system for acquiring picture for discrimination | |
CN105761282B (en) | The detection method and device of image color cast | |
CN106402717B (en) | A kind of AR control method for playing back and intelligent desk lamp |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190226 |