I super-impose pixels found from [ Y, X]=find(BW==1), where BW is after the edge() function of a a snapshot image of a lip captured via a webcam . But there are some outlier pixels as shown. The outlier pixels are obvious when the the webcam Brightness is set to example cam.Brightness=180. Could someone suggest how should I get ride of the outlier pixles if I need to retain the Brightness setting.
mouthImgGray=rgb2gray(I2); %%%I2 is the RGB of a lip image
BW = edge(mouthImgGray,'Sobel','horizontal');
[ Y, X]=find(BW==1);
plot( X, Y,'.');