title: opencv remove white pixels of the edges
body: <p>Hello guys I'm trying to make a correct segmentation for lemon fruits.
  I'm using Otsu's method to get the lemon from de region of background,
  but my results are not good.. as you can see in this image.
  the edges of the lemons of grade "mature" has white pixels in the edges
  ¿what could i do to fix it?</p>
  
  <pre><code>image = cv2.imread(imagePath)
          original = image
          #(blur)
          image = cv2.blur(image,(31,31),0)
          #convert to hsv
          image = cv2.cvtColor(image, cv2.COLOR_BGR2HSV)
          #(CV_RGB2GRAY)
          image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
          #Otsu.
          ret, otsu = cv2.threshold(image,0,255,cv2.THRESH_BINARY+cv2.THRESH_OTSU)
  
          #Apply mask
          result = cv2.bitwise_and(original, original, mask=otsu)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/vjojF.jpg" alt="original lemon image:"></p>
  
  <p>Lemon result</p>
  
  <p><img src="https://i.stack.imgur.com/VFB7l.jpg" alt="Lemon result."></p>
  
  <p>PD: I applied the erosion method to fix it.. it works but is deforming the shape of my lemons.. thanks..</p>
  
  <p>warped lemon after erosion operation</p>
  
  <p><img src="https://i.stack.imgur.com/1LJkL.jpg" alt="warped lemon after erosion operation"></p>