3
$\begingroup$

The images given below are a result of fruit defect detection algorithm i have made myself...

Just wanted to know is there a way of outlining these defects?

Original image 1:

enter image description here

1st Image:

enter image description here

Original image 2:

enter image description here 2nd Image:

enter image description here

What i want to achieve is this :

  1. enter image description here => 2. enter image description here
$\endgroup$
10
  • 1
    $\begingroup$ You should add more detail, such as, what are the original two images, what operations have you executed on them to obtain this end result, and what is the defect you are talking about? $\endgroup$
    – Geerten
    Commented Feb 8, 2012 at 14:09
  • 3
    $\begingroup$ Yes, original images would help. Also, what qualifies as a defect? $\endgroup$
    – Phonon
    Commented Feb 8, 2012 at 14:18
  • $\begingroup$ Check the edit :) $\endgroup$
    – vini
    Commented Feb 8, 2012 at 14:24
  • 1
    $\begingroup$ @vini: checked, but still wondering: what is a defect? $\endgroup$
    – Jean-Yves
    Commented Feb 8, 2012 at 15:45
  • 2
    $\begingroup$ @vini Hmm, would it be correct to say that (so far) a defect is defined as simply a discoloration? That seems to be the only feature here ya? $\endgroup$
    – Spacey
    Commented Feb 8, 2012 at 20:34

1 Answer 1

4
$\begingroup$

As far as I understand what you call defects are detcted by changes in color of the fruit.

I would proceed as follow:

  1. edge detection algorithm, (as you did), to detect the fruit region in the image.
  2. In this region, compute the median color, that is the color that matches the most pixels (for example, it would be some kind of yellow for a banana)
  3. For each pixel in the fruit region, check the distant between the median computed at step 2 and the color of the pixel. If the distance is high, mark the pixel as defect
  4. At the end, apply some morphological operator to remove outliers

Hope this helps.

$\endgroup$
1
  • 1
    $\begingroup$ Maybe add a connected component step in between to evaluate blobs further (on area size, mean distance of that blob to the mean color of the fruit, etc). $\endgroup$
    – Geerten
    Commented Feb 9, 2012 at 12:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.