Content of the invention
In view of this, the invention provides a kind of tooth recognition methods, Apparatus and system, to overcome electronics in prior art
Equipment is relatively slow to the processing speed of tooth whitening, and the problem that the degree of accuracy is low.
For achieving the above object, the present invention provides following technical scheme:
A kind of tooth recognition methods, including:
From image to be identified, obtaining the coordinate of lip feature point, the coordinate of described lip feature point includes outside lip
The coordinate of contour feature point, and the coordinate of lip Internal periphery characteristic point;
According to the coordinate of described lip Internal periphery characteristic point, determine the target image including tooth;
By each picture of the lip internal image that the coordinate of lip Internal periphery characteristic point described in described target image surrounds
The pixel value that the pixel value of element is set to each pixel of lip external image in 255, and described target image is set to 0,
Obtain the first mask gray level image;
Described target image is converted to pre-set color space from RGB color, it is thus achieved that with described pre-set color space
Luminance channel, chrominance channel and saturation degree passage corresponding brightness/gray scale image, chromatic diagram picture and saturation degree image respectively;
According to described brightness/gray scale image and described first mask gray level image, obtain the second mask gray level image;
According to described chromatic diagram picture and described saturation degree image, it is thus achieved that lip probabilistic image;
According to described second mask gray level image and described lip probability graph, it is thus achieved that the 3rd mask gray level image;
The region that pixel value in described 3rd mask gray level image is formed more than or equal to the pixel of the 3rd preset value, really
It is set to tooth regions.
Preferably, also include:
The pixel value of each pixel in brightness/gray scale image is mapped according to presetting mapping function, it is thus achieved that lighten figure
Picture, described default mapping function is monotonically increasing function;
It using described 3rd mask gray level image as masking-out, is placed in the described image that lightens on described brightness/gray scale image,
Obtain final brightness/gray scale image;
Using described final brightness/gray scale image, chromatic diagram picture and saturation degree image as described pre-set color space
The gray level image of three passages, go back to RGB color.
Wherein, the described default mapping function of pixel value foundation by each pixel in described brightness/gray scale image reflects
Penetrate, it is thus achieved that lighten image and include:
According to default mapping function f (xi,j)=255-(255-xi,j)2/ 255, it is thus achieved that lighten image;
Wherein, f (xi,j) it is described to lighten pixel in image (i, pixel value j), xi,jFor described brightness/gray scale image
(i is just whole less than total line number M of pixel in described brightness/gray scale image more than or equal to 0 to middle pixel for i, pixel value j)
Number, j is the positive integer less than total columns N of pixel in described brightness/gray scale image more than or equal to 0.
Wherein, described using described 3rd mask gray level image as masking-out, image will be lightened and be placed in described brightness histogram
As upper, it is thus achieved that final brightness/gray scale image includes:
According to Sr "CYi,j=SrCYi,j×(1-Maski,j”/255)+Sr'CYi,j×(Maski,j"/255), it is thus achieved that finally bright
Degree gray level image;
Wherein, Sr "CYi,jFor pixel (i, pixel value j), Sr in described final brightness/gray scale imageCYi,jFor described tune
Pixel (i, pixel value j), Mask in bright imagei,j" it is pixel (i, pixel j) in described 3rd mask gray level image
Value.
Preferably, also include:
According to the coordinate of described lip feature point, determining lip state, described lip state includes closure state and unlatching
State;
When described lip state is opening, step, from image to be identified, obtains lip feature point
Coordinate.
Wherein, the described coordinate according to described lip Internal periphery characteristic point, determines and includes that the target image of tooth includes:
Obtain the coordinate of the boundary rectangle of the coordinate of described lip Internal periphery characteristic point;
The coordinate of described boundary rectangle is extended out predetermined coefficient, it is thus achieved that described boundary rectangle extend out coordinate;
The described image extending out coordinate encirclement is defined as described target image.
Wherein, the described coordinate by described boundary rectangle extends out predetermined coefficient, it is thus achieved that described boundary rectangle extend out coordinate
Including:
According to Pnew=P × (1-rate)+Pcenter × rate, it is thus achieved that described boundary rectangle extend out coordinate;
Wherein, P is the coordinate of described boundary rectangle, and Pcenter is the barycenter of described boundary rectangle, and Pnew is described external
Rectangle extend out coordinate, rate is described predetermined coefficient, rate be less than 0.
Wherein, described according to described brightness/gray scale image and described first mask gray level image, obtain the second mask ash
Degree image includes:
According to below equation, it is thus achieved that the second mask gray level image;
Mask′i,j=Maski,j×SrCYi,j/255
Wherein, Mask 'i,jFor pixel (i, pixel value j), Mask in described second mask gray level imagei,jFor described
Pixel (i, pixel value j), Sr in first mask gray level imageCYi,jFor pixel in described brightness/gray scale image (i, j)
Pixel value, i for being less than the positive integer of total line number M of pixel in described brightness/gray scale image more than or equal to 0, and j is for more than or equal to 0
Positive integer less than total columns N of pixel in described brightness/gray scale image.
Wherein, described according to described chromatic diagram picture and described saturation degree image, it is thus achieved that lip probabilistic image includes:
The pixel value of each pixel in described colourity gray level image and described saturation degree gray level image is normalized to 0 to
1;
FoundationWherein,
Obtain lip probabilistic image;
Wherein, MaskLipi,jFor pixel (i, pixel value j), C in described lip probabilistic imageri,jFor described colourity ash
Pixel (i, the pixel value after j) normalizing, C in degree imagebi,jFor pixel (i, j) normalizing in described saturation degree gray level image
Pixel value after change.
Wherein, described according to described second mask gray level image and described lip probability graph, it is thus achieved that the 3rd mask gray scale
Image includes:
According to Mask "i,j=Mask 'i,j-MaskLipi,j, it is thus achieved that the 3rd mask gray level image;
Wherein, Mask "i,jPixel (i, pixel value j) for described 3rd mask gray level image.
A kind of tooth identification device, including:
First acquisition module, for from image to be identified, obtains the coordinate of lip feature point, described lip feature point
Coordinate include the coordinate of lip contour characteristic points, and the coordinate of lip Internal periphery characteristic point;
First determining module, for the coordinate according to described lip Internal periphery characteristic point, determines the target figure including tooth
Picture;
Second acquisition module, for the lip surrounding the coordinate of lip Internal periphery characteristic point described in described target image
The pixel value of each pixel of internal image is set to each pixel of lip external image in 255, and described target image
Pixel value be set to 0, obtain the first mask gray level image;
3rd acquisition module, for being converted to pre-set color space by described target image from RGB color, it is thus achieved that with
The luminance channel in described pre-set color space, chrominance channel and saturation degree passage corresponding brightness/gray scale image, chromatic diagram respectively
Picture and saturation degree image;
4th acquisition module, for according to described brightness/gray scale image and described first mask gray level image, obtains the
Two mask gray level images;
5th acquisition module, for according to described chromatic diagram picture and described saturation degree image, it is thus achieved that lip probabilistic image;
6th acquisition module, for according to described second mask gray level image and described lip probability graph, it is thus achieved that the 3rd
Mask gray level image;
Second determining module, for being more than or equal to the picture of the 3rd preset value by pixel value in described 3rd mask gray level image
The region of vegetarian refreshments composition, is defined as tooth regions.
A kind of tooth identification system, including:
Processor;
For storing the memory of described processor executable;
Wherein, described processor is configured to:
From image to be identified, obtaining the coordinate of lip feature point, the coordinate of described lip feature point includes outside lip
The coordinate of contour feature point, and the coordinate of lip Internal periphery characteristic point;
According to the coordinate of described lip Internal periphery characteristic point, determine the target image including tooth;
By each picture of the lip internal image that the coordinate of lip Internal periphery characteristic point described in described target image surrounds
The pixel value that the pixel value of element is set to each pixel of lip external image in 255, and described target image is set to 0,
Obtain the first mask gray level image;
Described target image is converted to pre-set color space from RGB color, it is thus achieved that with described pre-set color space
Luminance channel, chrominance channel and saturation degree passage corresponding brightness/gray scale image, chromatic diagram picture and saturation degree image respectively;
According to described brightness/gray scale image and described first mask gray level image, obtain the second mask gray level image;
According to described chromatic diagram picture and described saturation degree image, it is thus achieved that lip probabilistic image;
According to described second mask gray level image and described lip probability graph, it is thus achieved that the 3rd mask gray level image;
The region that pixel value in described 3rd mask gray level image is formed more than or equal to the pixel of the 3rd preset value, really
It is set to tooth regions.
Understand via above-mentioned technical scheme, compared with prior art, the tooth recognition methods of the embodiment of the present application offer,
According to the coordinate of the lip feature point obtaining, determine the target image including tooth, i.e. obtained the general area of tooth, then tied
Close tooth feature brighter in luminance channel, target image is converted to the more sensitive pre-set color of brightness detection empty
Between, then according to described brightness/gray scale image and described first mask gray level image, obtain the second mask gray level image, according to institute
State chromatic diagram picture and described saturation degree image, it is thus achieved that lip probabilistic image, finally, according to described second mask gray level image with
And described lip probability graph, it is thus achieved that the 3rd mask gray level image, the pixel value of the 3rd mask gray level image Tooth part and its
He has a marked difference the pixel value of position, presets pixel value in described 3rd mask gray level image more than or equal to the 3rd
The region of the pixel composition of value is as tooth regions.It is achieved thereby that identify the purpose of tooth regions fast and accurately.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Describe, it is clear that described embodiment is only a part of embodiment of the present invention, rather than whole embodiments wholely.Based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of not making creative work
Embodiment, broadly falls into the scope of protection of the invention.
Refer to Fig. 1, for the schematic flow sheet of a kind of tooth recognition methods that the embodiment of the present application provides, the method bag
Include:
Step S101:From image to be identified, obtain the coordinate of lip feature point.
The coordinate of described lip feature point includes the coordinate of lip contour characteristic points, and lip Internal periphery characteristic point
Coordinate.
Lip feature point acquisition methods has a lot of middle implementation, such as ASM (Active Shape Model) method or god
Through network method etc..
As in figure 2 it is shown, the showing of lip feature point obtaining in a kind of tooth recognition methods providing for the embodiment of the present application
It is intended to.
In Fig. 2, characteristic point 21 is lip contour characteristic points, and characteristic point 22 is lip Internal periphery characteristic point.
Step S102:According to the coordinate of described lip Internal periphery characteristic point, determine the target image including tooth.
Target image is tooth regions substantially.
Step S103:The lip internal image that the coordinate of lip Internal periphery characteristic point described in described target image is surrounded
The pixel value of each pixel be set to the pixel value of each pixel of lip external image in 255, and described target image
It is set to 0, obtain the first mask gray level image.
As it is shown on figure 3, one the first mask gray level image providing for the embodiment of the present application.
As can be seen from Figure 3 each pixel of the lip internal image 31 that the coordinate of lip Internal periphery characteristic point surrounds
Pixel value is set to 255, i.e. white, and in target image, the pixel value of each pixel of lip external image is set to 0, i.e. black
Look.
The lip outline that the coordinate of lip Internal periphery characteristic point surrounds can utilize Bezier drafting to obtain.
Step S104:Described target image is converted to pre-set color space from RGB color, it is thus achieved that preset with described
The luminance channel of color space, chrominance channel and saturation degree passage corresponding brightness/gray scale image respectively, chromatic diagram picture and saturated
Degree image.
Pre-set color space is the color space more sensitive to brightness detection, for example, it is possible to be YCrCb color space.
YCrCb color space includes three passages, respectively luminance channel, chrominance channel and saturation degree passage.Target image is from RGB face
After color space transformation is pre-set color space, can obtain and three passages corresponding three gray-scale maps, i.e. brightness histograms respectively
Picture, chromatic diagram picture and saturation degree image.
Because tooth is white, utilize this feature, target image is converted to detect brightness from RGB color
More sensitive pre-set color space.
Step S105:According to described brightness/gray scale image and described first mask gray level image, obtain the second mask ash
Degree image.
Can be according to below equation, it is thus achieved that the second mask gray level image;
Mask′i,j=Maski,j×SrCYi,j/255
Wherein, Mask 'i,jFor pixel (i, pixel value j), Mask in described second mask gray level imagei,jFor described
Pixel (i, pixel value j), Sr in first mask gray level imageCYi,jFor pixel in described brightness/gray scale image (i, j)
Pixel value, i for being less than the positive integer of total line number M of pixel in described brightness/gray scale image more than or equal to 0, and j is for more than or equal to 0
Positive integer less than total columns N of pixel in described brightness/gray scale image.
It should be noted that above-mentioned formula is not intended that limitation of the invention, those skilled in the art can be according to this
The technological thought that invention provides combines practical application request designed, designed.
As shown in Figure 4, one the second mask gray level image providing for the embodiment of the present application.
Figure 4, it is seen that the profile ratio of the second mask gray level image Tooth is more visible, but tooth is near lip
Border also be clear especially.
Step S106:According to described chromatic diagram picture and described saturation degree image, it is thus achieved that lip probabilistic image.
Step S106 specifically can include:By each pixel in described colourity gray level image and described saturation degree gray level image
The pixel value of point normalizes to 0 to 1.
FoundationWherein,Obtain
Obtain lip probabilistic image.
Wherein, MaskLipi,jFor pixel (i, pixel value j), C in described lip probabilistic imageri,jFor described colourity ash
Pixel (i, the pixel value after j) normalizing, C in degree imagebi,jFor pixel (i, j) normalizing in described saturation degree gray level image
Pixel value after change.
It should be noted that above-mentioned formula is not intended that limitation of the invention, those skilled in the art can be according to this
The technological thought that invention provides combines practical application request designed, designed.
As it is shown in figure 5, a kind of lip probabilistic image providing for the embodiment of the present application.
From figure 5 it can be seen that lip probabilistic image is by showing that the profile of lip is clarified above.
Step S107:According to described second mask gray level image and described lip probability graph, it is thus achieved that the 3rd mask gray scale
Image.
According to Mask "i,j=Mask 'i,j-MaskLipi,j, it is thus achieved that the 3rd mask gray level image;Wherein, Mask "i,jFor described
Pixel (i, pixel value j) of the 3rd mask gray level image.
It should be noted that above-mentioned formula is not intended that limitation of the invention, those skilled in the art can be according to this
The technological thought that invention provides combines practical application request designed, designed.
As shown in Figure 6, the 3rd mask gray level image providing for the embodiment of the present application.
From fig. 6 it can be seen that the pixel value of the 3rd mask gray level image Tooth part with other positions
Pixel value has a marked difference.
Step S108:Pixel value in described 3rd mask gray level image is formed more than or equal to the pixel of the 3rd preset value
Region as tooth regions.
Depending on 3rd preset value can be according to actual conditions, for example the 250th, the 247th, 230 etc..
The tooth recognition methods that the embodiment of the present application provides, according to the coordinate of the lip feature point obtaining, determines and includes tooth
The target image of tooth, has i.e. obtained the general area of tooth, in conjunction with tooth feature brighter in luminance channel, by target figure
Picture is converted to the pre-set color space more sensitive to brightness detection, then covers according to described brightness/gray scale image and described first
Mould gray level image, obtains the second mask gray level image, according to described chromatic diagram picture and described saturation degree image, it is thus achieved that lip is general
Rate image, finally, according to described second mask gray level image and described lip probability graph, it is thus achieved that the 3rd mask gray level image,
The pixel value of the 3rd mask gray level image Tooth part has a marked difference with the pixel value of other positions, by described
In three mask gray level images, pixel value is more than or equal to the region of the pixel composition of the 3rd preset value as tooth regions.Thus it is real
Show the purpose identifying tooth regions fast and accurately.
It it is understood that after identifying tooth, whitening can be carried out to the tooth identifying, refer to Fig. 7, is this Shen
The flow process of a kind of implementation that please carry out whitening to the tooth identifying in a kind of tooth recognition methods of providing of embodiment is shown
Being intended to, the method includes:
Step S701:The pixel value of each pixel in brightness/gray scale image is mapped according to presetting mapping function, obtains
Must lighten image, described default mapping function is monotonically increasing function.
Can be according to default mapping function f (xi,j)=255-(255-xi,j)2/ 255, it is thus achieved that lighten image;Wherein, f
(xi,j) it is described to lighten pixel in image (i, pixel value j), xi,jFor pixel in described brightness/gray scale image (i, j)
Pixel value.
It should be noted that above-mentioned formula is not intended that limitation of the invention, those skilled in the art can be according to this
The technological thought that invention provides combines practical application request designed, designed.
Step S702:Using described 3rd mask gray level image as masking-out, image will be lightened and be placed in described brightness histogram
As upper, it is thus achieved that final brightness/gray scale image.
Can be according to Sr "CYi,j=SrCYi,j×(1-Maski,j”/255)+Sr'CYi,j×(Maski,j"/255), it is thus achieved that
Whole brightness/gray scale image;Wherein, Sr "CYi,jFor pixel (i, pixel value j), Sr in described final brightness/gray scale imageCYi,j
Lighten pixel in image (i, pixel value j), Mask for describedi,j" be pixel in described 3rd mask gray level image (i,
J) pixel value.
Step S703:Using described final brightness/gray scale image, chromatic diagram picture and saturation degree image as described pre-
If the gray level image of the three of color space passages, go back to RGB color.
It is understood that the lip of people is probably and closes in image to be identified, i.e. do not show one's teeth, now not
Need to carry out tooth whitening, it is not required that carry out tooth identification, as shown in Figure 8, for a kind of tooth of the embodiment of the present application offer
Recognition methods determines the schematic flow sheet of a kind of implementation whether including tooth regions in image currently to be identified, should
Method includes:
Step S801:According to the coordinate of described lip feature point, determining lip state, described lip state includes closed form
State and opening.
Concrete, calculate lip contour characteristic points and surround area Sout and lip Internal periphery characteristic point encirclement area Sin.
Calculate lip contour characteristic points and surround area Sout and the ratio of lip Internal periphery characteristic point encirclement area Sin
Rate=Sin/Sout.
If rate value is less than predetermined threshold value threshold, then judges that lip closes, tooth whitening operation need not be carried out,
Without identification tooth.
If rate value is more than predetermined threshold value threshold, then judge that lip is opened, be ready for identifying the behaviour of tooth
Make.
Depending on predetermined threshold value threshold is according to concrete lip feature point algorithm, for example, can be threshold=
0.16.
Step S802:When described lip state is opening, step, from image to be identified, obtains lip
The coordinate of characteristic point.
Refer to Fig. 9, for the embodiment of the present application provide a kind of tooth recognition methods according to described lip Internal periphery
The coordinate of characteristic point, determines the schematic flow sheet of a kind of implementation of target image including tooth, and the method includes:
Step S901:Obtain the coordinate of the boundary rectangle of the coordinate of described lip Internal periphery characteristic point.
Step S902:The coordinate of described boundary rectangle is extended out predetermined coefficient, it is thus achieved that described boundary rectangle extend out coordinate.
Can be according to Pnew=P × (1-rate)+Pcenter × rate, it is thus achieved that described boundary rectangle extend out coordinate;Its
In, P is the coordinate of described boundary rectangle, and Pcenter is the barycenter of described boundary rectangle, and Pnew is extending out of described boundary rectangle
Coordinate, rate is described predetermined coefficient, and rate is less than 0.
Step S903:The described image extending out coordinate encirclement is defined as described target image.
Referring to Figure 10, for the structural representation of a kind of tooth identification device that the embodiment of the present application provides, this tooth is known
Other device includes:First acquisition module the 1001st, the first determining module the 1002nd, the second acquisition module the 1003rd, the 3rd acquisition module
1004th, the 4th acquisition module the 1005th, the 5th acquisition module the 1006th, the 6th acquisition module 1007 and the second determining module 1008,
Wherein:
First acquisition module 1001, for from image to be identified, obtains the coordinate of lip feature point, and described lip is special
Levy coordinate a little and include the coordinate of lip contour characteristic points, and the coordinate of lip Internal periphery characteristic point.
Detailed description sees Fig. 2, does not repeats them here.
First determining module 1002, for the coordinate according to described lip Internal periphery characteristic point, determines the mesh including tooth
Logo image.
Detailed description sees Fig. 3, does not repeats them here.
Second acquisition module 1003, for surround the coordinate of lip Internal periphery characteristic point described in described target image
The pixel value of each pixel of lip internal image is set to each of lip external image in 255, and described target image
The pixel value of pixel is set to 0, obtains the first mask gray level image.
3rd acquisition module 1004, for described target image is converted to pre-set color space from RGB color, obtains
Must be with the luminance channel in described pre-set color space, chrominance channel and saturation degree passage corresponding brightness/gray scale image, look respectively
Degree image and saturation degree image.
Pre-set color space is the color space more sensitive to brightness detection, for example, it is possible to be YCrCb color space.
YCrCb color space includes three passages, respectively luminance channel, chrominance channel and saturation degree passage.Target image is from RGB face
After color space transformation is pre-set color space, can obtain and three passages corresponding three gray-scale maps, i.e. brightness histograms respectively
Picture, chromatic diagram picture and saturation degree image.
Because tooth is white, utilize this feature, target image is converted to detect brightness from RGB color
More sensitive pre-set color space.
4th acquisition module 1005, for according to described brightness/gray scale image and described first mask gray level image, obtains
To the second mask gray level image.
4th acquisition module 1005 includes:Obtain the second mask gray level image unit, for according to below equation, it is thus achieved that the
Two mask gray level images.
Mask′i,j=Maski,j×SrCYi,j/255
Wherein, Mask 'i,jFor pixel (i, pixel value j), Mask in described second mask gray level imagei,jFor described
Pixel (i, pixel value j), Sr in first mask gray level imageCYi,jFor pixel in described brightness/gray scale image (i, j)
Pixel value, i for being less than the positive integer of total line number M of pixel in described brightness/gray scale image more than or equal to 0, and j is for more than or equal to 0
Positive integer less than total columns N of pixel in described brightness/gray scale image.
It should be noted that above-mentioned formula is not intended that limitation of the invention, those skilled in the art can be according to this
The technological thought that invention provides combines practical application request designed, designed.
Description to Fig. 4 be may refer to the second mask gray level image, repeat no more here.
5th acquisition module 1006, for according to described chromatic diagram picture and described saturation degree image, it is thus achieved that lip probability
Image.
5th acquisition module 1006 includes:Obtain lip probabilistic image unit, for by described colourity gray level image and institute
The pixel value stating each pixel in saturation degree gray level image normalizes to 0 to 1.
Concrete, the maximum of pixel value in colourity gray level image can be normalized to 1, the Returning to one for minimum value of pixel value
Turn to 0, the corresponding normalization of other pixel values.In saturation degree gray level image, the maximum of pixel value is normalized to 1, and pixel value is
Little value is normalized to 0, the corresponding normalization of other pixel values.
FoundationWherein,Obtain
Obtain lip probabilistic image;
Wherein, MaskLipi,jFor pixel (i, pixel value j), C in described lip probabilistic imageri,jFor described colourity ash
Pixel (i, the pixel value after j) normalizing, C in degree imagebi,jFor pixel (i, j) normalizing in described saturation degree gray level image
Pixel value after change.
It should be noted that above-mentioned formula is not intended that limitation of the invention, those skilled in the art can be according to this
The technological thought that invention provides combines practical application request designed, designed.
Description to lip probabilistic image may refer to Fig. 5, repeats no more here.
6th acquisition module 1007, for according to described second mask gray level image and described lip probability graph, it is thus achieved that
3rd mask gray level image.
6th acquisition module 1007 includes:Obtain the 3rd mask gray level image module, be used for foundation
Mask″i=Maski'-MaskLipi, it is thus achieved that the 3rd mask gray level image;Wherein, Mask "iFor described 3rd mask
The pixel value of the ith pixel point of gray level image.
Second determining module 1008, for being more than or equal to the 3rd preset value by pixel value in described 3rd mask gray level image
Pixel composition region, be defined as tooth regions.
The tooth identification device that the embodiment of the present application provides, the first determining module 1002 obtains according to the first acquisition module 1001
The coordinate of the lip feature point taking, determines the target image including tooth, has i.e. obtained the general area of tooth, in conjunction with tooth
Feature brighter in luminance channel, is converted to target image to brightness detection more sensitive by the 3rd acquisition module 1004
Pre-set color space, the 4th acquisition module 1005 is again according to described brightness/gray scale image and described first mask gray-scale map
Picture, obtains the second mask gray level image, and the 5th acquisition module 1006, according to described chromatic diagram picture and described saturation degree image, obtains
Obtaining lip probabilistic image, finally, the 6th acquisition module 1007 is according to described second mask gray level image and described lip probability
Figure, it is thus achieved that the 3rd mask gray level image, the pixel value of the 3rd mask gray level image Tooth part with other positions
Pixel value has a marked difference, the second determining module 1008 by pixel value in described 3rd mask gray level image more than or equal to the
The region of the pixel composition of three preset values is as tooth regions.It is achieved thereby that identify tooth regions fast and accurately
Purpose.
It is understood that after identifying tooth, whitening, optionally, tooth identification can be carried out to the tooth identifying
Device can also include:7th acquisition module, the 8th acquisition module and modular converter, wherein:
7th acquisition module, for carrying out the pixel value of each pixel in brightness/gray scale image according to presetting mapping function
Map, it is thus achieved that lightening image, described default mapping function is monotonically increasing function.
7th acquisition module includes:First acquiring unit, for according to default mapping function f (xi,j)=255-(255-
xi,j)2/ 255, it is thus achieved that lighten image;Wherein, f (xi,j) it is described to lighten pixel in image (i, pixel value j), xi,jFor institute
State pixel in brightness/gray scale image (i, pixel value j).
It should be noted that above-mentioned formula is not intended that limitation of the invention, those skilled in the art can be according to this
The technological thought that invention provides combines practical application request designed, designed.
8th acquisition module, is used for described 3rd mask gray level image as masking-out, will lighten image and be placed in described bright
On degree gray level image, it is thus achieved that final brightness/gray scale image.
8th acquisition module includes:Second acquisition unit, for according to Sr 'CYi, j=SrCYi, j×(1-MaskI, j′/255)
+Sr′CYi, j×(MaskI, j"/255), it is thus achieved that final brightness/gray scale image;Wherein, Sr "CYi,jFor described final brightness histogram
Pixel (i, pixel value j), Sr in XiangCYi,jLighten pixel in image (i, pixel value j), Mask for describedi,j" it is institute
State pixel in the 3rd mask gray level image (i, pixel value j).
Modular converter, for using described final brightness/gray scale image, chromatic diagram picture and saturation degree image as institute
State the gray level image of three passages in pre-set color space, go back to RGB color.
It is understood that the lip of people is probably and closes in image to be identified, i.e. do not show one's teeth, now not
Need to carry out tooth whitening, it is not required that carrying out tooth identification, optionally, tooth identification device can also include:3rd determines
Module and the 9th acquisition module, wherein:
3rd determining module, for the coordinate according to described lip feature point, determines lip state, described lip state bag
Include closure state and opening.
Concrete, calculate lip contour characteristic points and surround area Sout and lip Internal periphery characteristic point encirclement area Sin.
Calculate lip contour characteristic points and surround area Sout and the ratio of lip Internal periphery characteristic point encirclement area Sin
Rate=Sin/Sout.
If rate value is less than predetermined threshold value threshold, then judges that lip closes, tooth whitening operation need not be carried out,
Without identification tooth.
If rate value is more than predetermined threshold value threshold, then judge that lip is opened, be ready for identifying the behaviour of tooth
Make.
Depending on predetermined threshold value threshold is according to concrete lip feature point algorithm, for example, can be threshold=
0.16.
9th acquisition module, for when described lip state is opening, step from image to be identified,
Obtain the coordinate of lip feature point.
Optionally, the first determining module 1002 in tooth identification device includes:
3rd acquiring unit, for obtaining the coordinate of the boundary rectangle of the coordinate of described lip Internal periphery characteristic point.
4th acquiring unit, for extending out predetermined coefficient by the coordinate of described boundary rectangle, it is thus achieved that described boundary rectangle
Extend out coordinate.
4th acquiring unit includes:First acquisition subelement, for according to Pnew=P × (1-rate)+Pcenter ×
Rate, it is thus achieved that described boundary rectangle extend out coordinate;Wherein, P is the coordinate of described boundary rectangle, and Pcenter is described external
The barycenter of rectangle, Pnew is the coordinate that extends out of described boundary rectangle, and rate is described predetermined coefficient, and rate is less than 0.
First determining unit, for being defined as described target image by the described image extending out coordinate encirclement.
The embodiment of the present application additionally provides a kind of tooth identification system, including:Processor and memory, processor and storage
Device is connected by communication bus.
Memory, is used for storing described processor executable.
Described processor is configured to:
From image to be identified, obtaining the coordinate of lip feature point, the coordinate of described lip feature point includes outside lip
The coordinate of contour feature point, and the coordinate of lip Internal periphery characteristic point;
According to the coordinate of described lip Internal periphery characteristic point, determine the target image including tooth;
By each picture of the lip internal image that the coordinate of lip Internal periphery characteristic point described in described target image surrounds
The pixel value that the pixel value of element is set to each pixel of lip external image in 255, and described target image is set to 0,
Obtain the first mask gray level image;
Described target image is converted to pre-set color space from RGB color, it is thus achieved that with described pre-set color space
Luminance channel, chrominance channel and saturation degree passage corresponding brightness/gray scale image, chromatic diagram picture and saturation degree image respectively;
According to described brightness/gray scale image and described first mask gray level image, obtain the second mask gray level image;
According to described chromatic diagram picture and described saturation degree image, it is thus achieved that lip probabilistic image;
According to described second mask gray level image and described lip probability graph, it is thus achieved that the 3rd mask gray level image;
The region that pixel value in described 3rd mask gray level image is formed more than or equal to the pixel of the 3rd preset value, really
It is set to tooth regions.
It should be noted that each embodiment in this specification all uses the mode gone forward one by one to describe, each embodiment weight
Point explanation is all the difference with other embodiments, and between each embodiment, identical similar part sees mutually.
Described above to the disclosed embodiments, makes professional and technical personnel in the field be capable of or uses the present invention.
Multiple modifications to these embodiments will be apparent from for those skilled in the art, as defined herein
General Principle can realize without departing from the spirit or scope of the present invention in other embodiments.Therefore, the present invention
It is not intended to be limited to the embodiments shown herein, and be to fit to and principles disclosed herein and features of novelty phase one
The scope the widest causing.