teeth tracking

actually, it’s not tracking but i want to whiten anyone’s teeth recognized by live camera. I’ve got face tracking example running without any problem, so i should be doing some transformations up there. Maybe i should apply a filter to the recognized rectangle so that it will lighten any whiteish tones?

Do you have any recommendations?

You should be searching for connected components (pixels) that have a small distance from white and an area greater than some threshold. Knowing where a face is, the search region for mouth-teeth should be small.

Something to keep in mind is that the RGB color space is not perceptually uniform. This means that colors that we perceive as being close to each other, will not necessarily be close in the rgb color space. Thus, you should be either using a perceptually uniform color space or a distance metric in rgb (other than euclidian) that approximates perceived color distance ( if I remember well, some are based on the mahalanobis distance).

You could do a search in google to find details on this.

Of course there are many other ways to implement this. What I suggested was the first way (between a few) that came into my mind, reading your post.

HTH

Nikolas

p.s: it would be even easier to look for the brightest pixels, within the face region. What I proposed, is the basis of what is called “seeded region growing”