title: Smile Detection in Matlab
body: <p>I have to do smile detection in Matlab and I am stuck on filtration of corners of lips. For this I am using following approach.</p>
  
  <pre><code>img = imread('smile.jpg');
  
  faceDetector = vision.CascadeObjectDetector('Mouth','MergeThreshold',160);
  cornerDetector = vision.CornerDetector('Method','Harris corner detection (Harris &amp; Stephens)');
  Irgb2gray=rgb2gray(img);
  
  bboxes = step(faceDetector, Irgb2gray);
  lips = imcrop(Irgb2gray,bboxes);
  
  C = corner(lips);
  imshow(lips);
  hold on;
  plot(C(:,1), C(:,2), 'r*');
  </code></pre>
  
  <p>I am getting corners of an image as:</p>
  
  <p><a href="https://i.stack.imgur.com/jcBVj.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jcBVj.jpg" alt="enter image description here"></a></p>
  
  <p>I want to apply some filters so that I can get rid of some corners that are outside of Lips. I am stuck on this point how would I came to know which are good corners and those which are not good?
  Then after correcting the corners I would have to calculate the distance between them so that I can tell if there was a smiley or not.</p>
  
  <p>Can anyone please help me in <strong>filtration of corners</strong>? I would be thankful to you.</p>