Ask Your Question

object detection of small insects

asked 2017-09-12 01:19:22 -0500

gp77 gravatar image

updated 2017-09-12 02:09:56 -0500


I am trying to detect objects (many small insects Ex:bugs) in the given image (having various dusts, leaves, etc...) & highlight those detected objects in red boxes. Tried with various methods like 1. dilate 2. Canny 3. findContours 4. matchShapes (using reference insect/bugs images) 5. rectangle (if matchShapes output < threshold)

But results are not impressive.

Original input, expected output images & my code are here,

Please let me know if anyone achieved this.

edit retag flag offensive close merge delete



where are the images ? can you try again, to add them ?

also, seeing your code would be very helpful !

berak gravatar imageberak ( 2017-09-12 01:46:58 -0500 )edit

please put the images HERE, not on dropbox

berak gravatar imageberak ( 2017-09-12 02:15:05 -0500 )edit

3 answers

Sort by ยป oldest newest most voted

answered 2017-09-12 03:17:32 -0500

VxW gravatar image


to solve this detection tasks you would need several steps. I'll give you an example on a traditional image pipeline:

  1. apply a Median Filter to remove noise median filtered image
  2. apply a segmentation method e.g. KMeans Clustering result KMeans with 3 classes
  3. apply a blob detection
  4. calculate some features based on the black regions
  5. train a model based on the features e.g. random forest

another possibility would be to try a state-of-the-art approach like a U-Net (Neuronal Network). (if you have enough examples)

Best, Volkmar

edit flag offensive delete link more

answered 2017-09-18 23:52:18 -0500

Ziri gravatar image
  • Create data of positive and negative images (negative images should be noisy background , other blobs.... )

  • extract features (HOG for example) for both neative and positive images .

  • Make a classifier using (SVM for example).

  • Test : detect all blobs and classify.

Support Vector Machines

edit flag offensive delete link more

answered 2017-09-18 07:39:38 -0500

gp77 gravatar image

updated 2017-09-18 09:00:58 -0500

Thanks for your answer.

I tried till step 3, blob detection, but results are not impressive enough. Step 4 is bit unclear, is it possible to elaborate ?

Also trying the U-net in parallel.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower


Asked: 2017-09-12 01:19:22 -0500

Seen: 124 times

Last updated: Sep 18