Ask Your Question

Extract one object from set of objects

asked 2014-06-27 01:55:58 -0500

GrantGYK gravatar image

updated 2020-11-06 05:28:10 -0500

I want to extract one leaf from bunch of leaves to detect its features. So first I tried to find edges of the image and extract one object, but it seems that this way is not going to work. What I want to do is just extract one leaf from an image taken in real environment of the plant (See the following example image)

image description

As an example consider I want to cut off the leaf marked with red line. Then I can proceed to identify features of that leaf. Can any one please suggest a step by step method to do this. I'm using C++ as the language.

Thank you in advance.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2014-06-27 07:01:46 -0500

I think the following steps should do exactly what you want

  1. Define your red lines like you did before.
  2. Instead of drawing them on the coloured image, make a black image and draw them with white pixels.
  3. Calculate the convex hull, making sure you have a closed contour.
  4. Fill in that convex hull with white pixels.
  5. Now multitply your mask with the original image.
edit flag offensive delete link more

answered 2014-07-08 06:09:01 -0500

jamesnzt gravatar image

For real-time is it possible to draw red line for every images? in the following image is it possible to extract a single leaf?

image description

edit flag offensive delete link more



If you want to do it automatically, in real-time (I mean several fps) and for every possible leaf shape and configuration - it is not possible. If you want to do it automatically, not in real-time and for specific kind of leafs and their backgrounds - it should be possible, but not easy.

Witek gravatar imageWitek ( 2014-07-08 07:03:53 -0500 )edit

how about processing an image taken in natural condition?. Taking image in a camera and processing it in PC instead of live video? @Witek

jamesnzt gravatar imagejamesnzt ( 2014-07-23 05:08:50 -0500 )edit

Question Tools


Asked: 2014-06-27 01:55:58 -0500

Seen: 598 times

Last updated: Jul 08 '14